Posts

Showing posts from January, 2013

javascript - How to make the user save a text box value as an image or file to their machine in html5 using jQuery -

what best way make user save text box value out use of server side scripting . using html5 , jquery . tried printing textbox putting inside iframe print() function of javascript , worked , want know whether other alternatives available .

javascript - How to set id to a <tr> generated from a JSON response? -

i want set id's dynamically rows. have this: function (json) { (var ib = 0; ib < json.length; ib++) { var tableib = document.getelementbyid("treatments"); var treatmentid = json[ib].id; var rowib = tableib.insertrow(-1); var cell1ib = rowib.insertcell(0); var cell2ib = rowib.insertcell(1); var cell3ib = rowib.insertcell(2); var cell4ib = rowib.insertcell(3); var cell5ib = rowib.insertcell(4); var buttonid = json[ib].id; cell1ib.innerhtml = json[ib].name; cell2ib.innerhtml = json[ib].time; cell3ib.innerhtml = json[ib].price + "kr"; cell4ib.innerhtml = json[ib].details; cell5ib.innerhtml = "button"; } }); the id want set json response , has variable buttonid . possible or should append each row this? : $('#treatments').append("<tr><td&

asp.net mvc - Conditional validation on model in MVC -

i have view & model use both edit , insert page record. 1 of business requirements field required on edit not on new. before particular feature added docket, had model so: [required(errormessage = "*")] [range(0.0, (double)decimal.maxvalue)] [displayname("cost")] [displayformat(dataformatstring = "{0:d}", applyformatineditmode = true)] public decimal proposedcost { get; set; } i either remove required property if insert form, or add if edit form. better approach? other validation done above. or can alter model state? thoughts? edit something should clarify still permitted insert cost on new, not required. if you're on mvc3/.net4, can use ivalidatableobject exists such purposes. quoting scottgu , ...the ivalidatableobject interface enables perform model-level validation, , enables provide validation error messages specific state of overall model.... you model like public class myviewmodel : ivalidatableobject {

Convert C realloc to Delphi -

int stackrealloc(stack* s){ if ((s->array = realloc(s->array,sizeof(int)*(s->size)*2)) != null){ s->size = (s->size)*2; return 1; } else return 0; } how can convert code( c ) delphi ( delphi7 ) ? the delphi function analagous c realloc reallocmem . you could, if wished, make literal translation of c struct delphi record, , call reallocmem . in delphi use dynamic array instead of raw pointers: var arr: array of integer; ... setlength(arr, length(arr)*2); there's no need struct contains both array , size because delphi dynamic array keeps track of own length. what's more not signal errors using 0 or 1 return value. instead not write explicit error checking in code , let runtime raise exception should call setlength fail. since appear implementing stack, use tstack class found in contnrs unit. in modern delphi use generics.collections.tstack<integer> instead. as aside, c code broken. fails handle errors correc

Connection property has not been initialized c# -

im getting when execute non query .. calling executenonquery.... clsconnection.executenonquery("add_customers", commandtype.storedprocedure, paramlist); exception pop @ cmd.connection.open(); this whole executenonquery public static void executenonquery(string sql, commandtype type, list<sqlparameter> paramlist) try { dataaccess.clsconnection clsdb = new dataaccess.clsconnection(); using (sqlconnection cn =clsdb.opencon()) { sqlcommand cmd = new sqlcommand(); cmd = createcommand(sql, type, paramlist); cmd.connection = cn; cmd.commandtype = type; cmd.commandtext = sql; cmd.executenonquery(); } you don't assign connection object command when sqlcommand executes query needs open connection. first step search connection property see if has been initialized. property null , erro

excel - Summing rows condition on two columns -

Image
i'd use array function conditional sum based on 2 columns. given example, each id want calculate sum of value column if column b -1 . id | b | value | ________________________ 1 a1 1 2 2 a2 1 3 3 a3 1 4 4 a3 -1 5 5 a3 -1 1 6 a2 1 5 7 a1 1 1 8 a2 -1 2 the outcome should be: id | value_total | ________________________ 1 a1 1 0 2 a2 1 2 3 a3 1 6 this gives outcome show example data: edit seems have ‘done trick’, explanation: =sumifs syntax sumifs(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) so in case formula summing columnd values in corresponding row columnb value whatever happens in columnb row containing formula , columnc value -1 . the answer not repeat column unique values of id because 3 distinct ids shown in example and, conveniently, these first 3 , in order.

sql server - Slow SQL 2008 Cursor Performance - Index scan/seek -

Image
i have found interesting "issue" when using ado driver sql server 2008 (or rather when using specific sql cursors created driver). want execute following query: select id, televeid, teldayid, telmobid, qualityflag, weekbegin cef (televeid = '+44xxxx') or (teldayid = '+44xxxxx') or (telmobid = '+44xxxx') order id desc where there (for sake of example) 3 indexed on cef table tuples [id; televeid], [id; teldayid], , [id; telmobid] the query above "translated" driver in following way: declare @p1 int declare @p2 int declare @p5 int set @p5=4 declare @p6 int set @p6=4 declare @p7 int set @p7=-1 exec sp_cursorprepexec @p1 output,@p2 output,null,n'select id, televeid, teldayid, telmobid, qualityflag, weekbegin cef (televeid = ''+44xxxx'') or (teldayid = ''+44xxxx'') or (telmobid = ''+44xxxx'') order id desc',@p5 output,@p6 output,@p7 output exec sp_cursorfetch @p2,2,1,10 the pro

asp.net mvc 4 - RenderBody doesn't work -

i have main layout in @renderbody work, i'm working on new controller (called system) wanted use lay-out. added _viewstart.cshtml inside ~/views/system folder. content of page is: @{ layout = "~/views/shared/_system.cshtml"; } so i've made view inside shared views folder called _system.cshtml . seem find layout, because when removed _system.cshtml did there no layout. but why give error? :\ compiler error message: cs1502: best overloaded method match 'system.web.webpages.webpageexecutingbase.write(system.web.webpages.helperresult)' has invalid arguments source error: line 11: <div id="content"> line 12: @renderbody line 13: </div> line 14: </body> renderbody method: @renderbody()

jquery - Can't delete dynamically added table row -

i pretty new jquery , want add , delete table rows clicking add or remove image. the adding button works , manually added row delete button works perfectly, if add new row , click delete button new row, nothing. i have tried searching google , testing answers none seem work me. <script type="text/javascript"> $(document).ready(function(){ var idcount = 0; idcount++; var new_row="<tr><td><span style='float:left; margin-left:20px;'>ip:&nbsp;</span><input name='ipaddr' type='text' /></td><td><img src='images/delete.png' width='20px' height='20px' id='deleterow' /></td></tr>"; $("table#iplist img#addrow").click(function() { $("table#iplist").append(new_row); });

Python textfile formatting -

here text file apple1 apple2 apple3 date apple flower1 flower2 flower3 flower4 date flower dog1 dog2 date dog i need python code helps me turn file this apple1|date apple apple2|date apple apple3|date apple flower1|date flower flower2|date flower flower3|date flower flower4|date flower dog1|date dog dog2|date dog it need nested loop, 1 counts until line.startswith "date" when gets there appends every line before counter starts on while x between range of 0 , total line count. ideas? my solution requires list contains things not start date. f = open('apple.txt') lines = f.readlines() f.close() things = [] printtofile = [] in lines: things.append(i) if i.startswith('date'): things.pop() x in things: if i[:-1] == '\n': printtofile.append(x[:-1]+'|'+i[:-1]) else: printtofile.append(x[:-1]+'|'+i) things = [] print printtofile write

Facebook Android request error : GraphObject is null -

i'm trying send simple request android facebook sdk. here code : session.openactivesession( native_activty, true, new session.statuscallback() { @override public void call(session session, sessionstate state, exception exception) { request.callback callback= new request.callback() { public void oncompleted(response response) { if( response.geterror() != null) { log.i( "output", response.tostring()); // here i'm checking token, permissions, ... } } }; bundle params = new bundle(); params.putstring("access_token", session.getaccesstoken()); params.putstring("name", name); params.putstring("caption", caption); params.putstring("description", description); params.putstring("link", link); params.putst

asp.net mvc - MVC IE9 Issue - breakpoints in view not being hit -

i have weird problem on site happens in ie9 - have js code need add page ie9 sort out placeholders. code not getting added , don't know if bug ie9 or mvc. the problem put code script @ top of view - gets added session gets rendered on master template, in ie9, view not being hit code doesn't rendered. have put breakpoint onto view , visited page in browsers. breakpoint gets hit , moves onto master layout in every browser except ie9 breakpoint missed (no matter put in view) , master layout loaded first. however if postback on page, view hit , script render. has had problem before or know causes it update the code in controller isn't hit in ie9 either. caching problem - if so, how stop mvc caching page okay, further update in ie9, have noticed url being loaded http://localhost/quote/#/quote/form/ in every other browser url correct one: http://localhost/quote/form/ . if go correct url page works in ie9. is caused jquery mobile ajax enabled option?

left function in vba powerpoint -

i trying take part of string in powerpoint using vba. trying use following code lines: dim strie string strie = sh.name sbody = left(strie, 5) i don't know why giving me "run-time error '13': type mismatch" error. try using following line instead of last one: sbody = left(strie, 5) but 1 gives me "compile error: type-declaration character not match declared data type" error before starting exec code. how can use left , right functions? in excel work here cannot make them work.

Is it possible to override a driver that has been compiled into the kernel? -

i have usb device have api. api works if usb device doesn't use ftdi_sio/usbserial drivers. on laptop, if plug usb device in, these drivers loaded (as modules) , have unload them using modprobe -r after code using api can see device. i have device experiences same issue although no modules loaded i'm guessing these drivers compiled kernel. question - there way stop device using these drivers or have recompile kernel, etc? thanks help! you looking way : unbind default driver usb device and bind driver of choice it. take quick @ this started. a more detailed description of same available in excellent lwn article of (un)binding device drivers .

jboss - How to do hot deployment in Jboss5 -

i have got maven project. when ever there changes done in java file, take rebuild of application . put our ear file in deploy folder of jboss , restart jboss. waste our lot of time in restarting jboss again , again . i heard hot deployment in jboss . can 1 tell how in case . hot deploy enabled default in jboss 5. it should start automatically couple of seconds after put ear in deploy folder. maybe had disabled hot deployment on instance. then see turning off jboss hot deploy service? , opposite.

performance - Slow Dynamic GSP Reloading in Production on AIX -

we using grails 2.2.4, websphere 8.0.0.5 running on aix 6.1.0.0. websphere using ibm jdk: java(tm) se runtime environment (build pap6460_26sr3ifix-20121005_02(sr3+iv27268+iv27928+iv28217+iv25699)) ibm j9 vm (build 2.6, jre 1.6.0 aix ppc64-64 20120919_122629 (jit enabled, aot enabled) j9vm - r26_java626_sr3_ifix_1_20120919_1316_b122629 jit - r11.b01_20120808_24925ifx1 gc - r26_java626_sr3_ifix_1_20120919_1316_b122629 j9cl - 20120919_122629) jcl - 20120713_01 the problem using: grails.gsp.enable.reload = true grails.gsp.view.dir="/path/to/gsp/views" is slow, , mean 20 seconds render small gsp. what's interesting in our local development environments takes 2 seconds. we've isolated problem having controller nothing except call render(..) on blank gsp nothing in model, can assume it's compilation wrong. has come across other instances rendering gsps extremely slow, or have suggestions, perhaps it's sort of weird j

c - Convert .mat file to any other format such as .txt or .plist -

how read data store in .mat file , convert other format such .txt or .plist c language project? if there opensource project it, please tell me. thanks in advice. it doable, see spec here: http://www.mathworks.de/de/help/matlab/matlab_external/custom-applications-to-read-and-write-mat-files.html?s_tid=doc_12b in python neatly wrapped in scipy, see read .mat files in python

asp.net mvc - MVC4 POST model from an action to another action skipping view -

i need post register model model without showing register model user in mvc 4. please suggest. move business logic out of actions , methods. let actions call work. instead of trying abuse framework post data between actions, call method parameters have.

Custom widget in Android -

i need customize android application ancient people, typically have vision problems. if not difficult increase font size of edittext or textview fields, can't same timepicker , datepicker or numberpicker . these widget think can't change size. right? someone knows how can solve problem? need create custom plugin? if so, can found materials purpose? what want call "custom widget" or "custom view" fyi : http://www.vogella.com/articles/androidcustomviews/article.html

error showing malformed JSON in jquery -

i have string i'm passing js grails controller , i'm trying run $.parsejson() method on string in jquery , fails. when tested in json lint malformed can't figure out why. private string copydec = """ { "header" : "", "copy" : "<p style='font-family: tahoma, arial, helvetica, sans-serif; font-size: 12px;'><b>title copy</b></p> <p><span style='font-size: 12px;'>lorem ipsum onsectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. duis autem vel eum iriure dolor in hendrerit in vulputate velit esse m

Using an exported service in another app on Android -

i have main app includes service , second app wants make use of service. the main app has in manifest (not inside activity): <service android:name="com.example.foo.xmppservice" android:exported="true" android:process="xmppservice" /> in second app try bind it: intent intent = new intent(); intent.setclassname("com.example.foo", "com.example.foo.xmppservice"); bindservice(intent, mconnection, context.bind_auto_create); but error: unable start activity componentinfo{com.example.app2/com.example.app2.mainactivity}: java.lang.securityexception: not allowed bind service intent { cmp=com.example.foo/.xmppservice } so i'm wondering why not allowed, while set "exported" true. you start android:process lowercase letter, documentation: if process name begins lowercase character, service run in global process of name, provided has permission so. allows components in different applicatio

java - Difference between Target platform and Dependencies while developing plugins using Eclipse -

can please shed light on difference between plugin dependencies plugin , target platform particular plugin? has got plugins located, whether in workspace or somewhere else? thanks in advance! target platform definition of environment expect plugins run in. dependencies specification of plugin needs. dependencies resolved against target. the target platform typically have lot more what's necessary satisfy dependencies of 1 plugin, because solution typically composed of multiple plugins.

c# - What happens to an exception in an async method if EndInvoke is never called? -

let's have following code: private delegate void deadlydelegate(); private void deadly() { throw new exception("die!"); } public void dostuff() { deadlydelegate d = deadly; d.begininvoke(null, null); } now, there has been discussion if endinvoke() needed (and answer yes), i'm not asking that. let's whatever reason, endinvoke never reached (in example, don't call it, imagine other reasons of how accidentally not ever called). first question: happens exception? disappear , never cause problems? or thrown unhandled exception during garbage collection, same way task exceptions if never observed? i've done searching, both google , so, , haven't found answer this. in own code, of course plan call endinvoke(). nice know happens if, because of unanticipated program path, endinvoke somehow isn't called. don't want whole app come crashing halt because of unhandled exception (if there one). second question: whatever answer fi

How to connect to a room with a Socket.IO client on Android? -

i using android-websockets library connect our socket.io server. connection created, can't connect room. in javascript, our code looks this: emit('subscribe', { 'channel' : 'test' }); i've tried using client.of("test", callback) , client.emit("subscribe", jsonarray) array has channel, end creating frame error . socket.io servers require authentication. done sending post /socket.io/1/ @ server , reading response this: srglg8x2yschjzugveeq:60:60:websocket,htmlfile,xhr-polling,jsonp-polling the string before first ":" key. if connecting server via websocket address be: ws://(your socket.io server)/socket.io/1/websocket/(the key) more information on socket.io protocol: github.com/learnboost/socket.io-spec ps. don't know android programming i'm explaining socket.io protocol

jquery - How can I use or operator here to make my code shorter? -

i have following code. how can use 'or' operator here make code shorter? $(document).ready(function() { $("#id_event_type_1").click(function(){ $("#id_end_date").show(); $('label[for="id_end_date"]').show(); }); }); $(document).ready(function(){ $("#id_event_type_2").click(function(){ $("#id_end_date").show(); $('label[for="id_end_date"]').show(); }); }); $(document).ready(function() { $("#id_event_type_3").click(function(){ $("#id_end_date").show(); $('label[for="id_end_date"]').show(); }); }); since seem same: $(document).ready(function() { $("#id_event_type_1,#id_event_type_2,#id_event_type_3").click(function(){ $("#id_end_date").show(); $('label[for="i

java - Why does scrolling the page not scroll the cursor trail with the mouse? -

i'm using same cursor trail i've found twenty exact copies of on internet cursor script generators. on of sites using same code, when scroll down page, trail remain mouse should. when inside of code, scrolling down page leaves trail @ same position before scrolling , mouse movement moves trail inch above cursor. trail can never lower on page bottom of page on loading. honeslty don't understand why appears isolated case. appreciated! use layout.jsp page combine header.jsp + view(content) + footer.jsp. working eclipse ee , tomcat 7 :p header <style type="text/css"> <!-- .mouse { position: absolute; visibility: visible; top: -50px; font-size: 18px; font-family: arial,helvetica,verdana; font-weight: bold; color: blue; } body { width:100%; overflow-x:hidden; overflow-y:scroll; } --> </style> <script> var x,y var step=20 var doit=0 var text=" text.. " text=text.split(&

Using yepnope if already have inline jquery code on the page that can't remove -

so advanced user's in cms (designers/web developers) may have access add inline javascript/jquery code in content things hide on specific page in cms via $(function(){ $('#banner').hide() }); , other more advanced things add jquery ui datepicker on input added in content. my question if jquery , dependent plugins loaded asynchronously via yepnope (or requirejs assume too)... when landing on page, error since jquery library isn't available (till few microseconds later when it's loaded). what optimal way introduce class loader yepnope in existing website allow inline code stay same? my best guess if want cdn/fallback load synchronously htmlboilerplate (or if don't need cdn-fallback load via script tag): <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script>window.jquery || document.write('<script src="js/jquery/jquery-ui/js/jquery-1.7.1.min.js"><\/script>')&

linear algebra - Error with strcmp matlab -

in follow-up a question of mine yesterday , tried following: for b0, bq+1 , b did: bq1 = []; (i=1:length(mte(1,:,3))) t = sym(['bq' int2str(i)]); bq1 = [bq1; t]; end i ran: >> solve(h_tot_te*b == mte(:,:,q)*bq1 + lvec + mprime*b1) error using char conversion char logical not possible. error in solve>geteqns (line 245) vc = char(v); error in solve (line 141) [eqns,vars,options] = geteqns(varargin{:}); so tried: >> solve(double(h_tot_te*b == mte(:,:,q)*bq1 + lvec + mprime*b1)) error using strcmp number of rows of string matrix must match number of elements in cell. error in solve>geteqns (line 246) if any(strcmp(vc, {'ignoreanalyticconstraints', 'ignorespecialcases', ... error in solve (line 141) [eqns,vars,options] = geteqns(varargin{:}); what error mean, , how can fix it?

dependency injection - How to force an embedded Grizzly web application context to start -

i use embedded grizzly web server host restful web-services jersey. working correctly. my question how force web application context eagerly initialise when start server rather waiting first incoming client request. minor problem, 1 solve. i start embedded server this: public final class testapplication { public testapplication() throws exception { httpserver httpserver = grizzlyhttpserverfactory.createhttpserver( "http://0.0.0.0:8888", new resourceconfig() .registerinstances( new testbinder(), ) .registerclasses( jacksonjsonprovider.class, ) .packages( abstractresource.class.getpackage().getname() ), true ); } } the "testbinder" configures dependency injection need , class looks this: final class testbinder extends abstractbinder { @

css - Remove Scrollbars from Parent Window when Fancybox Loads -

i've searched topic, sure there solution out there i'm not looking right thing... i using customized version of twitter bootstrap 2.x (fluid responsive) top , bottom full-width fixed navigation bars , fancybox 2.1.4 <meta name="viewport" content="width=device-width, initial-scale=1.0"> bootstrap.min.css bootstrap-responsive.min.css modernizr-2.6.2-respond-1.1.0.min.js jquery.fancybox-media.js?v=1.0.5 jquery.fancybox.css?v=2.1.4 jquery.fancybox.js?v=2.1.4 anyways, problem occurring while using fancybox. of fancybox content using iframes (even content without iframes appears same thing figured include that). when click on link fancbox box appears on screen , parent window produces scrollbar (behind fancybox). isn't hurting looks tacky. producing html5 content go in kiosk not want scrollbars appear. you need set overflow:hidden on div scrollbar when click on link. never used jfiddle, according on riding class in fancyb

javascript - How can I combine inline elements with images in magnific popup having a displayed gallery -

i using magnific popup . i can work galleries . $(document).ready(function() { $('.popup-gallery').magnificpopup({ delegate: 'a', type: 'image', gallery: { enabled: true, navigatebyimgclick: true, } }); }); i can mix inline elements with images want: $('#open-popup').magnificpopup({ items: [ { src: 'http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/peter_%26_paul_fortress_in_spb_03.jpg/800px-peter_%26_paul_fortress_in_spb_03.jpg', title: 'peter & paul fortress in spb' }, { src: 'http://vimeo.com/123123', type: 'iframe' // overrides default type }, { src: $('<div class="white-popup">dynamically created element</div>'), // dynamically created element type: 'inline' }, { src: '<div class="w

c# - Regular Expression to Match IP Subnet -

i need c# regular expression match ip subnet, "127.65.231", not match ip address on subnet, "127.65.231.111". had found regex ip address: @"\b\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\b" and thinking delete part checks last octet, this: @"\b\d{1,3}.\d{1,3}.\d{1,3}\b" but matches both ip address , subnet. can this? @"^\d{1,3}\.\d{1,3}\.\d{1,3}$" use line anchors. add ^ @ beginning of regex, , $ @ end, verify beginning , end of input. this match 127.65.231 not 127.65.231.111

disable maven execution debug output -

option -x in maven able display execution debug output including parameters. possible configure maven pom.xml disable debug log output entire execution process or within execution of 1 particular maven plugin if "-x" option passed in maven? thanks maven 3.1 has introduced slf4j, means can have more control on logging. see http://maven.apache.org/maven-logging.html details. earlier version of maven specified log level complete execution.

c# - Range validator inside repeater -

i have repeater displays key-value pairs database table. of fields in table have min/max restriction. how can add range validator repeater , able use different ranges different fields? for example, table fields are: idle time: 20 (min 10, max 40) pickup time: 60 (min 3, max 90) when page displayed shows "idle time" (a label) , 20 in text box, nest row "pickup time" (a label) , 60 in textbox. need prevent user entering 80 or 5 in idle time, 80 or 5 valid pcikup time. <itemtemplate> <tr> <td style="vertical-align:top" class="boldsmall"> <asp:label runat="server" id="lblname" text='<%# eval("globalconfigname")%>' /> </td> <td style="vertical-align:top" class="boldsmall"> <asp:textbox runat="server" id="tbvalue" cssclass="normalsmall" text='<%# eva

Deleting a word from a specific implementaion of trie in Python -

i kinda new datastructures , implementing trie disambiguate database of names using edit distance. using following implementation of trie: http://stevehanov.ca/blog/index.php?id=114 which basically: class trienode: def __init__(self): self.word = none self.children = {} global nodecount nodecount += 1 def insert( self, word ): node = self letter in word: if letter not in node.children: node.children[letter] = trienode() node = node.children[letter] node.word = word # read dictionary file trie trie = trienode() name in names: wordcount += 1 trie.insert( name ) this job beautifully inserts names trie. now, go through list of names have 1 one, , use trie return list of names @ edit distance passed name. want delete names trie returned in list. is there fast way that? thanks! there 2 ways this, depending on whether want check whether you're removing l

ubuntu 12.04 - share CUDA library with docker container -

i using docker launch isolated apps. app use cuda library gpgpu computing. thinking of building image cuda installed on make huge. not sure either if cuda display driver installation go throuh on docker image. better way share cuda libraries on machine container, there way ? thank you, pradeep. if can mount driver volume on host, might able talk directly within container mounting docker run -v hostdir:containerdir:rw (see run docs ) if don't have device mounted outside container, suspect talking directly graphics card, through shared libraries, not work using standard docker configuration because default lxc configuration in docker excludes sys_rawio both security , portability reasons. see lxc_template.go file list of capabilities dropped default.

Connection Crash in mysql C++ -

currently, have implemented program write mysql database... using xcode c++as well. have imported libraries correctly i'm getting bad excess error message on line : con = driver->connect("tcp://127.0.0.1:3306", "root", "root"); what seems issue? heres full program... #include <stdlib.h> #include <iostream> // include directly different // headers cppconn/ , mysql_driver.h + mysql_util.h // (and mysql_connection.h). reduce build time! #include "mysql_connection.h" #include <cppconn/driver.h> #include <cppconn/exception.h> #include <cppconn/resultset.h> #include <cppconn/statement.h> using namespace std; int main(void) { cout << endl; cout << "running 'select 'hello world!' _message'..." << endl; try { sql::driver *driver; sql::connection *con; sql::statement *stmt; sql::resultset *res; // create

Getting facebook data since a specific post ~[({python})]~ -

i trying retrieve facebook posts user after post id. when it, unknown error. my code: from facebook import * token = facebook.get_app_access_token('3291xxxxxxxxxxxxx','c498e60cb1exxxxxxxxxxxxx') graph = graphapi(token) g = graph.get('travelguard/posts?limit=5&since=68827688457_10151569356908458') >>> traceback (most recent call last): file "<pyshell#40>", line 1, in <module> graph.get('travelguard/posts?limit=5&since=68827688457_10151569356908458') file "c:\documents , settings\visolank\desktop\python\programs\facepy\graph_api.py", line 42, in retry=retry file "c:\documents , settings\visolank\desktop\python\programs\facepy\graph_api.py", line 251, in _query return self._query(method, path, data, page, retry - 1) file "c:\documents , settings\visolank\desktop\python\programs\facepy\graph_api.py", line 251, in _query return self._query(method, path, data,

c++ - protocol buffers - generate NON-inline accessors -

we're using protocol buffers (2.4.1) in medium size embedded system w/ c# c++ code. use protobufs isolate our managed , native layers w/ easy maintain serialization layer (for curious, have used pinvoke, have run native code in separate process on test/simulators). our system has number of dll's, , have generated native protobuf code in it's own dll other parts of system can don't have link in generated code directly. the problem i'm having generated accessors inline , eg: inline const ::myprotoclassname::myfield& myprotoclassname::myfield() const { return myfield_ != null ? *myfield_ : *default_instance_->myfield_; } use generated api in size (the ' default_instance_ ' dereferenced , accessed if particular field not set). means can't link (lnk2001) clients using accessors because there not symbol default_instance_ i think typical use case protobufs have each component link in generated protobuf code (after all, serialization

javascript - Simple Ajax Jquery Get Method Not Completing -

this first use of ajax please excuse naivety. here script trying run: $(document).ready(function() { alert("on document ready"); $(document).click(function(e){ alert("inside click handler"); $.get("runner.php", function(data) { alert("get method has completed"); }); }); }); the alerts: "on document ready" , "inside click handler" display correctly cannot alert inside $.get method display. also, runner.php file in same directory javascript file. want information runner.php file cannot make $.get method complete. i'm sure i'm missing simple here, example taken directly jquery manual. in advance! try placing absolute url runner.php , /js/runner.php or /runner.php whichever directory it's in. also if have firebug installed, can use view problem is. if it's telling 404 not found need place absolute url mentioned.

sql - fields that don't match -

i have 3 fields per row in table 1 want compare exact same fields per row in table 2 i have been playing around not in, not having luck. can help? basically want see records both tables field 1, field 2, field 3 don't match in table 2 how written? select * table1 t1 full outer join table2 t2 on t1.col1 = t2.col1 , t1.col2 = t2.col2 , t1.col3 = t2.col3 t1.col1 <> t2.col1 or t1.col2 <> t2.col2 or t1.col3 <> t2.col3

hash - Second preimage resistance using MD4 AND MD5 -

let's have following: - string: str - md4 hash of string: md4(str) - md5 hash of string: md5(str) md4 , md5 cryptographically "broken" algorithms, meaning not difficult to: 1) find str_2 md4(str) = md4(str_2) (i.e. attack on md4) 2) find str_3 md5(str) = md5(str_3) (i.e. attack on md5) how hard to: 3) find str_4 md4(str) = md4(str_4) and md5(str) = md5(str_4) (i.e. attack on md4 , md5 simultaneously)? obvious (probably not efficient) way to: 1) find string str md4(str) = md4(str) 2) check if md5(str) = md5(str) 3) if so, we're done. if not, go step 1 , satisfy step 1 different string. above algorithm doesn't seem fast me (or it?). true string hashed both md4 , md5 quite safe second preimage attack? edit: (1) main concern enhancing second pre-image resistance (2) main motivation not use outdated hashes today's applications. rather, two-fold: first , anticipating day hashes considered secure today become broken. example, if use sha

ruby on rails - Nested models work fine in development but are not being saved in production -

this first heroku deploy , i'm having odd issue can't seem figure out. app has nested form when create product can add skus . works great in dev, when deployed heroku nested form rejecting skus blank. i've added skus individually (outside of product form) , works fine, additionally there nested dimensions fields in product form save properly. seems nested skus doesn't like. oddly enough logs seem show there nested attributes present skus when submit form. the error when form gets kicked , says: skus can't blank also, i'm not understanding why, in log files parameters getting cut off, how it's displayed in heroku logs? the other odd thing don't have validation skus , far can tell product should able saved if sku blank. any advice far troubleshooting or avenues investigate appreciated. logs 2013-07-31t21:13:20.977351+00:00 app[web.1]: name: add image :: f.object: #<product:0x007fabc02a7bf0> :: association: images :: cont