Posts

Showing posts from June, 2010

ember.js - How to use Ember.Select in emberjs? -

i have posted code here . i new ember.js , still in learning phase.here trying build simple crud program. i trying use select in above crud program using ember.select not able use it. {{view ember.select contentbinding="objtype.content" valuebinding="objtype.selected" prompt="please select type" }} how use ember.select in above crud program create/update record? change this: objtype: ember.object.create({ selected: null, content: ['1', 2] }) to this: objtype: ember.object.create({ selected: null, content: ['1', 2] }) you should notice changed 'o' 'o', , need update select use right property name

php - Iterate through array changing all values in an array that match a from/to associated array -

i have list of operating systems. if enters "ubuntu", correct "linux ubuntu". have various other corrections , i'm wondering if there efficient way go through array making these corrections? i thinking of having associative array name , key pairs; key being "from" field , name being "to". there better way more efficiently? sample array: $os = array('ubuntu', 'vmware', 'centos', 'linux ubuntu'); the above values example of of data. of them correct, not though, , need corrected. what using array preg_grep ( string $pattern , array $input [, int $flags = 0 ] ) [1] kind less or more sophisticated regular expression? might need simple array of corrected (like linux ubuntu) values that. edit: code example crystal clearance: $regex = '/^[a-z ]*' . $user_input . '[a-z ]*$/'; $correct_values = {"linux ubuntu", "linux debian", "windows xp", ...}; //co

debugging - Browser Console for AOL Desktop? -

Image
i participate in development of site has significant number of users view our site through aol desktop v9.7 windows - spawns browser windows inside itself. when debugging, don't have tooling able invoke (for example chrome's developer console ; firebug; msie's f12 developer tools ). when inside aol desktop, don't appear have of these, or similar. there developer mode or console can invoke, unearth? what meant in comments, use decent javascript debugger manual dom inspecting features, comes visual studio ( [edited] including free edition). tricks, work aol desktop, (what amusing piece of software is, btw :) of course, not same ie's f12 tools, lacks interactive features visual dom tree, css tracing etc. still allows step through code, watch locals , objects, evaluate expressions , access dom elements. it's invaluable tool , use lot projects host webbrowser control. after all, that's aol does, too. anyway, if you're familiar this, give post

r - What is the cause of "Error in .C("unlock solver")" Error in deSolve Package? -

i have been using desolve package in mcmc algorithm estimate parameters in ode , wrote functions used in solver in c speed algorithm. sometimes, not error error in .c("unlock solver") when running ode function. able compile , link c files using commands system("r cmd shlib [insert-file-path]") dyn.load("[dll-file-path]") but when try solve ode using dll file, error thrown. then, when running simple script 1 below, same error. think issue related using compiled code, don't know how , cannot find references on error. > require(desolve) > initval <- c(y=1) > times <- seq(0, 1, 0.001) > parms <- c(k=1) > model1 <- function(t, y, parms){ + with(as.list(c(y, parms)),{ + dy <- -k*y; + list(c(dy)) + }) + } > out <- ode(y=initval, times=times, parms=parms, func=model1) error in .c("unlock_solver") : "unlock_solver" not resolved current namespace (desolve) partial solution

css3 - Overflow Hidden Not working correctly with radius border -

i trying create nice hover effect project working on , overflow hidden doesn't seem working in safari take look. learn.michaelscimeca.com html: <div class="thumnnail"> <img class="mainbg" src="img/shoppee.jpg" alt=""> <div class="textbox"> <img src="/img/eye.png" alt=""> <span class="launch"><a href="http://www.shoppedelee.com">view project</a></span> </div> </div> css: .thumnnail .textbox .launch { margin-left: -78px; text-align: center; margin-top: 10px; font-size: 12px; font-weight: bold; color: #ffffff; padding: 15px 40px; position: absolute; top: 45px; left: 50%; background-color: #1c51c8; border-radius: 100%; text-transform: uppercase; -ms-transition: .5s ease; /* animation effect bring textbox down , down */ -webkit-transition: .5s ease; -moz-transition: .5s ease; -

svn - Installing subversion under /apps other than /var/www/ is not working. Centos Linux version -

i m installing subversion 1st time , have lot ofquestions. svn under /var/www/svn , on rot (/) has 50 gb of space. our devlopers might need lot of space 50gb. m trying create repositoies under /apps ( or install svn under /apps modifying subversion.conf file when access page saying forbidden. seems apache can access svn if under /var/www/. can me in solving issue. /apps filesystem has 1tb of space.and separate mount /. in httpd.conf file document root section probally says <directory "/var/www"> also can give apache ownership of directory if such placed in document root. (if understand may not work you) chown -r apache.apache /apps apache can access items outside root soemthing not familiar , can apache alias edit comment under op says svnadmin should able create repo , should able hit it. mkdir /app/svn svnadmin create /app/svn/testrepository chown svn:svn -r /app/svn subversion nice keeping space low since stores revisions projects instead

python - Default buffer size for a file on Linux -

the documentation states default value buffering is: if omitted, system default used . on red hat linux 6, not able figure out default buffering set system. can please guide me how determine buffering system? since linked 2.7 docs, i'm assuming you're using 2.7. (in python 3.x, gets lot simpler, because lot more of buffering exposed @ python level.) all open (on posix systems) call fopen , , then, if you've passed buffering , setvbuf . since you're not passing anything, end default buffer fopen , c standard library. (see the source details. no buffering , passes -1 pyfile_setbufsize , nothing unless bufsize >= 0 .) if read glibc setvbuf manpage , explains if never call of buffering functions: normally files block buffered. when first i/o operation occurs on file, malloc (3) called, , buffer obtained. note doesn't size buffer obtained. intentional; means implementation can smart , choose different buffer sizes different cases. (ther

How to run some code in Unity3D after every x seconds? -

i need execute code every x seconds till condition met in unity3d c#. code should run irrespective of other code long condition true , stop otherwise. condition turns false, should stop executing , run again if condition becomes true (counting no. of seconds 0 again if possible). how that? something should work. void start(){ startcoroutine("dostuff", 2.0f); } ienumerator dostuff(float waittime) { while(true){ //...do stuff here if(somestopflag==true)yield break; else yield return new waitforseconds(waittime); } }

Why doesn't count return the correct value for a set C++ object? -

i have set object containing struct data elements. however, count seems returning "1" when object isn't contained within set object. seems looking @ first element of struct. doing wrong? here example of code: i did implement "<" , "==" operators well: struct drugkey_tp { std::string alert_uuid; std::string patient_id; std::string claim_id; std::string ndc_code; }; inline bool operator<(const drugkey_tp &lhs, const drugkey_tp &rhs) { return (lhs.alert_uuid < rhs.alert_uuid && lhs.ndc_code < rhs.ndc_code && lhs.claim_id < rhs.claim_id && lhs.ndc_code < rhs.ndc_code); }; inline bool operator==(const drugkey_tp &lhs, const drugkey_tp &rhs) { return (lhs.alert_uuid == rhs.alert_uuid && lhs.patient_id == rhs.patient_id &&

node.js - $all mongodb node js -

i implementing search keywords mongodb , node js, see there operator $all in mongo selects documents field holds array , contains elements. here source code node js exports.find = function(req, res) { var b=req.params.search; var query = {}; var cadsrch = b.split(' '); var l = cadsrch.length; var = 0; (i = 0; < l; i++) { if(cadsrch[i]!=''){ query[i]=new regexp('^'+cadsrch[i], 'i'); } } db.collection('publicacion', function(err, collection) { collection.find({tags: {'$all':query}},{title:true,content:true}).limit(5).toarray(function(err, items) { res.jsonp(items); }); }); }; the above source not work, query works in mongo-> db.publication.find({tags:{$all:['chevrolet','car']}}) and strange '$in' instead '$all' works, useful work '$all' implement exact searches you have defined quer

winforms - Images Scaling Down in draw in C# -

alright guys last little bit of project i'll ask on promise. go load images, works fine notice upon loading dimensions of image have been scaled down in y 300 (all constant value of 433) , or down original width 600. i'm using following method load them foreach (string file in directory.enumeratefiles(imagepath, "*.jpg")) { image contents = image.fromfile(file); treesimage[count] = contents; count++; } and resulting image when have loaded. http://i.stack.imgur.com/q40kk.png as can see image below red rectangle quite small any appreciated. if require more information please post below , i'll make sure edit original question relevant information humanly possible. edit: using simple windows form application , not graphical framework own reasons. in advance :) i'll assume using picturebox control display image. when chooses tree map, set picturebox image property image object referenced index in array. use image object set

JPA Multiple relationships on one field in an entity -

i beginner using jpa 2.0 , databases in general , confused few concepts. have total of 3 tables. 1 usertable, contains information user. has primary key field called user_id. other 2 tables exercisestable , foodintaketable, , each have foreign key field called user_id reference user_id in usertable. want one-to-many relationship user_id table each of 2 tables can find pull out exercise information or food information user. pretty this: foodintaketable <-> usertable <-> exercisestable i need bidirectional mapping usertable foodintaketable , bidirectional mapping usertable exercisestable field user_id. the problem is, when try write code in usertable class: @onetomany(mappedby="exercisestable.userid") @onetomany(mappedby="foodintaketable.userid") public long userid; it's illegal because can't have 2 @onetomany annotations on same field. think it's supposed legal in normal relational database , i'm confused how translate jpa. i

ontology - Query RDF using SPARQL / Sesame -

i´m trying query repository using sparql , sesame 2.7 when run code following error org.openrdf.http.client.sesamehttpclient - server reports problem: org.openrdf.query.parser.sparql.ast.visitorexception: qname 'viagem:nome' uses undefined prefix the problem that, have prefix "viagem" under namespaces tab repository on openrdf-workbench, when use method getnamespaces() shows up... the way query run add prefix manually on every query, sounds wrong... is there i´m missing on how use properly? --- edited more information code not working: string querystring = "select ?name \n" + "where {?aeroporto viagem:nome ?name.\n" + "?aeroporto rdf:type viagem:aeroporto}"; tuplequery tuplequery = con.preparetuplequery(querylanguage.sparql, querystring); tuplequeryresult result = tuplequery.evaluate(); try { list<string> bindingnames = result.getbindingnames(); while (result.hasnext

javascript - highcharts add series from array -

i trying add series javascript array, not work. code shows: var values=[]; (var i=0;i<string.data.length;i++) values[i]=string.data[i].value; that sets values [11,9,9,8,7,7,5,4,4,2]. highcharts $(function () { $('#uniquescancount').highcharts({ ... series: [{ name: 'unique scans: ', data: values, }] }); }); the series not show data. can me out? thanks! there must wrong values array, caused loop or string.data , here working example using var series.data , values arrary: fiddle var values= [11,9,9,8,7,7,5,4,4,2]; $('#container').highcharts({ series: [{ data: values }] });

JavaScript + RegEx Complications- Searching Strings Not Containing SubString -

i trying use regex search through long string, , having trouble coming expression. trying search through html set of tags beginning tag containing value , ending different tag containing value. code using attempt follows: matcher = new regexp(".*(<[^>]+" + starttext + "((?!" + endtext + ").)*" + endtext + ")", 'g'); data.replace(matcher, "$1"); the strangeness around middle ( ((\\?\\!endtext).)* ) borrowed thread, found here , seems describe problem. issue facing expression matches beginning tag, not find ending tag , instead includes remainder of data. also, lookaround in middle slowed expression down lot. suggestions how can working? edit: understand parsing html in regex isn't best option (makes me feel dirty), i'm in time-crunch , other alternative can think of take long. it's hard markup parsing like, creating on fly. best can looking @ large table of data collected range of items on r

c - Dynamic -ffast-math -

is possible selectively turn -ffast-math on/off during runtime? example, creating classes fastmath , accuratemath common base class math, 1 able use both implementations during runtime? ditto flashing subnormals zero, etc. in particular, don't know whether compiling -ffast-math emit instruction would, once executed, affect numerical computations in thread (for example, setting flag flush subnormals zero). try this: gcc -ffast-math -c first.c gcc -c second.c gcc -o dyn_fast_math first.o second.o putting uniquely-named functions in first.c , second.c. should trick. there "global" impact of compiler optimization. if 1 exist, linking fail due conflict. i tried small sample without problem. here's example. first.c extern double second(); double first () { double dbl; dbl = 1.0; dbl /= 10.0; return dbl; } int main () { printf("first = %f\n", first()); printf("second = %f\n", second()); ret

jsf - Update Primefaces selectOneMenu from JavaScript -

i have jsf form, contains javascript. when specific input changes value >= 10 selectonemenu needs dynamically change option (which yes or no). my jquery: if ($("input[id*='inputbox']").val() >= 10) { $("select[id*='selectonemenu']").val("no"); } else { $("select[id*='selectonemenu']").val("yes"); } when debug, value in selectonemenu changed correctly, ui component doesn't change option. how tell selectonemenu update rendered value? primefaces selectonemenu not trivial select tag, collection of divs put make select tag, use widgetvar.selectvalue(val); select tag hidden inside visible ui parts that's why not working you.

eclipse - Samsung Galaxy S II AVD (Android Virtual Device) - "emulator: ERROR: unknown skin name 'galaxy_s2'" -

i'm trying create first ever (android) app using eclipse. i've set avd samsung galaxy sii (thanks question - samsung galaxy s ii avd (android virtual device) basic settings? ), still encountering problem, prevents me getting work. whenever try , launch simulator (using avd manager), following message comes up: starting emulator avd 'avd_for_samsung_galaxy_sii_1' emulator: error: unknown skin name 'galaxy_s2' i have feeling might various files stored/the directory eclipse set up. advice on how resolve this? thanks in advance! have downloaded skin skins folder? (..sdk directory.../platforms/android-10/skins)

installation - Emgu: Unable to load DLL. Device is not ready -

i working emgu set use on computer. have downloaded 32 bit installation sourceforge , installed it. have created console project , added following dll's references: - emgu.cv - emgu.cv.debuggervisualizers.vs2010 - emgu.cv.gpu - emgu.cv.ml - emgu.cv.ocr - emgu.cv.stitching - emgu.cv.ui - emgu.cv.videostab - emgu.util (i know don't need of these each project, put them in anyway) i added opencv_core242.dll other dll's in same folder output folder this answer suggested. i added folder containing opencv_core242.dll path variable on comp this video suggests. however, still getting following error 'emgu.cv.cvinvoke' threw exception. ---> system.dllnotfoundexception: unable load dll 'opencv_core242': device not ready. (exception hresult 0x80070015) ... any ideas on forgetting or else need do? as exception says compiler not able opencv dll. as addition device not ready seems indicate referencing opencv dll's unreachable

transport - Kendo UI does not call create if a function is specified -

using kendo.web.js versions 2013.2.716 , 2012.3.1315, trying use function in transport.create rather calling url. find function not called. instead default url called , resulting html appears cause error in bowels of kendo because expected json instead. i assume type of configuration error, can't figure out problem is. here snippet of code: var clientlistds = new kendo.data.datasource({ transport: { read: { url: window.baseurl + 'healthcheck/clientsummary', datatype: 'json', type: 'post' }, create: function(a,b,c) { alert('create'); }, createy: window.baseurl + 'healthcheck/dontcallme', createx: { url: window.baseurl + 'healthcheck/dontcallme', datatype: 'json', type: 'post' }, whatwewantcreatetodo: function () { showchoosedialog('some random string', &#

How do I average MySQL result set -

i have mysql query tells me difference between status change entries: select t1.`trackid` ticketnumber, timediff(t2.`date`, t1.`date`) difference hesk_history t1 join hesk_history t2 on t2.`trackid` = t1.`trackid` , t1.`action` = 'created' , (t2.`action` = 2) gives me following result set: ticketnumber difference 2013-08-12-36 410:21:25 2013-06-12-91 00:01:22 2013-08-12-50 00:00:26 how avg result set? http://www.w3schools.com/sql/sql_func_avg.asp in case select avg(t1. trackid ticketnumber, timediff(t2. date , t1. date )) difference hesk_history t1 join hesk_history t2 on t2. trackid = t1. trackid , t1. action = 'created' , (t2. action = 2)

search - Ruby difference between statements -

i'm using solr search list of companies. when try filter works companies = [] current_user.cached_company.cached_companies.each |company| companies << company.id end doesn't work companies = [] companies << current_user.cached_company.cached_companies.map(&:id) when call @search = company.search :id, companies end @companies = @search it works first example not second. however, works fine @search = company.search :id, current_user.cached_company.cached_companies.map(&:id) end @companies = @search i know i'm missing simple here. know doesn't have caching, cannot wrap head around what's going on. your second example putting nested array in companies . here's simplified idea of what's going on: data = [{value: 1}, {value: 2}, {value: 3}] foo = [] data.each |number| foo << number[:value] end p foo # => [1,2,3] # 1 array 3 values foo = [] foo << data.map

Point in polygon algortim using location class in android? -

i've a set of location forms closed path (similar polygon). there possible way check if latitude , longitude inside closed path? you need ray-casting algorithm. did this: ;-) point in polygon algorithm and little background knowledge: https://en.wikipedia.org/wiki/point_in_polygon

tomcat - sendRedirect not working -

i'm trying redirect different page. i've tried locally on machine using jetty , redirect works correctly. if deploy war file tomcat , try redirect page error. http status 500 - file &quot;/web-inf/jsp/.jsp&quot; not found javax.servlet.servletexception: file &quot;/web-inf/jsp/.jsp&quot; not found org.apache.jasper.servlet.jspservlet.handlemissingresource(jspservlet.java:412) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:379) org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334) javax.servlet.http.httpservlet.service(httpservlet.java:728) org.springframework.web.servlet.view.internalresourceview.rendermergedoutputmodel(internalresourceview.java:229) org.springframework.web.servlet.view.abstractview.render(abstractview.java:250) org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1047) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:817) org.springframework.web

java - Copy 2D array within object by reference -

object1.java: public class object1 { public double[][] var1; ... } object2.java: public class object2 { public double[][] var2; ... } i want copy reference (shallow copy) object2.var2 object1.var1. here's i'm trying, isn't working: object1 object1 = new object1(); object1.var1 = new double[2][]; system.arraycopy(object2.var2, 0, object1.var1, 0, object2.var2.length); anyone know i'm going wrong? i'm getting java.lang.nullpointerexception compile error. note object2.var2 populated data. update 1: note object2.var2 nx2 matrix, looks like: object2.var2[0][0]=1.232 object2.var2[0][1]=23.233 object2.var2[1][0]=3.23 object2.var2[1][1]=32.12 ... object2.var2[n][0]=3.23 object2.var2[n][1]=32.12 i see java.lang.nullpointerexception when try following: object1.var1=new double[object2.var2.length][2]; object1.var1=object2.var2; object2 object2 = new object2(); // need iniialize ur object2.var2 first objec

verilog - SPI slave doesn't work when I follow the spec, does when I don't? -

i wrote spi slave in verilog. there implementations out there, still learning verilog , digital logic in general, , decided i'd try write on own. my implementation works. had make change work, , making change (i think) puts implementation @ odds motorola spi spec. i'm wondering: right in thinking strange, or not understand how works? the spi signals come in on 4 wires called sck, ss, mosi, , miso. no surprise there. fpga running @ 12mhz , spi bus running @ 1mhz. strategy sample bus spi bus on every fpga clock posedge , keep track of both current , last value sck , ss can detect edges. pass each signal through buffer reg. logic operating 2 fpga clocks behind actual events: on clock 1, latch signal in buffer; on clock 2, copy reg use logic, , on clock 3, act upon it. i'm using spi mode 0. according spi spec, in mode 0, slave should sample mosi line on posedge of sck , transmit on negedge of sck. so wrote way: reg [511:0] data; // exchange 512-bit m

user interface - Jquery UI Convert Select's to Range Slider -

i have function , running takes id of select box, hides select , displays jquery ui slider instead. works great fires auto submit other ajax delegate script looks after on same page. i want take script , convert ui range slider drawing info 2 select boxes. i have tried add line values: [ 1, 7 ], ui slider called play, display second slider tab cannot connect differant select box. current function/ html displayed below: jquery(document).ready(function($) { $('#clarityfrom').each(function(index, el){ //hide element $(el).addclass("slideron"); //add slider each element var slider = $( '<div class="sliderholder"><div class=\'horizontalslider\'></div></div>' ).insertafter( el ).find(".horizontalslider").slider({ min: 1, max: el.options.length, range: 'true', //i tried , got 2 tabs //values: [ 1, 7], value: el.sel

vb.net - Convert linq statement to sql -

i deprecating project linq coding sql stored procedures. (my company refuses upgrade our sql 2000 database.) stuck on current code trying convert sql. can this? dim icd9codes = ( in linq2db.icd9codes iif(string.isnullorempty(variable1), 1 = 1, a.code.startswith(variable1)) select a).tolist i stuck on 'iif' statements converting 'where' clause uses if statement if value not null. to convert sp you'll need make variable1 parameter. iif part addressed in where clause, this: create procedure [procedure_name] @variable1 varchar(50) begin select * id9codes len(ltrim(rtrim(isnull(@variable1, '')))) = 0 or code @variable1 + '%' end

php - Make a controller indexcontroller in yii -

i planning make blog in yii. have table named article , corresponding model,view,contoller generated using gii. want posts displayed in home page set defaultcontroller='article' although posts displayed in homepage, when click title readmore, url still has contoller name in like www.yiisite.com/article/1 so want url instead: www.yiisite.com/1 i want hide controller name in url. what conventional method implement it? i wanted make url seo friendly used following rule: '/<year:\d{4}>/<month:\d{2}/<vanity:[\w\w]+>'=>'article/view' now in loadmodel() in articlecontroller wish change findbypk($id) fetch data using year,month , unique vanity url. url www.yiisite.com/2013/07/vanity-url-article. this approach fine right? update urlmanager on site config return array( 'name'=>'my project', 'defaultcontroller'=>'article', 'components'=>array( 'urlmanager'

java - replace wicket 6.3 jquery -

after migration wicket 6.3, encountered error in console of developertools in chrome on pages use jquery. seems jquery wicket 6.3 use built-in, contains link rvzr-a.akamaihd.net. failed load resource: server responded status of 403 (forbidden) http://rvzr-a.akamaihd.net/amz/aeyjhzmzpzci6mtaxocwic3viywzmawqiojewmjisimh…2h0ijo3njgsimxvywrlcl9jbgllbnrfdgltzxn0yw1wijoxmzc2mzy2mtu0mtaxfq%3d%3d.js you can provide wicket own version of jquery described on http://wicket.apache.org/ . in application class, override init method so: @override protected void init() { getjavascriptlibrarysettings().setjqueryreference(new urlresourcereference(url.parse("http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"))); } (you can pick other versions of jquery http://cdnjs.com/ ) that being said i'm skeptical wicket have references rvzr-a.akamaihd.net.

ios - NSManagedObjectController (like a NSFetchRequestController for single NSManagedObject) -

nsmanagedobjectcontroller doesn't seem exist, maybe called else... nsfetchrequestcontroller fetches multiple nsmanagedobjects , lists them in uitableview. there existing class show attributes of nsmanagedobject , list them in uitableview of style == uitableviewstylegrouped. maybe using localized property names in nsmanagedobjectmodel section header names, , values of properties single row of section? magical thing @ data-types of attributes of nsmanagedobject add uitextfield cell rows of data-types nsstring, nsnumber, etc, , uidatepicker cell rows of data-type nsdate, , ... is there existing class show attributes of nsmanagedobject , list them in uitableview of style == uitableviewstylegrouped no, cocoa touch doesn't provide class matches description. doesn't sound difficult write, value seems questionable. can see use exploring data model during development, user interface describe seems unlikely useful in production app, 1 wouldn't want interfa

Running Mahout kMeans in local -

i running mahout kmeans setting mahout_local="true" below command have in shell script. mahout kmeans --input ./seq_input/ --output ./output --numclusters 4 --maxiter 10 --convergencedelta .0001 --clustering --distancemeasure org.apache.mahout.common.distance.cosinedistancemeasure --overwrite --clusters ./centroid_vectors while running script, getting below error unknown program 'kmeans' chosen. below log information: mahout_local set, don't add hadoop_conf_dir classpath. mahout_local set, running locally slf4j: class path contains multiple slf4j bindings. slf4j: found binding in [jar:file:/usr/lib/mahout/mahout-examples-0.7-cdh4.3.0-job.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: found binding in [jar:file:/usr/lib/mahout/lib/slf4j-jcl-1.6.1.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: see http://www.slf4j.org/codes.html#multiple_bindings explanation. log4j:warn no appenders found logger (org.apache.mahout.driver.mahoutdriver

sql server 2008 - Is it possible to set current date in stored procedure parameter? -

i want set getdate() default parameter value. shows error. below block of code: create proc xys ( @mydate datetime = getdate() //error ) set @mydate = getdate() // can neither want nor want pass current date front end or upper layer .... .... as far know functions/dynamic values not supported level, instead allowed hardcoded values. workaround? would suggest using value (e.g. 0 = minimum datetime) , checking in stored proc: create proc xys ( @mydate datetime = 0) begin if @mydate = 0 set @mydate = getdate() // ... end

c# - Is there a better way to implement OnModelCreating method in EF? -

we have products class implements dbcontext. onmodelcreating method has code so: modelbuilder.configurations.add(new customproductmap()); modelbuilder.configurations.add(new customproductdetailmap()); modelbuilder.configurations.add(new custprodcatmappingmap()); modelbuilder.configurations.add(new custproductskumap()); ... here entities added 1 one. i sure there's better way either using reflection or using ioc container. can show me example can implement myself? you can use following query instances of types inherited entitytypeconfiguration or complextypeconfiguration: var maps = in appdomain.currentdomain.getassemblies() a.getname().name != "entityframework" // skip ef assembly t in a.gettypes() t.basetype != null && t.basetype.isgenerictype let basedef = t.basetype.getgenerictypedefinition() basedef == typeof(entitytypeconfiguration<>) ||

What is the best way to test Action mailer without worrying about the enviroment-rails 3 -

i need test action mailer in ruby on rails project live.i don't want go in mess of creating new mail server zimbra on localhost or mess configurations of other environments have.moreover cant think of looking in log files complete height of patience.is there other way check/debug action mailer in localhost.if yes how , if not why not? several alternatives: define interceptor in development, see this railscast use letter_opener gem see mail instead of sending it, link gem

What are the best practices on catching COM-exception in C#? -

could you, please, tell me how handle com exceptions in c# in right way? example, using directorysearcher , getting comexception: server not operational . how should handle exception? can write handler comexception , how identify particular exception type? should examine exception message or hresult it? you must hresult , is errorcode of exception instance , , therefore way know going on. can decypher hresult this , this article. example: try { //your code } catch(comexception ex) { int error = ex.errorcode; //conditions , error handling } basically hresult 32 bit integer 2 significant bits describe sort of message (succes, info, warning, error). other 30 bits used describe rest of message.

asp.net mvc 4 - Calling action method for different entity in controller web api -

i have mvc 4 application. migrating of logic use web api. cannot make changestate method work in following code ( 404 file not found). saw post: webapi adding method and thinking of making different controller states different entity, curious how make work situation. public class franchisecontroller : apicontroller { [datacontext] public ienumerable<franchiseinfoviewmodel> getallfranchises() { var allfranchises = new list<franchiseinfoviewmodel>(); var franchiseinfolist = _franchiseservice.getall(); foreach (var franchiseinfo in franchiseinfolist) { allfranchises.add(new franchiseinfoviewmodel(franchiseinfo, p => p.isimportant)); } return allfranchises; } [datacontext] [system.web.http.httppost] public string changestate(int franchiseid, franchiseproductionstates state) { _franchiseservice.changeproductionstate(franchiseid, state); var redirecttourl

python - Pandas read_clipboard broken in pandas 0.12? -

since updated pandas version 0.11 0.12, read_clipboard doesn't seem work anymore: import pandas pd df = pd.read_clipboard() --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-2-6dead334eb54> in <module>() ----> 1 df = pd.read_clipboard() c:\python33\lib\site-packages\pandas\io\clipboard.py in read_clipboard(**kwargs) 16 pandas.io.parsers import read_table 17 text = clipboard_get() ---> 18 return read_table(stringio(text), **kwargs) 19 20 typeerror: initial_value must str or none, not bytes what did was: open csv file in excel 2010 copy range of cells, including headers perform read_clipboard in ipython qt console described in above code block after downgrading 0.11, procedure worked fine again. i'm using pandas python 3.3 win7 32 bit. is bug in pandas? suggestions on how resolve issue?

.net - What is the point of 'FieldSpecified' in WCF? -

ive noticed if field specified being not mandatory, when generate proxy class generate associated '[fieldname]isspecified' boolean related field. on using fiddler inspect request, if associated 'isspecified' set false, means field not sent on wires. i have 2 questions related 1.what point of this? purely minimize amount of data being sent across wire? 2.if no value passed parameter on webservice, wcf use default data type it. in case of integer field, default 0. once inside method how possible tell if 0 generated nothing being sent client field, or if indeed sent on 0? on question 2, specified fields not used only sending side. on receiving side, xml deserialiser set specified fields according presence or absence of corresponding fields on wire, allows service methods find out whether transmitted. as why want apart compactness of wire representation, example i've seen service allows update several fields in record @ once. in addition setting

c - Cannot enqueue array value -

i create queue includes 2 dimensional array, size of every element of array 2. exception occurs when enqueue 2-size array in queue. the following code: #include "stdio.h" #define size 1000 typedef struct queue { int *data[2]; int front; int rear; }queue; void init(queue *q) { q->front=0; q->rear=0; } void enqueue(queue *q,int *value) { if(q->rear==size) return ; q->data[q->rear++]=value; } void main() { queue q[1]; init(q); int a[10][2]; for(int i=0;i<10;i++) { a[i][0]=i; a[i][1]=i*2+1; enqueue(q,a[i]); } } *i create queue includes 2 dimensional array* no create pointer array in onw dimensional int *data[2]; if want create quene include 2 demensional array , it int data[size][size_anoter] however, didn't need 2 dimensional . in void enqueue(queue *q,int *value) function , pass address a[i] data[i] . need big enough pointer ar

mysql - How to make a query with nested structure? -

i have following table structure: table forum forum_id | parent_id where parent_id - nesting depth table thread thread_id | forum_id where forum_id -foreign key table forum table message message_id | thread_id where thread_id-foreign key table thread how can count number of messages particular forum? (сonsidering there may nested forums) sorry english, thanks. at moment mysql doesn't seem supporting recursive sql queries. although, might consider changing data structure achieve goal easier. take look, example, @ question: what efficient/elegant way parse flat table tree?

php - Upload multiple files in Laravel 4 -

here controller code uploading multiple files , passing key , value 'postman' rest api client on google chrome. adding multiple files postman 1 file getting upload. public function post_files() { $allowedexts = array("gif", "jpeg", "jpg", "png","txt","pdf","doc","rtf","docx","xls","xlsx"); foreach($_files['file'] $key => $abc) { $temp = explode(".", $_files["file"]["name"]); $extension = end($temp); $filename= $temp[0]; $destinationpath = 'upload/'.$filename.'.'.$extension; if(in_array($extension, $allowedexts)&&($_files["file"]["size"] < 20000000)) { if($_files["file"]["error"] > 0) { echo "return code: " . $_files["file"]["error"] . "<br>

java - easiest (legal) way to programmatically get the google search result count? -

i want estimated result count google search engine queries (on whole web) using java code. i need few queries per day, @ first google web search api , though deprecated, seemed enough (see e.g. how can search google programmatically java api ). turned out, numbers returned api different returned www.google.com (see e.g. http://code.google.com/p/google-ajax-apis/issues/detail?id=32 ). these numbers pretty useless me. i tried google custom search engine , exhibits same problem. what think simplest solution task? /**** @author rajesh kharche */ //open netbeans //choose java->prject //name googlesearchapp package googlesearchapp; import java.io.*; import java.net.*; import java.util.*; import java.util.logging.level; import java.util.logging.logger; public class googlesearchapp { public static void main(string[] args) { try { // todo code application logic here final int result; scanner s1=new scanner(system.in);

php - Having problems accessing tables with mysqli -

i'm having strange problem php mysqli extension. on local lamp installation works fine. after testing site in final production environment, i'm getting strange errors. this excerpt out of site internal sql logfile: [success] select * `tbl1` order `created` desc limit 20; [error] select * `tbl1` order `created` desc limit 20; (table 'dbname.tbl1' doesn't exist) [success] select * `tbl1` order `created` desc limit 20; [success] select * `tbl1` order `created` desc limit 20; for testing purposes, executed same query 4 times in 1 function. 3 out of 4 times query succeeded. failed query returns error: table 'dbname.tbl1' doesn't exist. this problem appears different tables , in different functions. tbl1 missing, after hitting f5 tbl2 seems missing... there seems problem server settings since queries work in local dev environment sometimes in production environment. does know cause problem? edit: forgot mention: when switch

android - OnScrollListener in Grid view -

i using grid view in 12 image web service when pass page no 1 , used onscrolllistener automatic run webservice(page 2) when reached ending not working page no 3 mean 24 images not execute third time. and code ---- gridview.setonscrolllistener(new onscrolllistener() { public void onscrollstatechanged(abslistview view, int scrollstate) { } public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) { if(firstvisibleitem+visibleitemcount == totalitemcount && totalitemcount!=0) { if(flag_loading == false) { flag_loading = true; int_current_page += 1; toast.maketext(_activity, ""+int_current_page, toast.length_short).show(); if (int_c

asp.net mvc - URL Routing Categories and Sub-Categories -

i've searched long time resolution of problem didn't found one.. i think, i'm not 1 has task , hope answer. my website stores products.. many products. these products have 1 or more categories (or subcategories). retrieve product in correct category not problem. add id of @ end of product name like: http://localhost.com/products/details/books/romance/romeo-and-julia-3245 . controller products , action details. but best solution clean urls if want list products of 1 category? problem is, 1 sub-category exist more once. example: http://localhost.com/products/list/games/romance http://localhost.com/products/list/books/romance if call list action in products controller, cannot detect if sub-categaory "romance" related games or books. how can solve issue? best regards you may try write 2 routes actionresult list , use parameters: if actionlink contains parameter called games takes route "games" , if books - takes route "b

Indexing a document in Solr without field "id" -

i have index file doesn't have field named key . know there concept of unique key in solr. can 1 me in same. have followed following steps:- changing unique key other field (say name) changing required="true" required="false" field id still not able index file doesn't have id . in schema.xml can specify key unique amongst documents. ref also, may want read through this reference , describes various use cases around unique key.

c# - Filter what datagrid elements to add to stringbuilder -

my app has export button opens save file dialog , drop down box allowing user select client , path save file , upon clicking export button want take data data grid client name matches found in drop down , send these file , @ moment code follows returns headings columns , know solution ? : foreach (datarow dr in this.calcdataset.minve) { bool hasvalue = false; (int = 0; < dr.itemarray.count(); i++) { //if doesnt match selected client if (!dr[i].tostring().contains(dropboxclientlist.selectedvalue.tostring())) hasvalue = true; } //else if (!hasvalue) rowstoadd.add(dr); foreach (datarow field in rowstoadd) { str.append(field.tostring() + ","); } str.replace(",", "\n", str.length - 1, 1); } try { system.io.file.

selenium rc - Not redirecting to next page -

i have recorded script in selenium ide , working fine it. have login form, after successful login should redirect dashboard. when run through selenium rc not redirecting dashboard after clickandwait. chrome says page not available when reload page working. me. selenium rc: selenium-server-standalone-2.34.0 selenium version: selenium ide 2.2.0 os:windows 7 browser:firefox, chrome browser version: firefox 23 code: <tr> <td>setspeed</td> <td>1000</td> <td></td> </tr> <tr> <td>open</td> <td>login.aboutone.com/</td>; <td></td> </tr> <tr> <td>waitforpagetoload</td> <td>50000</td> <td></td> </tr> <tr> <td>waitforelementpresent</td> <td>id=login_form</td> <td></td> </tr> <tr> <td>type</td> <td>id=username</td> <td>uitest+aotest13763045730@abc.com</td>

multithreading - C++ return value from multithreads using reference -

here code: vector<myclass> objs; objs.resize(4); vector<thread> multi_threads; multi_threads.resize(4); for(int = 0; < 4; i++) { multi_threads[i] = std::thread(&myfunction, &objs[i]); // each thread change member variable in objs[i] multi_threads[i].join(); } i expect elements in objs can changed @ each thread. after threads finished, can access member data. however, when program finished above loop, member variables i'd not changed @ all. i guess because multi-threading mechanism in c++, don't know did wrong. , may know how achieve expectation? many thanks. ================================================================================= edit: here source code of myfunc : void myfunc(myclass &obj) { vector<thread> myf_threads; myf_threads.resize(10); for(int = 0; < 10; i++) { myf_threads[i] = std::thread(&anotherclass::increasedata, &obj); myf_threads

c# - Accessing dynamically created textboxes text -

i have stumbled across problem asp.net form. within form end user chooses number of textboxes dynamically created , works fine following code: protected void txtamountsubmit_click(object sender, eventargs e) { int amountoftasks; int.tryparse(txtamountoftasks.text, out amountoftasks); (int = 0; < amountoftasks; i++) { textbox txtadditem = new textbox(); txtadditem.id = "txtadditem" + i; txtadditem.textmode = textboxmode.multiline; questionnine.controls.add(txtadditem); txtlist.add(txtadditem.id); } } however has caused small problem me, later on in form on submit button click, send results specified person needs go (using smtp email). again part fine, until trying retrieve text these dynamically created textboxes . what have tried i have tried using this msdn access server controls id method not working. i tried add these new textboxes list, unsure on