Posts

Showing posts from July, 2012

c# - Syntax error during inserting data using mysql -

c# - Syntax error during inserting data using mysql - error: incorrect syntax near 's'. unclosed quotation mark after charater string ');'. the code: private void btnadd_click(object sender, eventargs e) { sqlconnection cn = new sqlconnection(global::cimt.properties.settings.default.database2connectionstring); seek { string sql = "insert students(student_id,first_name,last_name,fathers_name,dob,mobile,address,post_code) values('"+this.txtid.text+"','"+this.txtfname.text+"','"+this.txtlname.text+"','"+this.txtfaname.text+"','"+this.txtdob.text+"','"+this.txtmob.text+"','"+this.txtaddress.text+"','"+this.txtpostcode.text+ "');"; sqlcommand exesql = new sqlcommand(sql, cn); cn.open(); exesql.executenonquery(); messagebox.show("add new record do...

javascript - JSON.parse is not working on iPad safari -

javascript - JSON.parse is not working on iPad safari - i doing 1 ajax phone call , in success function using json.parse function.but problem json.parse function working everywhere except in ipad-safari browser(ipad version~7.0.6).in ipad safari , code after line used json.parse not seems executed .i tried alert message under line json.parse had no luck.can find work around of problem? thanks in advance. here script running: var obj = json.parse($('#divwolistforfe').html()); alert('hello'); //this alert doesnt execute on ipadsafari $('#divwolistforfe').html(''); bindworkordergrid(obj, 1, 10); the value of $('#divwolistforfe').html() below "[{"pk_workorderid":6806,"fk_companyid":null,"fk_createdbyuserid":null,"fk_proposalid":null,"fk_invoiceid":null,"orderno":242,"fk_siteaddressid":null,"fk_customerid":null,"fk_ganttitemid":nul...

ssas - Create a drop down list in excel using data from cube -

ssas - Create a drop down list in excel using data from cube - i working on populating info cube on excel. new excel. can suggest me how create drop downwards list in excel using info cube sourse. i have product list based on category like: category products --------- ---------- finance audit contracting loans marketing target market market segmentation market subsidies all info in above table got cube. can utilize cube functions source in info validation - lists. can allow me know on possible ways of doing above. select both category field , product field in excel, toolbar select info , filter. filter can used dropdown. if looking else, please extend question vague. excel ssas cube

java - structr is it right to use -

java - structr is it right to use - i going develop application in neo4j ,i found structr based on neo4j. what structr? is spring or hibernate or totally different,what kind of problems can solve , stable plenty used in production. (disclaimer: i'm founder of project) structr can used as rapid application development tool content management system json document database graph editing/visualization tool it's end-user facing product ui, not library or mapping layer, although sports java-based ogm (object graph mapper). it stable , used in production. java neo4j structr

c++ - Do...While loop with probably if ... else statment inside with temporarily variables -

c++ - Do...While loop with probably if ... else statment inside with temporarily variables - i asked, after giving me initial_population(7), growth_rate(1.2%), initial_year (2011), , formula link final population inital 1 next : initial_population * exp ( (final_year - initial_year) * (rate/ 100.0)) for population entered, have made population grow year after year next forumla : double pc(0.0); // pc = population entered while (pc <= initial_population) { cout << "how many billion (> 7) ? "; cin >> pc; }; int temp(year); { ++temp; cout << "population in " << temp << " : " << initial_population * exp ( (final_year - initial_year) * (rate/ 100.0)) << endl; } while ( pc > initial_population * exp ( (final_year - initial_year) * (rate/ 100.0))); i create population growth...

jQuery Autoselect not working -

jQuery Autoselect not working - i've been trying fire event of autoselect using jquery.. works in way shouldn't work. don't understand what's going on. supposed work per documentation. code works $('.carcomplete').autocomplete( "/autocomplete.html?ajax=true&type=car" ); code doesn't work $('.carcomplete').autocomplete({ source:"/autocomplete.html?ajax=true&type=car" }); is there wrong in code? your url must point json or jsonp, not html. jquery jquery-autocomplete

How to convert pdfstamper to byte array -

How to convert pdfstamper to byte array - in application, need read existing pdf , add together barcode existing pdf , pass output stream. here existing pdf template. using itext jar adding barcode. i want know possibilities of converting pdfstamper object byte array or pdfcontentbyte byte array. can help on this? your question unclear. assume want write bytearrayoutputstream instead of fileoutputstream . there different examples on how on itext web site. see instance formservlet illustration says: // create outputstream new pdf bytearrayoutputstream baos = new bytearrayoutputstream(); // create pdf pdfstamper stamper = new pdfstamper(reader, baos); then later in example, this: // write pdf bytes outputstream outputstream os = response.getoutputstream(); baos.writeto(os); if want byte[] , can this: byte[] pdfbytes = baos.tobytearray(); i hope question wasn't writing pdfcontentbyte stream byte[] because wouldn't create sense: content str...

java - Casting Large Numbers -

java - Casting Large Numbers - import java.util.scanner; public class cast { public static void main(string[] args) { scanner scan = new scanner(system.in); double x = scan.nextdouble(); double x1 = (int) x; system.out.println(x); system.out.println(x1); } } i'm working on simple bank business relationship program. it's working fine, when seek come in big number , cast it, code breaks down. isolated 1 section of code see if wrong code or whether else... wrote quick , found when entered big number like... 10000000000000000000 , casted integer, 2.147483647e9 result. figured issue casting. why happen? what can prevent happening or else can in order resolve issue. it expected result of downcasting int big number big fit in valid range of int . getting integer.max_value double . section 5.1.3 of jls states: a narrowing conversion of floating-point number integral type t takes 2 steps: in firs...

objective c - How to save a color in NSUserDefaults in swift? -

objective c - How to save a color in NSUserDefaults in swift? - i have litle problem saving color in nsuserdefaults . in objective-c easy : -(nscolor *)colorforkey:(nsstring *)key{ nsdata *data; nscolor *color; info = [[nsuserdefaults standarduserdefaults] objectforkey:key]; color= [nsunarchiver unarchiveobjectwithdata:data]; if( ! [color iskindofclass:[nscolor class]] ){ color = nil; } homecoming color; } -(void)setcolor:(nscolor *)color forkey:(nsstring *)key{ nsdata *data = [nsarchiver archiveddatawithrootobject:color]; [[nsuserdefaults standarduserdefaults] setobject:data forkey:key]; } the above code works fine in objective-c, when seek write same code in swift, receive errors @ reading color nsuserdefaults. func savecolorforkey (color:nscolor , key:nsstring ) { var data:nsdata = nsdata() info = nsarchiver.archiveddatawithrootobject(color) nsuserdefaults.standarduserdefaults().setobject(data, forkey: key) } func colorforkey(key:nsstr...

javascript - Unable to find elements using Cheerio (Node.js/jQuery) -

javascript - Unable to find elements using Cheerio (Node.js/jQuery) - i'm trying write script scrape users achievements public codecademy profile. currently, how i'm trying parse info (backend, node.js using cheerio): var express = require('express'); var cheerio = require('cheerio'); var request = require('request'); var app = express(); app.get('/scrape/:username', function(req, res){ var user = req.params.username; console.log('processing request ' + user); url = 'http://www.codecademy.com/' + user + '/achievements'; request(url, function(error, response, body){ if (!error){ var $ = cheerio.load(body); var title, date var json = { achievements: [], meta: { request: { user: user, time: date.now(), }, server: { version: 1, contact: 'benedict@ovalbit.com' } ...

python - pytest capsys: checking output AND getting it reported? -

python - pytest capsys: checking output AND getting it reported? - python 3.4.1, pytest 2.6.2. when test fails, pytest routinely study printed stdout test. instance code: def method_under_test(): print("hallo, welt!") homecoming 41 def test_result_only(): result = method_under_test() assert result == 42 when executed python -m pytest myfile.py , study this: ================================== failures =================================== ______________________________ test_result_only _______________________________ def test_result_only(): result = method_under_test() > assert result == 42 e assert 41 == 42 pytestest.py:9: assertionerror ---------------------------- captured stdout phone call ----------------------------- hallo, welt! ========================== 1 failed in 0.03 seconds =========================== this nice feature. when utilize pytest's built-in capsys fixture, this: def test_result_...

indexing - Is it possible to make mysql order by index prefix? -

indexing - Is it possible to make mysql order by index prefix? - if create index this: create index part_of_name on client (name(10)); is possible create mysql utilize ordering in query like select * client order .... ? no, can not create indexes based on part of column's name. not allowed , can not utilize in anyway. to create , utilize index, can based on 1 table column or more. documentation. mysql indexing sql-order-by

javascript - Map object keys to array is value is true -

javascript - Map object keys to array is value is true - i have object pks , extract keys value true pks = {3: false, 7: true, 2: true} is there underscore function can homecoming [7, 2] ? i've tried _.invert lost 1 of values in process i'm looking alternative you can builtin functions, no need underscore: object.keys(pks) .filter(function(k){return pks[k]}) .map(number) javascript underscore.js

html - jQuery apply class to -

html - jQuery apply class to <tr> - my current html structure <div class="pull-right" id="sandbox-container"> <div class="datepicker datepicker-inline"> <div class="datepicker-days"> <table class=" table-condensed"><thead> <tr><th class="prev" style="visibility: visible;">«</th> <th class="datepicker-switch" colspan="5">october 2014</th> <th class="next" style="visibility: visible;">»</th></tr> <tr> <th class="dow">mo</th> <th class="dow">tu</th> <th class="dow">we</th> <th class="dow">th</th> <th class="dow">fr</th> <th class="dow">sa</th> <th class="dow">su</th> </tr> </thead> <tbody> <tr> <td class=...

SQL Server : need assitance parsing delimted data and returning a long concatenated string -

SQL Server : need assitance parsing delimted data and returning a long concatenated string - ok, have table mfbrw column serv_cde_list_osi this list separated space; each code 2 characters in length. entire string can 0 – 100 codes long. id | active_products__c | serv_cde_list_osi ____________________________________________ 1 | | aa ae ag 2 | | aa ag 3 | | aa ae lp and have table authcodes columns authcode , servicename id | authcodes | servicename __________________________________ 1 | aa | beer 2 | ae | coffee 3 | ag | coke 4 | lp | water i need authcode.servicename each code in mfbrw.serv_cde_list_osi , write name, 1 long string @ mfbrw.active_products__c id | active_products__c | serv_cde_list_osi ____________________________________________ 1 | beer; coffee; coke | aa ae ag 2 | beer; coke; | aa ag 3 | beer; coffee; ...

Error context in error handling in Scala -

Error context in error handling in Scala - suppose need phone call remote json/http service. create json request, send http server, , receive , parse json response. suppose have info type myerror for errors , functions homecoming either[myerror, r] type result[a] = either[myerror, a] def makejsonrequest(requestdata: requestdata): result[string] = ... def invoke(url: url, jsonrequest: string): result[string] = ... def parsejsonresponse(jsonresponse: string): result[responsedata] = ... i can combine them write new function: def invokeservice(url: url, requestdata: requestdata) result[responsedata] = { jsonrequest <- makejsonrequest(requestdata).right jsonresponse <- invoke(url, req).right responsedata <- parsejsonresponse(jsonresponse).right } yield responsedata now if parsejsonresponse fails ? i error need whole context. need url , requestdata , , jsonrequest . how suggest me ? if specific case create myerror trait (adt), ,...

php - Wordpress: register_activation_hook doesnt' working on my plugin -

php - Wordpress: register_activation_hook doesnt' working on my plugin - i'm creating new plugin test , when activate in wordpress plugin area, nil happens... does has same question? haven't error messages, nil happens to... thanks in advance. <?php /* plugin name: admin plugin uri: description: seu admin personalizado. version: 0.1.4 author: vinícius lourenço author uri: text domain: my-admin domain path: /languages */ register_activation_hook(__file__, 'ativar' ); function ativar(){ add_action('admin_menu','vilourenco_create_menu'); } function vilourenco_create_menu(){ add_menu_page('menu de opções','vilourenco settings','administrator', 'admin_fera' , 'vilourenco_menu_page','dashicons-format-status'); add_action('admin_init','vilourenco_register_settings'); } function vilourenco_register_settings(){ register_setting('vilourenco-options'...

javascript - Uncaught ReferenceError: showCategory is not defined -

javascript - Uncaught ReferenceError: showCategory is not defined - i've defined function named showcategory. however, reason debugger telling me show category not defined. , won't load/generate json pages. says "uncaught typeerror: cannot read property 'replace' of undefined" $.ajax({ type: 'get', url: 'http://jsonstub.com/bike/1', contenttype: 'application/json', beforesend: function (request) { request.setrequestheader('jsonstub-user-key', '50caee73-c7ed-43b7-912a-7fd6fcdbfd91'); request.setrequestheader('jsonstub-project-key', '54fb5790-b2cc-432f-88ee-7d3596b700bd'); } }).done(function showcategory( urlobj, options ) { var categoryname = urlobj.hash.replace( /.*category=/, "" ), category = categorydata[ categoryname ], pageselector = urlobj.hash.replace( /\?.*$/, "" ); if ( category ) { var $page = $( pageselector ), $header = $page.chil...

javascript - Apply Type validation on Sharepoint list columns -

javascript - Apply Type validation on Sharepoint list columns - i have dropdown list having list of columns nowadays in sharepoint xyz list. below code. function getcolumnname() { var _fields = ''; var lenum = fields.getenumerator(); var fieldxlist = document.getelementbyid('ddlxfield'); $('#ddlxfield').find('option:gt(0)').remove(); while(lenum.movenext()) { _fields = lenum.get_current().get_title(); var newlistitem = document.createelement('option'); var box = _fields; newlistitem.text = box; newlistitem.value = box; fieldxlist.add(newlistitem); box.value = ""; } } <div> <select id="ddlxfield"></select></div> now, want apply validation on dropdown , user can take column , type="single line of text", if chooses column name of other type , should prompt. possible? it should achievable adding onchange event handler dropdownlist. ...

abstract - How to "hide" a virtual method? (C++) -

abstract - How to "hide" a virtual method? (C++) - there post quite similar title here, understood actual problem there different. i know if possible forcefulness user of class wrote override method @ same time should not possible phone call method (but called within class). for example, if want following: class abstrdatasource { private: int index; protected: int currentdata; public: int getdata(){return currentdata;} void loaddata(int i){ // check valid index here if (index != i){doload(i);} this->index = i; } virtual void doload(int i)=0; }; in loaddata() can check index in valid range , bookkeeping, while actual loading has supplied user via overriding doload(). because pure virtual methods part of interface, public, how forcefulness implementation of doload() visible own class? my thought hide object in wrapper: class datasupplier { public: datasupplier(abstrdatasource* s) : source(s){...

How create vertical parallax background in android andengine -

How create vertical parallax background in android andengine - i developing game in andegine , want create parallax background move top bottom in portrait mode parallax move right left or left right. have set engine options portrait_fixed or portrait_sensor. how accomplish task have searched options autoparallax , parallaxentity there no alternative set portrait , landscape mode of parallax just found - http://www.andengine.org/forums/post306324.html#p31347 the guy has created 2 new classes autoverticalparallaxbackground , verticalparallaxbackground want! (i using it). can utilize verticalparallaxbackground or both depending on result :). a vertical parallax background can implemented as: mverticalparallaxbackground = new verticalparallaxbackground(0, 0, 0); mverticalparallaxbackground.attachverticalparallaxentity(new verticalparallaxentity(-5.0f, new sprite(0, screen_height - mresourcemanager.mparallaxlayerroad.getheight(), ...

python - How to convert matrix to pandas data frame -

python - How to convert matrix to pandas data frame - i'm trying convert matrix pandas info frame: matrixa={} matrixa[0,0]='a' matrixa[0,1]='b' matrixa[1,0]='c' matrixa[1,1]='d' like this: import pandas pd pd.dataframe(matrixa) i error. as said not creating matrix python dictionary. dict can serve parameter create dataframe, reversed indexing order. import pandas pd matrixa={} matrixa['a']=[0,0] matrixa['b']=[0,1] pd.dataframe(matrixa) b 0 0 0 1 0 1 additionally can utilize numpys matrix import numpy np = np.matrix('1 2; 3 4') pd.dataframe(a) 0 1 0 1 2 1 3 4 python pandas

security - Websockets - wss on http vs. wss on https -

security - Websockets - wss on http vs. wss on https - i've read ws works on http, , wss works on both http , https. wss (secure web socket) connections secure on http server on https server? web socket secure (wss) connection still encrypted through tls/ssl if website/server not? is web socket secure (wss) connection still encrypted through tls/ssl if website/server not? yes. are wss (secure web socket) connections secure on http server on https server? yes (see above). there 1 thing note: if html/javascript opens secure websocket connection comes on non-secure http, websocket connection still secure, attacker might modify html/javascript while beingness sent web server browser. http connection isn't protected against man-in-the-middle sniffing or modification. security http https websocket

Spring Batch: @Value is null when other annotations are not -

Spring Batch: @Value is null when other annotations are not - i have java/spring application connects mongo database. application uses spring annotations throughout. have base of operations database class looks this: public abstract class mongodatabase { @value("${db.url}") private string db_url; @value("${db.index}") private string db_index; public dbcollection createconnection() { seek { mongouri mongouri = new mongouri(db_url); db db = mongouri.connectdb(); db.authenticate(mongouri.getusername(), mongouri.getpassword()); homecoming db.getcollection(db_index); } grab (exception e) { e.printstacktrace(); } homecoming null; } } this works when connect through mvc way (@controller class autowired @service class autowired @service class (my dao) in turn loads connection this: dbcollection coll = createconnection(); however, when effort access database spring batch job, @value's in ...

c# - DTO and bindingsource -

c# - DTO and bindingsource - i have dto class, , in winforms client i'm creating datasource it. in form design, bind bindingsource datasource controls bound automatically. in code next bind bindingsource empty object: public void clear() { var dto = new mydto(); bindingsource.datasource = dto; } to item db , display similar: public void load(int id) { var dto = dtorequest.get(id); bindingsource.datasource = dto; } however want know if info has changed after datasource has been set. need implement inotifypropertychanged in dto classes? because if case, defeat purpose of having dto's in first place. are there other solutions? i develop you, using dto side view. never used inotifypropertychanged. if want know when info has changed have utilize events of bindingsource or build properties in dto. in add-on see reply post how set values in cells of row in datagridview when alter field value? and famous question implementi...

javascript - Fancybox inside fancybox( or nested fancybox) -

javascript - Fancybox inside fancybox( or nested fancybox) - i have 3 html pages, index.html, first.html , second.html. in index page have button b1. when clicked on button fancy box opened contents of first.html. within fancybox , button b2 used. when b2 clicked , sec fancybox open. 2nd fancy box within of first fancybox , content of 2nd second.html. problem size of 2nd fancybox limiting within of first fancybox. how can increment width , height of 2nd fancybox of 1st fancybox? next code. $(".fancybox").click(function () { var url = $(this).attr('url'); $.fancybox.open({ href: url, type: 'iframe', padding: 1, autodimensions: true, autoscale: false, }); }); i tried set width , height not worked. according documentation if set "autodimensions" true, width , height parameters ignored. have tried set "margin" equal 0? remove space ...

able to login to dotnetnuke with incorrect password -

able to login to dotnetnuke with incorrect password - i able login dnn website wrong password. when click on login button after typing wrong password, gives me proper validation message. however, logged in because if refresh or browse site pages, access , can see screen name. i using dnn version 7.1.2 on login button click, using below c# code: var user = usercontroller.userlogin( portalid, username, password, string.empty, portalname, ipaddress, ref loginstatus, checked); values each : portid = 0 ipaddress = ::1 var loginstatus = userloginstatus.login_failure; var checked = false; below configuation membership. <add name="aspnetsqlmembershipprovider" type="system.web.security.sqlmembershipprovider" connectionstringname="sitesqlserver" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false...

matlab - Plotting own function in scilab -

matlab - Plotting own function in scilab - hey have issuse plotting own function in scilab. want plot next function function f = test(n) if n < 0 f(n) = 0; elseif n <= 1 & n >= 0 f(n) = sin((%pi * n)/2); else f(n) = 1; end endfunction followed the console command x = [-2:0.1:2]; plot(x, test(x)); i loaded function , next error !--error 21 invalid index. @ line 7 of function lala called : plot(x, test(x)) can please tell me how can prepare this so did loop. don't think best solution can't other ones running atm... function f = test(n) f = zeros(size(n)); t = length(n); = 1:t if n(i) < 0 f(i) = 0; elseif n(i) <= 1 & n(i) >= 0 f(i) = sin((%pi * n(i)/2)); elseif n(i) > 1 f(i) = 1; end end endfunction i guess need find source issue , used features , perks matlab/scilab have on :) help tho matlab function p...

Does any Java compiler or JVM ignore a statement for optimization? -

Does any Java compiler or JVM ignore a statement for optimization? - suppose have next statement arraylist.size(); this statement in nothing. java compiler or jvm ignore statement optimization purposes? in effect, compiler or jvm assumes there no side effects of statement , hence removes optimization. as stated in comments, it's not no-op: @ least, must perform null check. moreover, there may subclasses of arraylist working differently. in theory, fetch info database or alike. normally, nobody subclass arraylist doing this, such list implementation makes sense. the compiler (jit, not javac) must able prove it's side-effect free. usually, it's quite simple as it knows, if there overriden implementation of arraylist.size() .1 if there none, sees it's simple getter , inlines it.23 this reduces problem useless field load, gets reduces null check. the null check can eliminated too, if performed before (e.g., due previous useless statement :d...

java - Generate Missing Bpmn Diagram Elements -

java - Generate Missing Bpmn Diagram Elements - there bpmn files without diagram elements. eclipse bpmn plugin can generate them. java solution generate missing elements needed. can somehow reuse eclipse bpmn plugin? i've downloaded sources, not find way that. there other frameworks? i tried utilize camunda, downloaded editor, seems not back upwards feature. you can utilize studio of bonita bpm solution generate automatically graphical part of bpmn 2 file. regards, java eclipse-plugin bpmn

how to Block a method until another method executes in c# .net -

how to Block a method until another method executes in c# .net - i have application, in i'm sending command hardware controller, controller responds command. in this, have queue of commands , send them 1 one, want send commands synchronously, means when receive first commands response send next command. have 2 methods, 1 send commands , handling received commands. this called signaling , simplest way implement via manualresetevent . if phone call waitone on manualresetevent object, current thread gets blocked until thread "signals" go on calling set on same object: var signal = new manualresetevent(false); // instantiate in "unsignaled" state new thread (() => { console.writeline("sending command hardware controller..."); // send command // ... console.writeline("done."); signal.set(); // signal waiting thread can continue. }).start(); console.writeline("waiting hardware thread it's wo...

php - How to print single value of entity without dumping the whole object? -

php - How to print single value of entity without dumping the whole object? - i want 1 single value entity.can help me here. here code.please allow me know missing here. $query = $em->createquery("select e adminbundle:mailtemplates e e.keyword = '" .$keywordval."'"); $query->execute(); $result = $query->getresult(); echo $result ->getid(); here want 'id'. this noted in documentation how can this. so given you're code become: $query = $em->createquery("select e.id adminbundle:mailtemplates e e.keyword = ?1"); $query->setparameter(1, $keywordval); $query->execute(); $result = $query->getresult(); // array of mailtemplates ids note: made utilize of setparameters instead of setting value straight in query. php symfony2 doctrine2

How can i crop Image like scanmaster.apk in android -

How can i crop Image like scanmaster.apk in android - after seeing great solution on cropping image inquire question 1 time again great help. please see scan master.apk, want crop image not in rectangle or square format,in shape. while calling native activity capturing or choosing image gallery. have pass key value pair in intent. android crop

jquery - Appending to HTML a content of a Javascript object -

jquery - Appending to HTML a content of a Javascript object - trying crack little issue have.. i using parse.com store , retrieve info , have json object trying retrieve part of append html var tempobject = parse.object.extend("dev"); var query = new parse.query(tempobject); query.notequalto("objectid", "dan stemkoski"); query.find({ success: function(results) { alert("successfully retrieved " + results.length + " receipts"); (var = 0; < results.length; i++) { var object = results[i]; $("#receipts").html(object.get('receipt_title')); console.log(object) //alert(object.id + ' - ' + object.get('receipt_title'));` the result want show in <div id = receipts> <div> unfortunately reason getting 1 line instead of 10 should getting. know should loop somehow results tries have failed me far. thanks in advance help! you need add together result html, right replace pr...

jquery - Django and AJAX : completely lost -

jquery - Django and AJAX : completely lost - my question in more appropriate way hope: essai.html: <html> <head> <title> ajax </title>, <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript" src="/static/js/ajax.js"></script> </head> <body> <div class="wrapper"> <h3>ajax callback introduction</h3> <div class='entry_wrapper'> <h4>data send server:</h4> <input type="text" size="50" id="input_text"/> <input type="button" value="ajax phone call back" id='call_back_btn'/> </div> <div class='response_wrapper'> <textarea id='responsetext'></textarea> </div> ajax.js: $(document).ready( function() { ...

jquery - Why are cookies not being destroyed in Java MVC website -

jquery - Why are cookies not being destroyed in Java MVC website - i attempting prevent users viewing webpage if not logged in. currently user able "login" sets cookie 24 hours. accomplish using ajax forwards admin page after creating "loggedin" cookie. when user navigates maincontroller?page=logout should delete cookie , forwards user login page, appears do. but when navigating maincontroller?page=admin user should forwarded login page if no cookies exist, instead admin page loads. i'm assuming i'm not deleting cookies properly? here ajax phone call check user credentials when logging in: $("#loginform").submit(function(e){ e.preventdefault(); //stop default action var postdata = $("#loginform").serializearray(); var username = $("#username").val(); var password = $("#password").val(); var botcatcher = $(".botcatcher").val(); if(username.length > 3 ...

javascript - Can't get page to scroll to top on click -

javascript - Can't get page to scroll to top on click - so i'm migrating webpage basic construction wordpress , 1 of pages has table of contents. toc has plus signs allow expand different areas of toc , when click on links , not, body scrolls properly, however, actual html tag of entire page not scrolling up. so basically, rough mock of page laid out like <html overflow-y: scroll; margin-left/right: auto; width: 1235px;> <body overflow-y: scroll> ...primary content here centered html css </body> </html> so basically, clicking plus signs uses href tags set body scroll window, however, since html document isn't scrolling well, doesn't align page header of section clicked navigate to. here code openclose function utilized plus signs: function openclose(thename, menuarray, theid) { for(var i=0; < menuarray.length; i++) { if (menuarray[i] == theid) { if (document.getelementbyid(theid).style.display == "block") { ...

Console not staying open with getch() using C++ (windows 8) -

Console not staying open with getch() using C++ (windows 8) - this question has reply here: how stop c++ console application exiting immediately? 29 answers i'm new c++ , can't figure out why console won't remain open during execution. i'm tinkering around, sense free crucify bad habits. please help: #include <stdio.h> #include <conio.h> int main() { printf("quantity\tcost\ttotal\n"); printf("\a\a\a\a\askip few lines, , beep "); printf("%s %c.", "you kicking butt learning", 'c'); getche(); homecoming 0; } use system("pause"); displays message press key continue... , waits you. c++ console

Why doesn't PHP Strict Standards complain about difference in constructor arguments? -

Why doesn't PHP Strict Standards complain about difference in constructor arguments? - normally when kid class has different function arguments parent, php strict standards lets know: strict standards: declaration of boele::bla() should compatible oele::bla($one, exception $two) in foo.php it doesn't break anything, lets know it's not cool. agree. however, constructors seem special treatment: class="lang-php prettyprint-override"> class oele { function __construct($one, exception $two) {} function bla($one, exception $two) {} } class boele extends oele { function __construct(exception $two) {} function bla(exception $two) {} } the __construct() , bla() methods both different in parent , child, yet php notifies bla() , not __construct() . proof on 3v4l why?? isn't as 'bad' constructors? (i'm running php 5.5.17 here, can see on 3v4l works same php 5.) i can not explain why there info in php docume...

c++ - in Qt 4.8 how to set "Qt::PreciseTimer" -

c++ - in Qt 4.8 how to set "Qt::PreciseTimer" - as title says: have snippet: qtimer timerdata; i can start timer calling timerdata.start(5); however, not getting 5 msec...i know in qt 5.x there 3 levels of precision timers: qt::precisetimer: 1 ms resolution on windows qt::coarsetimer (default): 15 ms resolution on windows qt::verycoarsetimer: 1000 ms resolution on platforms my question is there similar in qt 4.8 , if true, how set it? qt4 not provide high-precision timers. if want high-precision timers, need either migrate qt5 or utilize library. for example, seek this: http://www.boost.org/doc/libs/1_56_0/doc/html/boost_asio/reference/high_resolution_timer.html c++ qt qt4.8

mysql - Magento error after moving site to another hosting -

mysql - Magento error after moving site to another hosting - i have transfered site(cms magento) on hosting, have newest version on (apache version 2.2.29 | php version 5.5.16 | mysql version 5.6.16-cll-lve) not old host(about v5.1). error in frontend "fatal error: phone call fellow member function useloaddatafields() on non-object in /home/xxxxxx/public_html/app/code/core/mage/eav/model/config.php on line 610" header still working. have opened log , shows error "a:5:{i:0;s:63:"sqlstate[hy000]: general error: 2006 mysql server has gone away";i:1;s:1580:"#0 /home/xxxxxx/public_html/lib/varien/db/statement/pdo/mysql.php(110): zend_db_statement_pdo->_execute(array).... ". in admin when log in error "fatal error: class 'mage_adminhtml_block_widget_grid_column_renderer_abstract' not found in /home/sexup/public_html/app/code/core/mage/adminhtml/block/widget/grid/column/renderer/text.php on line 37" please help me solve...

r - How to create multiple rules for "lapply" function -

r - How to create multiple rules for "lapply" function - currently, have array of list(groupa) next example: $aaaaaa time timegap 1 06:00:00 0 2 07:00:00 60 3 08:00:00 40 4 09:00:00 0 5 10:00:00 30 $bbbbbbb time timegap 1 06:00:00 0 2 07:00:00 60 3 08:00:00 40 4 09:00:00 0 5 10:00:00 30 i trying create function generate dummy variable if timegap greater number. challenge number generating dummy variable different others if time in in range 07:00:00 09:00:00. what did following: dummytime<-function(x){ if(x$time>times("07:00:00") & x$time<times("09:00:00")){ d<-c(1200) } else{ d<-c(600) } dummytime<- as.numeric(x$timegap>=d) as.data.frame(dummytime) } dumtime<-lapply(groupm2,dummytime) however, got error this: error in if (as.logical(x$time > times("07:00:00") & x$time < time...

c# - Oxyplot: Rectangles on top of HeatMapSeries -

c# - Oxyplot: Rectangles on top of HeatMapSeries - is possible create filled rectangles on top of heatmapseries in oxyplot? i'm able set scatterseries on top, i'm struggling rectangles. what want accomplish create this, preferably filled transparent pattern lines or bitmap: wpf, series part: <oxy:plotview.series> <oxy:heatmapseries data="{binding heatmap}"/> <oxy:scatterseries itemssource="{binding scatter}"/> </oxy:plotview.series> c#, properties part: public double[,] heatmap { get; private set; } public ilist<scatterpoint> scatter { get; private set; } regards, jostein solved using 4 rectangleannotations added plotmodel.annotations. c# wpf oxyplot

c++ - convert a number from base-10 to another base -

c++ - convert a number from base-10 to another base - i tried next code convert number base-10 base. works if there no zero(0) in destination base. check 79 , 3 , prints 2221 correct. seek number 19 , 3, result 21 instead of 201 indicates something's wrong. int x, y, = 0, i, t, j; cout << "enter 2 numbers" << endl; cin >> x >> y; // x number in base-10 , x, destination base of operations = x; while (x >= y) { t = 1; (i = 0; x > y; i++) { x /= y; } cout << x; (j = 0; j < i; j++) { t *= y; } = - (t*x); x = a; } cout << x<<endl; using recursive function easier using while loop trying accomplish. here's working program. #include <iostream> using namespace std; void printinbase(int x, int y) { if ( x < y ) { cout << x; return; } int rem = x%y; printinbase(x/y, y); cout << rem; } int main() ...

mysql - SQL Join SQLzoo -

mysql - SQL Join SQLzoo - there's problem on sqlzoo under more bring together operations mysql. problem asked list films released in year 1978 ordered number of actors in cast. the tables given follows, ord has value of 0 or 1, 1 star role. movie | actor | casting id id movieid yr name actorid title ord budget gross director i wrote sql query follows, sqlzoo isn't telling me have right answer, believe query correct. can verify , perchance tell me how without subquery please? thanks! select distinct movie.title, f.num_actors (select casting.movieid,count(casting.actorid) num_actors casting grouping casting.movieid ) f bring together film on f.movieid = movie.id movie.yr = 1978 order 2 desc you can bring together first, grouping: select movie.* film bring together casting on movie.id = casting.movieid movie.yr = 1978 grouping movie.id order count(*) desc mysql sql sql-serv...

Android SyncAdapter not firing automatically -

Android SyncAdapter not firing automatically - i'm next syncadapter tutorial @ https://developer.android.com/training/sync-adapters/index.html. i've got of stub classes in place, , it's wired up. syncadapter 1 tutorial, nil log message. next work:- the business relationship visible in settings/accounts disabling/enabling sync in settings causes sync choosing "sync now" causes sync calling mresolver.requestsync(maccount, authority, settingsbundle); causes sync however, that's far goes. i'm expecting network events, (eg wifi becoming available) trigger sync, isn't. have misunderstood mresolver.setsyncautomatically(maccount,authority,true); does, or there else preventing automatic syncing? android android-networking android-syncadapter

angular ui router - AngularJS Route: when switching through routes, form becomes empty after re-loading the page? -

angular ui router - AngularJS Route: when switching through routes, form becomes empty after re-loading the page? - i have simple app built angularjs routes loading controller , template each path. have register form , login form on separates paths/templates. go login form (/#/login) , come in username/password, if nail "register" (redirects me /#/register), , nail in browser, homecoming me /#/login form empty; info typed in has been removed. expected behaviour form info still there. anyway create happen (without manually caching info in service)? i'm guessing when page changes, angular tossing old template info , reloading template again. there way instead cache page template/dom , reload when user returns path (instead of downloading , showing new template file)? well, bit tricky. browser should implement kind of feature out of box. firefox started doing work around "issue" don't know current status of it. alternatively ca...