Posts

Showing posts from July, 2011

express checkout - How do I edit an app in PayPal Developer Portal Classic API? -

express checkout - How do I edit an app in PayPal Developer Portal Classic API? - i created app in paypal developer portal set "automatically approved". now, i'd edit settings when edit them there's no button submit changes. need delete app , create new one? paypal express-checkout

reactjs - How to pass both this.state and this.props to routes using react-router -

reactjs - How to pass both this.state and this.props to routes using react-router - i can't figure out how access method parent reactjs component within post route , component. using react-router . this in <routehandler {...this.state} /> the method/function pushtopostlist() in adds post object array, held in this.state.mylist . trying <post /> component working calls this.props.pushtopostlist(newpost) update this.state.mylist in <app /> router is: var routes = ( <route handler={app} > <defaultroute handler={signup} /> <route name="feed" path="feed" handler={latestfeed} /> <route name="post" path="post" handler={post} pushtopostlist={this.pushtopostlist} /> </route> ); router.run(routes, function (handler) { react.render(<handler />, document.body ); }); more code: var app = react.createclass({ getinitialstate: function() { hom...

Whether I can have common leader board for both iOs and Android using Google Play Game Service? -

Whether I can have common leader board for both iOs and Android using Google Play Game Service? - my question how maintain mutual leader board. whether google play game services way maintain both ios , android? yes, long app id, bundle name, leaderboards keys same, mutual leaderboards should work fine. android ios google-play-games leaderboard

Spring Aop logging line number incorrect -

Spring Aop logging line number incorrect - i using spring aop logging application : have before after , afterthrowing advice configured line numbers see not of target class of class used logging how can solve below configuration spring xml : <aop:aspectj-autoproxy proxy-target-class="false" /> class used logging : package com.digilegal.services.ahc.logging; import java.lang.reflect.modifier; import org.apache.log4j.logger; import org.aspectj.lang.joinpoint; import org.aspectj.lang.annotation.after; import org.aspectj.lang.annotation.afterthrowing; import org.aspectj.lang.annotation.aspect; import org.aspectj.lang.annotation.before; import org.aspectj.lang.reflect.methodsignature; import org.springframework.core.ordered; import org.springframework.core.annotation.order; @aspect public class ahclogging { @before("execution(* com.digilegal.services..*.*(..))") public void logbefore(joinpoint joinpoint) { logger log = logger.ge...

Timing with javascript performance.now() -

Timing with javascript performance.now() - i trying time execution of function in milliseconds. utilize performance.now() in order that. able time on first run, on second, third, , on runs 0 milliseconds. here example: function somefunciton (){ var t0 = performance.now(); //function calculations var t1 = performance.now(); console.log(t1 - t0); } i launch function onclick. works when first launch page. stops working on sec click. t0 , t1 same values , when subtract them 0 time. there anyway around it? don't need utilize performance.now(). want measure time in milliseconds. thank you. update think has speed. example: <html> <script type="text/javascript"> function somefunciton (){ var t0 = performance.now(); console.log(t0); //function calculations //some loop var counter = 0; (i = 0; < 1000000; i++) { counter ++; } var t1 = performance.now(); console.log(t1); console.l...

AWS toolkit for java eclipse -

AWS toolkit for java eclipse - i acutally installed eclipse java ee kepler , , followed guide install aws toolkit java . i opened business relationship aws ,i clicked install new software entered location http://aws.amazon.com/eclipse, got error unable connect repository http://aws.amazon.com/eclipse/content.xml unable connect repository http://aws.amazon.com/eclipse/content.xml connection http://aws.amazon.com refused java eclipse amazon-web-services

android - Text colour of action bar is not getting changed -

android - Text colour of action bar is not getting changed - i trying alter text colour of action bar. able alter background colour text colour not getting changed. changing white still is coming default black. here style xml : <resources> <style name="apptheme" parent="@android:style/theme.holo.light"> <item name="android:actionbarstyle">@style/apptheme.actionbar</item> <item name="android:textallcaps">false</item> </style> <style name="apptheme.actionbar" parent="@android:style/widget.holo.light.actionbar"> <item name="android:background">#000000</item> <item name="android:textcolor">#ffffff</item> </style> </resources> kindly help me wrong try set textstyle <style name="apptheme.actionbar" parent="@android:style/widget.holo.light.actionbar"> <it...

ios - How do I present UIImagePickerController scene as initial scene? -

ios - How do I present UIImagePickerController scene as initial scene? - i created uiviewcontroller scene , set custom class storybookpageimagepickercontroller when ran program, , grant access photos, see header , black screen no photos selection. class storybookpageimagepickercontroller : uiimagepickercontroller, uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate { override init() { super.init() self.sourcetype = uiimagepickercontrollersourcetype.photolibrary self.mediatypes = uiimagepickercontroller.availablemediatypesforsourcetype(.camera)! } required init(coder adecoder: nscoder) { super.init(coder: adecoder) } override func viewdidload() { self.delegate = self println("loaded image picker") } //mark: delegates func imagepickercontroller(picker: uiimagepickercontroller, didfinishpickingmediawithinfo info: [nsobject : anyobject]) { } func imagepickercontrollerdidcancel(picker: uiimagepickercontroller) { } } so...

azkaban - PHP script stopped unexpectedly without error -

azkaban - PHP script stopped unexpectedly without error - this script executed job scheduler azkaban every day , have been working fine more week now. yesterday failed unexpectedly. no exception thrown, no fatal error , no error log entry. inserting count of records processed database destruct function worked fine shows 241 of 7060 records processed. where @ now: if district called means no uncaught exception, no fatal error. 241 records processed script working fine. no error in php error log, syslog, logs of azkaban script stopped after 50 seconds. takes 30+ minutes. not timeout. it unlikely exceed memory limit. fetching , processing 1 record @ time. is possible os or azkaban or other process stopped script, if how can find out? system info : ubuntu server 2gb of free ram. , 30 gb free memory. cpu usage normal @ time of failure. with no error in logs totally confused. php azkaban

Use MATLAB cameraParams in OpenCV program -

Use MATLAB cameraParams in OpenCV program - i have matlab programme loads 2 images , returns 2 photographic camera matrices , cameraparams object distortion coefficients, etc. utilize exact configuration undistort points , on, in opencv programme triangulates points given 2d locations in 2 different videos. function [cameramatrix1, cameramatrix2, cameraparams] = setupcameracalibration(leftimagefile, rightimagefile, squaresize) % auto-generated cameracalibrator app on 20-feb-2015 the thing is, output of undistortpoints different in matlab , opencv though both utilize same arguments. as example: >> undistortpoints([485, 502], defaultcameraparams) ans = 485 502 in java, next test mimics above (it passes). public void testundistortpoints() { mat srcmat = new mat(2, 1, cvtype.cv_32fc2); mat dstmat = new mat(2, 1, cvtype.cv_32fc2); srcmat.put(0, 0, new float[] { 485, 502 } ); matofpoint2f src = new matofpoint2f(srcmat); matofpoint2f ds...

osx - Scheduling RSpec tests on Mac without the use of Ruby gems -

osx - Scheduling RSpec tests on Mac without the use of Ruby gems - i've been trying find way set schedule suite of rspec tests take hours finish. problem on work environment can't add together whatever gems such rufus gemfile. so, there way mac's automator, or simpler way write script manually runs @ specific time? osx rspec scheduling automator

templates - how to access an object from meteor.call -

templates - how to access an object from meteor.call - just trying figure things out in meteor js. stuck trying meteor.call result object passed template. here code: html template <template name="showtotals"> <div class="container"> {{#each recordcnt}} {{/each}} </div> </template> client js //get count per item template.showtotals.recordcnt = function(){ meteor.call('getcounts', function(err, result) { if (result) { //console.log(result); <-this shows object in javascript console homecoming result; } else { console.log("blaaaa"); } }); } server js meteor.startup(function () { meteor.methods({ getcounts: function() { var pipeline = [{$group: {_id: null, count: {$sum : 1}}}]; count_results = mycollection.aggregate(pipeline); homecoming count_results; } }); }); glob...

html - How can I hide an element with css while still keeping it on the page? -

html - How can I hide an element with css while still keeping it on the page? - i trying hide element on page still want there. want button still can clicked want invisible. there 3 ways hidden elements , maintain page position. can more info between normal flow , css style(ie: opcity, visibility) attribute relation. visibility opcity transparent class="snippet-code-js lang-js prettyprint-override"> $('div').click(function (){ alert(this.innerhtml) }) class="snippet-code-css lang-css prettyprint-override"> div{ border: 1px solid #000; } .one{ visibility:hidden; } .two{ opacity: 0; } .three{ background: transparent; color: transparent; } class="snippet-code-html lang-html prettyprint-override"> <!doctype html> <html> <head> <script src="//code.jquery.com/jquery-2.1.1.min.js"></script> <meta charset="utf-8"> <title...

intellij idea - Display java application errors in terminal/console -

intellij idea - Display java application errors in terminal/console - as know when building applications errors/exceptions such nullpointerexception etc. on ide console (i'm using intellij idea). i want display errors simultaneously in mac terminal larger view don't have horizontally scroll ide console every time when big errors. i don't want run applications terminal commands (java class...) i want run ide , texts going down(errors,exceptions infos.) reflect terminal. so there log file can into? how can accomplish this? in logs tab of intellij thought run configuration, there alternative "save console output file". can utilize save output of application file , view in terminal. java intellij-idea terminal console

arraylist - when i use HashMap in java all my values get overrided. -

arraylist - when i use HashMap in java all my values get overrided. - if hashmap hashmap<string,arraylist<objects>> a; if first key "dog" , value arraylist called object1. if add together key called "cat" , value arraylist called object2. object 2 arraylist overrides key dog value object 2. how prepare this? doing: keywordsindex.put("dog", object1); keywordsindex.put("cat", object2); i getting basically: [dog=object2, cat=object2] when want this: [dog=object1, cat=object2] please share code, can guess otherwise. as per guess, dog , cat pointing same object or equal (same hashcode , equals), when you're setting cat=object2 it's overriding first key. just test utilize below order:- keywordsindex.put("cat", object2); keywordsindex.put("dog", object1); and check value or check map size after adding sec element. java arraylist put

dynamics crm 2011 - FetchXML - Today - minus 30 days -

dynamics crm 2011 - FetchXML - Today - minus 30 days - i attempting create fetchxml script retrieves records date of today minus 30 days. below sql works. help me fetchxml, please? select * [students] start_date = convert(date,dateadd(day,-30,getdate())) thanks in advance, richard fetchxml provides limited back upwards specific problem. you have calculate target date , pass filter value: <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="account"> <attribute name="name" /> <filter type="and"> <condition attribute="createdon" operator="on" value="2015-03-13" /> </filter> </entity> </fetch> if didn't try: utilize advanced find explore built-in filters supported datetime attributes via downloading generated fetchxml. dynamic...

ipad - searching in large amount of info in a single file on iphone -

ipad - searching in large amount of info in a single file on iphone - i wanna store list of people while each person has pieces of info associated him. illustration location , phone number , e-mail address. i wanna store in list around 10,000 persons. after want search list dynamically (after typing each letter , database searched new matches string written in search box) [if there scientific name search process , allow me know please :) ] my question think should utilize in implementation best performance? sqlite, xml, plist ??? and there tutorial kind of search ? thanks in advance you should using sqlite this, , using coredata abstraction layer ideas unless pro @ sqlite calls. documentation core info place start on how this. apple provides several examples similar doing. iphone ipad

git branch - GIT/STASH for Multiple Independent Server Creation -

git branch - GIT/STASH for Multiple Independent Server Creation - we implementing git/stash scripts automatic creation of application servers in aws (box + o/s + application stack) multiple independent applications, each own server. code mutual 2 or more servers. prod deployments expected 1 server @ time. i'm thinking should have either 1 repo per app server (therefore 1 mutual code) , or 1 repo maybe permanant branches each app server & 1 branch mutual code. enable easy/automatic tracking of changes each app server. i'm thinking trunk should production (needing pull request merge in), can track has changed in production each appserver we using jenkins automatically build if has used git/stash this, i'd know recommend handle scenario (including branching technique) thanks git git-branch atlassian-stash

linux - Best practices for handling/dropping root permissions in C -

linux - Best practices for handling/dropping root permissions in C - so, i'm working c programme requires root create raw socket() call. i'm trying find best way drop or limit root permissions after no longer need them. things i've discovered: ping , ping6 in linux utilize suid root and, after making number of calls alter capabilities, utilize setuid(getuid()) after grepping through nmap source code, can't find code drops or limits root permissions if it's beingness run root. is there 'best way' deal dropping root or limiting capabilities programme that's run root? see lot of code uses setuid(getuid()) , although requires binary suid root. should utilize makefile set binary suid root , that, or should utilize setuid() other parameter proper non-root uid? should doing more sophisticated libcap/capability flags? there guide or else should looking at? c linux permissions root suid

format .xml - percentage change, class green and red -

format .xml - percentage change, class green and red - i have little problem. import percentage alter companies .xml format file. how can create function: - if percentage alter not "-" add together class="green" - if "-" add together class ="red"? my code: <?php print $percentagechange; ?> result: example: -2,50% xml format percentage

Objective C Tap Gesture no working after frame resize -

Objective C Tap Gesture no working after frame resize - i making ipad application screen split in half. each side contains container , each container holds uiview. in left uiview have uiscrollview multiple elements (customs uiview) inside, grid scroll, , each element back upwards tap gesture. when tap each element work fine , behave suppose to. lets nslog(@"tapped!"). problem comes when resize either entire view holds scroll view or container so: navigationvc.view.frame = cgrectmake(0,0, 338,768); the tap stops working! if resize original frame, tap starts working again. navigationvc.view.frame = cgrectmake(0,0, originalwidth ,768); i thought problem elements re-arrange when resize scroll view, in fact not. frame beingness resized when swipe entire application either left or right. edit: behaviour diagram: http://i.imgur.com/4vkphlq.png?1 edit2: didnt figure out yet, see element bound's changing when frame resized. got it! ...

asp.net mvc - Razor will not render hidden accurate PK in HiddenFor -

asp.net mvc - Razor will not render hidden accurate PK in HiddenFor - running weird problem in asp mvc 4 site. if user opens create form , attempts add together agent our database, naturally run validation on fields first. if there error, save agent in incomplete status, , redirect user create page. the error comes when user attempts re-save agent. on first post-back, agent saved database , pk generated. on sec post-back, however, pk beingness sent server value of 0 instead of auto-generated. i've added hiddenfor on create view, renders value of 0 each , every time. i've stepped through code create sure pk beingness generated after .save called, still nowadays when return view called , ensured model.id property contains same value when view beingness rendered. regardless, if right click page , view source, hidden field renders so: <input data-val="false" data-val-number="the field id must number." data-val-required="the...

sql - Print stored procedure message directly to Java console -

sql - Print stored procedure message directly to Java console - i have stored procedure using dbms_output.put_line(' output' || outvar); i want print same output straight in java console (directly stored proc) without using below code outvar : callablestatement.registeroutparameter(1, string); system.out.println(callablestatement.getstring()); change procedure function as: function some_function homecoming varchar2 begin -- processing here.... homecoming 'output:' || ....; end; back in java land: callablestatement cs = connection.preparecall("{? = phone call some_function}"); cs.registeroutparameter(1, string); cs.executeupdate(); system.out.println(cs.getstring(1)); there no other way. got oracle, got ide console. there no relationship between two. info database, have utilize function homecoming value, argue returning values out parameters same thing, , while both value back, code much more intuitive others. says...

c# - Class does not contain a definition for object, even though I have initialised the object -

c# - Class does not contain a definition for object, even though I have initialised the object - myclass[] myobject = new myclass[n]; int counter = 0; while (counter < myclass.myobject.length) { myclass.myobject[counter] = new myclass(); } above illustration of i'm trying in current project of mine (obviously i've renamed object , class in illustration create clearer). my problem i'm getting error when trying compile -- error given compiler on while condition: cs0117; 'myclass' not contain definition 'myobject'. i'm attempting straight in main() method, , due nature of project, must initialise object array, while loop initantiates each index of array object of class. i don't understand why compiler not recognizing array, though beingness created right before while loop. can tell me dumb error i'm making? remove myclass. in next lines: while (counter < myclass.myobject.length) { myclass.myob...

oracle11g - ORA-00936: missing expression(UPDATED) -

oracle11g - ORA-00936: missing expression(UPDATED) - update tbl_train_list set seat=t.total (select anam.name,anam.seat,anam2.train_name, anam2.seat, anam2.seat - anam.seat total tbl_passenger anam, tbl_train_list anam2 anam.no=anam2.id ) t tbl_train_list.id=tbl_passenger.no; that syntax doesn't looks correct. seek changing query below update (select anam.name, anam.seat newseat, anam2.train_name, anam2.seat, anam2.seat - anam.seat total tbl_passenger anam inner bring together tbl_train_list anam2 on anam.no = anam2.id ) t set t.newseat = t.total; oracle11g

Sql-request to sort blogs by order in wordpress mu? -

Sql-request to sort blogs by order in wordpress mu? - i'm using next code generate list of wordpress blogs in wordpress mu network: $blogs = $wpdb->get_results("select * " . $wpdb->blogs . " last_updated!='0000-00-00 00:00:00' , public='1' , spam = '0' , deleted ='0' order registered " . $order . " limit " . $limit); how do order them alphabetically instead of when registered? if not familliar database layout of wordpress, i'd happy coneptual explanation! name not registered in same database, how blogname collected output: foreach ($blogs $blog) { $blog_options = "wp_" . $blog->blog_id . "_options"; $blog_name = $wpdb->get_col("select option_value " . $blog_options . " option_name='blogname'"); } without knowing wordpress database schema: if there unique blog id in both $wpdb->blogs table , $blog_options table, can ...

python - pandas plotting a group -

python - pandas plotting a group - i want plot te next info wich count of unique text element motor 1 thermiek 15 tijd te lang 9 motor 2 thermiek 12 tijd te lang 3 motor 3 thermiek 5 tijd te lang 4 dtype: int64 by_element = data.groupby('element') by_element['alarm tekst'].value_counts().plot(kind='bar') result of code how can create plot grouped like: this should work grouped bar chart similar 1 linked in comment: gb = df.groupby(['element','alarm tekst']) gb['alarm tekst'].count().unstack().plot(kind = 'bar') original suggestion aggregated bar: you should include agg() function count total values. data.groupby('element').agg('count').plot(kind = 'bar') if sec column summed term can utilize agg(numpy.sum) instead: import numpy data.groupby('element').agg(numpy.sum).p...

PHP export with empty content -

PHP export with empty content - i'm having problem here. wanted retrieve info mysql database , export it. however, exported csv file contains nothing. please help me. if(isset($_post['export'])){ $filename = 'applicants '.date('m-d-y').'.csv'; $tablename="applicants"; $sql=mysql_query("select * applicants"); $num_rows=mysql_num_rows($sql); mysql_data_seek($sql, 0); $row = mysql_fetch_assoc($sql); $fp = fopen($filename,"w"); $seperator=""; $comma=""; $tablename="applicants"; foreach($row $name => $value) { if($name==""){ $name=" "; } $seperator .= $comma . '' .str_replace('','""','"'.$name.'"'); $comma = ","; } $seperator .="\n"; fputs($fp,$seperator); mysql_data_seek($sql, 0); while($row = mysql_fetch_assoc($sql)){ $seperator=""; $comma...

vba - Continue forward if file is already open (file with curDate) -

vba - Continue forward if file is already open (file with curDate) - could please help me function go on forwards if file open? below code open file. having difficulty not straight forwards open-file. give thanks you. dim curdate string, fname string curdate = format(date, "yyyy-mm-dd") dim wba workbook fname = "http://sharepoint.xyz.com/sites/company/operations/dmc/xyzdm/shared%20documents/" & curdate & "%20master%20build%20plan%20-%20only%20for%20view.xlsx" set wba = workbooks.open(filename:=fname, updatelinks:=false, notify:=false) vba

python - Activate JS after HTTP Request -

python - Activate JS after HTTP Request - i'm using python, "requests" lib. send post request website, , response it. want phone call function regular user use, maybe js function using. example, post response gives me website imports liba, , want phone call function defined in liba. possible? python http web request httprequest

binning - converting activity start and end time into binned data for multiple groups in R dplyr tidyr -

binning - converting activity start and end time into binned data for multiple groups in R dplyr tidyr - i have info looks this: foo <- data.frame(userid = c("a","a","b","b","b"), activity = factor(c("x","y","z","z","x")), st=c(0, 20, 0, 10, 25), # start time et=c(20, 30, 10, 25, 30)) # end time and want, each user, convert activity info 5 min time bins. result this: result <- data.frame(userid = c("a", "b"), x1 = c("x", "z"), x2 = c("x", "z"), x3 = c("x", "z"), x4 = c("x", "z"), x5 = c("y", "z"), x6 = c("y", "x")) the ...

Do Java's regular arrays have built in methods? -

Do Java's regular arrays have built in methods? - i know regular java array int[] arr = new int[5]; lives in heap , hence considered object. although considered object different other java obects because cannot other java objects can. one of books read java says, "even though array object, lives in own special world , can't invoke methods on it, although can access 1 , instance variable, length" this book based on java 5.0. i using netbeans ide, , strangely plenty noticed methods can invoked on array object "arr". arr.equals() arr.clone() arr.getclass() --> gives class [i, , don't know means was book wrong, or these methods introduced in recent versions? , class [i an array reference type, means it's sub-class of object . hence methods of object can invoked on arrays. perhaps book meant arrays don't introduce array specific methods. [i class name of int array ( int[] ). java arrays

android - Sorting a GridView with column headers -

android - Sorting a GridView with column headers - i have gridview contains 4 columns populated next code: public void showgrid() { dbhelper = new databasehelper(this); seek { cursor = dbhelper.getallaccounts(); startmanagingcursor(a); string[] = new string[]{databasehelper.colname, databasehelper.colamount, databasehelper.colperiodclass, databasehelper.colstatclass}; int[] = new int[]{r.id.colname, r.id.colamount, r.id.colperiod, r.id.colstat}; simplecursoradapter saa = new simplecursoradapter(this, r.layout.accrow, a, from, to); grid.setadapter(saa); } grab (exception ex) { alertdialog.builder b = new alertdialog.builder(this); b.setmessage(ex.tostring()); b.show(); } } grid works fine , all, issues are how column headers clickable. how sort items based on specific column field clicked. for illustration arrange items in view name/amount in ascending/descending order or g...

asp.net - Use FInd/Replace to re-order attributes in Visual Studio -

asp.net - Use FInd/Replace to re-order attributes in Visual Studio - across many hundreds of pages in old webforms app, there gridviews declared in html as <asp:gridview gridlines="none" ..... > where every gridview tag starts <asp:gridview gridlines="none" this shot in dark, i'm wondering if gridlines property can moved end of tag using regex in search & replace? example, <asp:gridview gridlines="none" .....> would become <asp:gridview ..... gridlines="none"> ..... represents many other attributes can exist, aren't declared in particular order. update some gridview controls utilize resource file info allow multi-lingual output. tag gets corrupted, can regex business relationship that? <asp:gridview gridlines="none" ..... emptydatatext="<%$ resources: reports, noresultsfound %>" .....> yes, can. address issue of non-serialzed > , <...

rotation - Emgu CV draw rotated rectangle -

rotation - Emgu CV draw rotated rectangle - i'm looking few days solution draw rectangle on image frame. i'm using cvinvoke.cvrectangle method draw rectangle on image because need antialiased rect. problem when need rotate given shape given angle. can't find solution. have tryed draw rectangle on separate frame rotate hole frame , apply new image on top of base of operations frame. in solution there problem antialiasing. it's not working. i'm working on simple application should allow draw few kinds of shape, resize them , rotation given angle. thought how achive this? you should read opencv documentation. there rotatedrectangle class can utilize task. can specify angle rectangle rotated. here sample code (taken docs) drawing rotated rectangle: mat image(200, 200, cv_8uc3, scalar(0)); rotatedrect rrect = rotatedrect(point2f(100,100), size2f(100,50), 30); point2f vertices[4]; rrect.points(vertices); (int = 0; < 4; i++) line(image, ve...

php - Why returns the first element of an array only? -

php - Why returns the first element of an array only? - $count =0; $result1 = mysql_query("select fwid sbsw fword = '".$searchtext."'"); while ($result2= mysql_fetch_array($result1)) { $result3 = mysql_query("select fsyn wrsyn fwid = '".$result2[$count]."'"); $result4= mysql_fetch_array($result3); print $result4[$count].'<br>'; $count++; } mysql_free_result($result1); mysql_free_result($result3); let's have @ how mysql_fetch_array works - illustration if have table construction like id | name | surname | role 1 john smith user 2 peter qeep user 3 mark ziii admin when execute query select * table , loop $result = mysql_fetch_array($query) , $result array(4) containing [0] => id, [1] => name, [2] => surname, [3] => role therefore, when execute query $result3 = mysql_query("select fsyn wrsyn fwid = '".$result2[$count]."...

python - Simplify Matrix by Averaging Multiple Cells -

python - Simplify Matrix by Averaging Multiple Cells - i have big 2d numpy matrix needs made smaller (ex: convert 100x100 10x10). my goal essentially: break nxn matrix smaller mxm matrices, average cells in these mxm slices, , build new (smaller) matrix out of these mxm slices. i'm thinking using matrix[a::b, c::d] extract smaller matrices, , averaging values, seems overly complex. there improve way accomplish this? you split array blocks view_as_blocks function (in scikit-image). for 2d array, returns 4d array blocks ordered row-wise: >>> import skimage.util ski >>> import numpy np >>> = np.arange(16).reshape(4,4) # 4x4 array >>> ski.view_as_blocks(a, (2,2)) array([[[[ 0, 1], [ 4, 5]], [[ 2, 3], [ 6, 7]]], [[[ 8, 9], [12, 13]], [[10, 11], [14, 15]]]]) taking mean along lastly 2 axes returns 2d array mean in each block: >>> ski.view_as_bl...

html - How to create trigger boxes for non retangular buttons for a website? -

html - How to create trigger boxes for non retangular buttons for a website? - i'm trying create simple website portfolio , thinking in doing html , css. base of operations site simple came across complex problems experience doesn't allow me solve. http://s3.postimg.org/dtat0gbur/logo_v2.png so how mais page should like. and want create buttons within main image, closed shapes created traces more specific, lead different parts of site. so, objective when pass mouse on 1 of areas, specific area coloured , piece of text apears under main image.and of course, if area clicked lead other page. i though html , css, after hours looking in net similar cases, i'm not sure anymore. started code in html adding first image fixed image , though add together others on top of can't create in way odd shape recognized. illustration if want irregular triangle button , save png, regognize invisible rectangle of background , not triangle. need help, don't know turn....

c++ - Does include ? -

c++ - Does <algorithm> include <cmath>? - the next programme compiles correctly: #include <algorithm> int main(int argc, char *argv[]) { homecoming int(log(23.f)); } (under g++ 4.9.2 flag -std=c++11 ) the code uses function log , defined on <cmath> . however, not include header <cmath> , header <algorithm> . why g++ doesn't give warnings, , compiles code correctly? in c++11 standard, [res.on.headers]/1 states that a c++ header may include other c++ headers. c++ header shall provide declarations , definitions appear in synopsis. a c++ header shown in synopsis including other c++ headers shall provide declarations , definitions appear in synopses of other headers. now consider [algorithms.general]/2: header <algorithm> synopsis #include <initializer_list> namespace std { // ...... <cmath> isn't listed , not included in <initializer_list> . programme not guar...

Issue with checked checkbox in Liferay/Alloy UI -

Issue with checked checkbox in Liferay/Alloy UI - i have form has checkbox. saving check box value true/false based on selecting of check box. if open form in edit mode, able value db true or false. value true need show checked checkbox in form or if value false need show unchecked checkbox. please give me suggestions. <%= user.isadmin() %> // here getting either true or false based on above value need check or uncheck check box, <aui:input type="checkbox" name="isadmin" label="is admin"></aui:input> if use, <aui:input type="checkbox" name="isadmin" label="is admin" checked="<%= user.isadmin()>"></aui:input> though user.isadmin() value true, getting error. use next way checking checkbox based on value of user.isadmin() <% string checked = user.isadmin() ? "checked" : "" %> <aui:input type="checkbox" name=...

python - Linux: Is there a 'reboot' or something similiar after calling rmmod or insmod? -

python - Linux: Is there a 'reboot' or something similiar after calling rmmod or insmod? - do have reboot or commit changes did calling rmmod or modprobe ? from os import scheme def disable_i2c(): system('sudo rmmod i2c_dev') system('sudo rmmod i2c_bcm2708') python linux module kernel

Eclipse and Egit - recognising git core.worktree -

Eclipse and Egit - recognising git core.worktree - in egit possible using git "core.worktree" config value set info file path different repository file path. when creating new (zend studio 12.0.2) eclipse project egit repository (configured using core.worktree) using new => project => php project existing directory; , choosing egit repository path "existing directory", project configuration appears ignore configured core.worktree value , creates info path kid of git repository path. is possible create eclipse project such project respects git.worktree value i.e. aligns layout git layout, , @ same time recognises project eclipse git (egit) enabled? eclipse git egit zend-studio

.net - PropertyInfo.SetValue on a property List(Of Int32) -

.net - PropertyInfo.SetValue on a property List(Of Int32) - i have class list properties this: public class listpropertiesclass public property id list(of int32) end class and class utilize reflection : public class test public sub mysub() dim identityvalue int32 = 100 dim propertyname string = "id" dim lpc new listpropertiesclass dim pinfo propertyinfo pinfo = lpc.gettype().getproperty(propertyname) if not pinfo nil pinfo.setvalue(lpc, convert.toint32(identityvalue), nothing) end if end sub end class but when seek utilize not working because i'm trying set value of type int32 list one, how can utilize propertyinfo.setvalue add together list itens ? , after adding how can value using reflection value of specific index of list pinfo.getvalue(lpc, nothing) i happy if can help me. thanks. you have first value of current property (and check it) below this illustration ...

c# - Building indexes in MongoDB with .NET driver 2.0 -

c# - Building indexes in MongoDB with .NET driver 2.0 - what's new way build indexes new driver 2.0? there's no documentation whatsoever this. apparently works new indexkeysdefinitionbuilder<> interface that's got far. you need phone call , await createoneasync indexkeysdefinition using builders.indexkeys : static async task createindex() { var client = new mongoclient(); var database = client.getdatabase("db"); var collection = database.getcollection<hamster>("collection"); await collection.indexes.createoneasync(builders<hamster>.indexkeys.ascending(_ => _.name)); } if don't have hamster can create index in non-strongly-typed way specifying index's json representation: await collection.indexes.createoneasync("{ name: 1 }"); c# .net mongodb mongodb-csharp mongodb-csharp-2.0

servlets - query reg the url used in post method of ajax call -

servlets - query reg the url used in post method of ajax call - i new ajax, help me know excatly value used in url in post method. have read on net should point file on server. have ajax phone call in 1 index.html. in server have servlet (s) , web.xml. i used below ajax call: localhostif (resp!=null){ log('resp not null '); ajaxpost(resp); } function ajaxpost(data) { log('after entering ajax function '); var httprequest = false; if (window.xmlhttprequest) { httprequest = new xmlhttprequest(); } else if (window.activexobject) { httprequest = new activexobject("microsoft.xmlhttp"); } log('xmlhttpreq obj created '); httprequest.open("post", "http://localhost:8083/ps" , true); httprequest.setrequestheader('content-type', 'application/x-www-form- urlencoded'); httprequest.onreadystatechange = function() { if (httprequest.readystate === 4) { if (httprequ...

Cosume rest service in erlang -

Cosume rest service in erlang - hey trying consume rest service in erlang, the module have written looks this. but throwing issues.any thought if missing something -module(mod_rest_casaandra). -author("root"). %% api -export([get_keywords/0]). -define(base_url, "http://localhost:8080/users"). get_keywords()-> header ="", contenttype = "application/json", body = "", method=get, httpoptions=[], options=[], url = ?base_url, r =httpc:request(method, {url,header}, httpoptions, options). to able run requests httpc requires inets application started. suspect didn't start before running request. illustration below works fine: application:start(inets), httpc:request(get, {"http://google.com", []}, [], []). besides pay attending headers (in illustration header ). defined as headers() = [header()] header() = {field(), value()} field() = string() value() = str...

signal processing - How to implement Overlap add method on Analog devices ADSP Bf70x -

signal processing - How to implement Overlap add method on Analog devices ADSP Bf70x - i trying create sound fft convolution analog devices dsp , have utilize overlap add together method. can see source code bellow , still have problem on output sound it's saturation. tell me if doing wrong or if have illustration implement overlap add together method on analog devices dsp or documentation. thanks. #include <filter.h> #include <fract2float_conv.h> #define fft_size 512 #define scale_method 1 #define samples_per_chan 256 complex_fract32 a_coeffsseg[512], w[512],complexsegmentleftin[512] ,complexsegmentrightin[512] ,complexsegmentleftout[512], complexsegmentrightout[512]; fract32 leftin [512], rightin [512]; int *block; // initialisation fft twidfftrad2_fr32(w, fft_size); //prepare coeffs for(i = 0; < samples_per_chan ; i++){ a_coeffs[i] = float_to_fr32(*(((float*) testcoefs) + i)); // coeffs } for(; < fft_size; i++){ a_coeffs[i] ...

mongodb - Advice on Query execution with Hibernate -

mongodb - Advice on Query execution with Hibernate - my application takes extremely long time (over 1.5 minutes) queries execute & load entity records database , queries timeout after 2-3+ minutes. after much investigation found due hibernate 1+n issue rather problem application/database or way designed. please see below similar database construction mine & illustration of query use my question in 2 parts, am querying right , if not else can solve this? (my queries similar java ee tutorial, hibernate doc etc) will migrating nosql/schemaless(mongodb) resolve of info need can embedded 1 document means have execute 1 query (at few) gather info want rather 20-30 queries hibernate run @ moment. database / entity structure basically one order has many order_items , each order_item links item , , item has 1 or more item_specifications . item_specifications set via dynamic table, , each item_specifications link specification_question_answer links related spe...

jquery - Properly formatting a table using Angular's ng-repeat -

jquery - Properly formatting a table using Angular's ng-repeat - i'm working in angularjs environment. i have next table of chart images i'm converting ng-repeat . i've managed assign records want display using gadgeticonsctrl below. need display 2 <td> elements per row. how display 2 <td> elements per row using ng-repeat ? class="snippet-code-html lang-html prettyprint-override"> <table id="gadgets" class="propertytable clickable_row"> <tr> <th>type</th> </tr> <tr> <td data-url="chart_treelist"> <img data-draggable id="chart_treelist" src="images2/table.png" title="tree grid" alt="hierarchy grid" width="64" height="64">grid </td> <td data-url="{chart_pivot}"> ...

dbpedia - SPARQL federated query "SERVICE" returns Virtuoso RDFZZ Error: unexpected variable name 'stubvar14' -

dbpedia - SPARQL federated query "SERVICE" returns Virtuoso RDFZZ Error: unexpected variable name 'stubvar14' - i want list of persons 2 different sparql-endpoints, i'm using query on de.dbpedia: prefix category-en: <http://dbpedia.org/resource/category:> select distinct * { ?name dcterms:subject category-de:haus_liechtenstein. ?name rdf:type foaf:person. service <http://dbpedia.org/sparql> { ?name dcterms:subject category-en:princely_family_of_liechtenstein. ?name rdf:type foaf:person. } minus {?name dbpedia-owl:deathdate ?d} } i next error: virtuoso rdfzz error db.dba.sparql_rexec('http://dbpedia.org/sparql', ...) has received result unexpected variable name 'stubvar14' any thought i'm doing wrong? lot! so problem although both these queries work fine separately, service part in combined query trying filter first set based on sec set. think missing union: prefix category-en: <http://dbpedia.or...

r - How to calculate a mean value from multiple maximal values -

r - How to calculate a mean value from multiple maximal values - i have variable e.g. c(0, 8, 7, 15, 85, 12, 46, 12, 10, 15, 15) how can calculate mean value out of random maximal values in r? for example, calculate mean value 3 maximal values? first step: draw sample of 3 info , store in x second step: calculate mean of sample try dat <- c(0,8,7,15, 85, 12, 46, 12, 10, 15,15) x <- sample(dat,3) x mean(x) possible output: > x <- sample(dat,3) > x [1] 85 15 0 > mean(x) [1] 33.33333 r max

sql server 2008 - Is It Possible To Combine These Two Queries -

sql server 2008 - Is It Possible To Combine These Two Queries - i need results of query 2 input in slot [data query 2 should go here] displayed in query 1. have been running both queries individually , manually inputting #'s possible run of 1 query? --query 1 select case when employee 'ricardo%' '38526' when employee 'james%' '44187' else employee end [employee], count(case when d.shipped_status in ('hold', 'waiting approval') d.id else null end) [processing], count(case when d.shipped_status = 'shipped' d.id else null end) [shipped], count(case when d.shipped_status = 'pending' d.id else null end) [pending], --this secondary query should go '' [data query 2 should go here] employeesales d.employee not null grouping case when employee 'ricardo%' '38526' when employee 'james%' '44187' else employee end --query 2 select case when employee 'ricardo%...

c# - how to dynamically fill Bootstrap dropdown -

c# - how to dynamically fill Bootstrap dropdown - i new bootstrap.i have notification drop downwards fills <!-- begin notification dropdown --> <li class="dropdown" id="notifications-header"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true"> <i class="glyph-icon flaticon-notifications"></i> <span class="badge badge-danger badge-header">6</span> </a> <ul class="dropdown-menu"> <li class="dropdown-header clearfix"> <p class="pull-left">notifications</p> </li> <li> <ul clas...

Yii2 SwiftMailer sending email via remote smtp server (gmail) -

Yii2 SwiftMailer sending email via remote smtp server (gmail) - i want send emails via gmail account. my mailer config: [ 'class' => 'yii\swiftmailer\mailer', 'usefiletransport' => false,//set property false send mails real email addresses 'transport' => [ 'class' => 'swift_smtptransport', 'host' => 'smtp.gmail.com', 'username' => 'my@gmail.com', 'password' => 'pass', 'port' => '587', 'encryption' => 'tls', ], ] i wrote command mailcontroller: <?php namespace app\commands; utilize yii\console\controller; utilize yii; /** * sanding mail service * class mailcontroller * @package app\commands */ class mailcontroller extends controller { private $from = 'my@gmail.com'; private $to = 'to@gmail.com'; public function actionindex($type = 'test', $data =...

java - How to get nodes of only current element in dom4j? -

java - How to get nodes of only current element in dom4j? - please help me solve next issue in dom4j this xml file: <root> <variant> <name>first</name> <values> <name>first_element</name> </values> </variant> <variant> <name>second</name> <values> <name>second_element</name> </values> </variant> </root> i used next java code variant node. root.selectnodes("\root\variant"); this giving me list count 2. using list collect each node individually. list nodes iterating. used next code value "values\name". variant.selectnodes("\\values\name"); i getting both values "first_element , second_element". 1 help me 1 values of current node. you should select name current node : list list = document.selectnodes( "//a/@hre...

Using hashtable or SQL Lite in my android application -

Using hashtable or SQL Lite in my android application - initially utilize hashtable in android application. key point love hashtable is able store complex item such as: coordinate-->float[2], velocity-->float[2]. but many samples, using sqllite table in android seems more efficient may store values in 1 row defined rowid. so can enlighten me on problem? using hash table or sql lite more feasible? can hashtable maintain info if exit application? can hashtable maintain info if exit application? no, of course of study no. hashtable instance live while app running, close app, deleted. now, set hand in heart , reply these questions: how much info have save? how utilize data? how long should info persist? that said, let's talk more ways persist data: shared preferences if want easy way persist simple info structures, way go. in fact, shared preferences allows save info in key<->value schema similar hashtable . sqlite ...

Clean in Eclipse temporarily destroys Android project with error message: missing required source folder: 'gen' -

Clean in Eclipse temporarily destroys Android project with error message: missing required source folder: 'gen' - i experiencing annoying problem android project in eclipse. other android projects okey (at moment). whenever perform clean (menu:project->clean...) project gives error , can't compile/run app. error is: project 'project name' missing required source folder: 'gen' as edit code problem disappears until perform clean again. can right-click on gen-folder , delete it. eclipse recreate gen-folder , problem disappears until perform clean. not showstopper annoying since have clean before run app. i'm using following: os: ubuntu 10.04 (linux cylon 2.6.32-24-generic) eclipse: helios release (build id: 20100617-1415) android dev tools: 0.9.7.v201005071157-36220 (the latest of today) we have tracked lastly problem regarding bug. the "clean" action used delete "gen" folder wrong. fixed in adt 8 or 9, can't...

c# - Date Picker Date Returns Null If date is Greater than MM/10/YYYY -

c# - Date Picker Date Returns Null If date is Greater than MM/10/YYYY - i using jquery datepicker , collecting values text box , passing c# controller problem when select date below 10th going controller if date more 10(05/21/2015) giving null value placed break point in browser , checked values there getting correctly <!--/page --> <!-- javascripts --> <!-- placed @ end of document pages load faster --> <!-- jquery --> <script src="~/content/js/jquery/jquery-2.1.1.min.js"></script> <!-- jquery ui--> <script src="~/content/js/jquery-ui-1.11.4.custom/jquery-ui.min.js"></script> <!-- bootstrap --> <script src="~/content/bootstrap-dist/js/bootstrap.min.js"></script> <!-- cookie --> <script type="text/javascript" src="~/content/js/jquery-cookie/jquery.cookie.min.js"></script> <!-- custom script --> <script src="~/content/js/ad...

java - Adding more than one mouse listener to a panel -

java - Adding more than one mouse listener to a panel - i'm trying add together more 1 mouse listener panel, want them on same line this: paint.paint.addmouselistener(shape.circle,shape.blah); is possible? know can instead: paint.paint.addmouselistener(shape.circle); paint.paint.addmouselistener(shape.blah); and that's not bad, thought easier if you're not using arrays, , can add together same line if it's possible. so, know if possible? thanks. there no addmouselistener(...) method accepts more 1 listener, can write own utility method so: public static void addmanymouselisteners( component component, mouselistener... mouselisteners ) { if ( component != null && mouselisteners != null ) { ( mouselistener mouselistener : mouselisteners ) { component.addmouselistener( mouselistener ); } } } the varargs parameter allows phone call method like: addmanymouselisteners( paint.paint, shape.circle...

Learn 64bit Assembly from 32bit Instruction -

Learn 64bit Assembly from 32bit Instruction - i've been trying utilize hacking: fine art of deception book larn assembly , programming. has great programming section gives greater appreciation inner workings of programme , gives greater understanding of how beingness precise when programming important. however, i've been having hard time next along because book uses 32bit examples , utilize 64bit system. know how compile gcc 32bit, or tune downwards 32bit cd provided book, think i'd rather larn 64bit because more relevant 32bit systems are(or becoming increasingly more relevant?). i'm trying inquire if should bother trying utilize book figure out 64bit assembly, because have heard much different, or if should find other material larn 64bit assembly separately? if there easy understand books cover 64bit intel assembly, i'd grateful reference. like lurker said in above comment. since have book 32-bit, larn it. 32-bit still relevant. ...

How to fill Multiple Knapsacks PHP -

How to fill Multiple Knapsacks PHP - this problem related knapsack problem. i've multiple knapsacks x space, want fill knapsacks close x possible (i'm not going leave items behind). how can efficient way? in code below loop through knapsacks, problem it's looking @ 'value' of items , if not gonna fit in sack leave to the lowest degree of import item behind. //all knapsacks $knapsacks = array(1,1,1,1,1,1,1,1); foreach($knapsacks $knapsack){ ## initialize $m = ''; $pickeditems = ''; $totalval = ''; $totalwt = ''; ## solve list ($m4,$pickeditems) = knapsolvefast2($w4, $v4, sizeof($v4) -1, 32,$m); # display result echo "<b>items:</b><br>".join(", ",$items4)."<br>"; echo "<b>array indices:</b><br>".join(",",$pickeditems)."<br>"; echo "<b>chosen items:</b><br>"; echo "<table borde...

c++ - Bounds check in 64bit hardware -

c++ - Bounds check in 64bit hardware - i reading blog on 64-bit firefox edition on hacks.mozilla.org. the author states: for asm.js code, increased address space lets utilize hardware memory protection safely remove bounds checks asm.js heap accesses. gains pretty dramatic: 8%-17% on asmjs-apps-*-throughput tests reported on arewefastyet.com. i trying understand how 64-bit hardware have automatic bounds check (assuming compiler hardware support) c/c++. not find answers in so. found one technical paper on subject, not able grasp how done. can explain 64-bit hardware aids in bounds check? most modern cpus implement virtual addressing/virtual memory - when programme references particular address, address virtual; mapping physical page, if any, implemented cpu's mmu (memory management unit). cpu translates every virtual address physical address looking in page table os set current process. these lookups cached tlb, of time there's no delay. (in non-x8...