Posts

Showing posts from March, 2012

javascript - How to scale the Nivo Slider down to mobile size? -

javascript - How to scale the Nivo Slider down to mobile size? - the responsive html5 site scales using media queries, slider not scale or respond @ on handheld device(s). dev7studios back upwards forums dreadfully bad, forgive me asking here. know how scale nivo slider responsively? in nov 2011, nivo slider back upwards representative said: unfortunately @ moment slider not responsive feature working on next version... i'm afraid have no release date, working on it. source [edit] dev7studios says latest version of nivo slider "completely responsive." javascript jquery html5

Python: using pyodbc and replacing row field values -

Python: using pyodbc and replacing row field values - i'm trying figure out if it's possible replace record values in microsoft access (either .accdb or .mdb) database using pyodbc. i've poured on documentation , noted says "row values can replaced" have not been able create work. more specifically, i'm attempting replace row value python variable. i've tried: setting connection autocommit "true" made sure it's not info type issue here snippet of code i'm executing sql query, using fetchone() grab 1 record (i know script query returning 1 record), grabbing existing value field (the field position integer stored in z variable), , getting new value want write field accessing existing python dictionary created in script. psql = "select * %s %s = '%s'" % (reviewtbl, newid, basinid) cursor.execute(psql) record = cursor.fetchone() if record: oldval = record[z] val = codecrosswalk[oldval] record...

java - JUnit for a directory zipper -

java - JUnit for a directory zipper - i have piece of code in java zips contents of directory zip file. the signature of method follows: /** * zips contents of directory zip file. * @param directory directory zip * @param zipfilename file name zip */ public static void dozip(string directory, string zipfilename) { //do zipping } now have write junit test case above method. should test, , how? note : not looking answers on how write junit test case. thanks in advance. create temporary directory , write files directory. phone call method temp directory argument , given zip file name. test zip file exists. test can open zipfile , find expected zip entries in zip file. the method doesn't specify contract well. example, doesn't if directory doesn't exist, or if it's impossible write zip file, it's hard test these aspects. normally, it's developer of method writes unit test it, because knows corner-cases are. java junit

java - Binding the nested json to @RequestBody object using Jackson converter -

java - Binding the nested json to @RequestBody object using Jackson converter - i have 2 classes public class parent { private string name; private int age; private arraylist<child> children = new arraylist<child>(); //setters , getter follow.. } public class kid { private string name; private int age; } spring config includes: <bean id="jsonmessageconverter" class="org.springframework.http.converter.json.mappingjacksonhttpmessageconverter" /> <bean class="org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter"> <property name="messageconverters"> <list> <ref bean="jsonmessageconverter" /> </list> </property> </bean> controller looks following: @requestmapping(value = "/parents", method = requestmethod.post, headers=...

sql - How to properly define the [float] data type in mysql -

sql - How to properly define the [float] data type in mysql - i defined (through phpmyadmin) field float info type. when seek insert number 78.556677099932222377 translate 79. how create save right number, @ to the lowest degree 7 places after decimal dot? how define float in phpmyadmin float(23,19) when u declare field utilize above. better go cygnusx1 , alter decimal see mysql numeric types and problems float mysql sql floating-point

Android AccountManager authToken and OAuth -

Android AccountManager authToken and OAuth - my task write imap e-mail client gmail. far know client should authenticate through oauth (there's java library imap auth google). i'd set user free password typing. android provides cool 'native' way gain authtoken google business relationship services via accountmanager. wonder how utilize authtoken , for? gae authentication? is there way oauthtoken , oauthtokensecret without browser (via accountmanager)? have tried using " oauth2:https://mail.google.com/ " "auth token type" ( authtokentype parameter) when calling accountmanager.getauttoken() ? according said @ 46:50 in talk mentioned, should work. by way, this page describes how oauth2 token google tasks, , has a link code sample. makes sounds matter of providing right authtokentype parameter. android oauth accountmanager

c++ inheritance pointer -

c++ inheritance pointer - it's pretty diffecult me describe problem. have 2 classes, base_a , derived_a . can see names, class derived_a derived base_a . in programme have other 2 classes base_b , derived_b (also inheritance). class base_a contains object of base_b , , class derived_a contains object of derived_b . class base_a { public: base_a() {} virtual ~base_a() {} base_b b_; base_b* pointer_; void init() { b_ = base_b(); pointer_ = &b_; pointer_->setvalue(1); } void print() { pointer_->getvalue(); } }; class derived_a: public base_a { public: derived_a() {} virtual ~derived_a() {} derived_b b_; derived_b* pointer_; void init() { b_ = derived_b(); pointer_ = &b_; pointer_->setvalue(2); pointer_->increasevalue(); } }; class base_b { public: base_b() {} virtual ~base_b() {} int value_; void setvalue(...

linux - Unix command to create file:/// URI based on the file's directory (pwd) -

linux - Unix command to create file:/// URI based on the file's directory (pwd) - i write filepath uri in unix command-line emulator. desired output: file:///c|/directory/filename.ext using sed , pwd can close not quite there because $ pwd /c/directory/ ...gives me lower-case drive , no pipe. is there improve way? you can sed ; has y command case-conversion, though convoluted because have go through hold space pattern space. easier utilize perl - has 1 or more modules (such uri , uri::file), though simple version produced regular expressions. #!/usr/bin/env perl utilize strict; utilize warnings; foreach $name (@argv) { if ($name =~ m%^/([a-za-z])(/.+)%) { printf "file:///%c|%s\n", uc($1), $2; } else { print stderr "$0: unexpected name format - no /x/ drive letter prefix ($name)\n"; } } (untested code.) linux git unix command-line cygwin

javascript - How to dynamically add a navbar to a jQuery Mobile application -

javascript - How to dynamically add a navbar to a jQuery Mobile application - how can dynamically add together navbar jquery mobile application? javascript want able add together navbar elements dom , have them parsed. i found add together element dom wanted, , phone call .navbar() on element , perform navbar parsing. for instance use var mynavbar = $('div', { 'data-role':'navbar', 'html':'<ul><li><a id="some">first</a></li></ul>' }).appendto(mypage).navbar(); javascript jquery-mobile

Eclipse plugin with JOGL - ClassNotFoundException -

Eclipse plugin with JOGL - ClassNotFoundException - i'm trying create eclipse plugin uses jogl display editor contents. packaged required libraries (jogl, nativewindow , gluegen) each own plugin , added 3 plugins dependency of editor plugin. if seek setup opengl display , implement gleventlistener next exception in eclipse error log upon loading class opengl calls: java.lang.noclassdeffounderror: com/jogamp/common/type/writecloneable (full stack below) tracked downwards class , located within gluegen dependency , can open class using "open type" dialog in eclipse , still eclipse doesn't seem able find it. created plugin project libraries using "plug-in existing jar archives" wizard within eclipse , double-checked exported packages , contain bundle can't found. now, know i'm doing wrong? total stacktrace: java.lang.noclassdeffounderror: com/jogamp/common/type/writecloneable @ java.lang.classloader.defineclass1(native meth...

r - Anova, for loop to apply function -

r - Anova, for loop to apply function - >str(set) 'data.frame': 1000 obs. of 6 variables: $ id : factor .. $ : factor .. $ b: factor .. $ c: factor .. $ dat : num .. $ contrasts : ord.factor .. >x [1] "a" "b" "c" (i in 1 :length(x) ){ my=x[i] f=as.formula(paste("dat~contrasts*", paste(my,"error(id/(contrasts))",sep="+"))) sum = summary( aov (f, info =set)) } x can huge, thinking apply function instead of for-loop.is possible in case?? i tried this: apply( as.matrix(x), 1, function(i){ summary(aov(as.formula(paste("dat~contrasts*", paste(i, "error(id/(contrasts))", sep="+"))), data=set)) } ) but makes no sense. can help me? this ought it: # sample info set <- data.frame(id=1:10, a=letters[1:10], b=letters[1:10], c=letters[10:1], dat=runif(10), contrasts=ordered(rep(1:2, 5))) x <- letters[1:3...

javascript - Automatically showing div on mouseover -

javascript - Automatically showing div on mouseover - this simple problem i'm having, life of me, can't seem figure out. if of help me this, much obliged. i'm using jquery create menu appear when user hovers on div. menu displayed on top left of div. got work, when seek click on menu item of div appeared, div disappears again, because mouse technically not on div, on menu. in illustration below, "#blockmenu" menu dynamically appears. fade current div ($this)) out bit, emphasize menu well. i utilize next code create happen: $("div.editable").hover(function () { $(this).fadeto(500, 0.25); $('#menu').css("position", "absolute"); $("#menu").css("top", $(this).offset().top); $("#menu").css("left", $(this).offset().left); $("#menu").css("zindex", "10000"); $('#menu').show(); }, function (e) { // on mouseout ...

java - How to draw a JButton in Android -

java - How to draw a JButton in Android - which class should utilize in android programme when gets 1 draws button or textfield, when gets 0 not draw anything. there class in java can perform functionality? want when 1 shoud draw button. android doesn't utilize jbuttons, uses it's own button widget: http://developer.android.com/reference/android/widget/button.html java android button

glm - R Zeroinfl model -

glm - R Zeroinfl model - i carrying out zero-inflated negative binomial glm on insect count info in r. problem how r read species info 1 stacked column preserve 0 inflation. if subtotal , import r single row titled abundance, loose zeros , model doesn't work. already, have tried to: stack info myself (there 80 columns * 47 rows) 3760 rows after stacking manually can imagine how slow r gets when using pscl zeroinfl() command (it takes 20mins on computer!, still worked) the next problem concerns spatial correlation. samplers sampled same medium violate independence. can set medium in factor in model? 3760 rows take 20 mminutes pscl? god, have battle 30.000 rows :) that´s why pscl calculation did not finish... however, worked glmm including nested random effects (lme/gamm) , negative binomial distribution setting theta low value distribution handles 0 inflation. think depends on grade of zeros. in case 44% , residuals looked rather good. r glm zero

c - Limit on memory allocation in windows + am I calculating this properly? -

c - Limit on memory allocation in windows + am I calculating this properly? - i'm writing programme requires lot of memory (large graph analysis). currently there 2 main info structures in programme (taking of memory). these are: a n*n matrix of type int ** and array of length n, type node * node, in case, struct containing 2 ints ( sizeof(node) = 8) the biggest value n can run code on 22900, doing bit of calculation get: 22900*22900 * sizeof(int) * 8 + 22900 * sizeof(node) = 16782591360 bits this 1.95375077 gigabytes. so question 1: calculating memory usage these 2 info structures properly? , 2: there 2gb memory allocation limit on windows. if so, how can around it? for farther information, on 64bit windows 7 machine compiling gcc, 4gb ram ~3gb of free ram @ time of running. thanks. you aren't calculating correctly. first, there no reason multiply 8. quantum of allocation in c byte, not bit. second, neglect pointer array implements fir...

visual studio 2010 - How do I adjust the left margin on parameters in ReSharper/VS2010? -

visual studio 2010 - How do I adjust the left margin on parameters in ReSharper/VS2010? - this silly, when have this somethingstupid.whatever(string a, string b, string c); and break them off this: somethingstupid.whatever(string a, string b, string c); my code cleanup moves them position, when i'd see them here: somethingstupid.whatever(string a, string b, string c); for life of me can't figure out setting exists, ideas? you need alter setting @ resharper -> options -> c# -> formatting style -> other -> align multiline constructs -> method parameters . enabling alternative line multiline method parameters each other want. visual-studio-2010 code-cleanup resharper-5.1

asp.net mvc 3 - How to make a table cell clickable with an Ajax.ActionLink -

asp.net mvc 3 - How to make a table cell clickable with an Ajax.ActionLink - i have table cell want user able click go ajax action, have like <td class="code-cell"> @ajax.actionlink(model.code, "edit", "mycontroller", new { id = model.id }, new ajaxoptions { httpmethod = "get", updatetargetid = "edit", insertionmode=insertionmode.replace }, new { @class = "code-link" }) </td> which puts link in table cell. but want user able click on cell rather having click link. using jquery can wire event handler click on td (via class) , find kid link , click it. i'm having problem understanding event propagation, etc. i have this: <script type="text/javascript"> $(function () { $(".code-cell"...

c# 4.0 - Garbage values on TChart Axis -

c# 4.0 - Garbage values on TChart Axis - i've been working tchart version 4.11 .net 4.0 fine charts rendered using new version in c#, except garbage @ begining of left , bottom axis? not getting why happening? if have used newer version , has faced same thing, please allow me know? thanks in advance, kapil omg...it simple. figured out axis labels need value format beingness set exponential format, , resulting in garbage looking figueres of values, starting values. on setting appropriate, looking cool now. c#-4.0 teechart

r - How do I combine two data-frames based on two columns? -

r - How do I combine two data-frames based on two columns? - this question has reply here: how bring together (merge) info frames (inner, outer, left, right)? 10 answers i know can utilize plyr , friends combine dataframes, , merge well, far don't know how merge 2 dataframes multiple columns based on 2 columns? see documentation on ?merge , states: by default info frames merged on columns names both have, separate specifications of columns can given by.x , by.y. this implies merge merge info frames based on more 1 column. final illustration given in documentation: x <- data.frame(k1=c(na,na,3,4,5), k2=c(1,na,na,4,5), data=1:5) y <- data.frame(k1=c(na,2,na,4,5), k2=c(na,na,3,4,5), data=1:5) merge(x, y, by=c("k1","k2")) # na's match this illustration meant demonstrate utilize of incomparables , illustrat...

objective c - NSMutableArray writing issue? -

objective c - NSMutableArray writing issue? - i read in csv file , parsing string , writing element 2d nsmutablearray. as writing elements 2d array nslog outputs expected element. but when done parsing , writing whole file 2d array, nslog shows lastly element @ each row each column @ row. --as if every element in row replaced. ??? why, give thanks in advanced... for (int = 1; < im; i++) {//was 1 pass on header //get row , break columns nsmarrdummy = [nsmutablearray arraywitharray:[[nsmarrrow objectatindex: i] componentsseparatedbystring: nsstrcolparse]]; //write each item proper column in 2d array @ given row (int j = 0; j < in; j++) {//<<-- [[nsmarrdata objectatindex:j] replaceobjectatindex:i-1 withobject: [nsmarrdummy objectatindex:j]]; nslog(@"i:%d j:%d item:%@", i, j, [[nsmarrdata objectatindex:j] objectatindex:i-1]); } } //all next same value, doing nslog writing correct. nslog(@"final: i:%...

c# - Sending variables to sqldatasource -

c# - Sending variables to sqldatasource - i have sqldatasource takes stored procedure parameter..but stored procedure doesnt executed... am passing parameter successfully? sqldatasource: <asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:cp_allquestionsanswered %>" selectcommand="getmessagestitles" selectcommandtype="storedprocedure"> <selectparameters> <asp:parameter name="name" type="string" /> </selectparameters> </asp:sqldatasource> the pageload code behind: string name = moderatorusefulfunctions.getmessageusersname(g); sqldatasource1.selectparameters.add("@name", name); the stored procedure: alter procedure dbo.getmessagestitles @name nvarchar(50) select messagetitle, messageid messages messageto=@name you need p...

cookie plugin grails - cookie is null -

cookie plugin grails - cookie is null - with grails' cookie plugin, wich correctly installed, want set cookie: response.setcookie("username", "cookiename", 1000) this method "setcookie" underlined, in ide means not found, version doesnt work either def cookieservice cookieservice.set(response, "username", "cookiename", 1000) this line says, cookie null println(cookieservice.get("username")) what miss? wondering has grails running on server , performs task on client side (wich done js). can help? lot, daniel dan: add together next code config.groovy com.studentuniverse.grails.plugins.cookie.services.cookieservice.metaclass.setcookie = { response, name, value, maxage -> def cookie = new javax.servlet.http.cookie(name, value) cookie.setmaxage(maxage) cookie.setpath("/") response.addcookie(cookie) } you getting null coz of path.. solve ur issue :)...

jquery - How do you access data in a Ruby on Rails controller that is POSTed via an AJAX request? -

jquery - How do you access data in a Ruby on Rails controller that is POSTed via an AJAX request? - i'm sending ajax request , posting json info server. how access info in controller (i'm using ruby on rails). it should trivial: data = activesupport::json::decode(params[:param_with_json_string]) jquery ruby-on-rails ruby ajax ruby-on-rails-3

c# - FileUpload in FormView -

c# - FileUpload in FormView - i have problem regarding add together image url within database.i'm using fileupload method within formview in asp.net.and have table called duyurular can record image url.btw,i'm using sql server database. question is;i'm doing process update,delete , create proclamation in formview.i can upload images within folder called "img" fileupload. however,i want record within database well.when add together within database infos,there no image url. finally,i can't add together image url within database. here code; public partial class panel_yoneticipaneli : system.web.ui.page { fileupload dosya, dosya1; //textbox t1, t2, t3; //button btn; sqlconnection con; static string str = "data source=sert;initial catalog=mmakina;integrated security=true"; string yol = ""; protected void page_load(object sender, eventargs e) { dosya = (fileupload)formview2.findcontrol("fileupload1"); dosya1 = ...

entity framework - when using code first, accessing association does not account for .Take(x) -

entity framework - when using code first, accessing association does not account for .Take(x) - 2 entities: member , comment member has icollection<comment> comments whenever utilize member.comments.take(x) ef produces query gets comments database. supposed that? because property icollection? there way tell ef factor in take(x) or should refactor code utilize context.comments.where(c=>c.memberid==member.id).take(x) , live it? the proxy classes generated ef provide lazy-loading navigation properties, not evaluate queries. 1 time accessed member.comments property, comment-entities loaded database , query applied in memory. avoid this, must comments in query straight executed on object-set (like illustration you've gave). i believe design, since have homecoming iqueryable navigation property in order ef intercept access property, suppose isn't covered aswell. you've described way handle this, although isn't pretty. alternative some...

observablecollection - Using Scala's ObservableMap -

observablecollection - Using Scala's ObservableMap - i'm trying utilize scala.collection.mutable.observablemap. i grabbed snippet below from scala-user , copied repl. the email mentions ticket 2704 has been marked fixed snippet not work. so has syntax changed or subscribe beingness called incorrectly? this on 2.9.0.final scala> import scala.collection.mutable._ import scala.collection.mutable._ scala> import scala.collection.script._ import scala.collection.script._ scala> class mymap extends hashmap[int,int] observablemap[int,int,mymap] <console>:13: error: wrong number of type arguments scala.collection.mutable.observablemap, should 2 class mymap extends hashmap[int,int] observablemap[int,int,mymap] ^ scala> class mymap extends hashmap[int,int] observablemap[int,int] defined class mymap scala> val map = new mymap map: mymap = map() scala> class mysub extends subscriber[mess...

Jquery tooltips, get data from other attribute -

Jquery tooltips, get data from other attribute - due page have other jquery plugin utilize title attribute, possible jquery tooltips info other attribute other "title"? http://flowplayer.org/tools/tooltip/index.html#configuration <span class="something" title="this title" otherattr="this tooltips"></span> if understand jtools tooltip documentation correctly, if setup tooltip selector other $("[title]") utilize element next trigger tooltip content. so can this: $(document).ready(function(){ //place span class tooltip after each element otherattr attribute placing otherattr text within $("[otherattr]").each(function(){ $(this).after('<span class="tooltip">' + $(this).attr("otherattr") + '</span>'); }); //when initate tooltip way utilize .tooltip span after each element. $("[otherattr]").tooltip(); }); ...

javascript - eval json data get different length in IE and firefox -

javascript - eval json data get different length in IE and firefox - i got json info server ajax: request.responsetext=[{name:xxx},{name:xxx},{name:xx}]. then utilize var data=eval(request.responsetext); alert(data.length); in ie,it "4",while in firefox "3". use ie debugger found element in info like: [methods] [0] [1] [2] so itis length 4. i wonder why? my guess server returned info trailing comma, example: [1, 2, 3, ] in ie, array interpreted having length 4, while in standard compliant browsers, have length 3. javascript json

android playing streaming pls files -

android playing streaming pls files - i'm building application , need help. this application can play streaming .pls files internet. problem can't figured out class play streaming pls file. i had used mediaplayer class, got error , stopped working. this piece of code in executing mediaplayer : try { mediaplayer.setdatasource(site); } grab (illegalargumentexception e1) { // todo auto-generated grab block e1.printstacktrace(); } grab (illegalstateexception e1) { // todo auto-generated grab block e1.printstacktrace(); } grab (ioexception e1) { // todo auto-generated grab block e1.printstacktrace(); } seek { mediaplayer.prepare(); } grab (illegalstateexception e) { // todo auto-generated grab block log.e (getclass().getname(), ...

javascript - How to search href and open part of url -

javascript - How to search href and open part of url - given illustration html gm script runs on, want create code captures id http://www.mycharactersid.com/id=234223 after javascript got 234223, , other id's on page. open them different link in new tabs. mean id's in html. example: window.open("http://www.mycharactersid.com/talkid=234223") . burada takılan <b>12</b> karakter bulunmaktadır.<br><br> <table border="0" cellpadding="2" cellspacing="0" width="400"> <tbody><tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=1858480">alexandra&nbsp;anthony</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class=...

jquery pop up asp.net problem! -

jquery pop up asp.net problem! - i have problem getting pop-up jquery: http://www.htmldrive.net/items/show/431/jquerynotice-animated-notification-tooltip script work in shop coded in asp.net. when product added basket, have pop allows go checkout click - go basket. below se script, can click go basket, product added, if not click, product not show in basket - should ... - have been told 'post back' problem ... have thought how solve problem.? - have asked problem - see also: link in message of jqnotice - hope somone can/will help ;0) $(document).ready(function() { $('a.buy').click(function() { jqnotice('message..!<a href="' + $(this).attr('href') + '">go shop</a>'); homecoming false; }); }); html btn: <span class="buy"><a href="/order/cart/add/productnr.." id="buy" class="buy">add basket</a></span> if there have...

Opening a file using AutoIt -

Opening a file using AutoIt - i using autoit script automate application. next command running: fileopendialog ("file upload", "c:\documents , settings\abhishek.kumar\desktop\quadrillion work", "images (*.jpg;*.bmp)", "","westf12433.jpg","" ) send("{enter}") the first command works opens file open dialog westf12433.jpg file selected. want click on open button. how can it? send("{enter}") not working. send not method requires window focused, can't guarantee. have posted, best method this: controlclick("file upload", "", "button1") edit in response comments: your problem: fileopendialog blocking execution. need think of though autoit reads line, runs it, reads next. in case: autoit reads line 1. creates fileopendialog , waits close it. 1 time been closed reads next line, , runs that. try following: create 2 au3 files, , set first line in 1...

git - What are some Alternatives to Gitk that can be used in Windows Powershell? -

git - What are some Alternatives to Gitk that can be used in Windows Powershell? - i'm using windows powershell manage git, limited in can't seem run gitk command. (at to the lowest degree default) are there other tools can utilize ps or there way can forcefulness ps interpret gitk launch script correctly? just create sure c:\program files (x86)\git\bin\gitk or c:\program files (x86)\git\cmd\gitk.cmd ( alter per installed msysgit) in path git powershell gitk

Redirect to another controller+ action without changing URL in ASP.Net MVC3 -

Redirect to another controller+ action without changing URL in ASP.Net MVC3 - note: below little demo sort simulate looking for: below urls format on app user can see mydomain.com/cat/1 --display cat id 1 |controller=cat, action=displaydetails mydomain.com/dog/2 --display dog id 2 |controller=dog, action=displaydetails mydomain.com/cow/2 --display cow id 3 |controller=cow, action=displaydetails i have maintained scheme no 2 animals(may of different kind) can have same id, means if there cat id=1, cant have other animal id. scheme can extract animal details+ type animal id apart existing url pattern, planning create short url in format below mydomain.com/1 --this show cat mydomain.com/2 --this show dog mydomain.com/3 --this show cow routes have created below, , appear same order in global.asax pattern= cat/{id}, controller= cat, action=displaydetails pattern= dog/{id}, controller= dog, action=displaydetails pattern= cow/{id}, controller= cow, action=dis...

c# - Input String was Not in a Correct Format -

c# - Input String was Not in a Correct Format - i'm new in creating application using visual studio 2010 , mysql. creating application adds info database. when click add together button, there error message says input string not in right format. come in letters textbox , used varchar datatype. now, can't figure out what's problem. can help me please? code: private void buttonaddcompany_click(object sender, eventargs e) { string myconstring = "server=localhost;" + "database=payroll;" + "uid=root;" + "password=admin;"; mysqlconnection connection = new mysqlconnection(myconstring); mysqlcommand command = connection.createcommand(); command.connection = connection; using (mysqlconnection conn = new mysqlconnection(myconstring)) { connection.open(); using (mysqlcommand com = connection.createcommand()) { command.commandtext...

scala - Raw result rows with named fields in ScalaQuery? -

scala - Raw result rows with named fields in ScalaQuery? - in scalaquery, can work "raw" result rows: for ( x <- queryna[(string,int)]("select * foo")( getresult(r => (r.<<[string], r.<<[int])) ) ) { println(x) } but exclusively positional (r positionedresult ). there way work results using column names? (e.g., row.getstring("foo").) i utilize db api supports this, querulous, i'm using scalaquery in code type-safe queries, , stick 1 library if possible. from scalaquery mailing list: can underlying resultset r.rs . scala scalaquery

javascript - Loading external content into server on localhost -

javascript - Loading external content into server on localhost - i trying create web application loads content dynamically. when this, of course of study want development locally, i.e. localhost. of "functionality" form , when posting form e-mail sent server. because want access servers e-mail functionality, linking specific page server. problem is not loaded. in script below works, if alter comments pointing iandapp.com, empty string. it's same page, copied server. $("#support").click(function () { if(support_page==null){ //$("#section2").load("http://www.iandapp.com/smic/subscription_2.php", function(data) { $("#section2").load("subscription_2.php", function(data) { support_page = data; }); } the script located inte main page (index.html) , content should loaded div id="section2". i know (support_page==null) true because have break point within stops. ...

sql - PSQL request too slow. How to fix it? -

sql - PSQL request too slow. How to fix it? - select count(a)/count(s)*100 aratio, count(b)/count(s)*100 bratio, count(c)/count(s)*100 cratio, count(a), count(b), count(c), count(s) (select count(cid) images width > height , category_id = 4 grouping cid) aq, (select count(cid) b images width < height , category_id = 4 grouping cid) bq, (select count(cid) c images width = height , category_id = 4 grouping cid) cq, (select count(cid) s images category_id = 4 grouping cid) sq; how can create request more effective? it possible using with . move queries with , modify them little: alter count(cid) count(distinct cid) , remove group by clause @ all. sql postgresql datatable count subquery

Different results using f@expr and expr // f in Mathematica -

Different results using f@expr and expr // f in Mathematica - i playing around prefix , postfix operators ( @ , // respectively) , ran next issue. given next code, evaluate in same exact way: hold[matrixplot@sort@data] // fullform (* hold[matrixplot[sort[data]]] *) hold[data // sort // matrixplot] // fullform (* hold[matrixplot[sort[data]]] *) however, given next expressions, different results: functionexpand@abs'[0] (* abs'[0] *) abs'[0] // functionexpand (* 0 *) i'm not quite sure why is. in dozens of other snippets of code i've had, f@expr , expr // f , , f[expr] evaluate same result. why 1 particular case give result? this precedence issue. @ has higher precedence //. see going on, place cursor on functionexpand in both cases, either cmd+. (on os x) or ctrl+. on else, , end selecting things precedence. another way see utilize trace : functionexpand@abs'[0] // trace (* -> {{{functionexpand[abs],abs},abs^\[prime]},...

python - Call stored procedure from SQLAlchemy -

python - Call stored procedure from SQLAlchemy - in sqlalchemy , preferred way phone call stored database procedure? (including set arguments , receive exit status , outputted variables) i've seen examples utilize execute() execute raw database string, contain vendor specific syntax, right? yes can utilize execute , can indeed contain vendor specific syntax. you should consider using outparam . from sqlalchemy docs : sqlalchemy.sql.expression.outparam(key, type_=none) create ‘out’ parameter usage in functions (stored procedures), databases back upwards them. the outparam can used regular function parameter. “output” value available resultproxy object via out_parameters attribute, returns dictionary containing values. here examples of using outparam: http://nullege.com/codes/search/sqlalchemy.sql.outparam python sqlalchemy

c# - Generic Business to ORM object mapping functions -

c# - Generic Business to ORM object mapping functions - i have 2 objects, businesscustomer , ormcustomer i want able map 1 other in business layer activities like say if load ormcustomer db, want populate businesscustomer or if working on businesscustomer , want persist db want populate ormcustomer in business layer want able go like: mapper.mapcustomer(src, target) mapcustomer method able decide direction of mapping businesscustomer->ormcustomer or ormcustomer->businesscustomer i've been tinkering around generics can't seem find appropriate neat solution of how implement in mapper class. internal void mapcustomer<t, k>(t src, k target) { if (src.gettype() == typeof(businesscustomer)) { mapbusinesscustomertoormcustomer(src, target); } else if (src.gettype() == typeof(ormcustomer)) { mapormcustomertobusinesscustomer(src, target); } } any thoughts how best implement this? here simple wrote such task. property names...

c# - Silent UI automation -

c# - Silent UI automation - is there tool .net (either free or commercial) can execute ui automation in silent manner? eg. go command panel , something, without beingness shown on logged on user's session. thanks it depends on you're looking do. things cannot done due intentional developer-made windows limitations (for anti-spam , security reasons). check out apis , command line options see if can you're looking for. you can execute command line commands .net code silently, might not need. c# testing ui-automation

ruby on rails - Hiding all exception messages -

ruby on rails - Hiding all exception messages - i'm running rails 3.0.8 webrick webserver started in production mode such command rails_env=production rails server i have next problem. i've read, rails in production mode should handle exceptions , errors. i'm still having error message "activerecord::recordnotfound" when i'm trying unexisted item in production mode. i've read rescue_from activerecord::recordnotfound, :with => :page_not_found such hack, think isn't rails-way. here's production.rb file contents: beerpub::application.configure # settings specified here take precedence on in config/application.rb # production environment meant finished, "live" apps. # code not reloaded between requests config.cache_classes = true config.whiny_nils = false # total error reports disabled , caching turned on config.consider_all_requests_local = false config.action_view.debug_rjs ...

wpf - TextBlock TextWrapping not wrapping -

wpf - TextBlock TextWrapping not wrapping - when place textblock within of horizontally aligned stackpanel not wrap. realize because available width of stackpanel positiveinfinity there workarounds? my layout much more complicated sample cannot remove stackpanel or horizontal orientation. tried reproduce simplest possible illustration exhibits behavior. <stackpanel orientation="horizontal"> <rectangle width="50" height="50" fill="blue" verticalalignment="top" /> <rectangle width="50" height="50" fill="red" verticalalignment="top" /> <textblock textwrapping="wrap" text="lorem ipsum dolor sit down amet, consectetur adipiscing elit. phasellus leo lectus, viverra ut lobortis vel, mollis eget lectus. suspendisse laoreet consequat ultrices. curabitur ultricies, tortor feugiat porttitor faucibus, lorem eros pret...

caching - CakePHP Custom CacheEngine and shell problems -

caching - CakePHP Custom CacheEngine and shell problems - i wrote own cacheengine memcached that's extension have installed on server , not memcache, can't utilize default memcache engine. now engine working fine when visiting website, however. when seek start shell sorts of cache::config errors, don't see when visiting site. php warning: cache not configured properly. please check cache::config(); in app/config/core.php in /home/ezra/sites/example.nl/cake/libs/configure.php on line 402 warning: cache not configured properly. please check cache::config(); in app/config/core.php in /home/ezra/sites/example.nl/cake/libs/configure.php on line 402 php notice: undefined index: prefix in /home/ezra/sites/example.nl/cake/libs/configure.php on line 410 notice: undefined index: prefix in /home/ezra/sites/example.nl/cake/libs/configure.php on line 410 php warning: /persistent/ not writable in /home/ezra/sites/example.nl/cake/libs/cache/file.php on line 267 warning: ...

java - JPA/Hibernate - Prevent deletion in PreRemove handler? -

java - JPA/Hibernate - Prevent deletion in PreRemove handler? - the question title says all. possible in jpa/hibernate gracefully prevent deletion of entity database? flag entity "hidden" instead of removing it. i want cascade semantics preserved, such if seek delete entity owns collection of other entity, owning entity , every entity in collection marked hidden without work beingness necessary on part, beyond implementing @preremove handler prevents deletion , marks entity hidden. is possible, or need figure out other approach? is possible in jpa/hibernate gracefully prevent deletion of entity database? yes, long avoid using entitymanager.remove(entity) possible. if utilize entitymanager.remove() , jpa provider flag object deletion using corresponding sql delete statement implying elegant solution not possible 1 time flag object deletion. in hibernate, can accomplish using @sqldelete , @where annotations. however, not play jpa, entitymana...

Add new Item and Edit Item in silverlight DataForm not correctly updating SharePoint List -

Add new Item and Edit Item in silverlight DataForm not correctly updating SharePoint List - i trying create simple silverlight application hosted on sharepoint site. reading info list "testlist" , trying utilize dataform command edit, add together , delete info list. able delete fine. when seek add together adds new entry info item viewed , unable edit current items whatsoever. here code: namespace sp2010 { public partial class mainpage : usercontrol { clientcontext context; list customerlist; listitemcollection allcustomers; public mainpage() { this.loaded += new routedeventhandler(mainpage_loaded); initializecomponent(); } void mainpage_loaded(object sender, routedeventargs e) { this.datacontext = this; context = new clientcontext(applicationcontext.current.url); customerlist = context.web.lists.getbytitle("testlist"); context.load(customerlist); camlquery c...