Posts

Showing posts from August, 2015

sass - livereload failing to compile -

i'm new dev environments , grips sass. i've installed compass , few other gems, im trying use live reload update browser, won't play nice; loaderror on line ["55"] of /system/library/frameworks/ruby.framework/versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- compass/import-once/activate run --trace see full backtrace screen.scss: compilation failed. i'm not sure what's happening here, 1 shed little light on subject , preferably point me resource? resolved issue after little more googling; livereload plugin hopefully ill else stuck in same boat :)

c# - Nullreferenceexception after initializing an array -

this question has answer here: what nullreferenceexception, , how fix it? 29 answers i've been trying make test game in xna (visual studio 2015), nullreferenceexception every time load this, though initialize it. here short version of it... namespace overbox { public class player { private player[] characterlist = new player[14]; virtual public void initialize() { //characterlist = new player[14]; characterlist[0] = new hero(); //for (int = 0; <= characterlist.length; i++) // characterlist[i].initialize(); characterlist[0].initialize(); } } virtual public void draw(spritebatch spritebatch, texture2d texture) { //for (int = 0; <= characterlist.length; i++) //{

tfs - Can't create more team projects after update -

Image
after updated tfs 2013 server update 4 can't create anymore team project inside visual studio. receiving error. searched in entire network , deleted cache folder , changes xml agile file false like says in page. resolved. i downloaded c:\program files\microsoft team foundation server 12.0\tools\deploy\processtemplatemanagerfiles\1033\msfagile\template.zip , unziped. in xml file put false. in computer , in tfs explorer > settings > process manager template upload folder again , works.

r - How to match and divide -

given following data tables: df1 <- data.table(v1=c("a","c","d","b"),v2=c(0,2,0,2),v3=c(2,0,2,0)) df2 <- data.table(v1=c("a","b","c","d"),v2=c(4,2,4,2)) df1 df2 > df1 v1 v2 v3 1: 0 2 2: c 2 0 3: d 0 2 4: b 2 0 > df2 v1 v2 1: 4 2: b 2 3: c 4 4: d 2 i seek following: every numerical value of df1, divide value corresponding value df2, using v1 key. resulting data table should be: > df3 v1 v2 v3 1: 0 0.5 2: c 0.5 0 3: d 0 1 4: b 1 0 can please me? many in advance. this work examples although isn't extensible more columns. real world usage use 2 tables have same column names? df3<-merge(df1,df2,"v1")[,list(v2=v2.x/v2.y, v3=v3/v2.y),by=v1] here's way work more columns, if may or may not have same name in each table. relies on column matched being named v1 otherwise doesn't rely on column names.

ios - How to make 3 textFields in a ViewController take only integer input - XCode -

i have 3 textfields called text1,text2, , text3. how program them accept integer input? most of similiar questions i've seen don't work in newest version of xcode (using swift 2) , don't cater multiple textfields. this 1 seemed helpful: how can declare text field can contain integer? first change keyboardtype uikeyboardtypenumberpad suggested ianurag and check content change in delegate method shouldchangecharactersinrange (code tested swift 2.0 , xcode 7) func textfield(textfield: uitextfield, shouldchangecharactersinrange range: nsrange, replacementstring string: string) -> bool { // find out text field after adding current edit let text = (textfield.text! nsstring).stringbyreplacingcharactersinrange(range, withstring: string) if text == "" { return true } if let _ = int(text) { return true } else { return false } }

sql server - PHP Variable from one page to automatically run SQL query on other page -

i trying pass variable 1 page load query on page passed variable. my code follows: awaiting variable if(isset($_post['viewrecord'])){ $sup_code = $_post['vhidden']; } sql query $sql = "select sup_code, firstname, lastname, email, telephone dbo.table sup_code = ('$sup_code')"; thanks guys, added following variable on page 2 , seemed solve issue. $sup_code = preg_replace('/\s+/', '', $_post['vhidden']);

javascript - What happens if node js doesn't find a client html file? -

am trying implement push server php application. initial thoughts long keep events called on client let message_view.php file . not have problem of emiting node js events. but see of tutorial online use dont understood ? fs.readfile(__dirname + '/client.html') ...//html files or response.sendfile('hello world') after have started server. add event , logic follow on client html file supposed on messages_view.php file. <script src="socket.io/socket.io.js"></script> <script src="http://code.jquery.com/jquery-latest.min.js"></script> and socket emiting events 1 : <script> // create new websocket var socket = io.connect('http://localhost:8000/?profile_id=abcde2'); //..i want code here update divs. </script> what need emit message on php file. many thanks! if want serve html php, , have node.js socket server, socket server doesn't need serve html, can omit majority o

javascript - CKEditor plugin, how to reopen dialog when click on created content -

i creating ckeditor plugin, realize default ckeditor plugins have ability reopen edit dialog after create it. example insert table or link, if double click on new created table or link, table dialog open again can change attributes. know need done make plugin can reopen dialog if click on created content? thank you. set listener doubleclick event , adjust data.dialog value if it's on element. if want learn more, read documentation should explained among guides provide. editor.on( 'doubleclick', function( evt ) { var element = evt.data.element; if ( element.is( 'img' ) ) evt.data.dialog = 'mydialog'; });

mysql - Group_concat distinct makes my query fails if the field is null -

select replace(group_concat(distinct(myvalue)),',','|') mytable myconditions i'm using query multiple times in union. when myvalue different null, works. when has no value, query fails (it says query can't executed). tried if(myvalue null, '000', myvalue), doesn't work (same ifnull). think distinct doesn't work here, since query : select distinct('000') mytable myconditions doesn't work either. how can manage error when myvalue null group_concat(distinct())? thank you try out this: select replace(group_concat(distinct(coalesce(myvalue,'000'))),',','|') mytable myconditions

c++ - Stack around variable was corrupted (Converting long long to byte array) -

when gets end of function, bombs "stack around variable corrupted" variable keybytes2. not sure missing why problem. using nvcc compiler. char keybytes2[7]; long long unsigned lkey; lkey = 32428228256948131; //convert long long byte array (int = 0; < 8; ++i) { keybytes2[i] = ((lkey) >> 8 * i) & 0xffu; } char keybytes2[7]; this allocates 7 bytes, not 8. in loop access keybytes2[7] , i.e. eighth byte of array. out-of-range access , undefined behavior.

html - PHP mail function doesn't complete sending of e-mail -

<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'from: yoursite.com'; $to = 'contact@yoursite.com'; $subject = 'customer inquiry'; $body = "from: $name\n e-mail: $email\n message:\n $message"; if ($_post['submit']) { if (mail ($to, $subject, $body, $from)) { echo '<p>your message has been sent!</p>'; } else { echo '<p>something went wrong, go , try again!</p>'; } } ?> i've tried creating simple mail form. form on index.html page, submits separate "thank submission" page, thankyou.php , above php code embedded. code submits perfectly, never sends email. please help. there variety of reasons script appears not sending emails. it's difficult diagnose these things unless there obvious syntax error. without 1 need

javascript - Do not unselect rows when clicking on another rows in Primefaces datatable -

i'm working primefaces 3.5 data table. table multiselection mode enabled. basically, table same last 1 this showcase . table defined this <p:datatable id="mytable" var="item" value="#{mycontroller.items}" selection="#{mycontroller.selecteditems}" rowkey="#{item.id}"> <p:column selectionmode="multiple"/> <p:column headertext="id"> ... so when user selects rows clicking on checkboxes , accidentally clicks on 1 row, selected rows become unselected except 1 on user clicked @ last. the question is: there workaround maintain rows selected if user click on row out of checkbox? some of observations: if user press ctrl , click on row other rows maintain selected. behavior want, without pressing ctrl . i've looked @ primefaces.js source , found other rows deselected function clearselection:function(){} . fine not execute when user click on row. edit: as kukeltje

java - Migrating from guava.Optional to java8.Optional -

trying migration guava optional implementation java 8 optional. got issue not able understand. here how method looks: public optional<entity> getentity(string input) { try{ final entity obj = otherclass.verifyentity(input); return optional.of(obj); } catch(exception e) { } return optional.empty(); } it looks straight forward keep getting compilation error says change return type optional<entity . what wrong code? try using return optional.<entity>empty();

ajax - Reading local XML file from browser using javascript -

i writing html page myself( i not want use webserver ) need read xml file ( on same folder .html file ) , parse data it. name of file known , not dynamic. now, aware due restrictions browsers not allow cross origin requests on ajax calls because of security restrictions. seems option filesystem api. could me out code same please? in short 1. read xml file javascript once page loads in browser . 2. name of xml file known , on same directory level. 3. how use filesystem api reading file , parsing xml constraints 1. dont want use web-server page( since single page app ). 2. dont want use javascript libraries( like jquery etc ). 3. dont want tweak chrome adding flags. 4. alright if solution works on chrome. thanks

angularjs - What is the best way ( performance wise ) to animate numbers? -

in angular.js app i'm using directive: https://github.com/sparkalow/angular-count-to which works great on web. when compile phonegap, it's really slow. but other way have animate number 0 200 (for example), in 2 secods, without hurting performance of app? the directive uses $timeout , suggested way settimeout functionality in angular. it's doing 1 of following reasons, though there others too: easy inject mock testing assumes each step should allow other components update it's "angular way" i don't believe #2 big concern since doesn't expose value or update on scope anyway, , standard html textcontent manipulation. regardless, point $timeout settimeout $digest (allowing angular update other components). digest cycles slow part, , every angular developer should read on them they're central angular's design (hint: go read on these now ). such, taking original library, replacing $timeout settimeout call (and,

javascript - No luck with image slider -

i've been using image slider http://responsiveslides.com/ due it's simplicity , it's i'm after. so slider have html <ul class="rslides"> <li><img src="1.jpg" alt=""></li> <li><img src="2.jpg" alt=""></li> <li><img src="3.jpg" alt=""></li> </ul> the css .rslides { position: relative; list-style: none; overflow: hidden; width: 100%; padding: 0; margin: 0; } .rslides li { -webkit-backface-visibility: hidden; position: absolute; display: none; width: 100%; left: 0; top: 0; } .rslides li:first-child { position: relative; display: block; float: left; } .rslides img { display: block; height: auto; float: left; width: 100%; border: 0; } js <script> $(function() { $(".rslides").responsiveslides(); }); </script> http://ajax.googleapis.com/aja

sql - Find the last row matches a criteria -

i need create sql query sql server find last row matches criteria. i need find last dauditdate person if tech1 or tech2 or tech3 233 . in case need 7/15/2015's row dauditdate . can please help.any appreciated. ipersonid snamefirst snamelast dauditupdate tech1 tech2 tech3 75605 jeff plutter 10/29/2013 233 0 0 75605 jeff plutter 10/29/2013 233 0 0 75605 jeff plutter 7/15/2014 233 0 0 75605 jeff plutter 7/15/2014 15 0 0 75605 jeff plutter **7/15/2014** 15 **233** 259 75605 jeff plutter 7/25/2014 15 233 259 1377905 jeff plutter 1/31/2015 15 233 0 i tried using top 1 record order dauditupdate desc , not working. i assume using microsoft sql server. unfortunately there no in-built last-method. but use ordering , top last record..

Nuget pack csproj using nuspec -

i want create nuget package contains specified in nuspec file, still version csproj. in order use token have pack like: nuget pack myproj.csproj but when adds dependencies , creates unwanted folder in nuget package. nuspec file is: <?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>test</id> <version>$version$</version> <title>test</title> <authors>test</authors> <owners>test</owners> <requirelicenseacceptance>false</requirelicenseacceptance> <description>test</description> <summary>test</summary> <releasenotes>test</releasenotes> <copyright>test</copyright> </metadata> <files> <file src="bin\debug\*.dll" target="lib\net45" /> <file s

fft - Is the storage of COMPLEX in fortran guaranteed to be two REALs? -

many fft algorithms take advantage of complex numbers stored alternating real , imaginary part in array. creating complex array , passing fft routine, guaranteed can cast real array (of twice size) alternating real , imaginary components? subroutine fft (data, n, isign) dimension data(2*n) 1 i=1,2*n,2 data(i) = .. data(i+1) = .. 1 continue return end ... complex s(n) call fft (s, n, 1) ... (and, btw, dimension data(2*n) same saying real?) i'm writing answer because experience has taught me write sort of answer 1 of real fortran experts hereabouts piles in correct me. i don't think current standard, nor of predecessors, states explicitly complex implemented 2 neighbouring-in-memory reals . however, think implementation necessary consequence of standard's definitions of equivalence , of common . don't think have ever encountered implementation in complex not implemented pair of reals .

hortonworks data platform - Oraoop disabled for Sqoop import -

i'm using hortonworks hdp sandbox, , i’ve installed oraoop per instructions, whenever run sqoop import message “oracle.oraoopmanagerfactory: data connector oracle , hadoop disabled.”. i’m not sure else need pick up. have verified oraoop driver in sqoop lib directory. imports work, using oracle driver, , play around of features oraoop. this command i'm running: sqoop-import --connect jdbc:oracle:thin:@<ip>:1521/sid --username myuser -p --query "select * mytable \$conditions" -split-by sequence_id -as-sequencefile --target-dir /user/hue/data/deactivatedsponsor if '--query' argument specified in place of '--table' parm, oraoop connector not used. following mentioned in sqoop documentation data connector oracle , hadoop accepts responsibility sqoop jobs following attributes: oracle-related table-based - jobs table argument used , specified object table. following command should use oraoop connector. have included

java - JavaFX fade out stage and close -

i'm having difficulty finding out if possible. common behavior people want fade out extension of node , entirely possible through fadetransition however, i'm trying fade out entire stage, imagine closing running program , instead of killing windows (i.e. showing -> not showing), window ( stage ) fade out on 2 seconds toast or notification would. create timeline keyframe changes opacity of stage's scene's root node. make sure set stage style , scene fill transparent. make program exit once timeline finished. below application single big button that, when clicked, take 2 seconds fade away, , program close. public class stagefadeexample extends application { @override public void start(stage arg0) throws exception { stage stage = new stage(); stage.initstyle(stagestyle.transparent); //removes window decorations button close = new button("fade away"); close.setonaction((actionevent) -> {

jquery - Loading Javascript files sequentially in <body> and fire callback on completion -

i have weebsite (cordova/phonegap app actually) has in <head> : <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="apppolyfills.js"></script> <script type="text/javascript" src="applibs.js"></script> <script type="text/javascript" src="app.js"></script> this works fine, website scripts quite heavy, while scripts parsed, html of page not displayed. i want html of page displayed, , load scripts above. i know can load scripts in <body> tag, in case must absolutly load these scripts sequentially. so want is: make html display on startup before loading script load scripts sequentially in body be notified when last script (app.js) loaded, can start app (as document ready event has fired, need one) is possible? i can accept jquery based solution prefer raw javascript. you can put

What's different between "isset($string)" & "@$string" on PHP? -

what's different between isset($string) , @$string in php ? this works both ways, what's difference? if(isset($string)) .... if(@$string) .... function isset() check variable , return true if variable exists. sign @ ignore error. give same values. next code maybe show it: if(isset($string)) print 1; // no print if(@$string) print 2; // no print $string = false; if(isset($string)) print 3; // print 3 if(@$string) print 4; // no print

php - Javascript value won't change -

i have 2 files: first script.js ; second index.php (but in file script.js included). i have declared in script.js global variable time = 12000 , when if stime() called, variable time should changed 2000. variable pass variable in index.php won't chages... problem ? script.js var time = 1200; function stime() { time = 2000 } index.php var tick = time; // variable pass var script.js (time) var interval; var l = 5; function time_reset() { interval = setinterval(function() { if (l > 0) { post(4); // ajax function l = l - 1; } }, tick); //interval time } one more thing can tell me how can stop function time_reset() ?

php - How can I get the key intersect of two arrays? -

i have 2 arrays shown blow //array 1 array ( [0] => 223 [1] => 216 ) /array 2 array ( [221] => bakers [220] => construction [223] => information technology [216] => jewellery [217] => photography [222] => retailers ) i want text key (values) of first array matches second array (keys). expected result: information technology, jewellery $result = array(); foreach( $array1 $index ) { $result[] = $array2[ $index ]; } echo implode( ', ', $result );

SQL - Capture result of where comparison as ad hoc column -

i've got sql question. want use case logic determine value of ad hoc column based on result of comparisons done in clause. simplified, want this: select t.id, (case when cond1 "lbl1" + t2.v1 when cond2 "lbl2" + t2.v1) tbl1 t left join tbl2 t2 ( cond1 || cond2 ) the problem don't want recompute cond1 , cond2 in select clause, they're expensive. how can result? thanks, frood this written in ms sql 2008, not sure if it'll work in other rdbms same code, gives idea of might work. have iterated each record, overall have run each comparison once instead of twice each record. declare @cond1 bit declare @cond2 bit if 1=1 -- substitute condition 1 set @cond1 = 1 else set @cond1 = 0 if 1=0 -- substitute conditon 2 set @cond2 = 1 else set @cond2 = 0 select case when @cond1 = 1 'condition 1 met' when @cond2 = 1 'condition 2 met' end @cond1 = 1 or @cond2 = 1

unity3d - Playscape Publishing Kit. failed to sign apk -

unable build project playscape publishing kit v1.11 on mac. an error occured while applying post-build logic: failed sign apk log: androidsdktools: root : /users/zombie/documents/android-sdk-macosx tools : /users/zombie/documents/android-sdk-macosx/tools platform-tools: /users/zombie/documents/android-sdk-macosx/platform-tools build-tools : /users/zombie/documents/android-sdk-macosx/build-tools/22.0.1 adb : /users/zombie/documents/android-sdk-macosx/platform-tools/adb aapt : /users/zombie/documents/android-sdk-macosx/build-tools/22.0.1/aapt zipalign : /users/zombie/documents/android-sdk-macosx/build-tools/22.0.1/zipalign androidjavatools: java : /library/java/javavirtualmachines/jdk1.8.0_25.jdk/contents/home/bin/java updating projectsettings/qualitysettings.asset - guid: 00000000000000009000000000000000... done. [time: 3.979047 ms] ----- total assetimport time: 0.035828s, assetimport time: 0.016885s, asset

spring xd - nameExpression: option named 'nameExpression' is not supported -

i trying deploy 1 stream in springxd. stream create --name myfilestream --definition "http --port=9000 | file --nameexpression=payload.trim()" --deploy but error getting below: command failed org.springframework.xd.rest.client.impl.springxdexception: error option(s) module file of type sink: nameexpression: option named 'nameexpression' not supported when remove --nameexpression=payload.trim() ,i able create stream.. any suggestion..where problem.. what version using? wasn't added file sink until 1.2. use 1.2.0.release. https://jira.spring.io/browse/xd-2717 also, when using nameexpression , need direxpression .

floating point - Adding float values in c -

why f 0.0 after adding 0.1? #include <stdio.h> int main() { float f=0.0f; f = f + 0.1f; printf("f %f \n",&f); return 0; } sorry messed original question why these 2 values not ? because of precision. sorry have ask question here because i'm blocked can't ask more questions #include <stdio.h> int main() { float f=0.0f; int i; for(i=0;i<10;i++) {f = f + 0.1f; } if(f == 1.0f) printf("f 1.0 \n"); else printf("f %f not 1.0\n",f); return 0; } printf("f %f \n",f); gives correct output. see here- https://ideone.com/158zbv to print address printf(" %p \n",&f); . where printf statement give undefined behaviour. about second code - can re-write if condition - if(f>0.99f && f<1.01f) so gives correct output- https://ideone.com/karx3a edit while adding in program value of f not 1.0

w3c validation - Is W3C validator is required? -

i wonder why techie giants facebook shows many errors when validated in w3c ( link ) is w3c required? w3c validation idea, not "required". "required" possibly mean? call isp, static ip, set server, buy domain, , configure http return want , call html if like. if you're doing web development , have no reason not pass w3c validation, should. presumably, facebook had reason ignore - either wanted wouldn't pass, or didn't want pay engineers make pass, or engineers responsible incompetent, etc. it's idea validate ensure you're conforming applicable standards site works in many standards-compliant browsers possible. you think w3c validation bad? tell browser alert javascript errors, enable javascript debugging, , go favorite sites.

elasticsearch plugin - Getting logstash "fingerprint" filter to source every field -

i'm using fingerprint filter in logstash create fingerprint field set document_id in elasticsearch output. configuration follows: filter { fingerprint { method => "sha1" key => "key" } } output { elasticsearch { host => localhost document_id => "%{fingerprint}" } } this defaults source being message , how make sha1 entire record , not message ? note, fields record has depends on message. i think there no built-in possibility achieve fingerprint plugin. concatenate_sources option doesn't recognize fields , fields change cannot set them manually source . however, might consider using ruby plugin calculate sha1 hash regarding of fields. following might want. filter { ruby { init => "require 'digest/sha1'; require 'json'" code => "event['fingerprint'] = digest::sha1.hexdigest event.to_json" } } i've tested

c++ - If pointer of a COM interface assigned to a CComPtr object do I need to Release the original one? -

if create pointer of com interface , assign object of ccomptr of same com interface need release original com pointer? isomecominterface* psomecominterface = new csomecominterfaceimplemented(); ccomptr<isomecominterface> cptrsomecominterface = psomecominterface; // .... // need release original com pointer. psomecominterface->release(); ccomptr takes care of reference count of internal interface pointer, managed instance of class. has no effect on reference counts of other pointers. is, having assigned pointer variable, can sure ccomptr 's internal pointer addref 'ded , release 'd necessary, should take care of raw interface pointer variable psomecominterface , make explicit release call.

Connect Redis cluster with jedis -

Image
since single redis instance doesn't meet requirements, went redis cluster. formed cluster 3 nodes , populated data cluster. when data cluster using jediscluster takes more time single instance. so, what's proper way connect jedis redis cluster. how can make use of connection pool connect jedis redis cluster? it's normal observe latency when retrieve datas in jedis cluster depending of clustering strategy have because bonce 1 jedis in order take datas. red arrow, reason of time added queries in jedis cluster. the onlyway access right instance understand key location of datas, introduicing in key location exemple : "instance3/user/5" or finding location instance performing calculation on keys.

javascript - Converting a number in English to its digital value (ignore decimals) -

i want convert these types of values, '3 million', '24 thousand', '350 thousand', etc. number. in either javascript(so can client side) or php(server side). there function this? phps strtotime() function? input output 3 million 3000000 24 thousand 24000 350 thousand 350000 do want combine them well? function convert(num) { return num.match(/(\d+)( ?\w* ?)/g).map(mapgroups) .reduce(function(p,c){return p+c;}); function mapgroups(str){ if (/million/.test(str)){ return str.match(/\d+/)[0] * 1000000; } if (/thousand/.test(str)){ return str.match(/\d+/)[0] * 1000; } if (/hundred/.test(str)){ return str.match(/\d+/)[0] * 100; } return +str; }

logging - Java loggers do not start messages from new line sometimes -

Image
is there way fix such behaviour? examples: in log files okay, in tool shows logfiles lines this: log4j designed write give it... no println function. so must add log message + "\n" or create fileappender adds new line in each log entry. check answer

c++ - When I reserve memory with VirtualAlloc() and MEM_RESERVE, shouldn't I be able to grow my allocation on a 64K boundary? -

first of all, know how virtualalloc() works: when reserve blocks of memory, addresses aligned 64k boundaries, (a value can obtained getsysteminfo() ), when commit pages, them on page size boundary, 4k. the thing can't get, why if call virtualalloc() mem_reserve flag (so i'm reserving pages) , specify size, let's 4096, won't able grow further region 64k? what i'm saying is: when commit pages can use memory 4k because windows alignes these commits page size (of course, i'm commiting pages!), when i'm reserving regions of memory, shouldn't windows align size of region pass virtualalloc() 64k? "wasted" 15 pages go? so if reserve 4096 bytes, shouldn't able commit more pages until 65536 bytes? doesn't seem so, because if try this, virtualalloc() fails error_invalid_address last error code. but why? if windows reserve pages on 64k boundaries, , reserve pages on less size, loose pages don't reserve forever? because seems t

dom - Access specific text in body that has no tag -

this dom of page, <html> <head> <body> <div id="content"> take/o a/o look/o at/o the/o section/o about/o filling/o in/o forms/o using/o <div id="footer"> </body> </html> i want access text not under tag body after <div id="content"> , before <div id="footer"> in page body. i tried: drv.findelement(( by.xpath("//html/body"))).gettext(); give me full text in page under body tag. drv.findelement(( by.xpath("//html/body/data"))) // error unable locate element now can use following preceding xpath option, doubt tag in page? from wording, assume mean html code, closed head , div tags: <html> <head></head> <body> <div id="content"></div> take/o a/o look/o at/o the/o section/o about/o filling/o in/o forms/o using/o <div id="fo

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot

google chrome - Rails4 application on Heroku, Bootstrap work -

this first question on stackoverflow. i developing rails web application based on railstutorial.org. succeed deployed application online @ yurilliam.heroku.com. yet, seems can view ideal version on safari. seems bootstrap lost on ie, chrome, , firefox. what can fix issue. if open mozilla firefox console, security tab throws following error: blocked loading mixed active content "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" and learn more link. a solution add bootstrap.min.css files in heroku, , not use cdn anymore. 1 use secure version of cdn link, using https . https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css if helps, +1 , accept.

tortoisesvn - Error : svn path not found -

while trying add repository in sts(spring tool suite) cheking out project, getting error "svn path not found". same url able checkout project in folder(not through sts). check svn plugin compatible sts tool version. if installed compatible svn plugin in sts tool, please check whether svn interface correctly choose or not. (click preferences -> team -> svn - svn interface: choose java hl (jni 1.8.9) or svn kit)

jquery - how to change input type with onclick event in javascript -

i have check box , text box in same row. type of text box hidden, when click check box type of text box should change hidden text. if unchecked should change type text hidden. how can this? here code: <div class="row"> <div class="col-xs-6 col-sm-6 col-md-6"> <div class="form-group"> <input type="checkbox" name="customer_web" value="yes" style="float:left;"> <h4 align="left" style="font-size:16px; margin-left:20px !important;">web designing</h4> </div> </div> <div class="col-xs-6 col-sm-6 col-md-6"> <div class="form-group"> <input type="hidden" name="web_designing_details" placeholder="web designing details" class="form-control input-md" >

CSS selector for element being edited (not hover!), only WebKit -

i have elements editable (content-editable, is). each 1 inside regular spans. there way add border span text cursor (insertion point) is? know "mouse" cursor can use ::hover. <span class=one>alpha</span> <span class=one>beta</span> <span class=one>gamma</span> for example, if "|" text insertion point, word "one" becomes red border al|pha beta gamma no javascript, css. thank you! use selector :focus note: span must content-editable css .one:focus{ border: solid 1px red; display: inline-block; } demo here

ios - Swift - Realtime images from cam to server -

i hope can me! making app sends frames of camera server, , server make process. app sends 5-8 images per second (on nsdata format) i have tried different ways that, 2 methods works have different problems. explain situations, , maybe can me. first situation tried using avcapturevideodataoutput mode. code below: let capturesession = avcapturesession() capturesession.sessionpreset=avcapturesessionpresetiframe960x540 capturesession.addinput(avcapturedeviceinput(device: capturedevice, error: &error)) let output=avcapturevideodataoutput(); output.videosettings=[kcvpixelbufferpixelformattypekey:kcvpixelformattype_32bgra] let cameraqueue = dispatch_queue_create("cameraqueue", dispatch_queue_serial) output.setsamplebufferdelegate(self, queue: cameraqueue) capturesession.addoutput(output) videopreviewlayer = avcapturevideopreviewlayer(session: capturesession) videopreviewlayer?.videogravity = avlayervideogravityresizeaspectfill

Unable to get correct path in PHP due to server settings -

i not expert on servers , 1 of friends wanted use of php scripts wrote, has problem server , unable find how fix this. basically problem in generating paths files. in script, use following variables path: $path = "/template/"; // path template folder $baseurl = $_server['document_root'].$path; then include pages example this: include($baseurl."scripts/functions.php"); on server, works fine , when tried echo baseurl parameter this: /data/web/virtuals/104571/virtual/www/template/ however, on friend´s server, throws "php fatal error: call undefined function" - because checked , functions.php not being loaded, when tried echoing baseurl on friend´s server, got nothing. so tried viewing phpinfo() , interestingly, did't find document_root there @ , paths weird, php error shows: php fatal error: call undefined function convertt() in h:\webspace\hostings\kocher.es\hosting\www\meteotemplate\index.php on line 14 as dont unde

ios - How append string to a new line after setting exclusionPaths Rather than use NSTextAttachment? -

Image
how can uitextview can append string new line below screenshot show?thanks me. here code. main code : - (void)viewdidload { [super viewdidload]; nstextstorage *storage = [nstextstorage new]; nslayoutmanager *layoutmanager = [nslayoutmanager new]; [storage addlayoutmanager:layoutmanager]; nstextcontainer *textcontainer = [nstextcontainer new]; [layoutmanager addtextcontainer:textcontainer]; //setting exclusionpaths uiimage *image = [uiimage imagenamed:@"sample"]; cgrect arearect = cgrectmake(10, 50, 355, 180); uibezierpath *ovalpath = [uibezierpath bezierpathwithrect:arearect]; textcontainer.exclusionpaths = @[ovalpath]; //append text below image ,how do? nsattributedstring *text = [[nsattributedstring alloc]initwithstring:@"\ntest\ntet2\ntet2\ntet2\ntet2"]; [storage appendattributedstring:text]; uitextview *textview = [[uitextview alloc] initwithframe:cgrectmake(0, 0, 375, 600) textcontainer:textcontainer]; [self.view addsubview:textview]; // add ima

how to download image from server and store in internal storage using JSON in android -

i want download images server using json , storing in internal storage , after show image 1 one. have json format can body me how it??? json is: { "_id" : objectid("55b09029e56e5ecc1577f00e"), "user" : objectid("559a298d9969172f3ffeaa6d"), "name" : "ddd", "language" : "english", "pages" : [ { "_id" : objectid("55b0902be56e5ecc1577f00f"), "page_image" : [ { "image" : "images.png", "_id" : objectid("55b09032e56e5ecc1577f010") }, { "image" : "20140624_172041_fbhciha_sm.jpeg", "_id" : objectid("55b0903ce56e5ecc1577f011") }, { "image" : "673.jpg", "_id" : objectid("55b09042e56e5ecc1577f012") } ] } ], "__v" : 4 } 1- add compile 'com.squareup.picasso:picasso:2.5.2' inside build.gradle or download jar file pica

javascript - Use angular-translate to set placeholder value onblur -

i new angular. implementing localization in project. i've got many inputs , must translate placeholders. in html have this <input type="email" placeholder="{{ 'translation_key' | translate }}" onfocus="this.placeholder=''" onblur="this.placeholder='{{ 'translation_key' | translate }}'" required> but part of code doesn't work:( onblur="this.placeholder='{{ 'translation_key' | translate }}'" how set translated value placeholder onblur? i'll appreciate help! this approach problem jsfiddle : html: <div ng-app="myapp" ng-controller="myctrl"> <input type="email" placeholder="{{placeholder}}" ng-focus="setplaceholder()" ng-blur="setplaceholder('translation_key')" required> </div> js: angular.module('myapp', []) .controller('myctrl', function ($

xpath - Locating image in selenium -

i want check if logo (image) displayed or not unable find out xpath same.the html code below: <div class="page-wrapper"> <a class="brand pull-left" href="www.com">the logo<\a> what possible xpath verifying "the logo " displayed. may 1 of these works: //a[contains(text(), 'the logo')] //a[contains(text(), 'the logo') , @href='www.com'] //div[@class='page-wrapper']/a[contains(text(), 'the logo')] //div[@class='page-wrapper']/a[contains(text(), 'the logo') , @href='www.com']

inheritance - Delphi how to implement baseclass event? -

i have abstract delphi xe form acts base class family of forms used in application. trying figure out best way make function (on f1 keypress) opens wiki-page active form. i'd function implemented @ base-class level , call when user presses f1 need advice on how in smart way. put keydown-event on base form gets overwritten if subform receives own keydown, @ point have manually call basekeydown. obviously, not optimal.. there way ensure catch f1 keypress @ baseclass level, random overloads nonwithstanding? i running delphi xe on windows 7 you should override keydown method in base form class. type tbaseform = class(tform) protected procedure keydown(var key: word; shift: tshiftstate); override; end; procedure tbaseform.keydown(var key: word; shift: tshiftstate); begin // processing here // ... inherited; // call inherited method call onkeydown if assigned end; this default implementation of kewdown method calls onkeydown events procedure twin

php - How to update the quantity of all items in the cart with respect to database? -

i doing shopping cart using code-igniter. while can add cart functions, i'm confused how update them regards database. want when change item quantity in cart , click update ,both cart , database must updated particular item.i tried couldn't it.can please enlighten me do? controller code $this->load->model('user_m'); $result['query'] = $this->user_m->get($id); // inserts coresponing item foreach ($result['query'] $row) $id = $row->pid; $qty = $a; $quan=$row->quantity; $price = $row->pprice; $name = $row->pname; $q=$quan-$a; // remainig stock i.e total qty-user qty $data = array( 'id' => $id, 'qty' => $qty, 'price' => $price, 'name' => $name, 'stock' =>$q ); $this->cart->insert($data); $this->load->model('user_m'); $result['qry

c# - Where download examples of itextsharp? -

where can download c# examples usage itextsharp? link http://sourceforge.net/p/itextsharp/code/head/tree/tutorial/signatures/ broken (the interesting me signatures). all links http://support.itextpdf.com/node/178 not work. http://www.codeproject.com/articles/686994/create-read-advance-pdf-report-using-itextsharp-in http://www.codeproject.com/articles/277065/creating-pdf-documents-with-itextsharp all tutorials of itextsharp use : kuujinbo.info/itextinaction2ed/

git - Stash: is it possible to merge one pull request into several branches? -

given have pull request want merge several branches @ once. have create separate pull request each of branches. possible create 1 pull request merged several branches? as of version stash 3.11.x not possible. if want can create plugin allow - there none on market currently. more on plugins: https://developer.atlassian.com/stash/docs/latest/how-tos/creating-a-stash-plugin.html

java - SAX parser not completely working inside swing worker thread -

i tried couldn't working: @override protected void doinbackground() throws exception { // code uses online stream , parse xml. class saxhandler extends defaulthandler { @override public void startelement(string uri, string localname, string qname, attributes attributes) throws saxexception { system.out.println(qname); switch (qname) { case "requiredname": // code create new node break ; } } @override public void characters(char[] ch, int start, int length) throws saxexception { content = string.copyvalueof(ch, start, length).trim(); } @override public void endelement(string uri, string localname, string qname) throws saxexception { system.out.println("---" + qname + "---"); switch (qnam

javascript - How to change Facebook link appearance on wall? -

i've got website creator - can make own character. character generated in dynamic way via js. after registration, character saved on server. when user wants check character, can use link e-mail or find in gallery. when user using link, i'm taking data url, getting data server via ajax , showing user his/her character. problem started when wanted implement facebook's , share buttons. whole content generated in dynamic way , have access client-side of project. share button not problem anymore because i'm using feed dialog can use dynamic data. problem button. because of way how website works, don't have webpages every character different open graph tags on server-side. when new character shown in gallery, i'm changing data-href atribute button , calling fb.xfbml.parse(); refresh data in button. static thing generated character image (every character has it's own image saved on server) i'm using link image button. button works fine, number of

vb.net - Looking for examples connecting to DB2 from VB -

we use ibm backup solution called tivoli storage manager. reports of gubbins db2 database. i want able interact database vb can automate reporting features. only problem have no idea how go this. does have examples of being done might point me in right direction? thanks in advance! john, i think gives overview: http://www.codeproject.com/articles/4870/connect-to-db-from-microsoft-net i presume big difference connectionstring.

sql - PostgreSQL: how to use NOT IN without WHERE? -

i have 2 queries: select * tablea and select a,b tablea group a,b the first query returns 2101 rows second query returns 2100 rows i want know row in first not in second. should simple not in , can't find correct syntax not in should in where statement. don't have where statement in case. there n ways , 1 of simplest should find rows have count > 1 when grouped on a,b. select a,b tablea group a,b having count(*) > 1 here sample: with tablea ( select * (values (1,1,1), (1,1,1), (1,2,1) ) t(a,b,c) ) select a, b tablea group a, b having count(*) > 1;