Posts

Showing posts from March, 2011

css - Android version 4.3 and higher backround picture is not displaying -

Image
i use android studio 2.0. put background picture background 4.3 , higher versions not displaying picture. white background. less versions display background picture. background picture placed @ drawable folder. picture 1280х1768 png . how make display background picture @ versions of android? mistake? please give me advices. thank much. here xml of layout activity <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" android:background="@drawable/background"> <button android:id="@+id/button1" android:text="Мундарижа" android:textcolor="#ffffff" android:textsize="15sp" android:layout_width="170dp"

api - abraham/twitteroauth reply to a perticular tweet in PHP -

hi totally new here , title says .. want reply tweet using abraham/twitteroauth library twitter .. update twitte working fine unable reply thing . doing .. $status = $connection->post('statuses/update', array("status" => $dataa, "in_reply_to_status_id" =>$id)); twitteroauth_row('statuses/update', $status, $connection->http_code, $parameters); this code updates account value in $dataa variable not reply tweet defined in $id please . sorry bad english .this first post. yap . there mistake side while updating post .. after reading api document .. found without @username sign perticular user won't appear in reply section ..

c# - how to Radio button into hyperlink (Asp.net mvc) -

according culture language change. i'm using radio button,it works fine using razor syntax. here code snippet:- { var culture = system.threading.thread.currentthread.currentuiculture.name.tolowerinvariant(); } @helper selected(string c, string culture) { if (c == culture) { @:click="click" } } @using (html.beginform("setculture", "home")) { <fieldset> <div class="control-group"> <div class="controls"> <label for="en-us"> <input name="culture" id="en-us" value="en-us" type="radio" @selected("en-us", culture) /> english | <input name="culture" id="ar" value="ar" type="radio" @selected("ar", culture) /> arabic

Spring Boot URL mapping for static HTML -

my spring boot appliation consist of 2 main "modules": a "web" module consists of static html pages, available public (unauthenticated/anonymouse users); and an "app" module consists of number of dynamic pages, each of require (spring security-based) authentication access the basic app structure is: index.html : homepage, mapped http://localhost:8080/ about.html : page, mapped http://localhost:8080/about contact.html : contact page, mapped http://localhost:8080/contact login.html : login page, mapped http://localhost:8080/login dashboard.html : dashboard/landing page after logging in, mapped http://localhost:8080/account all other pages under http://localhost:8080/account/* mvc/dynamic pages typical @requestmapping mappings what not clear me is, static ("public web") html pages, i: just use standard controller-based @requestmappings render thymeleaf/handlebars template (which has no data model since content static)? or

twilio - Send SMS from Google Sheet -

i got script send sms rows in google sheet using twilio example . i want send sms acknowledgement customers below google sheet https://docs.google.com/spreadsheets/d/1jpka0wn8cq6j6be8ks5vf-jj50ykdcumietrwjai7kw/edit?usp=sharing i want sms go once customers whom status not starting "sent" , phone number starting "+91" the sms this complaint no "ser 160530" registered on "16/5/16" customer "tneb" due "ct failed". please call 18004257865 details the message made of text , value cells in particular row "status" column must updated "sent sms xxxxxxxx on xxxx @ xx:xx:xx:xx" possible run script every 1 hour automatically? there free alternative send sms google sheet? to execute script every hour can set time driven trigger. here documentation setting trigger. here workaround sending texts out of google sheet free, might not work specific need, option: every mobile phone carrier offers

mysql - Returning a default value in SQL when no rows found -

how can change sql return default value if no rows found? eg: select text,name text_file text='met' if no rows found, text contain 'values not found' example one method uses union all : select text, name text_file text = 'met' union select max('values not found'), null text_file text = 'met' having count(*) = 0; notes. second subquery aggregation query. returns 1 row (without having ). row has looking for. second, type of operation should done in application , not database. third, if expecting 1 row, can use aggregation query such as: select (case when count(*) > 0 text else 'values not found' end) text, (case when count(*) > 0 name end) name text_file text = 'met'

algorithm - Algorithmic complexity of o(n) -

i started playing algorithms this princeton course , observed following pattern o(n) double max = a[0]; (int = 1; < n; i++) if (a[i] > max) max = a[i]; o(n^2) for (int = 0; < n; i++) (int j = i+1; j < n; j++) if (a[i] + a[j] == 0) cnt++; o(n^3) for (int = 0; < n; i++) (int j = i+1; j < n; j++) (int k = j+1; k < n; k++) if (a[i] + a[j] + a[k] == 0) cnt++; the common pattern here nesting in loop grows exponent increases. safe assume if have 20-for loops complexity 0(n^20)? ps: note 20 random number picked, , yes if nest 20 loops in code there wrong you. it depends on loops do. example, if change end of 2nd loop 3 iterations this: for (int = 0; < n; i++) (int j = i; j < i+3; j++) if (a[i] + a[j] == 0) cnt++; we o(n) the key whether number of iterations in loop related n , increases linearly n does. here example 2nd loop goes n ^ 2: for (i

sql server - When I try to save data from table to another by datagridview -

Image
i have datagridview read data (t1) , want save data table (t2) procedure create procedure [dbo].[saving_tasks] @task1 nvarchar(50), @task2 nvarchar(50), @task3 nvarchar(50) begin insert t2 (task1, task2, task3) values (@task1, @task2, @task3) end and using code saving data (t1. col1) checked rows (t2.task1 , t2.task2 , t2.task3) dim comm new sqlcommand comm.connection = sqlconn comm.commandtext = "saving_task" comm.commandtype = commandtype.storedprocedure dim integer = 0 dgv1.rows.count - 1 if dgv1.rows(i).cells(0).value = true comm.parameters.addwithvalue("task1", dgv1.rows(i).cells(1).value) comm.parameters.addwithvalue("task2", dgv1.rows(i).cells(1).value) comm.parameters.addwithvalue("task3", dgv1.rows(i).cells(1).value) 'else' end if next sqlconn.open() comm.executenonquery() sqlconn.close() en

java 8 - Return method reference -

i playing around in java 8. how can return method reference? i able return lambda not method reference. my attempts: public supplier<?> foreachchild(){ return new arraylist<?>::foreach; } or public function<?> foreachchild(){ return new arraylist<?>::foreach; } you have small mis-understanding of how method-references work. first of all, cannot new method-reference. then, let's reason through want do. want method foreachchild able return accept list , consumer . list on object invoke foreach on, , consumer action perform on each element of list. that, can use biconsumer : represents operation taking 2 parameters , returning no results: first parameter list , second parameter consumer. as such, following work: public <t> biconsumer<list<t>, consumer<? super t>> foreachchild() { return list::foreach; } this type of method-reference called "reference instance method of arbitrary

ios - Specify Constraints for two UIViews in percentage -

Image
following image shows design 2 uiview. 1 in green should 20% , yellow should 80%, in land scape or portrait. i missing on constraint or content hugging change, trying fix. note: content hugging , compression priority has default values. you don't want have fixed height of 212 top view. want 20% of it's super view. you should delete top view's height constraint of 212. select both top view , super view. add equal height constraint. double click on constraint , open it's size inspector. change multiplier 0.2

php - Unable to decode decrypted string returning null -

after decrypting string using private key, using echo returns value. when try base64_decode returning null. needed value base64_decode. openssl_private_decrypt(base64_decode($_post['data']), $data, $privatekey, openssl_no_padding); echo $data; // returning value --> k/hgb3uqz1klyehlj2jhcg5fsoy+gowif4bich195ll7znf9sqbgg/1mkiupk4scflt2e0xiwxzanggrni2yeg== echo base64_decode($data); // returning null base64 decoding string: k/hgb3uqz1klyehlj2jhcg5fsoy+gowif4bich195ll7znf9sqbgg/1mkiupk4scflt2e0xiwxzanggrni2yeg== the decoded base64, binary data not string: 93f1e0077b90675925c9e1e52768e1706e5f48ecbe1a8c081786e2721d7de6597bccd17db106e083fd4c92252993849c1654f67b45c8c17cc034682b362db212 in general binary data can not represented in printable characters , in cases can not represented in character set.

javascript - jQuery - click function not working after remove() is used -

sample of html: <div class="row" id="thumbnailholder"> <div class="col-md-12"> <img src="http://images.sportsdirect.com/images/products/16503236_pit.jpg" class="thumbnails" bigimagelink="http://images.sportsdirect.com/images/products/16503236_l.jpg"> <img src="http://images.sportsdirect.com/images/products/16503236_piat_a1.jpg" class="thumbnails" bigimagelink="http://images.sportsdirect.com/images/products/16503236_l_a1.jpg"> </div> </div> here code: $(document).ready(function() { $('.thumbnails').each(function() { $(this).click(function() { var bigimagelink = $( ).attr( "bigimagelink" ); $('#imgbiglink').attr('href', bigimagelink); $('#productimgdefault').attr('src', bigimagelink); }); }); });

elixir - Ecto: how to define variable default field values in schema? -

in ecto, can give fields in schema default value specifying them field :name, default: "john" . in docs, stated default stored @ compile-time, , things date.now or uuid.generate not work. my question is: how create these variable defaults? 1 'just set value after creating struct'. however, when working virtual fields, not possible. when use e. g. repo.all(mymodel) or other querying-commands, virtual fields set default fixed value. how can create variable schema field defaults? it not possible. ecto defines struct , elixir structs expanded @ compile time. you can around explicitly having function produce struct default values or in changeset function via put_change , similar.

Scala type mismatch using multiple generic -

i'm trying use scala prototype functionality of lazy endless list lambda calculus classes. public constructor takes 2 arguments , should create lazylist[a,a]. class lazylist[a,b] private (private val first: a, private val mapper: => b, private val successor: => a) { def this(first: a, successor: => a) = this(first, (e: a) => e, successor) def head: b = mapper(first) def tail(): lazylist[a,b] = new lazylist(successor(first), mapper, successor) def map[r](func: b => r) = new lazylist[a, r](first, func.compose(mapper), successor) def at(index: long): b = if (index == 0l) head else tail().at(index - 1) def sublist(end: long): list[b] = if (end == 0l) list(head) else head :: tail().sublist(end - 1) override def tostring = s"lazylist($first, $mapper, $successor)" } but code compilation fails error. error:(20, 65) type mismatch; found : e.type (with underlying type a) required: b def this(first: a, successor: => a) = this(first,

telerik - Kendo Grid doesn't send all checked items -

i have kendo grid has checked box items. want check items , send them controller, export checked data pdf. but, when have checked items, kendo grid sends checked items first page of grid, , report in pdf has 1 page. how checked items kendo grid? code here: <div style="text-align:right; font-size: 0.9em;height:28px;position: relative;"> <span style="float:left;text-align:left;"> <a href="#" onclick="checkall();">check all</a>&nbsp; <a href="#" onclick="uncheckall();">uncheck all</a>&nbsp; <a class="k-button k-button-icontext k-grid-patient" id="hrefcheckedpatients" href="#" onclick="getchecked();">export pdf</a>&nbsp; <a href="#" id="lnkpdfdownload" style="display:none;" onclick="$(this).hide();">download generated pdf<

html - How can I make text in my td wrap when it reaches the width of the image in my td? -

so have <td> in table looks this: <tr> <td> <p class="tabletext">random text goes on long..........</p> <img src="www.imageurl.com/img.png" width="33vw"> </td> <td> <p class="tabletext">random text goes on long..........</p> <img src="www.imageurl.com/img.png" width="33vw"> </td> </tr> what want able do, width of each <td> width of image, text should wrap when reaches width of image next line. however, instead text running on. is there can in js/jquery,html, or css fix this? (preferably html/css) just give same width in p as giving img because siblings. td { border: red solid } img { display: block; width: 33vw } p { width: 33vw } <table> <tr> <td> <p class="tabletext">random text goes on long......

r - How to label the first few points and create non-overlapping labels on a plot using direct.label -

Image
how can create plot text not overlapping? also how create plot label first few points? image below, want label bottom left hand part of plot xx<-c(2.25,5.5,5,9.5,7.75,14,24.5,20.75,28,25.5,11.25,17.75,11.75,20.5,23.5,5,10.5,5.5,11,12.5,15,26.75,15.25,24.25,27.75,10.25,22,11.25,18,22.5) yy<-c(2.75,10.5,9.25,13.5,12,20,24.75,22,29,26.75,13,16.75,13.5,21,23,5.75,7.75,6.75,10.5,6.25,13.5,24.75,14,25.5,26.75,9.5,16.25,10.5,14.5,15) nm_plot<-c("lastrem_0.5_nn","lastrem_0.25_nn","pt_0.5_nn","pt_0.25_nn","lastrem_nn","lastrem_0.5_area","lastrem_0.25_area","pt_0.5_area","pt_0.25_area","lastrem_area","lastrem_0.5_100","lastrem_100","lastrem_0.25_100","pt_0.5_100","pt_0.25_100","lastrem_0.5_100area","lastrem_100area","lastrem_0.25_100area","pt_0.5_100area","pt_0.25_100area","l

Checkbox filtering using Jquery -

i'm using code: http://jsfiddle.net/6wyzw/42/ filter categories, need functionality different. if more 1 filter checked item contain both display. example: checking category , b display 'ab' not instances of 'a' , 'b' html: <ul id="filters"> <li> <input type="checkbox" value="categorya" id="filter-categorya" /> <label for="filter-categorya">category a</label> </li> <li> <input type="checkbox" value="categoryb" id="filter-categoryb" /> <label for="filter-categoryb">category b</label> </li> <div class="item categorya categoryb">a, b</div> <div class="item categorya">a</div> <div class="item categorya">a</div> <div class="item categorya">a</div> <div class="item categoryb">

JavaScript === vs == for type checking -

this question has answer here: which equals operator (== vs ===) should used in javascript comparisons? 48 answers which of following lines correct?... if (typeof value == 'boolean') { return value; } ... or ... if (typeof value === 'boolean') { return value; } i thought double equal sign type of "soft compare" value variable either string or formal type. not so? wonder because jshint complained first version. i've changed i'm worried typeof won't return string. == soft compare, typeof returns string. https://developer.mozilla.org/en-us/docs/web/javascript/reference/operators/typeof

bash - Create variable by combining text + another variable -

long story short, i'm trying grep value contained in first column of text file using variable. here's sample of script, grep command doesn't work: for ii in `cat list.txt` grep '^$ii' >outfile.txt done contents of list.txt : 123,"first product",description,20.456789 456,"second product",description,30.123456 789,"third product",description,40.123456 if perform grep '^123' list.txt , produces correct output... first line of list.txt. if try use variable (ie grep '^ii' list.txt ) "^ii command not found" error. tried combine text variable work: var1= "'^"$ii"'" but var1 variable contained carriage return after $ii variable: '^123 ' i've tried laundry list of things remove cr/lr (ie sed & awk), no avail. there has easier way perform grep command using variable. prefer stay grep command because works when performing manually. y

angularjs - How to move node_modules to a different location correctly -

i trying move node_modules different location, did deleted node_modules , moved package.json location wanted installed, ran npm install installed node_modules wanted now, if run npm start , server starts , alot of errors: (index):5 http://localhost:3000/node_modules/bootstrap/dist/css/bootstrap.min.css (index):9 http://localhost:3000/node_modules/es6-shim/es6-shim.min.js (index):10 http://localhost:3000/node_modules/systemjs/dist/system-polyfills.js (index):12 http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js (index):13 http://localhost:3000/node_modules/systemjs/dist/system.src.js (index):14 http://localhost:3000/node_modules/rxjs/bundles/rx.js (index):15 http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js (index):16 http://localhost:3000/node_modules/angular2/bundles/http.dev.js (index):21 uncaught referenceerror: system not defined(anonymous function) @ (index):21 i updated index.html file use files root node_modules instead o

ios - How to sort GTLQueryDrive items by folders first, name, size, date -

to items, this: gtlquerydrive *query = [gtlquerydrive queryforfileslist]; query.q = [nsstring stringwithformat:@"'%@' in parents , trashed=false", folderid]; query.fields = @"files(mimetype, id, name, size, createdtime)"; [self.service executequery:query completionhandler:^(gtlserviceticket *ticket, gtldrivefilelist *files, nserror *error) { }]; but files , folders scattered , not sorted name. how without manually sorting? thank answers. based thread , can use orderby query parameter has value of string order documents list feed criteria or keys. valid keys createddate , folder , lastviewedbymedate , modifiedbymedate , modifieddate , quotabytesused , recency , sharedwithmedate , starred , , title . each key sorts ascending default, may reversed desc modifier. example usage: ?orderby=folder,modifieddate desc,title . please note there current limitation users approximately 1 million files in requested sort order ignored. you can

vba - Why i get an "type mismatch" error? -

i got question, have line dim i, j, x, y, labels integer , , when want use labels variable in following way inside cycle error: labels = cint(dbrange.rows(i).item(10).value) , consider dbrange 1 database on worksheet 10 columns , 10 rows example. why i'm getting "type mismatch" error if variable i integer, , variable labels integer, , if i'm converting cell value integer cint function? @tomalak correct i , j , x , , y variants , not integers. label integer, variants can slow process , should avoided. with modern computing power , volume of work, consider integer obsolete long taking place:- a integer can hold number between -32768 , 32767 a long can hold number between -2147483648 , 2147483647 if dbrange.rows(i).item(10).value ever contained value outside of integer range or acted non-numeric containing non-numeric characters (i.e. space), error occur. if following way inside cycle building values end outside of integer range error o

javascript - InvalidParameterValueException: The role defined for the function cannot be assumed by Lambda -

i'm using aws sdk javascript , returning following error when try create lambda function: invalidparametervalueexception: role defined function cannot assumed lambda. i've double-checked role , valid. however, i'm still unable create lambda function. my role trust relationship is: { "version": "2012-10-17", "statement": [ { "effect": "allow", "principal": { "service": [ "lambda.amazonaws.com" ] }, "action": [ "sts:assumerole" ] } ] } this error happens when role invalid (which not case) or when try create lambda function just after role creation. amazon needs few seconds replicate new role through regions. so, fix here wait few seconds before creating lambda function . solution - example 1: v

security - Does javascript subresource integrity check protect from client-side editing? -

the question says all. use of subresource integrity checks foil execution of javascript has been edited locally (say in browser's debug window)? appreciate insights. quote mdn : browsers handle sri doing following: when browser encounters <script> or <link> element integrity attribute, before executing script or before applying stylesheet specified <link> element, browser must first compare script or stylesheet expected hash given in integrity value. if script or stylesheet doesn’t match associated integrity value, browser must refuse execute script or apply stylesheet, , must instead return network error indicating fetching of script or stylesheet failed. so no, not protect malicious code being executed via console, since wont affect loaded files in way.

Missing Classes in Authorize.net PHP SDK -

i'm trying generate custom report authorize.net using api cannot sdk load without errors. i created post on developer board here sending email request support team. issue supposed have been fixed temporary patch here . errors persist. does have ideas how work around issue? my code: <?php error_reporting(-1); ini_set('display_errors', 'on'); date_default_timezone_set('utc'); /* autoload through composer */ //require 'vendor/autoload.php'; /* autoload through git clone */ //require 'git/sdk-php/autoload.php'; /* autoload through .zip download */ require 'download/sdk-php-master/autoload.php'; use net\authorize\api\contract\v1 anetapi; use net\authorize\api\controller anetcontroller; function getsettledbatchlist($startdate, $enddate) { $api_id = "my_api_id"; $account_key = "my_account_key"; $start_dt = new datetime($startdate); $end_dt = new datetime($en

javascript - Changing fontFamily on ChartJS bar chart -

i've partially implemented chartjs in project, can't figure out how change font that's displayed on x , y axes of bar chart. i've read chartjs documentation , searched examples on github, etc. i'm not sure i'm doing wrong, rest assured knowing solution involve line of code , startlingly stupid oversight on part. this code draws chart want, default font: var barchartlanguage = chart.bar(mycanvas, { data: datalanguages, options: options, defaults: defaults }); i tried changing font in defaults without success: var defaults = { global: { // example font defaultfontfamily: "'raleway'" } }; and tried changing on axis options : var options = { animation: { duration: 2000 }, scales: { yaxes: [{ display: true, ticks: { suggestedmin: 0, // minimum 0, unless there lower value. // or // beginatzero:

java - PAYPAL - get token sandbox -

public void init(servletconfig servletconfig) throws servletexception { try { oauthtokencredential tokencredential = paypalresource.initconfig(new file(paypalservlet.class.getresource("sdk_config.properties").getpath())); accesstoken = tokencredential.getaccesstoken(); } catch (paypalrestexception e) { logger.fatal(e.getmessage()); }catch (exception e) { logger.fatal(e.getmessage()); } } i using above code getting access token. if enter paypal credentials works fine. if change credentials of sandbox test, access token null. have verified credentials sandbox right using curl. there might missing testing sandbox? pls check our server error logs , looking ssl connection failures, looks underlying connection did not setup. (otherwise there should api error returned paypal) paypal sandbox has been upgraded accept tlsv1.2 ssl connections protocol, make sure server environment c

how to recover folder data which is permanently deleted in ubuntu -

i have project in apps folder , deleted permanently. how can recover command line,apps folder contains folders project_1, project_2 etc. , project_1 folder contains files. depends on how long ago was. if now, shut down system , take disk image. foremost usual tool file recovery, partition intact might try things extundelete. if deleted few days ago, it's gone.

JSF Ajax Response populating input fields for form submit -

i'm parsing data in java file i'm passing parameters through ajax method , parses data , returns them in object - in model bean. can display value in jsf 2 <h2><h:outputtext id="output1" value="#{model.method.price}" /></h2> this works. ok want output of these values inside correspondent inputtext fields. i'd edit them , submit them form... tricky. outputting text done value , inputing it. for form "value" used - output in ajax response. do? i want : <h:outputlabel value="evaluate if price ok:" /> <h:inputtext value="#{model.method.price}" value_submit="#{evaluate.price}" /> <br/> <p><h:commandbutton value="vnos" action="evaluate.submit"/></p> thank you!

PHP regex for name verification -

so have assignment. have validate name input can contain big , small letters, apostrophe, spaces or comas. i've come validation: $name = $_post['your_name']; $regex_name = '/([a-z]|[a-z])([a-z][a-z\s])+/'; if (!preg_match($regex_name, $name)) { echo '<span style="color:red">please input valid name!</span><br />'; } but doesn't seem work fine , don't know why. i've read regex , rules don't i'm doing wrong. i've seen examples here on stackoverflow it's still not clear me. i think should validate @ least letters gives false simple input 'error'. please help! "doesn't work fine" not helpful description. i'd guess problem aren't anchoring query start of string ( ^ ) , end of string ( $ ). means you're matching subset of characters anywhere in string. also, didn't in question, in code looks want allow letters first character. should trick you:

xpath - click on a image link with Capybara -

i trying click on image link capybara / rspec test. having little success @ moment. i trying select link href "/post/3", (knowing other links before). have tried many combinations of xpath without success. combination working page.first(:xpath, //a).click however when have changed file , added more links above capybara test broken. <div class='row'> <a href="/posts/3"><img id="imagen3" src="/system/posts/images/000/000/003/original/frankie-mannings-102nd-birthday-5160522641047552-hp.gif?1464448829" alt="frankie mannings 102nd birthday 5160522641047552 hp" /></a> <p>caption</p> </div> how can select link, , click it? ok got it: find(:xpath, "//a[contains(@href,'posts/3}')]").click

javascript - searchBox Google Maps with pagination -

so trying implement google maps search box. currently, search box retrieves 20 of top places based on search result. what noticed there no pagination this. such if type in “pizza”, give me top 20 results in current location bounds. when use google.maps.places.placesservice(map) textsearch function obtain list of pizza searches, more 20 results pagination. is there way pagination on searchbox or use textsearch function provide pagination after used searchbox? what have here snippet: var canvas = element.find('div')[0]; var mapoptions = { zoom: 5, minzoom: 2, }; var searchbox = new google.maps.places.searchbox('pizza'); var placeservice = new google.maps.places.placesservice(map); google.maps.event.addlistener(searchbox, 'places_changed', locationchange); function locationchange() { var places = searchbox.getplaces(); //determine if there additional places not provided searchbox. using text var request = { query: input.v

How to Limit selection in checklist created directly from MYSQL database and PHP (*Not by manually making a checklist in HTML*) -

my code far outputs data mysql table on website checklist, having trouble setting limit how many options can checked off, i.e. if want 3 out of 5 boxes checked off how can in php? note: of answers out there checkbox limit show examples checklist has been manually created in html , using javascript limit put on number of boxes can checked off. however, not case in code; code outputs checklist not manually created in html automatically created pre-set mysql database using php (as shown below). how can put limit boxes checked off in case? solution/examples code appreciated! here php code: <?php $username = "root"; $password = ""; $hostname = "localhost"; $dbname = "major_degrees"; $str=''; // create connection $conn = new mysqli($hostname, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error

maven - Sonatype Nexus OSS using LATEST in pom.xml gives unresolved dependency (maven2) -

i have sonatype nexus oss install, , have artifacts on it. however, when using "latest" version in pom.xml, unresolved dependency error. there have enable allow latest keyword? i've looked everywhere the maven client not true support dynamic revisions. closest thing supports snapshot revisions, revision 1.0-snapshot, resolved latest time-stamped artifact. i think may confusing maven pom rest api used nexus. ability specify "latest" version: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=latest&e=jar

django - 'utf-8' codec can't decode byte 0x80 in position 0 -

ok when i'm in django can run website following command. sudo python manage.py runserver but when try , use greed arrow running project gives me dozen errors. this happens straight away when set project , hoping if help. unhandled exception in thread started <function check_errors.<locals>.wrapper @ 0x10484fbf8> traceback (most recent call last): file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception) file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/site

asp.net mvc - Elmah not logging 404 errors after third folder, and 403 errors at all -

continuing previous question , handle custom errors in mvc5 app using: <system.webserver> <httperrors errormode="custom" existingresponse="replace"> <remove statuscode="404"/> <error statuscode="404" path="/errors/notfound" responsemode="executeurl" /> <remove statuscode="403"/> <error statuscode="403" path="/errors/notfound" responsemode="executeurl" /> <remove statuscode="500"/> <error statuscode="500" path="/errors/servererror" responsemode="executeurl" /> </httperrors> ... </system.webserver> this enabled me show custom 404 error page after 3rd folder (e.g. site.com/a/b/c/nothing-here). yet, elmah not logging these errors. true 403 errors. questions are: is there way make elmah handle server errors regardless of being thrown

java - how to recycle image from ListView in Android using custom ListAdapter and Cache View -

my app working seem getting error running out of ram. seem working point scroll more , and run out of memory. need recycle image in list when user scroll past them. don't know begin recycle i using code tut this code using thanks here error in adapter: convertview = ( relativelayout ) inflater.inflate( resource, null ); you have check if convertview null , if - create new view, otherwise use convertview given method params

java - TextFlow in TableCell has an extra height -

Image
i tried display rich texts in cells of tableview, , created own subclass of tablecell , set textflow object graphic. textflow has height (textflow in right column): why happen? the code following (i wrote in groovy same in java): public class contentcell extends tablecell<word, wordcontent> { protected void updateitem(wordcontent wordcontent, boolean isempty) { super.updateitem(wordcontent, isempty) if (isempty || wordcontent == null) { settext(null) setgraphic(null) } else { textflow textflow = wordcontent.getcontenttextflow() settext(null) setgraphic(textflow) } } } public class dictionarycontroller implements initializable { @fxml private tableview<word> wordtableview @fxml private tablecolumn<word, string> namecolumn @fxml private tablecolumn<word, wordcontent> contentcolumn public void initialize(url location, resourcebundle resources) { contentcolumn.setcellfactory() { tablecolumn&

git - What is the difference between push branch and merge to master then push? -

one way: git checkout mybranch git push origin mybranch:master another way: git checkout master git merge mybranch git push what difference between these two? this: git checkout mybranch git push origin mybranch:master just attempts fast-forward (i.e. non-forced update) push of mybranch master . if master reachable mybranch , i.e. master doesn't contain commits mybranch doesn't have, push succeed; otherwise, push rejected. the preceding git checkout mybranch irrelevant git push , since you're using refspec mybranch:master . can learn more refspecs @ git internals - refspec . this: git checkout master git merge mybranch git push actually merges mybranch master , , attempts push remote (with default configuration of git repo, remote origin). because mybranch merged master , assuming remote master behind local one, i.e. doesn't contain commits local 1 doesn't have, push succeed, otherwise fail.

python - Sprite jumping way too high -

earlier, fixed lag of code , before, game made sprite lag. fixed that, time keeps making sprite fly way high , out of screen not coming down... can sprite(poppy) not jump high? import pygame, sys pygame.locals import * pygame.init() class poppy(pygame.sprite.sprite): def __init__(self): #making player pygame.sprite.sprite.__init__(self) self.image = pygame.image.load('poppy.png') self.rect = self.image.get_rect() self.grav = .5 self.y_vel = 5 self.jumping = false def jump_update(self): #checking jumps if self.jumping: self.y_vel += self.grav self.rect.y += self.y_vel def jump(self): #the jump initializer if not self.jumping: self.y_vel = -50 self.jumping = true def keys(self): #the keys key = pygame.key.get_pressed() dist = 5 if key[pygame.k_right]: # right key self.rect.x += dist # move right elif key[pygame.k_left]:

javascript - Indexof() returning -1 -

been making simple form + data validation thing, i'm using indexof make sure there "@" , "." in email address, returning -1. var custemail = document.getelementbyid("custemail"); if (custemail.value == "" || custemail.value.indexof("@" == -1) || custemail.value.indexof("." == -1)) { alert("you must enter valid email address!\n" } i've tried changing indexof check different letters instead of symbols, still returns -1, makes me think i'm trying data incorrectly. your parens in wrong place custemail.value.indexof("@") == -1 || custemail.value.indexof(".") == -1

javascript - can't have 2 ng-click on the same page -

there 2 ng-controller have 1 ng-click each. if set script 2 ng-click following code, 2 buttons not work. if set script either 1 ng-click, button works. how can solve it? <body ng-app="myapp"> <div ng-controller="logincontroller"> <h3>login</h3> <form class="login" role="form"> <div class="form-group"> <label for="email">email:</label> <input type="email" class="form-control" id="email" placeholder="enter email" ng-model="email"> </div> <div class="form-group"> <label for="pwd">password:</label> <input type="password" class="form-control" id="pwd" placeholder="enter password" ng-model="password">