Posts

Showing posts from 2012

python - Basemap drawparallels tick label color -

i have possibly simple question. simplified version of code below: # rid of white stripe on map ionst, lons=addcyclic(ionst, lons) #setting figure attributes fig=plt.figure(figsize=(15,15),frameon=false, facecolor='gray') #map settings m=basemap(llcrnrlon=-180, llcrnrlat=-87.5, urcrnrlon=180, urcrnrlat=87.5,rsphere=6467997, resolution='l', projection='cyl',area_thresh=10000, lat_0=0, lon_0=0) #creating 2d array of latitude , longitude lon, lat=np.meshgrid(lons, lats) xi, yi=m(lon, lat) #plotting data onto basemap cs=m.imshow(varcor, interpolation=none, alpha=.8, cmap='seismic', vmin=-.02, vmax=.02) vert=plt.axvline(x=-75, color='black', linewidth=5) #drawing grid lines m.drawparallels(np.arange(-90.,90.,30.),labels=[1,0,0,0],fontsize=20) m.drawmeridians(np.arange(-180.,181.,45.), labels=[0,0,0,1],fontsize=20) #drawing coast lines m.drawcoastlines() when call drawparallels , drawmeridians argument, labels set according array specify.

serialization - How can I store instances of TabItem and load the instances on Application start (VB.NET) -

i'm storing instances of tabitem retrieving selected tab item tabcontrol's "selecteditem" property dictionary of type (string, tabitem) on button click 1 1. after few clicks have dictionary containing lots of tabitems. store entire dictionary permanently such can load on application start. suggestions on how , can store instances? know file option there other alternative? i tried serializing dictionary , store in file gives me error stating tabitem not serializable.

annotations - How to annotate helper class to be visible inside JSF? -

i have helper class, neither stateful managed bean , nor stateless ejb , nor entity mapped table via jpa or hibernate . collection of static methods simple things return date formats , similar. given that, in order java class visible inside jsf, class must annotated in way container assigns visible jsfs, there way annotate helper class not match of standard jsf visible categories becomes visible? alternative, of course, have conduit method in managed bean passes call jsf helper class prefer not clutter managed bean if can call directly jsf. understand doing stateless ejb jsf considered anti-pattern methods in class wish use simple , non-transactional. mark class @applicationscoped . make sure has public no-arg constructor , class doesn't have state , methods thread safe. e.g. managed bean (pure jsf) //this important import javax.faces.bean.applicationscoped; @managedbean @applicationscoped public class utility { public static string foo(string anoth

ember.js - Ember Dynamically Generated HTML -

i have requirement need add html after dom has been rendered. wondering if possible manipulate dom after creation , dynamically add html , specifying associated ember action. e.g. intension of want achieve: $('.add').on("click", function(e){ e.preventdefault(); += 1; var content = "<div class=\"item dodgerblue\"><h1>"+i+"</h1></div>"; var content + "{{action "owlitemclicked" titlemodel.id titlemodel.index titlemodel on="click" }}" owl.data('owlcarousel').additem(content); }); specifically want add item carousel: http://owlgraphic.com/owlcarousel/demos/manipulations.html i'm not sure triple-stash, includes content without escaping it, work {{action}}. in case, looks me you'd better off defining html within each block , letting ember handle content addition. {{#each model |titlemodel index|}} <div class=\"item dodgerbl

java - Static initializer runs after the constructor, why? -

i have 2 classes: class a: public class { static b b = new b(); static { system.out.println("a static block"); } public a() { system.out.println("a constructor"); } } class b: public class b { static { system.out.println("b static block"); new a(); } public b() { system.out.println("b constructor"); } } i create main class creates new a: public class main { public static void main(string[] args) { new a(); } } the output is: b static block constructor b constructor static block constructor as can see, constructor of invoked before static initializer. i understand got cyclic dependency created under impression static initializer should run before constructor. what reason happen (technically in java implementation) ? is recommended avoid static initializers ? static b b = new b(); is before static {

Excel recorded SQL database query not working -

i've recorded macro query database, , when record macro, query runs properly. however, when try run macro again on same sheet or on different one, error: runtime error 1004, "sql syntax error" on line .refresh backgroundquery:=false". below recorded macro. sub macro3() activesheet.querytables.add(connection:= _ "odbc;dsn=substation prod;srvr=subp;uid=u326357;", destination:=range("a1")) .commandtext = array( _ "select fact_monthly.time_stamp, fact_monthly.system_number_val0, fact_monthly.substation_number_val0, fact_monthly.mva_max_out_val0, fact_monthly.mw_max_out_val0, fact_monthly.mvar_max_out_val0, fact_" _ , _ "monthly.mw_min_out_val0, fact_monthly.mvar_min_out_val0, fact_monthly.pf_max_val0, fact_monthly.pf_min_val0, fact_monthly.top_oil_tank_max_val0, fact_monthly.load_factor_val0, fact_monthly.ph1_tap_max" _ , _ "_drag_val0, fact_

c# - Entity Framework SaveChanges() not reflecting on entities -

i have winforms project , database running on sql server has 2 tables, student , standard . first created ado.net entity data model database wizard thing. have datagridview control has bindingsource datasource. note: databindingprojection class created able populate datagridview properties both student , standard entities i have code: var query = context.students .include(s => s.standard) .select(s => new databindingprojection { studentid = s.studentid, studentname = s.studentname, dateofbirth = s.dateofbirth, height = s.height, weight = s.weight, standardname = s.standard.standardname, standard_standardid = s.standard.standardid }).tolist(); mylist = new bindinglist<databindingprojection>(query.tolist()); dat

javascript - Maxlength limit for onClick button input -

i'm creating simple form allow customers input number form field, should have limit of 6 characters. the numbers submitted our database, customer needs see them before submitting. i have used script below create number submission form input text field (which can sent db). went method majority of our audience on on mobiles, didn't think standard text field input user friendly (open alternatives on this). <input name="ans" type="text" size="6" maxlength="6"><br> <p><input type="button" value="1" onclick="document.calculator.ans.value+='1'"> <input type="button" value="2" onclick="document.calculator.ans.value+='2'"> <input type="button" value="3" onclick="document.calculator.ans.value+='3'"></p> <p><input type="button" value="4" onclick="docum

c# - updates an entity flush is child entity in EF -

when save existing entity in project, if don't include child on dbset, lose previous value. can't figure out what's wrong project, not have in others projects. some code : var quoterequest = _session.set<quoterequest>() .include(x => x.quoterequestinvites) .include(x => x.quoterequestinvites.select(y => y.selectedservice)) .include(x => x.quoterequestinvites.select(y => y.selectedservice).select(z => z.service)) .include(x => x.quoterequestinvites.select(y => y.provider)) .include(x => x.district) .include(x => x.city) .firstordefault(x => x.id == quoterequestid); if (quoterequest == null) return request.createresponse(httpstatuscode.notfound); foreach (var invite in quoterequest.quoterequestinvites) { if (invite.token == guid.empty) { _logger.warn(invite, "empty token changed invite "

wcf - Web service must be accessible from internet but firewall blocks incoming request -

so here situation: we need client app able make requests throught internet wcf web service. we have total control of both service , client implementation, major problem don't control router service not visible internet. (and router configuration can't change , doesn't allow request internet) we don't want use vpn client or ipsec tunnel. the service knows clients, idea had initiate socket connections service clients, , client call service using callback methods. it not seem common way of communication, maybe more common think. wondering if had such kind of constraint, , if solution consider work. i fear run accross several issues in long term if wrong way proceed, because foundation of our platform need sure not over-complicate future development nor reduce system capabilities. we several tests opinion on ? or bad idea ? see @ first glance go wrong approach ? there important things should aware of ? for example service capabilities / wcf features lim

javascript - Handsontable is having issues - single row with readonly cells -

i'm using handsontable in project. working till last week. last 2 days not working (displaying single row readonly cells). i don't know issue , ensure didn't change in code. hot = new handsontable(document.getelementbyid('scid'), { rowheaders: true, mincols: 23, maxcols: 23, columnsorting: true, colheaders :['issuercode','productcode','componentcode','variantcode','platform','trackingcode','medicalplancode','pharmacyplancode','avvalue','metalliclevel','riders','network','scidstatus','contributionamountmin' ,'contributionamountmax','hiosdescriptor','hiosreason','linkedhios','caseeffectivedate','georating','discontinuedate','newexisting','note'], minsparerows: 1 }); anyone me resolve issue?

how to measure distance and centroid of moving object with Matlab stereo computer vision? -

which matlab functions or examples should used (1) track distance moving object stereo (binocular) cameras, , (2) track centroid (x,y,z) of moving objects, ideally in range of 0.6m 6m. cameras? i've used matlab example uses peopledetector function, becomes inaccurate when person within 2m. because begins clipping heads , legs. the first thing need deal with, in how detect object of interest (i suppose have resolved issue). there lot of approaches of how detect moving objects. if cameras stand in fix position can work 1 camera , use background subtraction objects appear in scene (some info here ). if cameras are moving, think best approach work optical flow of 2 cameras (instead use previous frame flow map, stereo pair images used optical flow map in each fame). in matlab, there option called disparity computation , try detect objects in scene, after need add stage extract objects of interest, can use thresholds. once have desired objects, need put them in binary ma

c - 32 bit number handling with ATTiny and Atmel Studio -

i wondering how attiny, attiny24 stores 32 bit unsigned ints in memory. i'm trying take 32 bit value , write 32 bit location in eeprom. have attempted use simple mask, every time try, lower 2 bytes (lsb) correctly , upper 2 bytes zeros. example, when try write: 0x12345678 output is: 0x00005678. there setting in atmel studio need set, or need use method other masking. ultimately want able read 32 bit counter value , write specific location in eeprom. working on modifying existing circuit , not have luxury debug serial output. code snippets: in main: unsigned long test_val = 305419896; //0x12345678 eeprom_long_write(0x25,test_val); functions: eeprom_long_write: void eeprom_long_write(unsigned char eeadr, unsigned long ee_data) { unsigned char temp=0; unsigned char count= eeadr + 3; unsigned long mask=0; unsigned char position=24; while (eeadr <= count) { mask = ((1<<8)-1) << position; temp = (ee_data &am

c++ - How to return a string of unknown size from DLL to Visual Basic -

i have visual basic script calls dll network requests , returns result of 1 request string. length of result unknown before calling dll. dll written in c/c++ myself. as far see, used way return strings dll pass reference of preallocated string object arguement dll. dll function fills memory returning string. problem allocated buffer has large enough, make sure result fits it. is possible directly return resulting string dll? or there other way dynamically allocate string object depending on length of result , return vb caller? i tried different approaches, example (ugly, examples): __declspec(dllexport) const char* sendcommand(const char* cmd, const char* ipaddress) { // request stuff... long lengthofresult = ... const char* result = new char[lengthofresult]; return result; } or like.. __declspec(dllexport) bstr sendcommand(const char* cmd, const char* ipaddress) { _bstr_t result("test string."); bstr bstrresult = result.copy(); r

pdf - manipulate clicked link in WebView Android -

i have webview in android application loaded local page have pdf links looks like: <a href="pdf:document.pdf">document</a> my need when user click on link change url , redirect user " http://url/pdf_files/document.pdf ". code not working. i've search lot of information , tried lot. my code below: webview = (webview) v.findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setloadsimagesautomatically(true); webview.getsettings().setloadwithoverviewmode(true); webview.getsettings().setusewideviewport(true); webview.getsettings().setpluginstate(websettings.pluginstate.on); webview.setscrollbarstyle(webview.scrollbars_outside_overlay); webview.loadurl("files://assets/localpage.html"); webview.setwebviewclient(new webviewclient(){ @override public boolean shouldoverrideurlloading(webview view, string url) { string[] file_name =

sql server - Add a total row to a Grouped Query -

i trying add total row grouped query. query have below: select t3.[slpname], t1.[cardcode], t1.[cardname], t1.[shiptocode], t2.[itemcode], t2.[dscription], sum(t2.[quantity]) 'total quantity', max(t2.[price]) 'line price', sum(t2.[linetotal]) 'line total', sum(t2.[grssprofit]) 'gross profit' ocrd t0 inner join oinv t1 on t0.[cardcode] = t1.[cardcode] inner join inv1 t2 on t1.[docentry] = t2.[docentry] inner join oslp t3 on t0.[slpcode] = t3.[slpcode] t3.[slpname] = 'name' , t1.[createdate] >= dateadd(day,-7, getdate()) group t3.[slpname], t1.[cardcode], t1.[cardname], t1.[shiptocode], t2.[itemcode], t2.[dscription]. what want total row sum line - in effect sum of sum. i've tried adding total using union clause gives me error message. when use rollup function summarises each row instead of line need summary for. can help? many thanks. if union without group mentioning non sum columns null, shall work fine follows:

java - From static main method in same outer class like inner class, can't access to constructor from inner class -

why happened, gives me error in void main when initializing newstring , the method stringthread(string, int) undefined type mainthread ? here code: public class mainthread { public class stringthread implements runnable { private int num; private string text; public stringthread(string text, int num){ this.text = text; this.num = num; } public void run(){ for(int = 0; < num;i++) system.out.println(i+1+". " + text); } } public static void main(string[] args){ stringthread newstring; newstring = stringthread("java", 30); new thread(newstring).start(); } } new keyword missing in initialization , that's why considering method , not constructor , it's inner class should be. (suggested stultuske ) mainthread obj = new mainthread(); stringthread newstring = new obj.stringthread("java", 3

java - DefaultBootstrap.bootstrap performance issue -

tuning java code performance , found out creating signablesamlobject , part defaultbootstrap.bootstrap() taking 400 ms . have notes on why takes longer time rest of unmarshalling part of code (which takes around 10 ms)? how can optimized performance? you should call defaultbootstrap.bootstrap() once in application, on startup. it's performance should not problem

ios - SceneKit Unit of Measure -

if create scnbox geometry in scenekit width, height , length of 5, how translate real world measurements? for example, measurements use create same size cube in sketchup? does 1 unit in scenekit equal 10mm or 100mm? in scenekit distances specified in meters. box 5m wide.

detect file changes in Java without WatchService -

i created file checker checks file changes every x sec. problem if check file watchservice send modify event if touch file . can check file.lenght , if changes not change file size? there idea how can detect file changes? this code( i'm using lastmodified() method while ) class checker implements runnable { static logger log = logger.getlogger(monitor.class.getname()); private static final long default_check_interval = 5000; //5 sec private static simpledateformat dataformat = new simpledateformat("mm/dd/yyyy hh:mm:ss"); private file file; private long checkinterval; public checker(string path, long checkinterval) throws exception { this.file = new file(path); this.checkinterval = checkinterval > 1000 ? checkinterval : default_check_interval; } private jsonobject loadconfig() { jsonobject conf = null; try(bufferedreader reader = new bufferedreader(new filereader(this.file));) { stringbuilder bldr = new stringbuilder((int) this.

r - Is there a way to connect sparkR with MLlib library? -

i using spark ver 1.4. there api r users - sparkr. i managed launch sparkr , convert r's data.frame spark's dataframe following command irisdf <- createdataframe(sqlcontext, iris) i wondering if there's way somehow connect spark mllib library proceed logistic regression - https://spark.apache.org/docs/latest/mllib-linear-methods.html or maybe there away reconvert dataframe regular data.frame ? there no way yet connect spark mllib, should released in next version. can reconvert dataframe data.frame by collect(irisdf)

regex - Using Sublime Text to ensure one sentence per line in LaTeX documents -

the goal adopt third way ---a.k.a. using semantic linefeeds . involves typing 1 sentence per line of tex file. makes easier use version control systems when working tex files , other, text-heavy files. (a similar recommendation made in answer this question .) of course, manually insert line break @ end of every sentence. however, lead bad habits (e.g. typing sentence per line when writing emails). i'm looking alternative way of implementing this. one solution, of using sublime text, use st's keybindings. essentially, turn spacebar keyboard shortcut script check whether precedes end of sentence, and if is, insert line break. here's relevant snippet: { "keys": [" "], "context": [ {"key": "selector", "operator": "equal", "operand": "text.tex.latex"}, {"key": "preceding_text", "operator": "regex_ma

Error when cross compiling Qt 5.0.1 for the Raspberry Pi -

i'm trying cross compile qt 5.0.1 (latest release @ moment) raspberry pi. set follows: operating system: ubuntu 12.04 32-bit cross compiler: built crosstool-ng program, using exact instructions found here raspberry pi operating system: raspbian wheezy 2013-02-09 (mounted @ /mnt/raspberry-pi-rootfs) configure command: ./configure -no-pch -opengl es2 -device linux-rasp-pi-g++ -device-option cross_compile=/home/<myusername>/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- -sysroot /mnt/raspberry-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5-raspberry-pi -v when run configure command, fails following error: could not determine target architecture! /mnt/raspberry-pi-rootfs/usr/include/features.h:323:26: fatal error: bits/predefs.h: no such file or directory anyone know means? i have tried latest pre-built linaro toolchain cross compiler from here , , qt @ least builds, progr

ruby - How do you include a mixin when using Minitest specs? -

how should include mixin when using minitest specs? this example of test suite in minitest specs: require "minitest/autorun" describe meme before @meme = meme.new end describe "when asked cheeseburgers" "must respond positively" @meme.i_can_has_cheezburger?.must_equal "ohai!" end end end the top-level describe block defines test case in same way class definition if writing assert-style tests, you'll include mixin module would: require "minitest/autorun" describe meme include mymixin before @meme = meme.new end describe "when asked cheeseburgers" "must respond positively" @meme.i_can_has_cheezburger?.must_equal "ohai!" end end end remember: minitest ruby.

java - Convert byte[] to UnsignedByte[] -

i want optimize following java code (a single method): private static unsignedbyte[] getunsignedbytes(byte[] bytes){ unsignedbyte[] usbytes = new unsignedbyte[bytes.length]; int f; for(int = 0; i< bytes.length;i++){ f = bytes[i] & 0xff; usbytes[i] = new unsignedbyte(f) ; } return usbytes; } this code converts byte array(which file) unsignedbyte array can send webservice consuming through apache axis. is there way can avoid loop. there direct method this? thank you. no, unfortunately there not. conversion of array of bytes has done element.

c# - SMTP client StackOverflowException -

i'm creating massmailing program basically, , problem if without threads, freeze , needs able show user progress. without using class/object works fine. stackoverflowexception: {cannot evaluate expression because current thread in stack overflow state.} on this.numericupdown1 = new system.windows.forms.numericupdown(); notice: can missleading because haven't created thread yet still get's stackoverflowexception. this code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.windows.forms; using system.io; using system.windows; using system.net.mail; namespace mass_mail { public partial class form1 : form { form2 frm = new form2(); worker work = new worker(); public list<string> succed = new list<string>(); public list<string> failed = new list<string>(); public form1() {

Release Management Azure Website -

how can publish azure website (no vm!) using microsoft release management. at moment, ms release management seems support deploying azure vm's. ms release management system lets me control deployment variables across multiple deployment stages. basically, not supported scenario out of box. your best bet here use agent-based release template "springboard" server manage release, , custom powershell scripts use azure sdk interact azure. 1 of colleagues did leg work figure out few months ago, , has few comprehensive blog posts describing how accomplished deploying azure web application via rm.

Oracle Query Error while using right outer join -

i have converted 1 mysql query oracle , facing following issue while executing. query: select oc.channel_id, oc.oc_calendar_date, to_number(to_char(oc.oc_calendar_date, 'ww')), to_char(oc.oc_calendar_date, 'day') day_week, to_number(to_char(oc.oc_calendar_date, 'ww'), 1) - to_number(to_char(trunc(sysdate, 'ww')), 1), (case when to_number(to_char(oc.oc_calendar_date, 'ww'), 1) = to_number(to_char(trunc(sysdate, 'ww')), 1) 'current week' else ('prev wk ' || (to_number(to_char(oc.oc_calendar_date, 'ww')) - to_number(to_char(trunc(sysdate, 'ww'))))) end) datediff, oc.package_id, orddet.order_completion_date total_count (select tor.channel_id, to_date(tor.order_completion_date) order_completion_date, tol.package_id package_id tibom.tom_orde

Stack items when mobile with Magento 1.9 and RWD theme -

i found lot of posts none of them show clear answer works: how can display 3 items in row when user desktop , stack them vertically when in mobile? i see possible no hacking product grid (but products shown 2 row), can use similar same result. i have created sample able show 3 items when desktop , show 2 in row , 1 in another. that's close want: <ul class="products-grid products-grid--max-4-col first last odd"> <li><img alt="" src="http://192.241.128.153/media/wysiwyg/index/pencil.jpg" /> <div class="product-info" style="min-height: 167px;"> <h2>assine</h2> </div> </li> <li><img alt="" src="http://192.241.128.153/media/wysiwyg/index/pencil.jpg" /> <div class="product-info" style="min-height: 167px;"> <h2>vote</h2> </div> </li> <li><img alt="" src="http://192.241.128.153/m

multithreading - Syncronisize two looping Java-Thread -

two threads running parallel: thread1: while(...) { <-- wait until thread2 not in update() dowork(); } thread2: while(...) { dowork(); <-- wait until thread1 not in work() update(); } i think examples above explain try do, have not idea how synchronization. update() -method of thread2 critical while executed thread2 have wait. edit: thanks far answers. more 1 working well. asked trying , want give short update that. based on currentstate thread2 calculates nextstate , swap both before repeats calculating endless. thread1 displays 'currentstate' in gui user. thread1 should not display currentstate while swaping in progress. thats all. one way use locks (look @ java.util.concurrent.locks package) i'd first think whether approach in general improved, e.g. lock-free algorithms etc. another way use of synchronized methods/blocks on shared object. depends on you're trying achieve, however. example using synchronized

android - Add a "page break indicator" to an endless RecyclerView -

Image
i have endless recyclerview loads new data when user scrolls bottom. adds null object end of list (to represents progressbar) , deletes object when execution complete. want inflate view indicate "page break" after loading new batch of data. looks this: however, position of objects in list messed if add null object represent view break. there way achieve without touching list? have @ recyclerview.itemdecoration . can use add visual cues above/below view objects being shown recyclerview . note gets called each view object, you'll have determine objects page break before (or after) them , draw objects.

iphone - How to give automatically top space to navigation bar in ios? -

Image
i have uiviewcontroller . designing screen iphone 5s. have uiimageview & giving top space container of 20. have uinavigationbar @ top.so space given of 20 not enough. uiimageview hidden behind uinavigationbar . can resolve issue giving space top. in case @ design time ui not proper. there way space uinavigationbar automatically calculated? in attribute inspector set top bar translucent navigation bar this then set top space of imageview top layout guide like,

xml - Google Contacts API get phone number (PHP) -

i'm using google contacts api , i'm able extract names , email addresses i'd profile pictures , phone numbers. i'm using php , here's code while authenticating: //if authenticated successfully... $req = new google_httprequest("https://www.google.com/m8/feeds/contacts/default/full"); $val = $client->getio()->authenticatedrequest($req); $doc = new domdocument; $doc->recover = true; $doc->loadxml($val->getresponsebody()); $xpath = new domxpath($doc); $xpath->registernamespace('gd', 'http://schemas.google.com/g/2005'); $emails = $xpath->query('//gd:email'); foreach ( $emails $email ){ echo $email->getattribute('address'); //successfully gets person's email address echo $email->parentnode->getelementsbytagname('title')->item(0)->textcontent; //successfully gets person's name } phone number this part getting phone number doesn't work. $phone = $xpa

sql - Excel Microsoft Query function to retrieve user name -

i have created microsoft query data connection links spreadheet. in sql query need filter out lines not bellong user. using clouse , need compare field current username. have tried user(), system.user(), current_user, system_user ... nothing seems work. also, knows language microsoft query use? language on own? i hope work environ("username") this should return username @ least in vba

scala - Replace characters in foreach variable -

here code: def readentitymultipletimes(entityname: string, pathprefix: string = "") = { val plural = entityname + "s" exec(http(s"geting $plural") .get(pathprefix + plural) .check(status 200) .check(jsonpath("$[*].id").findall.saveas("entityids")) ).exec(s => { if (loglevel >= 2) println("\nids:\n" + s("entityids")) s }) .pause(interval millis) .foreach("${entityids}", "entityid") { repeat(readentitynumber) { exec(http(s"getting 1 $entityname") .get(pathprefix + plural + "/${entityid}") .check(status 200) ) } } } the issue entityid may contain space , fails http request. need spaces replaced %20 . i tried gatling el ${entityid.replaceall(\" \", \"%20\")}" or ${java.net.urlencoder.enc

scalac - Where do I place Scala jar libs in Windows? -

i have installed scala-async.jar eclipse (it easy edit .classpath file) i want compile/run command line scala . scalac says object async not member of package scala . where place jar ? placing maven released-jar c:\program files (x86)\scala\lib did trick. have figured out folder location process monitor .

javascript - jQuery accordion issues - Hover icon and IE7/8 problems -

i trying use jquery accordion in website , have couple of issues trying address. firstly, can't seem make cursor hand when user hovers on mouse. secondly accordion not work in ie8 or ie7, works fine in ie9 , above , in other browsers. i no means expert in building code , have put there - need these 2 issues sorted , done. the link test page is: http://www.micklehamweather.com/test.php my code is: <!doctype html> <!-- dc rss feeds css --> <link type="text/css" rel="stylesheet" href="tsc_rssfeed.css" /> <!-- jquery library (skip step if called on page ) --> <script type="text/javascript" src="jquery.min.js"></script> <!-- (do not call twice) --> <!-- dc rss feeds js --> <script type="text/javascript" src="tsc_rssfeed.js"></script> <script type="text/javascript" src="tsc_vticker.js"></script> <

r - Get matching lines from a character and plot ts -

i have data frame columns dates, volumes, , companies. know how keep 1 line each company? grep returns number of lines, how can full line please? besides how can plot these volumes per companies on 1 single time series plot please? i found plot.ts can't while don't have volumes per companies if plot.ts full data set not make difference between companies , have wrong time serie (many points single date) i have plot this: time series plot instead of "websites" have "volumes" , instead of "shoes,socks,lace" have name of companies/subjects or svolumes time series plot 2 that's how data looks like: > head(data) date time subject sscore smean svscore sdispersion svolume sbuzz last close 1 2015-07-08 09:10:00 mmm -0.2280 0.2593 -0.2795 0.375 8 0.6026 155.430000000 2 2015-07-08 09:10:00 ace -0.4415 0.3521 -0.0374 0.500 4 0.7200 104.460000000 3 2015-07-07 09:10:00 aes 1.9821 0

c# - ASP.NET Redirect to Https issue - Error 401 -

we have implemented https our website, have made implement redirect. <rewrite> <rules> <rule name="rule - name" enabled="true" stopprocessing="true"> <match url=".*" /> <conditions> <add input="{https}" pattern="off" /> </conditions> <action type="redirect" url="https://yourpath" redirecttype="youttype" /> </rule> </rules> </rewrite> the redirect working ok, got issue. of users has saved in bookmarks old path http://applicationname/account/login?returnurl=%2f , redirect doing -> https://applicationname/?returnurl=/ , error can see below: 401 - unauthorized: access denied due invalid credentials. not have permission view directory or page us

c# - How to make a certain section scrollable -

i have got following xaml: <stackpanel horizontalalignment="center"> <image name="logo" source="logo.png" margin="0,0,0,50"/> <scrollviewer> <dashboard_control:alignablewrappanel x:name="wrappanel"/> </scrollviewer> <textblock fontweight="bold" horizontalalignment="center" x:name="txtbottomtext"></textblock> </stackpanel> i wrappanel scrollable only, txtbottomtext control @ bottom scroll, , logo image control @ top - allowing wrappanel scrollable. i have tried adding scrollviewer shown above, never shows. tried adding property have vertical scrollbar, appears without letting me scroll (the scrollbar disabled). i suspect because wrappanel's content dynamically generated @ run-time so: wrappanel.children.add(content); any ideas can fix this? it's not because of wrappanel's content.

visual studio 2012 - Install-Package : Unable to find package 'FeatureToggle.Core' -

when trying install featuretoggle package manager console, below eror coming up. this happening in vs 2012. pm> install-package featuretoggle.core install-package : unable find package 'featuretoggle.core'. @ line:1 char:1 + install-package featuretoggle.core + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [install-package], invalidoperationexception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.powershell.commands.installpackagecommand i able install-package featuretoggle make sure have chosen "all" package source dropdown in console.

javascript - Passing JS number array to emscripten C++ without reinterpret_cast -

have large number arrays in js want pass c++ processing. imho efficient way let js write directly c++ heap , pass pointer argument within direct call, like: var size = 4096, bpe = float64array.bytes_per_element, buf = module._malloc(size * bpe), numbers = module.heapf64.subarray(buf / bpe, buf / bpe + size), i; // populate array , process numbers: parseresult(result, numbers); module.myfunc(buf, size); the c++ functions process numbers like: void origfunc(double *buf, unsigned int size) { // process data ... } void myfunc(uintptr_t bufaddr, unsigned int size) { origfunc(reinterpret_cast<double*>(bufaddr), size); } that works expected wonder if there chance call origfunc directly javascript rid of myfunc , ugly reinterpret_cast . when tried bind origfunc via: emscripten_bindings(test) { function("origfunc", &origfunc, emscripten::allow_raw_pointers()); } ... , call directly: module.origfunc(buf, size); i error: uncaugh

payment - Sha-out sign not matching Ogone, PHP -

i'm trying make payment plugin webshop ogone ideal payments. can make payment, when return cannot sha-signs match. i have following request on return: orderid=476&amount=90%2e82&pm=ideal&acceptance=0000000000&status=9&payid=43934127&ncerror=0&brand=ideal&shasign=5ab0a065baa83c5d807249a66e661acbb6709b8f according documentation, have order keys alphabetically , hash allowed. these allowed keys: ['aavaddress', 'aavcheck', 'aavzip', 'acceptance', 'alias', 'amount', 'brand', 'cardno', 'cccty', 'cn', 'complus', 'currency', 'cvccheck', 'dcc_commpercentage', 'dcc_convamount', 'dcc_convccy', 'dcc_exchrate', 'dcc_exchratesource', 'dcc_exchratets', 'dcc_indicator', 'dcc_marginpercentage', 'dcc_validhous', 'digestcardno', 'eci', 'ed', 'enccardno

mysql - Combining Selects with two different Group Bys in same query -

i have 1 table 4 columns (1 primary key- not used here) col1: year col2: cust_id col3: units i want combine these 2 queries generate 1 output, different group by's required. select cust_id,year,sum(units) table group cust_id; select cust_id,year,units table group cust_id,year; independently both work. when try combine them , group cust_id,year sum(units) gets sum of specific year (which correct non-sum query), whereas need sum of years cust_id same. you need define want achieve. if want cust_id , sum of units years: select cust_id,sum(units) table group cust_id if want cust_id , year plus sum of years customer: select t1.cust_id,t1.year,sum(t1.units) unitsforyear,(select sum(t2.units) table t2 t1.cust_id = t2.cust_id) unitsforallyears table t1 group cust_id,year

java - Proguard returned with error code 1 error when signing apk with many external libraries -

i using eclipse mac. when want export signed apk "proguard returned error code 1. see console" error. i have these 2 files in project root folder: "proguard-android.txt" , "project.properties" inside project.properties have: target=android-17 proguard.config=proguard-project.txt android.library.reference.1=../google-play-services_lib android.library.reference.2=../facebooksdk among many other warnings when try create signed apk, get: com.my.app.va.debug.configurelog4j: can't find referenced class de.mindpipe.android.logging.log4j.logconfigurator com.my.app.va.debug.hockeyapphelper: can't find referenced class net.hockeyapp.android.exceptionhandler i put these lines inside "proguard-android.txt" , errors persist: -keep public class de.mindpipe.android.logging.** -dontwarn de.mindpipe.android.logging.** -keep public class net.hockeyapp.** -dontwarn net.hockeyapp.** what doing wrong? update: have changed filename &qu

javascript - Using getJSON function to read from while loop data -

<? while ($row_previous_bill = $res_previous_bill->fetchrow()) { $bill = $row_previous_bill[6]; $bill_2 = $row_previous_bill[2]; $bill_3 = $row_previous_bill[3]; $bill_4 = $row_previous_bill[1]; $hotspot_location = $row_previous_bill[5]; $data[] = array("result_paid" => $bill, "err_code" => 0, "result_payment_details" => $bill_3, "result_time" => $bill_4, "result_location" => $hotspot_location); } $name = array("response" => $data); //sets response format type header("content-type: application/json"); //converts php type json string echo json_encode($name); ?> i using while loop above json format, use this $(function() { //set url of json data. make sure callback set '?' overcome cross domain problems json var url = "http://127.0.0.1/olem.app/tab/api/js_on.php?get=json&subscriber

javascript - CLNDR - how to pass event info to a separate DIV? -

i putting page use clndr plugin ( http://kylestetz.github.io/clndr/ ), jquery plugin ('clndr.js') creating custom calendars. the page .html page inserted javascript .php file. have use .php our server not run php codes in .html files. the 'clndr.js' uses 'moments.js', 'underscore.js' , file 'site.js' provided kylestetz plugin. 'site.js' contains event information (dates events used in calendar generated 'clndr.js') in array this: var eventarray = [ { date: '2015.07.25', title: 'artpolis kick-off', location: ' ott. 2.', url: 'esemeny/esemeny_reszletes_150535_01.html', type: 'holiday' }, { date: '2015.06.25', title: 'smartpolis kick-off', location: ' sztnh, bp., garibaldi u. 2.', url: 'esemeny/esemeny_reszletes_150535_01.html'}, { date: '2015.05.26', title: 'Űr-lÉptÉk ', location: 'bme k ép. díszterem ', url: 'esemeny/ '