Posts

Showing posts from March, 2010

jasper reports - Adding FilterExpression in JasperReports with help of Java code -

i developing tool in java enable make automations in jasperreports (automatically printing, setting parameters etc..) use jasperreport library. have set filter expression using java code. know how prepare parameters, make in way: map<string, object> parameters = new hashmap<string, object>(); parameters.put("filter", "where name '%.'"); and then, pass parameters while generating pdf report: jasperprint pdf = jasperfillmanager.fillreport(jasperreport, parameters, connection); if there such simple way modify parameters, guess there similar way modify filter expression. i've been searching long time found nothing. the report filter expression (or other expression matter) can set/changed in jasperdesign objects (see setfilterexpression method). jasperdesign object have recompiled jasperreport . an alternative filter expression jrparameter.filter builtin parameter, takes value net.sf.jasperreports.engine.datasetfilter

objective c - iOS: When does iPhone switch from wifi to mobile network? -

i developing ios app main function communicate devices in local wifi network. means wifi connection required internet connection not. additionally app tries fetch data (like current software version, info critical update etc.) internet when app starts. now have test scenario. wifi network without connection internet. iphone logged in wifi. when app starts behaviour unpredictable. sometimes data fetching internet fails due fact wifi has no internet connection. in 20-30% data fetching internet works fine. in case can see wifi symbol disappears , lte symbol appears 2 or 3 seconds , wifi symbol appears again. obviously iphone switches wifi mobile network fetch data , wifi , not. possible control behaviour? here code fetching data internet: nsurl *url = [nsurl urlwithstring:@"https://myurl.com/data.xml"]; nsdata *data = [[nsdata alloc] initwithcontentsofurl:url]; nserror *error = nil; nsdictionary *dictionary = [xmlreader dictionaryforxmldata:data error:&error

android - Sort By in Sqlite -

this raw query contain left join , make list ascending order student_name . i want pass order student_details.student_name asc outside query. (i want make asc desc). how implement in raw query? cursor = db.rawquery( "select * student left join student_details on student.student_id=student_details.student_id student.start_date <= ? , student.expired_date >= ? order student_details.student_name asc", new string[]{date, date} ); just make query depends on needs string addictionalstate = "asc"; if (something) addictionalstate = "desc"; cursor = db.rawquery( "select * student left join student_details on student.student_id=student_details.student_id student.start_date <= ? , student.expired_date >= ? order student_details.student_name "+addictionalstate , new string[]{date, date} ); or can pass results li

Android NDK gives this error make Error 2 -

im trying build android ndk , gives me error. im using eclipse. im using android-ndk-r12. , android ndk preference in eclipse c:\android-ndk-r12 (i have tried "c:\android-ndk-r12\build" , did not work). , android android.mk below: local_path := $(call my-dir) include $(clear_vars) local_module := com_example_ndktest_store local_src_files := com_example_ndktest_store.cpp include $(build_shared_library) the error below: [armeabi-v7a] "compile++ arm ": "com_example_ndktesting_store <= com_example_ndktesting_store.cpp" process_begin: createprocess(null, c:/android-ndk-r12/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -mmd -mp -mf ./obj/local/armeabi-v7a/objs/com_example_ndktesting_store/com_example_ndktesting_store.o.d -gcc-toolchain c:/android-ndk-r12/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -wno-invalid-command-line-argume

logging - how to define log4j.properties for MongoDB -

i have been using wowza stream engine content streaming , used mysql storing logs coming wowza streaming of log4j mysql definitions. before using mysql, utilised instructions in official wowza web site. link below: https://www.wowza.com/forums/content.php?130-how-to-log-to-a-mysql-database however, because of fact mysql became slower day day, (sometimes crashing) while wowza streaming logs coming , accumulating on db (millions) ; intended move db log system mongodb. in accordance this, used below log4j mongodb statements in order work in mysql db. log4j.appender.mongodb=org.apache.log4j.jdbc.jdbcappender log4j.appender.mongodb= com.mongodb.jdbc.mongodriver log4j.appender.mongodb.hostname=localhost log4j.appender.mongodb.port= 27017 log4j.appender.mongodb.driver=org.mongodb.mongodb-driver log4j.appender.mongodb=org.log4mongo.mongodbappender log4j.appender.mongodb.databasename=primarydb log4j.appender.mongodb.collectionname=wowza_log log4j.appender.mongodb.layout=org.log4mongo.

arraylist - Python: concatenate 2 list -

i have 2 lists in python: list1 [1,1,0,0,1,1,0,0,1,1] list2 [a,b,c,d,e,f,-,-,-,-] i output follow: output [a,b,-,-,c,d,-,-,e,f] i lost, tried multiple things without luck. have idea how it? here's try: for e in range (0, len(stringas)): if controllo[e] == "1": memoria.append(stringas[e]) if controllo[e] == "0": memoria.append("-") blocco.append(e) salva.append(stringas[e]) print (stringas) print (memoria) f in salva: print (blocco[c]) print (salva[c]) memoria.insert(blocco[c], salva[c]) c = c + 1 thank in advance. try this: output = [list2.pop(b-1) b in list1]

linux - What does git -H do? -

i working command: sudo -u git -h bundle exec rake gitlab:backup:create rails_env=production , root user should able use command without sudo linux says me after used command without sudo -h unknown option. it's not git -h , it's option sudo . read as: sudo // we're running -u git // run command specified later user "git" -h bundle // set home environment variable of user "bundle" exec rake gitlab:backup:create // command execute if sudo complaining doesn't know -h means, may mean have old version of sudo doesn't support it, or flavour of sudo uses different command line option same behaviour. i'd suggest checking updates, , using man sudo check exact version you're running locally , options accepts.

MS ACCESS SQL Join Subquery -

i have 2 tables: newparts, storedparts i insert parts of newparts, not jet in storedparts storedparts: sql_string = "insert storedparts " & _ "select newparts.* " & _ "from storedparts " & _ "right join newparts on (storedparts.identifier = newparts.identifier) , (storedparts.timestamp = newparts.timestamp) " & _ "where ((storedparts.autoid) null);" this working fine far. problem: table storedparts getting big programm taking long join process. solution: compare newparts not parts of storedparts, parts aren't older 4 days... tried subquery this, can't run. sql_string = "insert storedparts " & _ "select newparts.* " & _ "from storedparts (where storedparts.timestamp > now() - 4) " & _ "right join newparts on (storedparts.identifier = newparts.identifier) , (stored

azure - Error: System.ArgumentException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand -

while going through https://github.com/azure/azure-iot-remote-monitoring @ local deployment , while debugging got error: error: at g:\azure-iot\2.customize preconfigured solution\trail_1\azure-iot-remote-monitoring\common\deployment\deploymentlib.ps1:704 char:23 + $result = invoke-restmethod -method "get" -uri $uri -headers @{"auth ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [invoke-restmethod], argumentexception + fullyqualifiederrorid : system.argumentexception,microsoft.powershell.commands.invokerestmethodcommand i using azure power shell 1.6.0 version. can tell me what's going wrong ?

erlang - change trace log format in emqtt message broker -

i using emqtt message broker mqtt. not erlang developer , has 0 knowledge on that. have used erlang based broker, because after searching many open source broker online , suggestions people advantage of erlang based server. now kind of stuck out put of emqttd_cli trace command. not json type , if use perl parser convert json type getting delayed output. i want know, in file change trace log output format. i looked on trace code of broker , found file src/emqttd_protocol.erl . exported function named trace/3 has code need. second argument of function, named packet , has information of receive & send data via broker. can fetch required data , format according how want print. edit : sample modified code added trace(recv, packet, protostate) -> packetheader = packet#mqtt_packet.header, hostinfo = esockd_net:format(protostate#proto_state.peername), %% packetinfo = {clientid, username, clientip, clientport, payload, qos, retain} packetinfo = {

r - Last observation carried forward conditional on multiple columns -

i have dataset structure: id = c(1,1,1,1,2,2,2,3,3,3,3) l40 = c(1, na, na, na, 1, na, na, na, 1, na, na) k50 = c(na, na, na, na, na, 1, na, na, na, na, 1) df = data.frame(id, l40, k50) when missing values occur in columns l40 , k50, want carry forward last non-missing value in column, conditional on id being same previous id , values in l40 , k50 in current row being empty. applied following code: library(tidyr) df2 <- df %>% group_by(id) %>% fill(l40:k50) this not achieve looking for. want previous non-missing value carried forward next row when other columns (except id) in row empty. want: id = c(1,1,1,1,2,2,2,3,3,3,3) l40 = c(1, 1, 1, 1, 1, na, na, na, 1, 1, na) k50 = c(na, na, na, na, na, 1, 1, na, na, na, 1) df3 = data.frame(id, l40, k50) we can use na.locf library(data.table) library(zoo) setdt(df)[, if(any(is.na(k50[-1]))) lapply(.sd, na.locf) else .sd , = id] # id l40 k50 #1: 1 1 na #2: 1 1 na #3: 1 1 na #4: 1 1 na #5:

git diff - Some doubts about how correctly compare the staging area content with the last commit using GIT? -

i pretty new in git , have following doubt correct use of git diff --staged should compare staging area content last commit. so obtain output: $ git diff --staged diff --git a/game.js b/game.js index 49bf5ea..0783175 100644 --- a/game.js +++ b/game.js @@ -421,6 +421,7 @@ ship = function () { } if (key_status.space) { if (this.delaybeforebullet <= 0) { + this.delaybeforebullet = 10; // added fix bug !!! (var = 0; < this.bullets.length; i++) { if (!this.bullets[i].visible) { sfx.laser(); @@ -539,6 +540,7 @@ bigalien = function () { this.delaybeforebullet -= delta; if (this.delaybeforebullet <= 0) { + //if (this.delaybeforebullet = 10) { this.delaybeforebullet = 22; (var = 0; < this.bullets.length; i++) { if (!this.bullets[i].visible) { andrea@andrea-pc mingw64 ~/documents/ws_vari/version-control/asteroids ((3884eab ...)) so means output? think means th

Debugging eclipse with eclipse -

Image
i debug eclipse view available in latest neon release. found class responsible view's behavior via plugin-inspector (alt+shift+f1 on mouseover). followed this question (and similar articles too) debug 1 eclipse instance another. i did following steps: i launch eclipse instance want debug i launch eclipse instance i open debug configurations view i create new remote java application configuration fill host 'localhost' , port '1044' i click debug , error "failed connect remote vm. connection refused. connection refused:connect" what doing wrong? additions: eclipse.ini in step 1 -vm i:/prep_ide_win_test/tools/jre/jre/bin/javaw.exe -startup plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.400.v20160518-1444 -product org.eclipse.epp.package.rcp.product --launcher.defaultaction openfile -showsplash org.eclipse.platform --launcher.defaultaction openfi

php - Fatal error: Cannot redeclare with call_user_func() -

i'm trying execute couple of tests in groups each 1 .php file contains 2 functions. problem each test given group has clean-up function same name (for example test10_cleanup, 10 group number). after execution of code: $dir = __dir__ . "/tests/"; $tests = array_slice(scandir($dir), 2); foreach ($tests $test) { include("{$dir}{$test}"); $arr = get_defined_functions(); //weird note: user defined functions in reverse order //cleanup function in array's first element call_user_func($arr["user"][1]); call_user_func($arr["user"][0]); unset($arr); } it seems unsetting , getting again defined functions not clearing previous ones. so, fixable procedural code rather using oop or should go straight ahead , exec new php process each test file?

layout - ImageView invisible when using color for background android -

i'd create imageview fill whole screen. , i'd make imageview have color (green,black,transparent etc.). faced problem wierd me because problem is, when set imageview background image using @drawable resources it's looking good, when using @color resources imageview invisble. how possible? check xml file below: <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true" android:id="@+id/scrollview"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" android:id="@+id/relativeinfo1"> <view android:layout_width="wrap_content&

Change datatype of a column in a spark RDD to date and query on it -

by default when loading data, every column being considered string type. data looks like: firstname,lastname,age,doj dileep,gog,21,2016-01-01 avishek,ganguly,21,2016-01-02 shreyas,t,20,2016-01-03 after updating schema of rdd looks like temp.printschema |-- firstname: string (nullable = true) |-- lastname: string (nullable = true) |-- age: string (nullable = true) |-- doj: date (nullable = true) registered temporary table , queried on temp.registertemptable("temptable"); val temp1 = sqlcontext.sql("select * temptable") temp1.show() +---------+--------+---+----------+ |firstname|lastname|age| doj| +---------+--------+---+----------+ | dileep| gog| 21|2016-01-01| | avishek| ganguly| 21|2016-01-02| | shreyas| t| 20|2016-01-03| +---------+--------+---+----------+ val temp2 = sqlcontext.sql("select * temptable doj > cast('2016-01-02' date)") but when trying see result giving me: temp2: org.apache.spark.sql.dat

javascript - Chart Js - Wasting Graph Space -

Image
does know why chart js wastes graph space? why not take full width of graph? the graph sitting in bootstrap container > row if makes difference? this code: <canvas id="mostpopularproductionapps" width="100" height="150"></canvas> javascript: barchartcreator(prodchart, prodlabels, proddata, '# heorku addons', 'number of addons per applications'); barchartcreator: function(domlocation, labels, data, label, title) { var createdchart = new chart(domlocation, { type: 'bar', data: { labels: labels, datasets: [{ label: label, data: data, backgroundcolor: 'rgba(54, 162, 235, 0.2)', bordercolor: 'rgba(255, 255, 255, 1)', borderwidth: 1 }] }, options: { scales: { yaxes: [{

c# - How to Implement Dispose In Inheriting Class -

i using smtpclient in .net-3.5 framework (meaning not implement idisposable ), put in using statement so: using (var client = new disposablesmtpclient("mail.domain.com", 25) { credentials = new networkcredential(), enablessl = false }) { client.send(emailaddress, emailaddress, subject, body); } so created following: class disposablesmtpclient : smtpclient, idisposable { bool disposed; public disposablesmtpclient(string mailserver, int port) : base(mailserver, port) { // var client = new smtpclient(mailserver, port); } public void dispose() { this.dispose(); gc.suppressfinalize(this); } } which works fine sending message, when debugging, throws stackoverflow exception (as this.dispsoe(); call forever). i tried calling this.dispose(true) per many other questions, complains no overload method 'dispose' takes 1 arguments . base.dispoe() work, bec

How to put random number in int array C -

i pass random number generate int array. not right. thanks in advance, #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int i, n; time_t t; n = 5; int haystack [n]; /* intializes random number generator */ srand((unsigned) time(&t)); /* print 5 random numbers 0 50 */ for( = 0 ; < n ; i++ ) { printf("%d\n", rand() % 50); haystack[i] = rand(); printf("%d\n", haystack[i]); } return(0); } this prints random numbers < 50: printf("%d\n", rand() % 50); this generate new random numbers no such limitation: haystack[i] = rand(); there no reason them equal. i guess want like: haystack[i] = rand() % 50; printf("%d", haystack[i])

java - Start ec2 instance with public ip -

i need start new instance in ec2 java code. can by: runinstancesrequest runinstancesrequest = new runinstancesrequest(); runinstancesrequest .withimageid(myimageid) .withinstancetype(myinstancetype) .withmincount(instances_count) .withmaxcount(instances_count) .withkeyname(mykeyname) .withsubnetid(mysubnetid) .withsecuritygroupids(mysecuritygroupid) .withplacement(myplace) ; runinstancesresult runinstancesresult = amazonec2client.runinstances(runinstancesrequest); and creates new instance. instance has empty fields "public dns" , "public ip". i not need elastic ip. ok if new instances have new addresses. so, how change request it? thanks! have found solution: runinstancesrequest runinstancesrequest = new runinstancesrequest(); instancenetworkinterfacespecification interfacespecification = new instancenetworkinterfacespecification() .withsubnetid(mysubnetid) .withassociatepublicipaddress(true)

c# - TypeConverter IsValid not fireing -

i want implement input validation on propertygrid . i've figured out need typeconverter , throw exception in convertfrom method. works fine except shows standard "message box". wish show own. according msdn exception catched in isvalid method. i've tried override thing there doesn't fire. my code: public class parameternameconverter : typeconverter { public override object convertfrom(itypedescriptorcontext context, cultureinfo culture, object value) { debug.print("convertfrom"); if (convert.tostring(value).contains(" ")) { throw new notsupportedexception("invalid input"); } return value; } public override bool isvalid(itypedescriptorcontext context, object value) { messagebox.show("invalid input"); return false; } } this code isvalid() microsoft reference source . can see isvalid() calls convertfrom() , try ca

c++ - Lastchild in xml file using QDomDocument Class -

i have xml: <vcaanalysis> <vcastream> <vcaframe width="768" height="432" rtptime="" utctime="102157000" utctimehigh="0" configid="0" /> <vcaframe width="768" height="432" rtptime="" utctime="102157160" utctimehigh="0" configid="0"> <object objectid="138.96.200.59_20160126_102157160_1" minx="276" miny="0" maxx="320" maxy="123" width="44" height="123" objproptag="person"> </object> </vcaframe> <vcaframe width="768" height="432" rtptime="" utctime="102157320" utctimehigh="0" configid="0" /> <vcaframe width="768" height="432" rtptime="" utctime="102157480" utctimehigh=&

javascript - Is having constructor necessary in Typescript code? -

i generated new aurelia project using aurelia-cli au new command. this app.ts given me: export class app { message = 'hello world!'; } i updated app.ts app.ts tutorial this: export class app { constructor() { this.message = 'hello world!'; this.firstname = "animesh"; this.lastname = "bulusu"; } fullname() { return `${this.firstname} ${this.lastname}`; } } i can see expected output when refresh page, these errors in errors console. property 'message' not exist on type 'app'. property 'lastname' not exist on type 'app'. property 'lastname' not exist on type 'app'. if remove constructor , place variables directly inside class, these errors go away. why , how rid of these errors? you need declare members: class app { private message: string; private firstname: string; private lastname: string; constructor() { th

Error:(8) Error parsing XML: junk after document element -

Image
am new in android development app, trying build apk file error"error:(8) error parsing xml: junk after document element"what problem, please need help, can me codes: `<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"/> <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent"/> <com.example.streamradio.radioone.untouchablescrollview android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="none"/> <com.example.streamradio.radioone.untouchablehorizontalscrollview android:id="@+id/horizontalscrollview" android:layout_wi

Sharepoint Approval Work Catch approve button -

i have created sharepoint approval 2010 workflow in visual studio. how can catch if user clicked approve or reject button? private void createtaskwithcontenttype1_methodinvoking(object sender, eventargs e) { createtaskwithcontenttype1_contenttypeid1 = "0x01080100c9c9515de4e24001905074f980f93160003a15057e2af34b67b32e14b94eb70409"; createtaskwithcontenttype1_taskid1 = guid.newguid(); createtaskwithcontenttype1_taskproperties1.assignedto = workflowproperties.web.siteadministrators[0].loginname; createtaskwithcontenttype1_taskproperties1.duedate = datetime.now.adddays(1.0f); createtaskwithcontenttype1_taskproperties1.title = "approval required xx"; createtaskwithcontenttype1_taskproperties1.description = "specify approval result here."; splist tasklist = workflowproperties.tasklist; } private void ontaskchanged1_invoked(object sender, externaldataeventargs e) { //i think here

Sylius: Creating Product Combo, Promotional Package -

i new sylius, have gone through documentation , nice, clean , elegant design (from developers perspective). one of requirements of project able sell products in combo/packages. say have these products sold separately. product 1: 19.99$ product 2: 30.00$ product 3: 10.00$ i want able create product combo, limited time offer sells products in package, total price of 30$. if sold package, system must keep them if sold separately part of promotional package. i wasn't able find on sylius me out of box. any thoughts on possible solution using sylius as possible without requiring create custom solution? thank you, ermal. why don't try use promotions component that? create campaign use rules: if product 1 in cart then add product 2 , product 3 @ discounted price

php - I am trying to pass variables between pages and i am failing -

i have been trying pass variable between pages tally score on quiz, reason variables aren't passing between pages want them to, want score 1 if first button hit, , 2 if second hit, of ever 1 hit result 0. 1st page - minus whole load of styling: <?php $score=0; if ( isset( $_post['submit1'] ) ) { $score=$score+1; } if ( isset( $_post['submit2'] ) ) { $score=$score+2; } ?> <body> <center><img src="http://fc06.deviantart.net/fs70/f/2011/002/d/3/purple_blob_pet_by_bunni0222-d36aw4q.png" alt="" align="middle"/></center> <form name ="form1" method ="post" action ="test1.php"> <input type = "hidden" name = "h1" value = <?php echo $score; ?> > <center><input type = "submit" class=mybutton name = "submit1" value = "1"></center> <center><input type = "submit"

react native - Getting issue in android if keyboard appear -

Image
hai designed registration page, wrote code this inputfocused (refname) { let android = platform.os == 'android' if(platform.os == android){ let scrollresponder = this.refs.scrollview.getscrollresponder(); scrollresponder.scrollto({y: windowsize.height/4}) } else{ let scrollresponder = this.refs.scrollview.getscrollresponder(); scrollresponder.scrollto({y: windowsize.height/3}) } } render{ return( <textinput ref='sixthinput' style={styles.textinput1} securetextentry={true} placeholder="confirm password" returnkeytype='done' value={this.state.confirmpassword} onsubmitediting={(event)=>{ this.onregister(); }}

python - Pandas: create dataframe using value_counts -

Image
i have data age 32 16 39 39 23 36 29 26 43 34 35 50 29 29 31 42 53 i need smth can df.age.value_counts() , 100. * df.age.value_counts() / len(df.age) but how can union , give name columns? you can use cut agg : #helper df min , max ages, necessary add category total df1 = pd.dataframe({'g':['14 yo , younger','15-19','20-24','25-29','30-34', '35-39','40-44','45-49','50-54','55-59','60-64','65+','total'], 'min':[0, 15,20,25,30,35,40,45,50,55,60,65,np.nan], 'max':[14,19,24,29,34,39,44,49,54,59,64,120, np.nan]}) print (df1) g max min 0 14 yo , younger 14.0 0.0 1 15-19 19.0 15.0 2 20-24 24.0 20.0 3 25-29 29.0 25.0 4 30-34 34.0 30.0 5 35-39 39.0 35.0 6

Java ArrayList Copy Changing Original Value -

i have copied arraylist want keep original values of source arraylist . if change first item of source arraylist , automatically chnages first item value of new arraylist . i used few code blocks couldn't solve problem. arraylist<sicilbakiye> resultcopy = new arraylist<sicilbakiye>(); resultcopy.addall(result); // 1.method resultcopy=result.clone(); // 2.method resultcopy=result; // 3.method if change : result.get(0).setid(5); this automatically changes : resultcopy.get(0).getid() // return 5 how can solve ? ideas let's have @ 3 methods provided , address problem: arraylist resultcopy = new arraylist(); resultcopy.addall(result); // 1.method this creates empty array list , adds elements result copy. change result (e.g. adding new element or removing one) not reflected in copy. resultcopy=result.clone(); // 2.method that same above, @ least of standard implementation used - copy created inside of clone() , re

How to get a position of custom object on image using vision recognition api -

i know there lot of vision recognition apis such clarifai, watson, google cloud vision, microsoft cognitive services provide recognition of image content. response of these services simple json contains different tags, example { man: 0.9969295263290405, portrait: 0.9949591159820557, face: 0.9261120557785034 } the problem need know not on image position of object. of apis have such feature face detection. so know if there such api or need train own haar cascades on opencv every object. i greatful sharing info. you take @ wolfram cloud/mathematica. it has ability detect object locations in picture. some examples. detecting road signs . finding waldo . object tracking in video .

doctrine2 - SQL to QueryBuilder -

first, sorry bad english! i try convert sql (it's operational): select distinct u.id user u inner join detail de on u.id = de.id_user inner join matiere ma on u.id = ma.id_user de.ville = $var1 , ma.matiere = $var2 in query builder. have try this: $query = $repository->createquerybuilder('u.id') ->from('user', 'u') ->innerjoin('detail', 'de', 'with', ' u.id = de.id_user' ) ->innerjoin('matiere', 'ma', 'with', 'u.id = ma.id_user') ->where('de.ville = :ville') ->setparameter('ville', $ville) ->andwhere('ma.matiere = :matiere') ->setparameter('matiere', $matiere) ->distinct(); but have error: "[syntax error] line 0, col 49: error: expected end of string, got '.' " and when try this: $query = $repository->createquerybuilder() ->select('u.id') -

c# - Show IDataErrorInfo errors in tooltip on keyboard focus and mouse over -

i have textbox shows idataerrorinfo validation information via tooltip using style: <style x:key="entitypropertytextboxerrorstyle" targettype="{x:type textbox}" basedon="{staticresource {x:type textbox}}"> <setter property="validation.errortemplate"> <setter.value> <controltemplate> <!-- gets rid of adornment including default red border --> <adornedelementplaceholder /> </controltemplate> </setter.value> </setter> <style.triggers> <trigger property="validation.haserror" value="true"> <setter property="tooltip" value="{binding relativesource={relativesource self}, path=(validation.errors)[0].errorcontent}"/> <setter property="background" value="mistyrose&

angularjs - c# security issue with user Id being stored in browser -

i have wcf api serves data site's users (angular build). every time user connects site, returning client token (jwt encrypted user id) being stored client in local storage, , being sent client server in order server know user is. issue is feels security breach. other user can copy token , implement on browser let him impersonate user. doing wrong? should different please? what talking called session hijacking . there multiple solutions prevent don't think solution works 100% see link more info: what best way prevent session hijacking?

asp.net - Getting specific days in a month -

possible duplicate: how find 3rd friday in month c#? there's condition specific event occur on first , third wednesday of every month. trying achieve below, datetime nextmeeting = datetime.today.adddays(14); int daysuntilwed = ((int)dayofweek.wednesday - (int)nextmeeting.dayofweek + 7) % 7; datetime nextwednesday = nextmeeting.adddays(daysuntilwed); but not getting desired result. sure, missing out on logic or there method in asp.net through can that? more detail: trying display next wednesday (whichever first) clicking on button set label. try this: var firstday = new datetime(datetime.now.year, datetime.now.month, 1); //first wednesday while (firstdat.dayofweek != dayofweek.wednesday) firstday = firstdate.adddays(1); //3rd wednesday var thirdwed = firstday.adddays(14);

python - Exception when training data in Predictionio -

i trying deploy recommendation engine mentioned in quick start guide . completed steps build engine. want train recommendation engine. did mentioned in quick start guide. (execute pio train ). got lengthy error log , couldn't paste here. putting first few rows of error. [info] [console$] using existing engine manifest json @ /home/predictionio/predictionio-0.9.6/bin/myrecommendation/manifest.json [info] [runner$] submission command: /home/predictionio/predictionio-0.9.6/vendors/spark-1.5.1-bin-hadoop2.6/bin/spark-submit --class io.prediction.workflow.createworkflow --jar/predictionio/predictionio-0.9.6/bin/myrecommendation/target/scala-2.10/template-scala-parallel-recommendation_2.10-0.1-snapshot.jar,file:/home/predictionio/predictionio-0.9.6/bndation/target/scala-2.10/template-scala-parallel-recommendation-assembly-0.1-snapshot-deps.jar --files file:/home/predictionio/predictionio-0.9.6/conf/log4j.properties --driver/home/predictionio/predictionio-0.9.6/conf:/home/prediction

windows - Can't access my web application on amazon ec2 -

i've deployed web application amazon aws can't access via browsers. deployed through webdeploy in vs. worked. exported sql database rds instance through sql manager. worked also. i've read many answers , don't know i'm missing. i've created 1 simple liner "hello world" bogus index.html in order check if problem in application itself. the firewall port 80 open {i read somewhere 8787}, security group applied , has port 80 open also. the files on c:\inetbub\wwwroot thanks insight

Copying Data into Cassandra table -

can import/copy multiple files acassandra table having same column name in table , in files? copy table1(timestamp ,temp ,total_load ,designl) 'file1', 'file2' header = 'true'; i tried using above syntax: saying improper copy command. i mean to suppose have 100's of delimiter files same columns, , want load files single cassandra table using single cql query? is possible:? when tried using each copy command each file table on writing data? please me! you can specify more tables following synax: copy table1("timestamp", temp, total_load, designl) 'file1, file2' header = 'true'; or can use wildcards: copy table1("timestamp", temp, total_load, designl) 'folder/*.csv' header = 'true'; two remarks however: timestamp type name in cassandra, if column has name, need quote did in example above. if data overwritten when executing several copy commands, overwritten if execute sin

php - Foreach in controller in laravel 5.2 -

i want $selected_student in foreach in selecct query should select column respected student_id , display datatable (it not doing same , giving errors). i using yajra datatable. controller public function anydata(request $request) { $selected_batch_value = session::get('batch_selection'); $select_student = db::table('student_batch') ->select('student_id') ->where('batch_id', '=', $selected_batch_value) ->get(); if($selected_batch_value != 0) { foreach($select_student $select_student) { $student[] = student::select('student_id', 'first_name','middle_name','last_name', \db::raw('concat(first_name, " ",middle_name, " " ,last_name) full_name'), 'mobile_num', 'email','address_line1','address_line2','state','city','pincode',\db::raw('concat(address_line1,

javascript - Populate Bootstrap form from Dropdown -

i trying populate bootstrap form content database. user flow is, user selects record dropdown has been filled information database. whenever select option dropdown fills form relevant data. here sample code: <?php mysql_connect('server', 'name', 'password'); mysql_select_db('database'); $sql = "select * table"; $result = mysql_query($sql); echo "<select name='select' class='form-control'"; while ($row = mysql_fetch_array($result)) { echo "<option value='" . $row['details_id'] . "'>" . $row['name'] . "</option>"; } echo "</select>"; ?> </div> <script> </script> </div> <legend>edit details , submit request</legend> <!-- text input--> <div class="for

elasticsearch - How to use DeleteByQuery plugin with embedded ES 2.3.3 -

i have run es 2.3.3 in embedded fashion i'm unable invoke deletebyquery action due described exception. added deletebyquery plugin classpath , set plugin.types settings not still not working. my maven dependencies: <dependency> <groupid>org.elasticsearch</groupid> <artifactid>elasticsearch</artifactid> <version>2.3.3</version> </dependency> <dependency> <groupid>org.elasticsearch.plugin</groupid> <artifactid>delete-by-query</artifactid> <version>2.3.3</version> </dependency> my es setup: settings elasticsearchsettings = settings.settingsbuilder() .put("threadpool.index.queue_size", -1) .put("path.home", options.getdirectory()) .put("plugin.types", deletebyqueryplugin.class.getname()) .build(); nodebuilder builder = nodebuilder.nodebuilder(); node = builder.local(true).settings(elasticsearchsettings).node(); invocation o

My updater is failing to close my main program (C#) -

i have updater, called via main program once update detected (from remote xml file), first checks whether process open if (clsprocess.processname.tolower().contains("conkinator-bot.exe")) { clsprocess.closemainwindow(); return true; } (this gets run every process until finds (foreach loop)) the updater downloads file: client.downloadfile(url, "conkinator-bot-new.exe"); and attempts delete current 1 , rename it: file.delete("conkinator-bot.exe"); file.move("conkinator-bot-new.exe", "conkinator-bot.exe"); but error when occurs following: unhandled exception: system.unauthorizedaccessexception: access path 'd:\conkinator's skype tool\conkinator-bot.exe' denied. however new version of program download. just because main window closed doesn't mean process over. need wait process exit after close main window: clsprocess.waitforexit(); ideally, you'd use timeout - there