Posts

Showing posts from July, 2011

java - HTTP 500 error failed with 200 status code -

java - HTTP 500 error failed with 200 status code - i have developed jax-rs project , called rest service add together info database. when sending post request add together data, gives 200 status code, adds info database , additionally gives 500 status says internal server error. below jax-rs code. @post @path("/users/add/") @produces("text/plain") public response adduser( @queryparam("userid") string userid, @queryparam("username") string username, @queryparam("userrole") string userrole, @queryparam("email") string email, @queryparam("password") string password, @queryparam("phone") string phone) { system.out.println("----invoking adduser"); try{ httpclient = new defaulthttpclient(); httppost postrequest = new httppost("http://appserver.dev.cloud.wso2.com/services/t/madusanka/projecttrackerdb-default

security - How i can allocate null page memory on Windows 8? -

security - How i can allocate null page memory on Windows 8? - could please describe me how can allocate memory in bottom regions (first 64 kb)? so, know windows 8 has introduced new mitigation disable null page allocation. there way allow allocation - http://www.askvg.com/windows-8-comes-with-built-in-16-bit-application-support/. so, have been trying method 16-bit application - 16-bit app has runned sucessfully (i have seen ntvdm.exe process in task manager) own application couldn't allocate (i have checked windbg). this flags in lastly seek (i straight phone call ntallocatevirtualmemory ntdll.dll): size_t mappedsize = 0x1000; pvoid mappedaddress = (pvoid)1; ntallocatevirtualmemory(getcurrentprocess(), &mappedaddress, 0, &mappedsize, mem_reserve | mem_commit | mem_top_down, page_execute_readwrite); is there compile alternative enable np allocation or else? thank you! it disabled in windows 8 prevent exploits seems can enable in 32 bit versi

How to store permanent set max_allowed_packet mysql variable -

How to store permanent set max_allowed_packet mysql variable - this question has reply here: how alter max_allowed_packet size 9 answers i have mysql version 5.5. want increment database packet size permanently.how can store permanently packet size in mysql . change in my.ini file. include single line under [mysqld] in file max_allowed_packet=500m restart mysql service , done. see documentation farther information.....https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html mysql

swift - Getting EXC_BAD_ACESS code =1 When Trying To Capture An Image From Camera -

swift - Getting EXC_BAD_ACESS code =1 When Trying To Capture An Image From Camera - new issue has come i've moved swift. code worked in objc broken. func captureimage() { var videoconnection:avcaptureconnection = avcaptureconnection() connection in _stillimageoutput.connections { } } for reason, if run above loop exc_bad_access code 1 on lastly line. _stillimageoutput avcapturestillimage object , not nil commenting out var videoconnection:avcaptureconnection = avcaptureconnection() stops crash. any ideas? turns out had nil loop doing var videoconnection:avcaptureconnection = avcaptureconnection() caused crash. changing var videoconnection:avcaptureconnection! fixed issue swift ios8 avfoundation avcapturesession avcapturedevice

c# - SignalR with Certificates -

c# - SignalR with Certificates - i want create simple signalr application. using http works fine, when seek utilize https , certificates application don't work. for now, thing want client's certificate in server. server (authentication handler): public class clientcertificateauthenticationhandler : authenticationhandler<clientcertificateauthenticationoptions> { protected override task<authenticationticket> authenticatecoreasync() { var cert = context.get<x509certificate>("ssl.clientcertificate"); if (cert == null) { homecoming task.fromresult<authenticationticket>(null); } seek { options.validator.validate(cert); } grab { homecoming task.fromresult<authenticationticket>(null); } homecoming null; } } client (hub) var connection = new hubconnection("https://localhost:8080/&q

websocket - No sound on browser when I connect with sipml5 and asterisk -

websocket - No sound on browser when I connect with sipml5 and asterisk - i using simpl5 , asterisk 12, connect websocket supported browser(latest version of chrome). works fine except sound. error "failed set remote reply sdp: called sdp without ice-ufrag , ice-pwd" , don't hear music/sound. note: have configuration required on asterisk. please help. thanks websocket asterisk sipml

Pass method to method as an argument in Java -

Pass method to method as an argument in Java - i want pass method method argument , want develop scheme follows. how can develop in java? pseudo code: class { public void test(method method, method method2) { if(condition) { method.run(); } else { method2.run(); } } } class b { a = new a(); a.test(foo(),bar()); public void foo() { print "hello"; } public void bar() { } } you don't pass method. pass object of class implementing interface. in case, existing runnable interface fit nicely, since has single run method no input arguments , no homecoming value. class { public void test(runnable method, runnable method2) { if(condition) { method.run(); } else { method2.run(); } } } class b { public static void main (string[] args) {

indexoutofboundsexception - Why does non-existant array position allow compiling -

indexoutofboundsexception - Why does non-existant array position allow compiling - #include <stdlib.h> #include <stdio.h> #include <ctime> // time functions #include <math.h> // pow() #include <iostream> using namespace std; int main() { int jiff=50; int sizes[jiff]; //array of size jiff sizes[49]=50; //existing, should lastly position sizes[55]=4; //should not exist printf("it %d\n", sizes[49]); printf("it %d",sizes[55]); } output: it 50 4 why doesn't code crash? sizes[55] should out of bounds , should crash @ run-time. gives? edit: nevermind, crashes now, or prints out obscurely big numbers. new question: why not misbehaving earlier? first 5 runs flawless array position till 60 accessing memory not allocated causes undefined behavior. sometimes, might print whatever happens sitting @ memory address , might give segmentation fault. see this question list of mut

javascript - make an ajax call in the very first page in JQM -

javascript - make an ajax call in the very first page in JQM - i trying show popup in first page if php post returns json file data. i tried with: $(document).on("pageinit", '#home', function() { ajax phone call async:false,... and after that, fill element list elements if json has data: if(userlastpush == 1){ var getpushxdays = '{"day":"4"}'; $.ajax({ type: "post", url: urlserver+"getpushxdays.php", data: getpushxdays, async: false, contenttype: "application/json; charset=utf-8", datatype: "json", success: function(response) { //console.log(response); html = ''; if(response.message != "empty"){ jquery.each(response, function(category, val) { if(val.id_event == 0){ html +='<li><a href="#mymessagesall&q

lotus notes - Mail-in database -

lotus notes - Mail-in database - i have scenario (this old story of mail-in) this company have many domino mail-in databases. 1 every branch. every person in every branch has personal notes email. the company policy each person of branch can not send email external business relationship (internal yes), need utilize mail-in database. i tried rules of domino perform block (in rule can set sender field track mail), not seem possible because unfortunately, when user sends email mail-in database (mail9.ntf template) sender field username. i know team mail service box project, old project , have problems html outgoing mail service , doesn't work on web. i tried looking solution, customizing standard mail9.ntf template , discovered library "coreemailclasses" function querysave method executed me.m_noteuimemo.send() have tried alter code copying backend document mail.box mail...but doesn't work because more complicated (there tmp field...and observed w

android - How to open a Calendar Sample App -

android - How to open a Calendar Sample App - i android beginner , seek write customized calendar app personal use. found sample calendar app github , seems demo me. however, after imported apps in eclipse, there problems in "res=>layout" of "allinoneactivity" , see "x" src bundle in "tests". appreciate if clues provided, many thanks! https://github.com/android/platform_packages_apps_calendar android calendar google-calendar

How can I receive error messages from the Python interpreter? -

How can I receive error messages from the Python interpreter? - i write python code in notepad++, save .py file , run double clicking on file in windows. however if there syntax errors in file, programme shuts down. no error message. how can receive error messages regarding problems in program? also, what's best way code run python scripts? when double-clicking .py file in windows, standard programme handler launched execute file. python interpreter, runs in console window. process finished—successful or not—the window closes again, doesn’t allow see error messages. in order maintain around, run programme within command line, e.g. opening cmd.exe first , executing file there. way, when python process exists, output still visible. python

mysql - SQL concept: nested loop -

mysql - SQL concept: nested loop - teacher (userid, name, dob, gender, email, address, phoneno, password, highestqual, isadmin) lesson (lessonid, lessonfee, <teacherid>, <subjectid>) enroll (<studentid>, <lessonid>, <paymentid>,result) suppose running below sql homecoming 2 tuple identical teacherid . select teacherid tuition.lesson lessonid in( select lessonid tuition.lesson lessonid not in (( select distinct lessonid tuition.enroll )) ); but if want select names display, result homecoming 1 tuple instead of two. select name tuition.teacher userid in ( select teacherid tuition.lesson lessonid in( select lessonid tuition.lesson lessonid not in (( selecr distinct lessonid tuition.enroll ))) ); what can result display 2 tuple, same name beingness displayed twice. please help advise. tuition.teacher has record

java - Hibernate Multiple @OneToOne all with the same id -

java - Hibernate Multiple @OneToOne all with the same id - i have 3 classes 1- narrative 2- narrativedata 3- narrativesponsershipe the narrative class has onetoone relation both narrativedata , narrativesponership . i need 3 classes have same id. in other words, need 3 classes mapped using id. the id of narrative class annotated using genericgenerator , property parameter's value set associated narrativedata field. way narrative , narrativedata has same id narrativesponsership take id. how can accomplish 3 classes having same id? java hibernate jpa

html - Hyperlink to specific page or folder with default document? -

html - Hyperlink to specific page or folder with default document? - we in process of redesigning our company's web site, , have been told consultants of import either: 1.) link specific page i.e. foo.com/buy/default.aspx or - 2.) link directory , allow default document load i.e. foo.com/buy/ "default.aspx" default document is there practical benefit either approach? beingness 100% consistent in doing 1 or other gain anything? in first example, linking specific page helps prevent ambiguity in urls. prefer canonical url (can or without file extension). if have have multiple urls single resource, illustration /products/product1.aspx , products?productid=product1, take advantage of canonical url property in code specify proper one. using extensionless urls allows alter technologies later. example, /blog/post1.aspx different /blog/post1.php, if ever switched wordpress (not common, of course, happens). it's easy way create links work no matter t

javascript - How can I recognize the elements to which is attached some jQuery code? -

javascript - How can I recognize the elements to which is attached some jQuery code? - $("#s").on("click") this kind of code nice, easy , intuitive, looking on website don't know developer see changing without knowing reason.. it's possible utilize dom breakpoints otherwise seems impossible realize why element has changed. how can find piece of code 1 @ top producing effect? how break js code execution when jquery event launched? i (https://chrome.google.com/webstore/detail/jquery-debugger/dbhhnnnpaeobfddmlalhnehgclcmjimi?hl=en). shows jquery code attached object. javascript jquery debugging

c# - Base Class Enum Implemented Differently in Derived Classes -

c# - Base Class Enum Implemented Differently in Derived Classes - my scenario: public class entitybase { public int id { get; set; } [required()] public string name { get; set; } //and getting me //i want "type" enum } then derived classes have different enums assign type. public class animalentity : entitybase { //type have 'animal type' value: land, sea or air //implementation code like: // myanimal.type = animaltype.land } public class personentity : entitybase { //type have 'person type' value: doctor, lawyer or engineer //implementation code like: // myperson.type = persontype.lawyer } public class monsterentity : entitybase { //type have 'monster type' value: goblinoid, undead } so, big question trying do, right? trying create base of operations repository class, homecoming entities grouped type. entities have kind of "type", , want create generic "group type&quo

Python scripting in Blender: how can I save a sequence of rendered images? -

Python scripting in Blender: how can I save a sequence of rendered images? - i'm new python scripting, i've been trying simple -- animation of bunch of cubes doing 3d random walk. i've managed programme render every frame of process, have no thought how save each frame. can help? here's code. i'm missing come in def render_and_save function. cheers! import bpy import random number_of_cubes = 10 animation_length = 10 def create_cubes(number_to_make): = 0 while < number_to_make: bpy.ops.mesh.primitive_cube_add(radius=1, view_align=false, enter_editmode=false, location=(0, 0, 0)) += 1 def move_cube(): bpy.ops.transform.translate(value=(random.randint(-1,1), random.randint(-1,1), random.randint(-1,1)), constraint_axis=(false, false, false), constraint_orientation='global', mirror=false, proportional='disabled', proportional_edit_falloff='smooth', proportional_size=1) def select_cube(cube_name):

c# - Exit code from a batch file converted to an exe is not returning 0 when called by Process.Start() -

c# - Exit code from a batch file converted to an exe is not returning 0 when called by Process.Start() - summary: c# app supposed phone call gpg.exe encrypt file before sending out. in testing found computer configuration gpg consistently fails. the goal have create wrapper batch file calls gpg prints command line args output file, , have our app phone call this. the c# code calling command: public static int startprocess(string command, string arguments, int waitforprocess) { processstartinfo startinfo = null; if (string.isnullorempty(arguments)) startinfo = new processstartinfo(command); else startinfo = new processstartinfo(command, arguments); startinfo.createnowindow = true; startinfo.errordialog = false; startinfo.useshellexecute = false; process p = new process(); p.startinfo = startinfo; p.start(); note have no c

Python : with dictionary, search for strings in another text file and print the entire line -

Python : with dictionary, search for strings in another text file and print the entire line - i want search dictionary if 1 of words in sec txt file. have problem next code: print 'searching known strings...\n' open('something.txt') f: haystack = f.read() open('d:\\users\\something\\desktop\\something\\dictionary\\entirelist.txt') f: needle in (line.strip() line in f): if needle in haystack: print line the open statements not me, took them from: python: search strings listed in 1 file text file? want print line wrote line instead of needle. problems comes : says "line not defined". my final objective see if words dictionary in "something.txt", , if yes, print line word identified. sorry bad english language or bad salutations, hope you'll help me! thx understanding :) the specific exception asked because line doesn't exist outside generator expression. if want access it, need mainta

ssl - Webpack Dev Server running on HTTPS/Web Sockets Secure -

ssl - Webpack Dev Server running on HTTPS/Web Sockets Secure - normally in developer mode webpack runs using http. there web server serving content through http , webpack using http/websockets on separate port. is possible run web server on https , webpack on https/websocket secure ? see webpack docs there flag can add together webpack-dev-server command webpack-dev-server --https ssl https webpack devserver

sql server - Removing Duplicates of two columns in a query -

sql server - Removing Duplicates of two columns in a query - i have select * query gives lots of row , lots of columns of results. have issue duplicates of 1 column when given same value of column b include 1 of. basically have column tells me "name" of object , tells me "number". have object "name" more 1 entry given object "number". want distinct "numbers" within "name" want query give entire table when true , not these 2 columns. name number columnc columnd bob 1 93 12 bob 2 432 546 bob 3 443 76 this illustration above fine name number columnc columnd bob 1 93 12 bob 2 432 546 bill 1 443 76 bill 2 54 1856 this illustration above fine name number columnc columnd bob 1 93 12 bob 2 432 546 bob 2 209 17 this illustration above not fine, want 1 of bob 2's.

Performance of for-comprehension in scala -

Performance of for-comprehension in scala - i've question efficiency of for-comprehensions in scala. this next code takes around 45 sec run when perm list of around 550 elements perm = list for{ perm <- perms.withfilter(_.size > 0) wordlist = somefunction(perm) //expensive operation, wordlist list of strings sentencelist = somefunction1(perm) //very expensive operation, sentencelist list of list of strings word <- wordlist sentence <- sentencelist } yield { word::sentence} when changed next code following, ran in 3 sec same perm list perm = list for{ perm <- perms.withfilter(_.size > 0) word <- somefunction(perm) //expensive operation sentence <- somefunction1(perm) //very expensive operation } yield { word::sentence} does difference in performance has lazy evaluation in scala? let's desugar both for-comprehensions: 1.) perms.withfilter(_.size > 0).flatmap { perm => val wordlist = somefunct

python - How to disable bbox_inches='tight' when working with matplotlib inline in ipython notebook -

python - How to disable bbox_inches='tight' when working with matplotlib inline in ipython notebook - when work matplotlib inline backend in ipython notebook, default behavior using bbox_inches='tight' generate embedded png image internally via savefig(). eliminates whitespace around axes , great in cases. however, 1 might want (temporarily) disable feature, example, when (s)he wants manually maintain 2 figures vertically aligned (assume don't want utilize subplot here): %matplotlib inline pylab import * plot(rand(100)) subplots_adjust(left=0.2) # has no effect inline, works expected qt figure() plot(rand(100)*10000) # result in larger left margin figure... subplots_adjust(left=0.2) so how disable behavior? thanks~ edit to create issue involved here more explicit (thanks anzel), 2nd figure, due more digits displayed in yticklabels, have larger left margin (and smaller right margin) after automatic layout adjustment triggered bbox_inches='tight

node.js - Failing to connect to mongodb (mongolab) from nodejs app running localhost -

node.js - Failing to connect to mongodb (mongolab) from nodejs app running localhost - i trying connect using next code. running nodejs app locally , cannot connect mongolab db using mongodb native driver. after 30sec error returned says: {"name":"mongoerror","message":"no valid seed servers in list"} should declare else somewhere? missing? when run live on heroku connects fine. also, when run terminal (shell) connects fine. var mongoclient = require('mongodb').mongoclient; var util = require('util'); var assert = require('assert'); var auth = { user: 'root', pass: 'blabla', host: 'blabla.mongolab.com', port: 63879, name: 'heroku_blabla' }; // connection url var url = util.format('mongodb://%s:%s@%s:%d/%s', auth.user, auth.pass, auth.host, auth.port, auth.name); // utilize connect method connec

typo3 - Bootstrapping an extension with Typoscript and calling a specific action -

typo3 - Bootstrapping an extension with Typoscript and calling a specific action - i have build extension bootstrapping typoscript , placing in modal box. have same extension included in page element different action. the problem when calling other actions extension in page reflects displayed in bootstrapped version in modal box. want no matter arguments in url (which tell extension action execute) 1 in modal box always phone call same action first. is possible? should different solution problem? the easiest way in sentiment abstractcontoller 2 different controller inherit. this way separated share same actions: namespace your\extension\controller; abstract class abstractcontroller extends \typo3\cms\extbase\mvc\controller\actioncontroller{ public function firstaction(){ // code here } public function secondaction(){ // code here } } first controller: namespace your\extension\controller; class firstcontroller extends abs

php - return all unique directories within a hierarchy -

php - return all unique directories within a hierarchy - i'm using recursivedirectoryiterator scan files , folders within given root dir. works fine, i'd maintain track of of unique directories in list, i'm not sure recursivedirectoryiterator way go. i have directory construction of -a ->b ->c -one ->two ->three here code: <?php function test($dir){ $in_dir = 'none'; $currdir = 'none'; $thisdir = new recursivedirectoryiterator($dir, recursivedirectoryiterator::skip_dots); $files = new recursiveiteratoriterator($thisdir, recursiveiteratoriterator::self_first); foreach($files $object){ //if directory... find out 1 is. if($object->isdir()){ //figure out if have changed directories... $currdir = realpath($object->getpath()); if(strpos($currdir, '.') == false){ $test = strcmp($currdir, $prevdir); if($test){ echo "current

How to set Region of Interest in OpenCV - JAVA -

How to set Region of Interest in OpenCV - JAVA - i have image of business card on have preformed perspective transform in order extract card image. now, want o feed image tesseract-ocr engine. before that, want extract part of involvement have text , feed instead of whole image. how can extract text card. here illustration of image: here code going you. did first finding contours of text available on image , using contours on actual image. mat img_grayroi = highgui.imread(perspective__transform_file, highgui.cv_load_image_grayscale); imgproc.gaussianblur(img_grayroi, img_grayroi, new size(15,15),50.00);imgproc.thresh_binary_inv, 15, 4); imgproc.threshold(img_grayroi, img_grayroi, -1, 255, imgproc.thresh_binary_inv+imgproc.thresh_otsu); imgproc.dilate(img_grayroi, img_grayroi, imgproc.getstructuringelement(imgproc.morph_rect, new size(2, 2))); mat heirarchy= new mat(); point shift=new point(150,0); list<matofpoint>

php - Long text entries not inserting into MySQL -

php - Long text entries not inserting into MySQL - i have form 2 user-editable fields. 1 text field come in numerical id , other uses tinymce input lengthy amounts of text saved mysql on submission: if ( !empty ( $_post ) ) { $location_id = $_post['restaurant_id']; $content = $_post['content']; $query = "insert restaurant_reviews (location_id, text1, review_date) values ('$location_id', '$content', now())"; $execute = mysqli_query($dbc, $query); print_r($_post); } the issue when little amounts of text submitted in form (by little amounts mean max of 2/3 normal paragraphs) record not generated in mysql. form submits every time few words of text in tinymce field. irrespective of amount of text submitted in form, appears in post array when it's echoed out print_r function, doesn't far db. text1 column type longtext sure isn't problem. ideas? i recomm

jquery - Bootstrap 3.0.3: dropdown menu-items not clickable on mobile -

jquery - Bootstrap 3.0.3: dropdown menu-items not clickable on mobile - on website links in dropdown menu's not working on mobile devices (android ánd ios). means when click on menu item on desktop, works fine, , when click same item on ipod touch closes dropdown , nothing. parent items function well. for example: when press 'activiteiten' , press 'wandelroute', nil happens on mobile. when draw window (on desktop) @ width of 320px (like width of mobile device) menu works. uncertainty whether code causes problem or mobile device does. what i've tried far: i've set jquery , bootstrap in right order; included bootstrap-dropdown.js; included next code: .dropdown-backdrop { position: static; } and there's other unusual thing. on this page of same website, menu functions okay on mobile devices. i've got absolutely no thought what's different on page compared other ones. i'm using joomla 3.x, jquery 1.11.1 , bootstrap 3.0.3

mysql - Search a combination of 3 values -

mysql - Search a combination of 3 values - i want search in mysql database combination of 3 successives values example, here table: | id | value | | 1 | value0 | | 2 | value1 | | 3 | value2 | | 4 | value3 | | 5 | value4 | | 6 | value0 | | 7 | value1 | | 8 | value2 | i want search, how many times there is, in order row containing "value0", , next row contains "value1" ans next row contains "value2". in above data, result 2 have twice value0, value1, value2 in 3 successives rows. is possible sql ? thanks lot. try friend select count( value ) test value = 'value0' , id +1 in ( select id test value = 'value1' ) , id +2 in ( select id test value = 'value2' ) mysql sql

html - CSS element with multiple values (px & rem) at the same time -

html - CSS element with multiple values (px & rem) at the same time - i have css code in many elements having multiple values single css attribute. for example, below css produce button shown below. css .btn-gold { display: block; text-decoration: none; font-size: 20px; font-size: 2rem; line-height: 22px; line-height: 2.2rem; color: #222; padding: 8px 0; padding: 0.8rem 0; text-align: center; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; background: rgb(254,196,26); background: -moz-linear-gradient(top, rgb(254,196,26) 0%, rgb(255,170,0) 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(254,196,26)), color-stop(100%,rgb(255,170,0))); background: -webkit-linear-gradient(top, rgb(254,196,26) 0%,rgb(255,170,0) 100%); background: -o-linear-gradient(top, rgb(254,196,26) 0%,rgb(255,170,0) 100%); background: -ms-linear-gradient(top, rgb(2

android - Add a different color for each action bar tabs separately -

android - Add a different color for each action bar tabs separately - i need add together different color every tabs. for eg: below image mainactivity.java: // add together new tab actionbar.addtab(actionbar.newtab().settext("home") .settablistener(tablistener)); actionbar.addtab(actionbar.newtab().settext("news") .settablistener(tablistener)); actionbar.addtab(actionbar.newtab().settext("latest") .settablistener(tablistener)); home.java: public class home extends fragment { @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater .inflate(r.layout.fragment_home, container, false); ((textview) v.findviewbyid(r.id.textview)).settext("home"); homecoming v; } } styles.xml: <resources> <style name="appbasetheme" parent="android:them

javascript - How make this slider with mouse over action? -

javascript - How make this slider with mouse over action? - i created slider , want mouse on action on numbers jquery can't seem work, know how can accomplish this? every time tried seemed break slider. thanks jsfiddle version: http://jsfiddle.net/bijanzand/cmqkc59b/ here current code: function tabsrotate() { $("#slider_a, #slider_b").tabs({ show: function (event, ui) { var lastopenedpanel = $(this).data("lastopenedpanel"); if (!$(this).data("toppositiontab")) { $(this).data("toppositiontab", $(ui.panel).position().top); } $(ui.panel).hide().fadein(1500); if (lastopenedpanel) { lastopenedpanel.toggleclass("ui-tabs-hide").css("position", "absolute").css("top", "0").fadeout(1500, function () { $(this).css("position", ""); }

c# - how to use foreach loop to edit some rows while populating datatable from sql? -

c# - how to use foreach loop to edit some rows while populating datatable from sql? - i trying populate data table database table. after populated using asp:gridview show data. the problem trying edit rows after populated database before binding data. i new c# cant working. code not update anything. private void bindgridviewfiledata() { string connectionstringname = webconfigurationmanager.connectionstrings["localconnection"].connectionstring; seek { using (sqlconnection sqlconn = new sqlconnection(connectionstringname)) { using (sqlcommand sqlcmd = new sqlcommand()) { sqlcmd.commandtext = "select * visualisation"; sqlcmd.connection = sqlconn; sqlconn.open(); sqldatareader objdatareader = sqlcmd.executereader(); datatabl

javascript - How to stop event bubbling on editing a view in Ember -

javascript - How to stop event bubbling on editing a view in Ember - i working on editable views in ember, click here see jsbin , have issue anytime want edit current view. can see problem 1 time click edit single view, other transactions become editable, don't want this, want single item becomes editable, not of them. don't know doing wrong, other hand if delete 1 , works well. in controller function: edit:function(ob){ this.map(function(item,index){ if(ob.id===item.id) em.set(item,'editable',true); }); }, i think problem stemming fact there no .id property on objects you're trying compare. try this... this.foreach(function(item) { if (ob === item) { em.set(item, 'editable', true); } }); although did notice in code, adding edit input when add together item list, , there binding going on. should reply question setting edit each individual item. the reason function setting of

javafx - Getting EXCEPTION_ACCESS_VIOLATION with Java 8 if I load data over 2 GB -

javafx - Getting EXCEPTION_ACCESS_VIOLATION with Java 8 if I load data over 2 GB - i using latest java runtime 8 , have created application in javafx load images in canvas. if info size below 2gb application runs fine, if 1 mb on 2gb next error logged. a fatal error has been detected java runtime environment: exception_access_violation (0xc0000005) @ pc=0x0000000053def51c, pid=5716, tid=10968 jre version: java(tm) se runtime environment (8.0_20-b26) (build 1.8.0_20-b26) java vm: java hotspot(tm) 64-bit server vm (25.20-b23 mixed mode windows-amd64 compressed oops) problematic frame: v [jvm.dll+0x21f51c] failed write core dump. minidumps not enabled default on client versions of windows error study file more info saved as: c:\users\105064864\documents\netbeansprojects\javafx3dapplication\hs_err_pid5716.log compiled method (nm) 51180 1220 n 0 sun.misc.unsafe::copymemory (native) total in heap [0x0000000002f4fb10,0x0000000002f4fe90] = 896 relocation

java - Parse String to Long using a specified locale (sv) and NumberFormat -

java - Parse String to Long using a specified locale (sv) and NumberFormat - i tried parse string (14 123) long in java using swedish locale using code: string longstring = "14 123" numberformat swedishnumberformat = numberformat.getinstance(new locale("sv")); system.out.println(swedishnumberformat.parse(longstring).longvalue()); the output of code 14 (it should 14123). per this question tried both sv , sv_se locale time result identical in both cases. according http://www.localeplanet.com/java/sv/index.html , http://www.localeplanet.com/java/sv-se/index.html grouping separator in both cases space( ) why string long parsing not handle a, locale, formatted double value stored string? swedish, french too, needs hard. non-breaking space. longstring = longstring.replace(' ', '\u00a0'); cumbersome. java string parsing locale

sql - inner join query in update statement giving error -

sql - inner join query in update statement giving error - i have update query: update secugconductorinfo inner bring together tblsecugconductor on secugconductorinfo.conductorguid = tblsecugconductor.globalid set secugconductorinfo.conductorcount = '0' upper(tblsecugconductor.file_name) '%q1222_s%' , secugconductorinfo.conductorsize = 'unknown' , secugconductorinfo.insulation = 'unknown' , secugconductorinfo.material = 'unknown' , secugconductorinfo.conductorcount = '1' i want update conductorcount=0 rows of secugconductorinfo based on bring together tblsecugconductor. i'm getting: error report: sql error: ora-00971: missing set keyword 00971. 00000 - "missing set keyword" how should alter query perform update? update secugconductorinfo set secugconductorinfo.conductorcount = '0' secugconductorinfo.conductorsize = 'unknow

javascript - Return all properties in JS object to "empty" state -

javascript - Return all properties in JS object to "empty" state - i wonder if there's utility function in framework jquery truncate js object (there more 1 possible result, not sure useful yet): { // original object foo: "bar", arr: [1, 2, 3], sub: {a: 4, b: 5, subsub: {c: 6}} } { // truncated, variant 1 foo: "", arr: [], sub: {} } { // truncated, variant 2 foo: "", arr: [], sub: {subsub: {}} } { // truncated, variant 3 foo: "", arr: [], sub: {a: 0, b: 0, subsub: {c: 0}} } if no, there solution more clever recursively iterate on properties, check types , remove / reset if necessary? call constructor each property create empty object of same type. for (var k in obj) { obj[k] = obj[k] && obj[k].constructor(); } this homecoming numbers 0, booleans false, dates now, , regexps empty (but nans remain nan). to recursively, retaining object-valued pro

What surface to use for a scrolling parallax interface with Famo.us -

What surface to use for a scrolling parallax interface with Famo.us - i create interface based on 3 layers stacked produce horizontal scrolling parallax on user input (on swipe). each layer got image placed randomly. should utilize scrollingsurface (that allow 300% of screen width ) or simple surface layer ? (or more clever option) the solution used create surfaces same 'index' , programatically create parallax effect based on touchsync parallax famo.us

docker - How do I run 2 environments of SkyDns/Skydock simultaneously? -

docker - How do I run 2 environments of SkyDns/Skydock simultaneously? - ref: https://github.com/crosbymichael/skydock https://github.com/crosbymichael/skydns first fired 2 instances. docker run -d -p 8080:8080 -p 172.17.42.1:53:53/udp --name skydns crosbymichael/skydns -nameserver 8.8.8.8:53 -domain docker docker run -d -v /var/run/docker.sock:/docker.sock --name skydock crosbymichael/skydock -ttl 30 -environment dev -s /docker.sock -domain docker -name skydns and setup working expected. now want spawn production environment. time fired skydock container env production follows. docker run -d -v /var/run/docker.sock:/docker.sock --name skydock-prod crosbymichael/skydock -ttl 30 -environment prod -s /docker.sock -domain docker -name skydns querying api doesn't show production skydoc. curl $(docker-ip):8080/skydns/services/ and wondering on how setup production version of skydock. do have run in separate docker-host? if fire in same docker host, in dns

C++ template instantiation with complex type -

C++ template instantiation with complex type - i want instantiate function template argument similar next complextype . template <class u, class type> struct complextype; template <class type> struct complextype<double, type> { typedef type t; }; template <class type> struct complextype<int, type> { typedef type t; }; i got next in header file template <typename u> void xyz( typename complextype<u, double>::t abc); and implementation in cpp file template <typename u> void xyz( typename complextype<u, double>::t abc) { abc = 1.0; } template void xyz( complextype<double, double>::t abc); unfortunately gcc giving me next compiler error message template-id xyz<> void xyz(complextype<double, double>::t) not match template declaration any suggestions of how resolve this? u isn't deduced argument. need explicit template specification: template void xyz<double&

Unable to upload image from android phone storage to facebook with caption in cordova android -

Unable to upload image from android phone storage to facebook with caption in cordova android - i'm using facebookconnect plugin github upload images timeline on facebook. i'm able upload image form web url using feed method specifying link. shows error when utilize link image file:///path img/img1.png. of import utilize caption image. image exists in phone storage. the function i'm using upload is: function imgshare() { var z = 'http://33.media.tumblr.com/4f057b48f29f3c167a962380d1a35443/tumblr_mgofxc3zhm1qfwg0ho1_500.jpg'; n='enjoy life'; var options = { method:"feed", picture: z, name:n, caption:'shared via app', description:'this image shared app'}; facebookconnectplugin.showdialog(options, function (result) { alert("posted. " +

actionscript 2 - How to clear a text input on focus but still be able to type? Flash/AS2 -

actionscript 2 - How to clear a text input on focus but still be able to type? Flash/AS2 - i trying create user input in swf , want clear default text on focus still allow user type input. currently using next as2 code: input.zip.onsetfocus = function() { input.zip.text = ""; } this clears text expected, 1 time text cleared, cannot type input. if remove code, can type in input fine. any ideas? thanks! you're either continuously setting text empty... or setting text once, you're changing type. code snippet should resolve both issues. //store boolean somewhere var hadfocus = false; input.zip.onsetfocus = function() { if(!hadfocus){ input.zip.text = ""; input.zip.type = "input"; hadfocus = true; } } input.zip.onkillfocus = function() { hadfocus = false; } flash actionscript-2

how to change an image to another image when hover -

how to change an image to another image when hover - how can alter image image when hover? have image , have alter image image when mouseover. how can that? presently, have image 1 , have alter image 1 image 2 when mouseover on image 1. , don't know how that. know how alter colors hover don't know how alter image. <div style="position:absolute; top:1050px; left:360px;"><img src="image1.jpg"><div> <img src="image1.jpg" onmouseover="this.src='image2.jpg'" onmouseout="this.src='image1.jpg'"> image hover

How can I use the same name for two or more different variables in a single C# function? -

How can I use the same name for two or more different variables in a single C# function? - how delete variable 1 time declared , defined? for example, in c++ do: int x; .. delete x; how can in c#? (i need this: switch (something) { case 1: int number; break; case 2: float number; break; } but can't it, because number taken case 1... , want same name, want delete int number before float number declared, compilator won't shout @ me. ;p you can create scopes non-overlapping using braces: switch (something) { case 1: { int number; } break; case 2: { float number; } break; } going out of scope way variable name "deleted" in sense talking about. notably , unlike other languages, c# doesn't allow hiding local variables other variables in more limited scopes -- scopes have non-overlapping (and in c#, means opening brace, not point of declaration!). mean code, legal in c , c++ (not sure java) cause compiler erro

database - What is the best way to make an auto increment ID's with large data? -

database - What is the best way to make an auto increment ID's with large data? - i want know best way or approach implement auto increment id big amount of info in database. my table contains @ to the lowest degree hundreds of thousands of info tagged unique id's. i'm thinking of alphanumeric id's contains prefix @ origin followed integer. considering number of characters should made not sure if cater info populate more. ex of id i'm thinking ia00001 incremented 1 ia00002 , on. is ok? i need suggestions please. and advance suggestions. database

delphi - Running an external program using ShellExecute -

delphi - Running an external program using ShellExecute - this question has reply here: how open file default text editor? 2 answers as far know ... need set executable programme in shellexecute (like notepad.exe) if user wants utilize other external programme (like notepad++.exe) open file? if possible how that? my guess want open document using whatever programme user has chosen associate document type. in case pass document shellexecute rather program: shellexecute(0, nil, pchar(documentfilename), nil, nil, sw_shownormal); passing nil sec parameter, verb, uses default verb document. 'open' verb. not always. might instead write: shellexecute(0, 'open', pchar(documentfilename), nil, nil, sw_shownormal); if want able check errors in sane way need utilize shellexecuteex rather shellexecute . your comments shed little more

java - Why does the Integer constructor method no longer require attributes? -

java - Why does the Integer constructor method no longer require attributes? - when attempting compile next code: public class inttest { public static void main(string[] args) { integer = new integer(5); } } the next error occurs: inttest.java:3: error: constructor integer in class integer cannot applied given types; integer = new integer(5); ^ required: no arguments found: integer reason: actual , formal argument lists differ in length 1 error it hence follows can utilize new integer() initialize variable, , cannot add together number attribute, e.g. new integer(5) . why java using different constructor usual, doesn't take attribute beingness included new integer() ? you trying initialize on - passing i argument, not 5 . java compiler-errors

How to handle jQuery UI accordion with Smallipop plugin -

How to handle jQuery UI accordion with Smallipop plugin - i trying implement smallipop plugin jquery ui accordion menu. accordion menus loading in div contain content on hover element tool tip not getting accordion menus in tool tip , can tell why not accordion not loading in tooltip ? jquery jquery-ui jquery-ui-accordion

Preview PDF from a source PDF file PHP -

Preview PDF from a source PDF file PHP - a bit of advice if possible required here. i have need allow user upload big 60 page + pdf , create 16 page preview pdf. thats pdf uploaded pdf. i want build in php , after while googling struggling find solution. able to create images without problem , 1 solution have looked creating pdf set of images certainly there improve way? anyway guidance great. thanks i googled 'php pdf reader library' , found these links: http://www.pdfparser.org http://www.pdflib.com/products/pdflib-family http://framework.zend.com/manual/1.12/en/zend.pdf.html and on. isn't there library suites needs? first 1 looks good. php pdf

java - Spring Best approach for multiple environments -

java - Spring Best approach for multiple environments - i have following: system - authorization (rest api) system b - needs check auth system c - needs check auth system d - needs check auth and have many environment: development homolog production each 1 have different urls system a . want create project integrate systems. since systems utilize bailiwick of jersey , spring, can create 1 filter (jersey) abort request in case user not authorized. so thought create integration system jar jerseys filters , uses parents configuration (active profile spring) right url. might utilize jar create system b communicate system d also, if can create work. the trick is, making jar right .properties file based on enviroment (set on parent-project). honest, dont know begin. reading docs spring environment found: do not utilize profiles if simpler approach can job done. if thing changing between profiles value of properties, spring's existing propertyplaceho

java - Struts 2 text tag weird behavior -

java - Struts 2 text tag weird behavior - i using struts2 text tag, translated value. so, have next statement: class="lang-jsp prettyprint-override"> <s:text name="a"/> i don't have key 'a' in properties files, in action, have object name a . what happens value rendered s:text class name of object instance ( package.a@xyz )! is normal? know struts2, if no property key found, rendered value key (text tag name attribute). did ever happened anyone? i think normal, because struts2 parses attributes ognl expression, , result of look evaluation used message key. doc says searchvaluestack should used prevent searches in value stack. 1 improve decide you, prefer <s:property value="gettext('a')"/> alternative. java jsp struts2 resourcebundle ognl

Android listview item not getting focus -

Android listview item not getting focus - my item in listview not getting focus, onfocuschanged not working created log statement log focus , returning "false" result of v.isfocused(). the onclick method working fine. any ideas? @override public view getview(final int position, view convertview, viewgroup parent) { view row = convertview; final exerciselistholder holder; if (row == null) { layoutinflater inflater = ((activity) context).getlayoutinflater(); row = inflater.inflate(layoutresourceid, parent, false); holder = new exerciselistholder(); holder.textview = (textview) row.findviewbyid(r.id.exercise_list_text_view); holder.imageview = (imageview) row.findviewbyid(r.id.trash_button); holder.edittext = (edittext) row.findviewbyid(r.id.exercise_list_edit_text_view); holder.deletebutton = (button) row.findviewbyid(r.id.delete_button); row.settag(holder); } else { holder =

java - netty-socketio Utf8 polish chars -

java - netty-socketio Utf8 polish chars - i've got problem utf-8 encoding (polish chars) when sending event (message) server netty-socketio client socket.io. have configure? client server it's ok. library netty-socketio 1.7.3 . @onevent(value = "message") public void onmessageeventhandler(socketioclient client, string data, ackrequest ackrequest) { client.sendevent("message", "z serwera wiadomości!"); } on client response server, broken message: "z serwera wiadomoÅci!" java utf-8 socket.io netty

c# - Where to store solutions .sln file in Visual Studio? -

c# - Where to store solutions .sln file in Visual Studio? - i read few things regarding issue i'm still bit confused seek nowadays scenario , questions. first of read shouldn't store .sln file in same folder .csproj. reason when seek add together new project added above directory .sln file. this visual studio 2010 best practices: [link] now i'm using vs 2013 different ? because when create new project root folder placed .sln file is.this projects created using new project... in visual studio , later using add together new project.. clicking on solution in visual studio. the reason inquire because copied project using step step [link] and working great except part .sln placing. re-create project delete .sln of first project , allow visual studio create new one. default visual studio tries in same directory .csproj. go 1 directory above , place .sln there. problem adding new project. starts behave in illustration visual studio best practices book (crea

Ant zip: how to remove original directory from the path -

Ant zip: how to remove original directory from the path - i have structure component1/database1/... component1/code/... component2/database2/... component2/code/... etc... i want create zip has structure: database1/... database2/... etc... with code: <zip destfile="db.zip" basedir="buildpath" includes="*/database*/**"> </zip> it creates: component1/database1/... component2/database2/... suggestions on how rid of first directories? thanks why don't seek copying folder construction temp folder , seek zipping it? https://ant.apache.org/manual/tasks/copydir.html https://ant.apache.org/manual/tasks/zip.html ant zip

xml - How can i link an xsl page into my php page? -

xml - How can i link an xsl page into my php page? - i have xml page includes php in it, hence called xml.php i have created xsl style sheet style xml.php page however need link xsl page php page. cannot use "<?xml-stylesheet type="text/xsl" href="xslt.xsl"?> because page .php?? thanks <?php // load xml source $xml = new domdocument; $xml->load('collection.xml'); $xsl = new domdocument; $xsl->load('collection.xsl'); // configure transformer $proc = new xsltprocessor; $proc->importstylesheet($xsl); // attach xsl rules echo $proc->transformtoxml($xml); ?> php xml xslt

update parameter in Java Primefaces -

update parameter in Java Primefaces - my problem kinda tricky, hope u explanation, i'll clear can this. i have datatable displays button see activities related selected item. opens little panel menu, @ moment has 1 option. opens yet panel 2 forms, in need to. my problem comes when utilize update parameters add together info need db. this code button i'm using. <p:commandlink action="#{reporteconsultorbean.veractividades(lead)}" update=":formmain:panelviewnotas" title="ver actividades asociadas al expediente"> <center> <p:graphicimage value="/images/actividad32.png" /> </center> </p:commandlink> this dialog pops out 1 time clicked button. class="lang-html prettyprint-override"> <p:dialog id="iddialogactitividades" header="actividades del expediente" widgetvar="dialogactividades" resizable="true"