Posts

Showing posts from January, 2010

Google Timeline - b[bc] is not a function -

Image
i have google timeline based graph. worked properly, earlier. have perceived yesterday, gives blank page message: b[bc] not function . i use generated (from sql query) json file source, checked , error free, seems valid. have not modified on this. oppinion, causes problem?

modify number in string php separated by comma -

i have string of numbers. numbers appear in sets of three. change second number in set depending on first number in set. this code far. $value='1 0 0,4 2 0,1 20 0,3 0 0,2 0 0,2 0 0,3 0 0,4 0 0,4 0 0,3 0 0,3 0 0,4 0 0,4 0 0,1 0 0,4 0 0,2 0 0,1 0 0,2 0 0,0 0 0,0 0 0,0 0 0,0 0 0,0 0 0,0 0 0,10 20 0,15 20 0,0 0 0,0 0 0,11 20 0,23 10 0,0 0 0,0 0 0,27 7 0,0 0 0,0 0 0,0 0 0,0 0 0,0 0 0,16 1 0,0 0 0'; $resouces_array=explode(',', $value); foreach ($resouces_array $key=> $value) { $first_number =substr($value,0,2); $second_number = explode(' ', $value); // part specify second number should depending on first number. if($first_number == 23) { $second_number[1]= 50; } //$first_parts= explode(' ', $value); $string_valo= implode(' ' ,$second_number); $after_spli=str_pad($string_valo, 6,','); echo $after_spli; } i want output this. 1 0 0,4 2 0,1 20 0,3 0 0,2 0 0,2 0 0,3 0 0,4 0 0,4 0

javascript - impliment array.map() on an array which itself is an element of another array -

here have array called "array" has 4 arrays element.as individual elements of "array" arrays itself,so can use array methods on them,right?so if choose first element array[0].map(callback) ,but unfortunately error occurring .how can fix problem ?? var array=[['apple','jackfruit'],['orange'],['pineapple'],['banana']]; (function(){ console.log(array[0]); var arr=array[0].map(function(row){ return row.reduce(function(first,second){ return math.max(first,second.length); },0); }); console.log(arr); })(); i can guess - search string in array largest length? with http://lodash.com/ can this: var array=[['apple','jacklongfurit'],['orange'],['pineapple'],['banana']]; // sort string.length (reverse) , use "flatten" make 1-imension-array. array = _.sortby(_.flatten(array), function(element){ return -element.l

spring roo - In a gvNIX application: any way to see only one register in DataTables? -

when create datatables in gvnix displays several registers in table, there way display 1 register show page? to add support datatables used following command: web mvc datatables add --type ~.web.entitycontroller you can adding simple parameter on roo command. web mvc datatables add --type ~.web.entitycontroller --mode show as parameter documentation says is optional param change visualization mode: if empty (default) renders table, otherwise create one-row-per-page + one-cell-per-row datatable created. on each cell content of given mode rendered, is, setting mode == show, each cell have show.jspx containing data of current entity. best regards

Android - Java - Have app run when device boots up -

i having bit of issue here, code seems right, not doing expecting too. i have app , run when device boots up. when device boots up, application not run, expecting. first in manifest, added uses-permission receive_boot_completed: <uses-permission android:name="android.permission.receive_boot_completed" /> then in manifest added receiver , activity inside application: <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter>

eclipse - implementing the NWalign.java alignment script for needleman wunsch algorithm -

i'm trying run nwaling.java file found here . code present @ link mentioned makes use of jaligner library. have downloaded java package here . inside zip folder there jar file. i'm developing code using eclipse. whenever add jar file code there classes missing example: import jaligner.needlemanwunschgotoh; & import jaligner.matrix.matrixgenerator; also in entire zipped folder there isn't pom.xml file allow me import entire folder maven project eclipse. can somenone suggest me how import jaligner library , use in eclipse? thanks. you can download community implementation of jaligner algorithm here . take @ this project sources may perhaps find searched artifacts.

Running sql SubQueries in asp.net c# -

hello working on mycollege project , trying make user login application in asp.dot net. have 2 tables in database 1 customer full detail , other customer login detail want count row in first query , if login_id , password matches executes other query retrive , displays customer first name, on redirectedd page below have done other type of method welcomed here code protected void login1_authenticate(object sender, authenticateeventargs e) { sqlconnection connection = new sqlconnection(conn); connection.open(); cmd = new sqlcommand("select count(*) customer_login login_id = @a , pass_login=@b",connection); cmd.parameters.addwithvalue("@a", login1.username); cmd.parameters.addwithvalue("@b", login1.password); string user_name; int = convert.toint32(cmd.executescalar().tostring()); if (i == 1) { e.authenticated = true; cmd = new sqlcommand("select f_name customer id = (select cust_id customer_lo

output - Program closes right after the last input -

so i'm trying write program school problem readln() program closes right after last output. code, don't know problem , i've tried everything; program calcolo; var el, ec, s, n:real; var nome:string; function returnvote(a, b, c, d:real):real; begin returnvote:= a+(2 * b) - (c / 2) - (d / 4); end; begin writeln('programma per calcolare il voto fornendo il numero di risposte esatte,'); writeln('quelle esatte e incomplete, quelle sbagliate e quelle non date'); writeln('====================================================================='); writeln('fornire il nome dello studente: '); read(nome); writeln('fornire il numero di risposte esatte e complete: '); read(ec); writeln('fornire il numero di risposte esatte ma incomplete: '); read(el); writeln('fornire il numero di risposte sbagliate: '); read(s); writeln('fornire il numero di risposte non date: '); read(n); writeln('il voto calcolato per lo stude

javascript - Empty field check -

i have flowing code working fine need check empty field, , if field empty show message , not go new page. keep trying add code crashes help find <script> function gotourl(){ var newurl = document.gotoform.theurl.value document.location.href="http://www.bluediamond.tv/jobs/" + newurl } </script> </head> <body> <form action="javascript:gotourl()" method="get" name="gotoform"> <p align="center"><input maxlength="100" name="theurl" size="20" type=“find” value="" align="middle" /></p> <p align="center"><input type="submit" value="view photographs" /></p> </form> </body> okay, first add inside input's tag class="myinput" then update function function gotourl(){ if($('.myin

c++ - I am trying to use a do while loop to repeat a certain portion of my program and it refuses to execute properly -

okay title said refusing execute stuff right under "do" function though far can tell parameters repeat have been fulfilled. far when run program along lines of... "would search name? please enter y yes , n no:" looping on , on when press y #include <iostream> #include <string> #include <iomanip> #include <vector> #include <algorithm> #include <cstdlib> using namespace std; int main() { vector <string> vname, vid, vclass; string sname, sid, sclass, ssearch, cquestion; int isize, istudent; // display initial vector size isize = vname.size(); cout << "student list starts size:" << isize << endl; // size of list user cout << "how many students add?" << endl; cin >> istudent; cin.ignore(); // names, ids, , classes (int = 0; < istudent; i++) { cout << "student" << + 1 << &qu

asp.net - Post back Method not get call on button click in MVC4 -

i have created login page without _layout.cshtml in mvc4 , added 2 text box button. when click button no getting post back. have tried using breakpoint. pls help. code @model mapprojectmvc.models.loginmodel @{ layout = null; } <!doctype html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>special spots</title> @styles.render("~/content/css") @scripts.render("~/bundles/modernizr") </head> <body> <div class="loginbox"> <div class="loginhead"> <img src="img/logo.png" alt="special spots - responsive admin panel" title="special spots - responsive admin panel" /> </div> <div class="control-group"> <label for="inputemail"> user name</label> @html.textboxfor(a => a.username

How to get C++ build command from vcxproj via a C# program -

i have microsoft.build.evaluation.project object on specific project. have set correct global properties, according build need. is there way retrieve programmatically actual command line used when building? i explain bit need, , maybe have different suggestion: want preprocessed data c/cpp file, , since there may many includes , other stuff in command line, have no information about, effect output itself, thought of taking command line , adding preprocess flag. to answer underlying question: set vcclcompilertool.generatepreprocessedfile preprocessyes . .keepcomments may useful.

linux - raspberry pi not allow ssh through port routing -

i have computer , raspberry pi sharing same router can not ssh pi. set pi allow port 23 port 22 being used computer when want ssh location. know people simple set port forwarding rule on router , missing on pi. thought had opened port 23 maybe not. suggestions may have great can ssh pi without having monitor present. you shouldn't have change on pi allow ssh (assuming didn't block ssh begin with). if want ssh pi computer, connect pi's internal ip address. if want ssh pi outside place, need use port forwarding. you'll want create rule port 22 on router go port 22 of pi (internal ip address). connect external ip address. side note: when ssh pi computer, pi use port 22, computer using port between 49152 - 65535, doesn't use port 22. edit: then can forward port 23 of router port 22 of pis internal ip address. when connect pi outside of home, have make sure program use connect can change port ssh connects to. because default port forwarded com

forcing R PDF to new page after variable number of plots -

i can have or odd number of plots on each page, depending on input data size/shape. i set par(mfrow) values such smallest grid possible hold of plots, want make sure moves next page on next loop iteration in case total number of plots ends odd or not fit grid. how can force new page? google has shown me grid.newpage() , error > grid.newpage() error: not find function "grid.newpage" when try use it. also, unless mistaken, base plotting not use grid anyways wouldn't me. here's suggested strategy: fill empty cells plot.new() until layout filled; next plot automatically push new page. n = 5 rc = n2mfrow(n) par(mfrow=rc, mar=c(0,0,0,0)) for(ii in seq_len(n)) plot(rnorm(10)) for(ii in seq_len(prod(rc) - n)) plot.new() plot(1,1) # on own new page alternatively, try while(!par('page')) plot.new()

java - Stopping a thread forcefully -

suppose have following piece of code running thread: public void logic() { //step1 //step2 //step3 //step4 ... ... //stepn } nowhere in method interruptible methods called(like wait, sleep, join).and steps taking lot of times execute. reason might other blocking operations (socket.read or read methods of file). , want ensure if entire logic method not executed in m seconds thread should killed. best way achieve this? you "nowhere in method interruptible methods called(like wait, sleep, join)", interruption isn't limited blocking methods; method can respond interruption if check it. put between each step in logic method: if (thread.currentthread().interrupted()) { throw new interruptedexception(); } (you might want put static allowinterruption method somewhere , call after each step.)

gradle - How do I use gradlew in Bamboo? -

Image
i have project build in bamboo specific version of gradle. however, when bamboo executes ./gradlew failing task since return code of [./gradlew clean build sonarrunner] -1 while expected 0 how fix this? in case checking in script svn windows, , bamboo running on rhel server. ./gradlew work, needed set svn:executable property true on gradlew file.

PHP couchbase integration just shows version number only in phpinfo() -

i have tried integrate couchbase in php in centos 6.5 machine. , installed couchbase extension said in " http://www.couchbase.com/communities/php/getting-started ". not able connect couchbase php. when checked phpinfo() shows version number of couchbase extension no configuration information showing there. their example code no longer works , need update site. original code: <?php // adjust these parameters match installation $cb = new couchbase("127.0.0.1:8091", "", "", "default"); $cb->set("a", 101); var_dump($cb->get("a")); ?> to set-up new data bucket, go site's address: http://127.0.0.1:8091/index.html or type following in command line: curl -x post -d name=default -d ramquotamb=200 -d authtype=none -d replicanumber=2 -d proxyport=11215 http://127.0.0.1:8091/pools/default/buckets then need call couchbasecluster instead of couchbase this: <?php // adjust these parame

Check when all Ajax Requests are complete - Pure JavaScript -

i know jquery's ajaxstop method. $(document).ajaxstop(function() { //do }); is there way pure javascript if jquery not available? could provide example if so? cheers very well, i'll bite (though not trying quite lazy on part): from jquery docs : whenever ajax request completes, jquery checks whether there other outstanding ajax requests. if none remain, jquery triggers ajaxstop event. , handlers have been registered .ajaxstop() method executed @ time. so need? well: central api (a module of sorts) you'll use perform ajax requests. in module, you'll have keep track of pending requests, , remove them once requests have terminated. if queue (so speak) empty, can check ajaxstop queue registered callbacks, , invoke those. a basic setup (pseudo-code) this: var myajax = (function() {//create closure scope track ajax requests var activerequests = [], stopqueue = [], ajaxmodule = {},//the module createxhr = functi

jquery - use .html() method to set javascript -

i'm trying create "mini html editor" using textarea sets html in iframe using function: $(document).ready(function(){ $('#outputtxt').keyup(function(){ var tval = $('#outputtxt').val(); $("#frameid").contents().find("body").html(tval); }); }); works fine simple html , styling. doesn't seem working class or id css , doesn't seem working scripts. can .html() method used that? use div instead of iframe, css work.

javascript - Bootstrap Modal appears inside another scrollable window -

Image
let me show image of i'm talking about it's weird since i'm using similar code 1 shown in tutorial. @{ viewbag.title = "my routine"; layout = "~/views/shared/_bootstraplayout.basic.cshtml"; } <div id="mymodal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true" style="display: none;"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">close</span></button> <h4 class="modal-title" id="mymodallabel">tracking de agua</h4> </di

sql - What is wrong with this package declaration and definition -

package cpac stgfile xyz_instance.filename%type; procedure poc (cid in xyz_instance.client_id%type, stgtype in xyz_instance.stg_instance%type, stgsrc in xyz_instance.stg_source%type); end; package body cpac procedure poc (cid in xyz_instance.client_id%type, stgtype in xyz_instance.stg_instance%type, stgsrc in xyz_instance.stg_source%type ) begin select filename stgfile xyz_instance stg_instance = stgtype , stg_source = stgsrc , client_id = cid; end poc; begin poc('0123','19517','l'); dbms_output.put_line(stgfile); end cpac; sql statement alone executing, procedure alone containing sql executing within package error : error @ line 4 ora-00900: invalid sql statement, took reference following document: http://docstore.mik.ua/orelly/oracle/prog2/ch16_02.htm prefix pa

Multi Inheritance in JavaScript -

why type of inheritance not work in javascript. there way perform step. please help function base() {} base.prototype.findfirst = function() { console.log("findme first"); } function base2() {} base2.prototype.findme = function() { console.log("findme "); } function inherit() { base.call(this); base2.call(this); } inherit.prototype = base.prototype; inherit.prototype.constructor = inherit; inherit.prototype = base2.prototype; inherit.prototype.constructor = inherit; var test = inherit(); test.findfirst(); test.findme(); you overwritting prototype base.prototype , base2.prototype. stores base2.prtotype i.e. assigned second. if create instance of inherit class var test = new inherit(); see test has base2.property i.e. has fimeme() method in test.property.findme(); . achieve goal should try extend or refer mixin multiple inheritance

rest - Generating TypeScript from WSDL or WADL -

how can convert wsdl or wadl typescript code? , if can't, how can handle large dto server changed signature? there way know has been changed? thanks how can convert wsdl or wadl typescript code i not know of open source project this . can either start 1 or step (at level above wsdl ) , codegen directly based on c# / f# (.net) data structures using typelite.

scala - How to use actors for database access and DDD? -

i'm not quite sure how actors can used access database. in documentation , books akka topic seems omitted. one solution can wrapped dao in stateless actor. example each table (or domain object type or aggregate type) in database 1 can create actor responsible crud operations. variation of can separation of commands , queries. example each data type 1 command actor (for concurrency) , 10 query actors (for parallelism). an other approach create stateful actors representing 1 row (or domain object instance or aggregate instance) in database. of course database can in case event store (like akka persistence module) consistent projection database, document store or cache. that's not relevant here. approach implementation of in memory cache benefits , problems. there must strategy destroying actors not run out of memory after while. i extend question ddd: let's say, want develop ddd application akka actors. let's concentrate here on command part. in opinion shou

java - How to resolve collision in the ObjectFactory on wsdl2java? -

i'm using cxf , wsdl2java autogenerate webservice classes. problem: somehow webservice want connect has duplicate names elements: two declarations cause collision in objectfactory class the xsd like: <xs:schema targetnamespace="http://thenamespace"> <xs:complextype name="violatingname"> ... </xs:complextype> <xs:element name="violatingname" nillable="true" type="tns:violatingname"/> </xs:schema> the xsd imported inside wsdl used autogenerate jaxb classes this: <wsdl:types> <xsd:schema targetnamespace="http://imports"> <xsd:import schemalocation="https://path.to.xsd" namespace="http://thenamespace" /> i'm trying cover using jaxb-bindings.xml : <jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xjc="htt

Error for public static double pow -

i new @ java forgive me if ask stupid question. have assignment need calculate pow of 2 numbers (lets it's 2.0^3) supposed use public static double pow() . reason following errors: for ecpipse it's- error: not find or load main class exp.e and drjava- static error: no method in static pow has name 'main' class pow { public static double pow( double x, long y ) { x = 2.0; y = 3; double exp = math.pow(x,y); return exp; } } i must missing basic. spent significant amount of time on , can't figure out. please point me out doing wrong you missing main method. every program in java starts calling public static void main(string[]) method. code doesn't seem have method. need create one, program run. other methods should called main , or method called main , or method called method called main . so-called call stack, because methods "stacked" when called , removed stack when on (hopefully return

jquery - make a div animated with a wobble effect -

description : i have styled div calendar. whenever update in calendar date, appears on screen. now trying animate div wobble effect follows: 1) tilt left 2) tilt right 3) tilt left 4) etc so far unsure if should using jquery/css animation. if point me in right direction, appreciative! here's jsfiddle of think you're looking for: this doesn't use jscript, css: (please note. values can changed suit @-webkit-keyframes wiggle { 0% {-webkit-transform: rotatez(2deg);} 50% {-webkit-transform: rotatez(-2deg);} 100% {-webkit-transform: rotatez(2deg);} } @-moz-keyframes wiggle { 0% {-moz-transform: rotatez(2deg);} 50% {-moz-transform: rotatez(-2deg);} 100% {-moz-transform: rotatez(2deg);} } @-o-keyframes wiggle { 0% {-o-transform: rotatez(2deg);} 50% {-o-transform: rotatez(-2deg);} 100% {-o-transform: rotatez(2deg);} } @keyframes wiggle { 0% {transform: rotatez(2deg);} 50% {transform: rota

python - What is regex for currency symbol? -

in java can use regex : \p{sc} detecting currency symbol in text. equivalent in python? you can use unicode category if use regex package: >>> import regex >>> regex.findall(r'\p{sc}', '$99.99 / €77') # python 3.x ['$', '€'] >>> regex.findall(ur'\p{sc}', u'$99.99 / €77') # python 2.x (notel unicode literal) [u'$', u'\xa2'] >>> print _[1] ¢ update alterantive way using unicodedata.category : >>> import unicodedata >>> [ch ch in '$99.99 / €77' if unicodedata.category(ch) == 'sc'] ['$', '€']

list - J: How to efficiently apply a verb to prefixes of suffixes? -

i have list n =: i.3 and want have adverb a such u n applies u prefixes of suffixes of n : <a n ┌─────────────┬───────┬───┐ │┌─┬───┬─────┐│┌─┬───┐│┌─┐│ ││0│0 1│0 1 2│││1│1 2│││2││ │└─┴───┴─────┘│└─┴───┘│└─┘│ └─────────────┴───────┴───┘ i've written sentence produces desirable result verb < : ([: <@]\&.> <@]\.) n ┌─────────────┬───────┬───┐ │┌─┬───┬─────┐│┌─┬───┐│┌─┐│ ││0│0 1│0 1 2│││1│1 2│││2││ │└─┴───┴─────┘│└─┴───┘│└─┘│ └─────────────┴───────┴───┘ but cannot how make adverb use verb. i see approach problem: =: \\. <a n ┌─┬───┬─────┐ │0│0 1│0 1 2│ ├─┼───┼─────┤ │1│1 2│ │ ├─┼───┼─────┤ │2│ │ │ └─┴───┴─────┘ ([: < (a: ~: ]) # ])"1(<a n) ┌─────────────┬───────┬───┐ │┌─┬───┬─────┐│┌─┬───┐│┌─┐│ ││0│0 1│0 1 2│││1│1 2│││2││ │└─┴───┴─────┘│└─┴───┘│└─┘│ └─────────────┴───────┴───┘ but written < , , maybe not efficient. , still cannot how make adverb. it better if can following result: <a n ┌

php - How can I make this WordPress search optionally consider meta values? -

i'm trying configure wordpress search functionality consider data stored in meta field created advanced custom fields plugin. i using code try , accomplish that: if (!is_admin() && $query->is_search) { $query->set('meta_query', array( array( 'key' => 'detailed_product_title', 'value' => sanitize_text_field($_get['s']), 'compare' => 'like' ) )); } this yielding me search results of posts contain search term in meta field. example, if search "white", receive posts meta value contains white within them in search results. this leads me question: how can optionally search meta values, making search return posts hold search term somewhere within meta value, ignoring if meta value otherwise? here current code: function searchproducttitle($query) { if (!is_admin() && $query->is

html5 - Why my responsive layout doesn't work? CSS issue, float: none; seems not be working -

i'm trying make layout responsive media queries, when scale down browser elements float left. why float: none; not work here? right way of fixing it? thank in advance. .row { width: 100%; max-width: 940px; min-width: 320px; margin: 0 auto; } @media screen , (max-width: 960px) { .row { padding: 0 20px; } } .row .row { min-width: 0px; } @media screen , (max-width: 960px) { .row .row { padding: 0; } } .column, .columns { margin-left: 2.12766%; float: left; min-height: 1px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .column:first-child, .columns:first-child, .alpha { margin-left: 0px; } .row .six.columns { width: 48.93617%; margin-bottom:20px;} @media screen , (max-width: 767px) { body { -webkit-text-size-adjust: none; -ms-text-size-adjust: none; width: 100%; min-width: 0; } .container { min-width: 0; margin-left: 0; margin-right: 0; } .row { width: 100%; min-width: 0; margin-left: 0; margin-right: 0; } .row .row .column

UPDATED How do I get a UTC Timestamp in JavaScript? -

regarding link , info. : how utc timestamp in javascript? i not post update gentleman gave me hint @ done enhance answer: i send : https://stackoverflow.com/users/376535/shiplu-mokadd-im shiplu.mokadd.im 29.1k33797 you utilizing gettimezoneoffset , gettime, x = new date() var utcseconds = (x.gettime() + x.gettimezoneoffset()*60*1000)/1000; thank timezoneoffset call. made enhancement. // 20140922 arf made piece of server side classic asp work. // prefer moving both sides of equation seconds. x = new date() var utcseconds = ( (x.gettime()/1000) + (x.gettimezoneoffset()/60) ); return utcseconds // sample post <script language='javascript' runat='server'> function jsgetutctime() { //var d = new date(); //return d.toutcstring(); x = new date() var utcseconds = ( (x.gettime()/1000) + (x.gettimezoneoffset()/60) ); return utcseconds } </script> <script language='vbscript' runat='server'> func

javascript - smooth scrolling animation distance over time -

i'm trying create smooth endless animation using javascript manipulate translate , i'm having hard time developing formulate dynamic speed acceleration , deceleration this have far function run() { //stride(); = date.now(); var delta = (now - time) / 1000; draw(delta); time = now; if(streets.y1 >= h) streets.y1 = 0 - h + 1; else if(streets.y2 >= h) streets.y2 = 0 - h + 1; requestanimationframe(run); } function draw(delta) { var old_y = streets.y1; var n = old_y + delta; streets.y1 += math.abs(n - old_y) * 25.8; street[0].style[ $.fx.cssprefix + 'transform' ] = 'translate(0,'+ math.round(streets.y1) + 'px)'; var old_y = streets.y2; var n = old_y + delta; streets.y2 += math.abs(n - old_y) * 25.8; street[1].style[ $.fx.cssprefix + 'transform' ] = 'translate(0,'+ math.round(streets.y2) +'px)'; } can give me pointers or steer me tutorial. thanks doing

sql - What is the difference between these two queries pls? -

when updating table or performing query involves comparing 2 tables, have habit of querying below update dbo.table1 set col = ( select i.colid dbo.table2 i.did = dbo.table1.did , i.[pdate] = dbo.table1.pdate , i.pamount = dbo.table1.pay , i.[ref no ] = dbo.table1.refno , i.[cno ] = dbo.table1.receipt ) and above failed me. returns error saying query returns morethan 1 record/row. superior queried below , works . still cant figure out why mine failed , succeed. , why never failed me before ? update dbo.table1 set col = i.colid dbo.table2 i.did = dbo.table1.did , i.[pdate] = dbo.table1.pdate , i.pamount = dbo.table1.pay , i.[ref no ] = dbo.table1.refno , i.[cno ] = dbo.table1.receipt your query fails because returns more 1 row. is, there 2 or more rows match conditions. think pretty obvious error. have scalar subquery. should return @ 1 row , 1 column. the second works,

c# - Write <% to a view in MVC2 -

i need pass template string chartjs in mvc2, template string akin to: tooltiptemplate: <%if (value != 0){%><%= label %> - <%= value %><%}%> how can in mvc2 view? rendering engine thinkgs <% tags c# , tries render them. the thing came was: this.viewdata["hack"] = "<%if (value != 0){%><%= label %> - <%= value %><%}%>"; but looks bad.

ruby - Rails 4: rbenv & rvm clash, following tutorial -

when first started, installed rails rbenv and, through time, created few apps. have not had touch rbenv, never had problem, yet never had chance know it. i decided run through "learn ruby on rails" tutorial daniel kehoe. in chapters dealing installation, has download rvm project-specific gemset using following command: $ rvm use ruby-2.1.1@learn-rails --create $ gem install rails will still able download specific gemset using rbenv instead? if so, command , how go this? on side note, there great beginner tutorials using rbenv? you shouldn't install rvm , rbenv side-by-side. can interfere 1 another. recommend doing instead ignoring rvm + gemset section , continuing on guide using rbenv.

javascript - FontAwesome doesn't display in Firefox 33 -

here code , fontawesome fonts displaying on chrome not in mozilla 33.0.what mistake doing? <head> <title>welcome sri mata anandamayi ashram</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="sri mata anandamayi ashram"> <meta name="author" content=""> <meta charset="utf-8"> <!-- css bootstrap & custom --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet" media="screen"> <link href="css/main.css" rel="stylesheet" media="screen"> <!-- javascripts --> &

Facebook API: Can I use an expired long-lived access token to get a new one? -

i'm aware can exchange/extend non-expired short-lived access token long-lived access token using this method . i'm aware can use non-expired long-lived access token generate new long-lived access token using this method . my question is : can use expired long-lived access token new long-lived access token using either of methods linked above? note: haven't been able answer myself because don't yet have long-lived access token 60 days old, i'll try make one, store away, , try both methods after 60 days, if no answer given question. no, can't use expired or otherwise invalid access token fetch new 1 - if possible make expiration or invalidation moot

android - Volley Timeout Error -

i trying hit rest service using volley. public class authfunctions { private static final string login_url = "http://10.0.2.2:8080/stewayservices/user-management/users/10"; boolean result; public boolean loginuser(string email,string password){ jsonobjectrequest request = new jsonobjectrequest(request.method.get,login_url,null,new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { log.d("jsonobject response",response.tostring()); try { jsonobject user = response.getjsonobject("user"); string firstname = user.getstring("firstname"); if (firstname.equals("lokesh")){ result = true; } else{ result = false; } } catch (jsonexception e)

c# - How to set the value of dropdownlist from data table? -

i'm trying bind dropdownlist data table, data table contain departmentid, , departmnentname. binding successful, how set value of items? dt = objdeparment.selectall().tables[0]; foreach (datarow dr in dt.rows) { dropdownlist1.items.add(dr[1].tostring()); //binding dropdownlist department names } don't add string, add listitem (which exposes more useful constructors this): dropdownlist1.items.add(new listitem(dr[1].tostring(), dr[0].tostring())); // ^^--text ^^--value (assuming "value" want in dr[0] , use whatever holds actual value code) you bind control directly datatable instead of adding items in loop. this: dropdownlist1.datasource = objdeparment.selectall().tables[0]; dropdownlist1.datatextfield = "some column"; dropdownlist1.datavaluefield = "another column"; dropdownlist1.databind();

windows - Executing a .ps1 file from a .bat file -

i have .bat file that executes list of things no issues. powershell execute line: powershell.exe "y:\data\fs01\notouch_deploy.ps1" i following error: warning: failed load 'sqlas' extension: exception in smo while trying manage service. --> failed retrieve data request. --> invalid class when run same script through gui, runs no issues. have tried , running simple powershell script in same spot (the test 1 throws windows message box, let me know opening , executing) works well. once add in regular .ps1 , run .bat file error. script included below. quick summary of script: sets few variables creates 2 functions (bcp, , logwrite error trapping) renames tables , fires sql stored procedure. executes bcp function move data server server, executes 1 more procedure. cls [system.reflection.assembly]::loadwithpartialname("system.windows.forms") ## test msgbox## [system.windows.forms.messagebox]::show("we proceeding next step."

asp.net mvc - How can I use the foreach or for loop in razor to display the data I am trying to output? -

@foreach (var item in model.foos) { <div> @item.label @item.var1 @item.var2 @item.var3 @item.var4 </div> } i want display div container above first row of each of columns of table. understand logic using indexed loop instead , if how implement that. want loop go way through each row in table ad display each row separately. let me know if need me elaborate , if i'm not being clear. code above want? i think unclear want display 1 row @ time still need go through whole table. one way use take , skip : @{ var first = model.foos.take(1); } <div> @first.label @first.var1 @first.var2 @first.var3 @first.var4 </div> @foreach (var item in model.foos.skip(1)) { ... }

jquery - Click function .slideToggle After open -

// toggle $('#toggle').click(function() { $('.extra').slidetoggle(); }); .extra { display: none; } #toggle { cursor:pointer; width:100%; display:block; text-align: center; padding:10px 0; color:#777; } using font awesome fa fa-chevron-down im trying make once slidetoggle has been opened changes fa fa-chevron-down im pretty sure simple cant seem find $('#toggle').click(function() { $('.extra').slidetoggle(400, function(){ $("#toggle .additionalclasstotheicon").toggleclass("fa-chevron-up fa-chevron-down"); }); }); where 400 duration of animation, can change whatever want. additionalclasstotheicon additional class icon can identify it. also check documentation: http://api.jquery.com/slidetoggle/ http://api.jquery.com/toggleclass/

Large File transfer error in Socket in C -

i m building code transferring file server.c client.c program . during run time not working . m sending file in chunks of 512 bytes . source file 784 kb has 88000 names in it. this program works correctly on 127.0.0.1 not working when connect 2 computers on lan/wifi . i m not including complete file function m going transfer/recieve file help me find error in code. if u test between 2 computers . if u guys have better code file sending , recieving please post ,see need control out of function after transfer done . appreciate . i m using linux following purpose & gcc compiltion server.c function void filesender(char fs_name[],int ncfd) { char sdbuf[length]; file *fs=fopen(fs_name,"r"); if(fs==null) { perror("\n[server] file not found on server directory"); exit(1); } bzero(sdbuf, length); int fs_block_sz; while((fs_block_sz = fread(sdbuf, sizeof(char), length, fs))>0) { if(send(ncfd, sdbuf, fs_block_sz, 0) < 0) {

ios - How does iPhone with 1GB RAM have similar performance to Android phones with 2GB RAM -

with release of latest iphone 6/6+, have been wondering how iphones compete against competition lower ram. fundamental difference in os lets ios run on less beefy hardware, ram? the fundamental difference number of layers between application , hardware. this pure subtraction, in android application running inside virtual machine , kind of abstraction has lot of downsides, including lower performance, promise art runtime improve lot situation ( http://developer.android.com/preview/api-overview.html#art ). in ios, there's no such thing, application running directly in operational system, there's huge difference because apple every year tries improve low level apis, sample can use metal api ( https://developer.apple.com/metal/ ).

amazon web services - Are Spring Integration Extensions up-to-date and useable? -

does know state of spring integration extensions @ https://github.com/spring-projects/spring-integration-extensions ? some seem outdated regards spring versions. , others, whilst updated, don't seem have recent releases or snapshots available @ http://repo.spring.io/libs-snapshot/org/springframework/integration/ . for example wanted integrate aws, cant find release or snapshot latest version of spring integration. , sqs support has been "coming soon" time. the outdatedness of exist, , lack of clarity on intended, make me concerned use of them. know spring team's intention regards release cycle of these extensions? viewed incubators move spring integration core, or else? cheers, menno spring integration extensions community provided, , change according of community. best chance in touch contributors of aws extension. you should use them, once understand doing, there no more guarantees other spring projects, fact others using it.

php - Populate new array in for loop from two other arrays -

hi have been struggling population of array if can appreciated. so have these 2 arrays $start_range[] , $end_range[] both contain respective values , both arrays of same size. example: $start_range[0] = 1000 , $end_range[0]=[2000] . want fill new array range between numbers , keep respectiveness of values in example $new_array[0] = range($start_range[0],$end_range[0]) . in moment using code here for ($i=0; $i<sizeof($start_range); $i++) { $new_array[] = range($start_range[$i], $end_range[$i]); } but problem generates arrays same data because loops through size of array. if size of array 4 generate 4 new exact same arrays. can't break out of loop generates arrays first columns of 2 arrays. any solution? would do? $newarray = array(); foreach ($startarray $key => $value) { $newarray[$key] = range($startarray[$key], $endarray[$key]); }

javascript - How to remove all classes except the one you clicked? -

this functions starts when click on link. needs remove '.is-active' classes on elements attribute [data-route]. , add class '.is-active' on [data-route] element connected link clicked on. toggle: function(section){ var sections = document.queryselectorall('[data-route]'); (i = 0; < sections.length; i++){ document.queryselector('[data-route]').classlist.remove('is-active'); } document.queryselector(section).classlist.add('is-active'); } but doesn't work. doesn't remove classes? see example: http://jordypouw.github.io/myfed2/deeltoets1/index.html p.s. has in vanilla javascript. toggle: function(section){ var sections = document.queryselectorall('[data-route]'); (i = 0; < sections.length; i++){ sections[i].classlist.remove('is-active'); // queryselectorall return array of dom elements, u can access them directly.

python - return and print does not give same result -

what i'm trying take entered string separated commas , change list each list key print associated value. def main(): mydict = {'a':1, 'b':2, 'c':3, 'd':4, 'e':5....} u_input = input("enter letter") mylist = [x.strip() x in u_input.split(',')] result = searchdict(mylist) print(result) def searchdict(key): ml in key: value = mydict.get(ml, "not found") re = [] re.append(value) print('-'.join(re)) #this 1 shows each value each entered key separated comma not print in 1 line prints 'none' on end #res = '-'.join(re) #return res //this shows value first key if enter multiple letter main(); the prob that, if return 'res' instead of printing it, i'm getting first key value. output print(if enter a, b): 1, 2, none output return 1 are these lines indented properly? for ml in key: value = mydict.get(ml

Git for Windows (not cygwin) svn clone: unable to remap to same address as parent -

Image
my git installation under win 8 standard setup (not full cygwin setup). when try git svn clone, error. repeats once few seconds until press ctrl+d. i've seen thread here it's cygwin setup. how fix one? so overall, following this guide . the following commands fixed error mentioned, git install path wherever git is, , path dlls @ top of error mention (i got second ddl after running first command). <git install path>\bin\rebase -b 0x64000000 <path dlls>libsvn_repos-1-0.dll <git install path>\bin\rebase -b 0x64200000 <path dlls>libneon-25.dll it might give error fetching after this, manual git fetch again. note: either use ruby's command line or add path (this in linked document). also, found commands while looking on internet cant remember exact source. answers had cygwin don't use.

amazon web services - Smart Stack vs ELB -

i interested in service discovery. looking using smart stack. 1 of tenants in synapse repo using smart stack ( https://github.com/airbnb/synapse ) says aws elb supports external requests, seems otherwise http://docs.aws.amazon.com/elasticloadbalancing/latest/developerguide/vpc-loadbalancer-types.html missing something? why use smart stack on private elb if not true?

java - Creating an echo server - server can only respond once -

i'm creating multithreaded chat server supposed create separate thread each connected client. every time client connects, server creates new instance of client handler class, supposed keep track ingoing , outgoing messages from/to specific client. the first time client connects echo server, server respond echo of clients response. if try send message server second time, client creates ioexception. have created client application myself, know works because can communicate other servers fine. i'm pretty sure problem somewhere in run method of client handler class, can't figure out why it's not working. here's run method in client handler class: public void run() { try ( bufferedreader in = new bufferedreader( new inputstreamreader(clientsocket.getinputstream())); printwriter out = new printwriter(clientsocket.getoutputstream()); ) { long time = system.currenttimemillis();

jquery - Ajax not passing strings or arrays to MVC Controller -

i have jquery method var params = { pgroupidents: $.param({ pgroupidents: groupidents }), pisnew: isnew, pnewtypecategoryident: $(detailsnewtypecategory_select).val(), pnewtypetitle: $(detailsnewtypetitle_tb).val(), pexistingtypeident: $(detailsexistingtypecategory_select).val(), pnote: isnew ? $(detailsnewtypenote_tb).val() : $(detailsexistingtypenote_select).val() }; var json = json.stringify(params); $.ajax({ url: "/activities/postextracurricular/setextracurricular/", type: "post", data: json, datatype: "json", processdata: false, contenttype: "application/json; charset=utf-8" }) .always(function () { }) .success(function (data) { }) .fail(function () { }); posting method public jsonresult setextracurricular(int32[] pgroupidents, bool pisnew, int pnewtypecategoryident, string pnewtypetitle, int pexistingtypeident, string pnote) and stringified data this &

python - Method changes all instances of class inside list -

in script have these classes: class action: def __init__(self,ac_type,ac_date): self.ac_type = ac_type self.ac_date = ac_date class user: actions = [] def __init__(self,i_id): self.ivi_id = i_id def add(self,act): self.actions.append(act) def get_len(self): return len(self.actions) i want create list of "user" elements , add of theme actions. in following way: for in range(len(data_queue)): ind = users_id.index(data_queue[i].i_id); act = action(0,data_queue[i].added) users[ind].add(act) but after running see every action data_queue added every user users. wrong! shall change? the code using class attribute shared instances of class , class itself. use instance attribute instead: class user: def __init__(self,i_id): self.ivi_id = i_id self.actions = [] def add(self,act): self.actions.append(act) def get_len(self): return len(self.actions) btw, code using index iterate se