Posts

Showing posts from June, 2011

active directory - ADFS not issuing claims from custom attribute stores to some users -

i'm trying work out why of our users aren't issued claims our custom attribute stores. our main attribute store authentication active directory, using 2 custom attribute stores issue several custom claims users, , perform logging of claims issued. when affected user logs in, authenticated ad, have no more claims added. according logging in our attribute stores, beginexecutequery never called. i can't see link affected users, seem new users, or users have not logged system in long time. restarting adfs clears problem, whether or not seems random. i'm trying understand why attribute store ignored adfs on logon users, when works fine others. if there quick guaranteed temporary fix users' claims issued correctly, useful too! for security reasons, don't have access adfs debug tracing. this solved longs string of calls microsoft's ad fs support team. problem traced piece of our claims rule language using lastlogon , lastlogontimestamp ad att

Android : How can i compare gesture with other gesture? -

how can compare (verify) gesture other one? captured gestures in sd card , want compare user drawed gesture captured gestures 1. first have import gesture file sdcard: adb devices #this give connected devices adb -s devicenamegivenbythepreviouscommand pull /sdcard/gestures desktop/ 2. follow tutorial !

parsing - How to receive JSON in server side i am receiving it as string instead -

i doing project in android,from client need send data json working perfect,on server side using j2ee receiving result string,how can result json or how can convert in json on server side storing in db.thanks!! you can use : jsonarray jsonlinkarray = new jsonarray();

jsonschema - "required" keyword in JSON schema -

i got below schema http://json-schema.org/examples.html , want know if required keyword can come @ top level. or can come within properties if there property of type object.i not find thing related in specification http://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.3 . { "title": "example schema", "type": "object", "properties": { "firstname": { "type": "string" }, "lastname": { "type": "string" }, "age": { "description": "age in years", "type": "integer", "minimum": 0 } }, "required": ["firstname", "lastname"] } so below example valid schema { "title":"example schema", "type":"object&quo

javascript - show and hide divs on timer -

i have list of divs <div id="container_dc"> <div class="slide" id="slide_1"></div> <div class="slide" id="slide_2"></div> <div class="slide" id="slide_3"></div> <div class="slide" id="slide_4"></div> </div> each div has background image. i want show , 1 div @ time starting first, , show each 4 second before hiding , showing next. i cannot use jquery! want simple possible. what best way go this? code appreciated.. something along these lines: var container = document.getelementbyid("container_dc"), children = container.childnodes, show=-1; window.setinterval(function() { if(children[show]) children[show].display='hidden'; show=show+1; if(show==children.length) show=0; children[show].display='block'; next=(next+1); },4000); the code documenta

sql server - Indexed view usability -

i have indexed view: create view ptv.vw_mokiniai_2 schemabinding select t1.year_name, t2.person_id, t2.year, t2.person_position, count_big(*) [aggregated number] table1 t1 inner join table2 t2 on t1.year = t2.year group t1.year_name, t2.person_id, t2.year, t2.person_position with unique clustered index on columns t1.year_name, t2.person_id, t2.year, t2.person_position i need query optimizer use indexed view on query select t1.year_name, count_big(distinct t3.person_id) [persons_per_year] table1 t1 inner join ( select t2.person_id, t2.year, t2.person_position table2 t2 group t2.person_id, t2.year, t2.person_position ) t3 on t1.year = t3.year group t1.year_name the query must derived table, because cognos generates query , not want edit multidimensional model. have idea how done? maybe way optimize query remove de

android - I work on my Gas_Station finder Mobile Application -

i want start button goes page gets user nearest gas_stations according gps "user's locaion" , start ?any there tutorial can understand flow of work ? you should using google's maps api version 2.0. here old answer this: android google maps v2 nearby gas stations , longitude , latitude of station draw route it

shell - concatenate ordered files using cat on Linux -

i have files 1 n, following: sim.o500.1 sim.o500.2 . . . sim.o500.n each file contains 1 line. want concatenate them in order 1 n . i tried cat sim.o500.* > out.dat . sadly not work if e.g. n larger 9, because concatenates sim.o500.1 followed sim.o500.10 and not sim.o500.1 followed sim.o500.2 . how can loop through file names using numeric order? since * expands in non-numeric-sorted way, you'd better create sequence seq : way, 10 coome after 9 , etc. for id in $(seq $n) cat sim.o500.$id >> out.dat done note use seq able use variable indicate length of sequence. if value happens fixed , known beforehand, can directly use range expansion writing n value like: for id in {1..23} .

jquery - passing datatable page number to webservice -

i'm working datatables , jquery. i populating table result of web service. web service needs have limit clause in associated query there many results page takes long load. so goal use page numbers in webservice call where: if click page 2, posting 20,40 limit, if click page 3 posting 30,50. so the: page number clicked * 10 starting range , page number clicked * 10 + 20 finishing range of limit clause. however pagenumbers displayed based on number of results, , if post webservice limit of 0,20 there 20 results , page numbers @ bottom of table not have 2,3,4 etc. options 20 rows returned. is there way around this? is there better way of implementing want achieve? some code: $(document).ready(function() { tableallocation('<?php echo $_session['authcode']?>'); $('#table_id').datatable( { "pagelength" : "20", "order": [[ 0, "asc" ],[1, "asc"]] }); }); where

php - Why is the <li> not lined up -

does know why below css <li> not aligning correctly? should 5 in each row per 2nd row of them. movie <li> http://i57.tinypic.com/9gd2l5.png css #movies { margin:0 auto; width:690px; } #movies ul { background-color:#222; border-radius:10px; text-align: center; display:inline-block; margin:0 auto; padding-left:10px; padding-top:10px; } #movies ul li { float:left; width:115px; padding: 5px 5px 20px 5px; list-style-type: none; } #movies ul li a{ text-decoration:none; display:block; padding:10px; color:#fff; } #movies ul li a:hover{ background-color:#111; } code <div id="movies"> <ul> <?php foreach($movietitle $movie) { echo '<li>'; echo '<img src="' . $movie->image . '" />'; echo '<div class="cfff">' . $movie->movie_name . '</div>'; echo '<div class="s11 c999">rating: ' . round($movie->rating) . '</div>'; ech

android - Map is not showing in app installed from playstore -

i strange problem. app available on play store. when app install eclipse, map showing. while @ same time, if app install play store, map not seen. not know make mistake. please help. link app - https://play.google.com/stor/apps/details?id=netleon.sansar.childsafeapp with eclipse have debug keystore, google play store have different key store. api key needs match keystore have used sign application.

rust - How do I automatically clear an attribute in a struct when it is moved? -

i have struct struct test { list: vec<u64> } and method in vector , erase list field empty vec fn get_list(&self) -> vec<u64> { let list = vec::new(); item in self.list.drain() { list.push(item); } list } it there approach doing it? autoreinit field on moving value, example: fn get_list(&self) -> ???<vec<u64>> { self.list } here solution, can test on rust playground (sadly share button doesn't work me atm). use std::mem; #[derive(debug)] struct test { list: vec<u64> } impl test { fn get_list(&mut self) -> vec<u64> { let repl = mem::replace(&mut self.list, vec::new()); repl } } fn main() { let mut r = test { list : vec![1,2,3] }; print!("r : {:?} ", r); print!("replace : {:?} ", r.get_list()); print!("r : {:?} ", r); } you need run mem::replace ( docs ) on mutable value , replace

android - change fragment by swiping or pushing button differences -

Image
i have activity has 3 fragments. when i'm switching fragments swiping ok. on fragment 2 have button must set current fragment fragment 1 . pushing button changes fragment problems expressed in pics when normal on . similar normal 1 . works correct on devices higher performance. how solve problem , problem connected? button listener onclicklistener btnlistener = new onclicklistener() { @override public void onclick(view v) { ((mainactivity)getactivity()).changefragment(2); } }; also here info mainactivity mainactivity extends fragmentactivity implements clfragment.onfragmentinteractionlistener, fmfragment.onfragmentinteractionlistener and private class screenslidepageradapter extends fragmentstatepageradapter { public screenslidepageradapter(fragmentmanager fm) { super(fm); } @override public fragment getitem(int position) { if (position == 0) { ret

c# - WPF Image RenderOptions.BitmapScalingMode.LowQuality consumes 10x more memory than HighQuality -

Image
i have image 5k x 5k pixels. image contains layouttransform scaletransform. <image x:name="image" source="{binding imagesource, mode=oneway}" width="{binding imagewidth, mode=oneway}" height="{binding imageheight, mode=oneway}" visibility="{binding imagevisibility, mode=oneway}" renderoptions.bitmapscalingmode="highquality" renderoptions.edgemode="aliased"> <image.layouttransform> <scaletransform scalex="{binding scalevalue, mode=oneway}" scaley="{binding scalevalue, mode=oneway}"/> </image.layouttransform> </image> since scaling image slow due highquality option, decided set lowquality during scaling process. turns out lowquality option consumes more memory highquality can see in screenshot. renderoptions.setbitmapscalingmode(image, bitmapscalingmode.lowquality); //reduce quality during resize improve performance (or not :() the memo

javascript - How to hide scroll bar but want to it keep working -

here code #scroll{ overflow-y:scroll; max-height:500px; width:267px;} i explored on stackoverflow , got many answers explained 2 conatiners in html have 1 div , want apply on that. thanks you should parent child approach recommended one. give element scroll bars, wrap in containing element, , make containing element element smaller, , give it: overflow: hidden; in current scenario can pure css. hide scroll bars in webkit-based browsers (chrome , safari). .element::-webkit-scrollbar { width: 0 !important } hide scrollbars in ie 10+. .element { -ms-overflow-style: none; } hide scrollbars in firefox, has been deprecated. .element { overflow: -moz-scrollbars-none; } jsfiddle

sql server - How to pass a parameter to an SQL script to change argument 2 of DATEADD() in VB.net? -

i trying send parameter drop down box sql server script change argument 2 of dateadd() : select distinct orders.order_id, customers.first_name, orders.order_date, payment_details.card_name, payment_details.card_type, payment_details.customer_id orders inner join customers on orders.customer_id = customers.customer_id inner join payment_details on orders.payment_id = payment_details.payment_id (orders.order_date < convert(varchar(20), dateadd(d, convert(dec, @date), { fn curdate() }))); and in turn populate grid view results: protected sub button1_click(sender object, e system.eventargs) handles button1.click dim orderhistorysearch new allin1idtableadapters.orderstableadapter gridview1.datasource = orderhistorysearch.getdatabyorderhistory(me.dropdownlist1.text) gridview1.databind() end sub end class however getting error stating: failed convert parameter value string dat

error handling - Exceptions in PHP - set_exception_handler output -

i'm starting use set_exception_handler now. first place tested try/catch block pdo layer. i forced exception incorrect database credentials. (this before applied <?php function log_exception($exception){ print_r($exception); } set_exception_handler("log_exception"); try { $dbh = new pdo(); $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception); echo "connected!! \n"; } catch (pdoexception $e) { print_r($e); // let's see looks throw new exception($e); } ?> you'll see print_r inside catch , in log_exception function. this gets displayed print_r($e) : pdoexception object ( [message:protected] => sqlstate[28000] [1045] access denied user 'localhost'@'127.0.0.1' (using password: yes) [string:exception:private] => [code:protected] => 1045 [file:protected] => /var/www/html/test.php [line:protected] => 35 [trace:exception:private] =>

java - Is there an opposite for the DelayQueue? -

i need queue automatically remove elements older given amount of milliseconds - basically, want items in queue expire after time. i see there delay queue seems doing opposite: 'an element can taken when delay has expired.' (i've never used it). maybe there queue implementation need? better if bounded. if want remove expired objects need delayqueue , thread extract expired objects it, this: static class wrapper<e> implements delayed { e target; long exp = system.currenttimemillis() + 5000; // 5000 ms delay wrapper(e target) { this.target = target; } e get() { return target; } @override public int compareto(delayed o) { return 0; } @override public long getdelay(timeunit unit) { return unit.convert(exp - system.currenttimemillis(), timeunit.milliseconds); } } public static void main(string[] args) throws exception { final delayqueue<wrapper<integer>>

swift - One SearchBar for loading URL and searching -

i'm searching how can when searchbar see it's url , go url instead of searching on google. example, when write www.twitter.com in searchbar, webview load twitter instead of searching, search still available same searchbar. my code : func searchbarsearchbuttonclicked(searchbar: uisearchbar!) { searchbar.resignfirstresponder() var text = searchbar.text text = text.stringbyreplacingoccurrencesofstring(" ", withstring: "+"); var url = nsurl(string: "http://google.com/search?q=".stringbyappendingstring(text)); var req = nsurlrequest(url:url!) self.webview!.loadrequest(req)

Android v7 Support Library attr referencing -

i have been using answer https://stackoverflow.com/a/11253806/2014236 style activity dialog theme looks alertdialog. use 'attr's available in support library. how reference android.support.v7.appcompat.r.attr version of buttonbarbuttonstyle instead of android.r.attr 1 used here: <button style="?android:attr/buttonbarbuttonstyle" android:layout_height="wrap_content" android:layout_weight="wrap_content" android:text="button" /> i have tried use style="?android.support.v7.appcompat:attr/buttonbarbuttonstyle" returns error: error: no resource found matches given name (at 'style' value '?android.support.v7.appcompat:attr/buttonbarbuttonstyle') despite being in specified package shown here: https://developer.android.com/reference/android/support/v7/appcompat/r.attr.html#buttonbarbuttonstyle . what correct format using non-android attrs/styles? looks works well.

javascript - hyperlinks in force-directed just won't work -

context : need force-directed graph have labels pointing urls. i reusing these examples : http://bl.ocks.org/mbostock/4062045 hyperlinks in d3.js objects, part 2 my file : <!doctype html> <meta charset="utf-8"> <style> .node { stroke: #666; stroke-width: 1.0px; } .link { stroke: #ccc; } .node text { pointer-events: none; font: 12px sans-serif; } </style> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script> //constants svg var width = 900, height = 600; //set colour scale var color = d3.scale.category20(); //set force layout var force = d3.layout.force() .charge(-100) .linkdistance(100) .size([width, height]); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); // read json file d3.json("collection_url.json", function(error, graph) { force.nodes(graph.nodes)

java - Creating GUI with using border layout Swing -

Image
i'm trying create gui java. gui simple. can see want here : http://sketchtoy.com/64839370 in order that, have decided use borderlayout suggested on web. have 2 jpanel object , have put them jframe layout borderlayout. can see simplified code below : private display display= new display(); // display extends jpanel public simulation() { super(); // frame settings settitle("label of jframe "); setdefaultcloseoperation(exit_on_close); setbounds(100,100,1094,560); contentpane=this.getcontentpane(); setresizable(false); contentpane.setlayout(new borderlayout()); try { leftpanellogo=imageio.read(new file("logo.png")); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } // generate left panel (information panel) leftpanel=new jpanel(){ @override public voi

c# - optional parameter: reversed precedence if override of overload exists -

Image
i wonder following behavior: public class { public virtual void do() { console.writeline("a"); } } public class b : { public override void do() { console.writeline("b override"); } public void do(int value = 0) { console.writeline("b overload"); } } class program { public static void main() { new b().do(); // ---> console: "b overload" } } i expect overload exact signature has precedence on overload optional parameters: expect "b override" in console. instead program writes "b overload" console. even resharper fails , falls trap: ... resharper says overload optional parameter hidden overload exact signature, in fact contrary. now, if remove inheritance, behaves expected , resharper warning legitimate: public class b { public virtual void do() { console.writeline("b override"); } public void do(int value = 0) { console.writeline("b overload"); } } c

Best place to enable lazy loading in entity framework 6 -

what best place keep lazyloading enable condition in web application. because when using database first approach of ef , when try update context setting got wiped out. below settings. public dbentities(): base("name=dbentities") { this.configuration.proxycreationenabled = true; this.configuration.lazyloadingenabled = true; } what best way these setting should not vanish after edmx update. there chance keep in global.asax. if yes downsides?. your placement looks fine. note, gert arnold has stated, these defaulted true . so, public dbentities(): base("name=dbentities") { } is need sake of brevity here, excluding explicitness.

c++ - how to read command output line by line in gcc in windows just as with the standard input? -

this tried: #include <iostream> #include <string> int main(int argc, char const *argv[]) { using namespace std; (string cin_line; getline(cin, cin_line);) { cout << cin_line << endl; } file* pipe = popen("app.exe", "r"); (string result_line; getline(pipe, result_line);) { cout << result_line << endl; } pclose(pipe); return 0; } it doesn't compile, result is: no matching function call 'getline(file*&, std::__cxx11::string&)' second example i've found here: https://stackoverflow.com/a/10702464/393087 seems mingw doesn't have pstream included: fatal error: pstream.h: no such file or directory - edit: ok know, missed not gcc library, named separate download: http://pstreams.sourceforge.net/ i know how using buffer , whole output on single line (like here: https://stackoverflow.com/a/478960/393087 ) explode line \n , array, point here must provide output input comes

android - IOUtils writer error Java connect to GAE -

Image
i import writer apache. error occured when try using it. in url. i following on link: store image blobstore android client , retrieve blobkey , upload url store in datastore. - gae does know error? updated here full code: import android.os.bundle; import android.support.v7.app.actionbaractivity; import android.view.menu; import android.view.menuitem; import com.google.api.client.util.ioutils; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httpget; import org.apache.http.client.methods.httppost; import org.apache.http.entity.contenttype; import org.apache.http.entity.mime.multipartentitybuilder; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.util.entityutils; import org.json.jsonexception; import org.json.jsonobject; import java.io.file; import java.io.ioexception; import java.io

asp.net - How to Insert whole DataTable into Sql table At once in C# -

i have excel sheet (named $sheet1) , sql table(named users ) same formate given below id | username | firstname | lastname | dateofbirth | 1 | robert | robert | poinan | 1984 | 2 | joy | joy | rob | 1990 | i have read whole excel sheet data in dataset (named ' ds ') want insert whole dataset (which ' ds ') in sql table (which ' users ') i using loop (can use foreach loop) insert ' ds ' (dataset) rows 1 one users (sql table) table sqlconn.open(); (int = 0; < ds.tables[0].rows.count; i++) { sqlcommand cmd = new sqlcommand("insert [users] ([id],[username],[firstname],[lastname],[dateofbirth]) values(@id,@username,@firstname,@lastname,@dateofbirth))", sqlconn); cmd.parameters.addwithvalue("@id", ds.tables[0].rows[i][0].tostring()); cmd.parameters.addwithvalue("@username", ds.tables[0].rows[i][1].tostring()); cmd.parameters.addwithvalue("@f

eclipse plugin - XTEXT based DSL Save All before Build -

i have eclipse rcp dsl application. build option not work in case end user not save manually changed files. need find following : - can save dsl source file automatically when user click "build all" menu item. other hand have set "save before build" option programmaticaly thank alex there 'save automatically before build' option in preferences in 'general > workspace'. if option set build action like: iworkbenchwindow[] windows = platformui.getworkbench().getworkbenchwindows(); (iworkbenchwindow window : windows) { iworkbenchpage[] pages = window.getpages(); (iworkbenchpage page : pages) { page.savealleditors(false); } }

python - Why does numba have worse optimization than Cython in this code? -

i trying optimize code numba. problem simple cython optimization (just specifying data types) 6 times faster using autojit, don't know if i'm doing wrong. the function optimize is: from numba import autojit @autojit(nopython=true) def get_energy(system, i,j,m): #system array, (i,j) indices , m size of array up=i-1; down=i+1; left=j-1; right=j+1 if up<0: total=system[m,j] else: total=system[up,j] if down>m: total+=system[0,j] else: total+=system[down,j] if left<0: total+=system[i,m] else: total+=system[i,left] if right>m: total+=system[i,0] else: total+=system[i,right] return 2*system[i,j]*total a simple run this: import numpy np x=np.random.rand(50,50) get_energy(x, 3, 5, 50) i've understood numba @ loops may not optimize other things well. anyhow, expect similar performance cython, numba slower accessing arrays or @ conditional statements? the .pyx file in cython is: import numpy np cimport cython cimport numpy np d

mongodb - Mongo Data not expiring -

i'm trying insert record in mongo expires in sometime. getmessagescollection().ensureindex(new basicdbobject("createdat", 1), new basicdbobject("expireafterseconds", 10)); i insert data this map map = new hashmap(); map.put("_id", mongomessage.getobjectid()); // other code map.put("createdat", new date()); getmessagescollection().insert(converttodbobject(map)) the field createdat date , before inserting object looks this { "_id" : "551bf9b72bea951ecf53fc5f" , "createdat" : { "$date" : "2015-04-01t09:59:19.723z"} , ...} but record not getting deleted. can tell me i'm doing wrong? looks you're incorrectly creating date. check out how it's done here date = new date(); basicdbobject time = new basicdbobject("ts", now);

Python f.read not reading the correct number of bytes -

i have code supposed read 4 bytes reading 3 sometimes: f = open('test.sgy', 'r+') f.seek(99716) aaa = f.read(4) bbb = f.read(4) ccc = f.read(4) print len(aaa) print len(bbb) print len(ccc) exit() and program returns: 4 3 4 what doing wrong? thanks! you're assuming read not. documentation tells you: read(...) read([size]) -> read @ size bytes, returned string. it reads at most size bytes if need exactly size bytes, you'll have create wrapper function. here's (not thoroughly tested) example can adapt: def read_exactly( fd, size ): data="" remaining= size while remaining>0: #or "while remaining", if you'd newdata= fd.read(remaining) if len(newdata)==0: #problem raise ioerror("failed read enough data") data+=newdata remaining-= len(newdata) return data as mark dickinson mentioned in comments, if you're on wind

javascript - How can I disable dynamically an Angular directive? -

i'm working on project using angularjs (html5/css3). in main html file of project, there table fill dinamically using array of controller: controller manages section of html page in table contained. the html code of table this: <table class="col-md-12 col-sm-12 col-lg-12 display" id="tableidprocedures"> <thead> <tr> <th><span>code</span></th> <th><span>description</span></th> <th><span>quantity</span></th> <th><span>note</span></th> </tr> </thead> <tbody> <tr ng-repeat="procedure in procedures"> <td>{{procedure.codexamination}}</td> <td>{{procedure.descrexamination}}</td> <td contenteditable="true">{{procedure.quantityexamination}}</td> <td>{{procedure.noteexamination}}&l

Get highest percentage value from a column based on value from another column in mySQL -

i have query percentages of different values in specific column: select dma, count(*) / const.cnt *100 my_percent full_db3 cross join (select count(*) cnt full_db3) const group dma order my_percent desc limit 10; step one: need amend gives me top 10 values in column dma based on value of column. example, if value in column gender "f", top 10 values in column dma . (which doesn't work, of course). select dma, count(*) gender = 'female' / const.cnt *100 my_percent full_db3 cross join (select count(*) cnt full_db3) const group dma order my_percent desc limit 10; the above throws error, should point across. step 2 looping through columns , returning top 10 values in every column (not dma ) give value of specific column (e.g., gender = 'female'). what's best way this?

javascript - What is difference between these two self invoking functions -

this question has answer here: location of parenthesis auto-executing anonymous javascript functions? 4 answers both of these functions below self-invoking functions. can explain me difference between these two? i've looked around lot of places. i've not been able find anything. first type (function(){ console.log('hello world'); }()); second type (function(){ console.log('hello world'); })(); they're same. they're 2 different similar ways force js engine correctly interpret function expression. another way example +function(){ console.log('hello world'); }() the accepted convention put parenthesis around function expression : (function(){ console.log('hello world'); })();

html - CSS Hover works locally, but not on dev server -

the hover effect i'm trying achieve works wonderful locally, doesn't thing when uploaded our dev. environment. here html... <a class="circle" href="/portfolio">portfolio</a> now, css... .circle{ display:inline-block; width: 380px; height: 380px; line-height: 360px; text-align: center; background-color: #02193b; border-radius: 50%; font-size: 54px; box-shadow: inset 0 0 0 0 rgba(0,0,0,0.6), inset 0 0 0 10px #a09176, 0 0 10px rgba(0,0,0,0.3); transition: box-shadow 400ms ease-in-out; -ms-transition: box-shadow 400ms ease-in-out; -moz-transition: box-shadow 400ms ease-in-out; -webkit-transition: box-shadow 400ms ease-in-out; -o-transition: box-shadow 400ms ease-in-out; color: white; text-decoration: none !important; text-transform: capitalize; } .circle:hover { box-shadow: inset 0 0 0 0 rgba(0,0,0,0.6), inset 0 0 0 20px #a09176, 0 0 20px rgba(0,0,0,0.3); transition: box-shadow 400ms ease-in-out; -ms-transition: box-shadow 400ms ease

java - Issue with my app after Android 5.0.1 update. "SurfaceView" turns into transparent mode -

Image
i use slidemenu in app. “menu” in 1 fragment , “surfaceview” in another. when opening “menu”, preview disappears during camera movement , surfaceview turns transparent mode. using setzorderontop(true) - surfaceview doesn’t disappear, overlaps lot of elements, should on it. untill android 5.0.1 update fine. can give me advice? comment out hardware acceleration in managelayers method of slidingmenu. seems solution since surfaceviews don't work. com.jeremyfeinstein.slidingmenu.lib.slidingmenu edit function managelayers: //final int layertype = layer ? view.layer_type_hardware : view.layer_type_none; final int layertype = view.layer_type_none;

what is the difference between the using of viewData dictionary and viewData.Model in asp.net mvc -

i need help. please explain me difference between using of viewdata dictionary , viewdata.model in asp.net mvc. for example can write viewdata["list"] = list; and can write viewdata.model = list; so difference between them , when use each one; explanation example appreciated. viewdata.model way pass model object controller's action view. can use method ensure view's model strongly-typed, , can reference object using "@model" within view. @model.someproperty alternatively (and preferably), pass model object action view using "return view(t);" t = object. return view(myobject); lastly, using viewdata.["somename"] = someobject would loosely-typed object, , couldn't reference object using @model view. instead, you'd have cast viewdata model-type within view able reference it. example: // in action: viewdata["obj"] = someobject; // in view: var objdata = viewdata["obj"] m

scala - Scalaz nested Validation: could not find implicit value -

playing scalaz validationnel, have following nested validations trying flatten: import scala.xml.{nodeseq, node, elem} import scalaz._ import scalaz._ val duration: validationnel[string, int] = // ... val nodes: validationnel[string, nodeseq] = // ... val r: validationnel[string, list[mytype]] = (duration |@| nodes) { (d, ns) => val n: validationnel[string, list[mytype]] = ns.tolist.traverse[({ type l[x] = validationnel[string, x] })#l, mytype](extractmytype(_, d)) n }.flatmap(identity) // ... private def extractmytype(n: node, d: int): validationnel[string, mytype] = //... when compiling sbt, get: [error] myclass.scala:xx: not find implicit value parameter f0: scalaz.bind[scalaz.unapply[scalaz.apply,scalaz.validationnel[string,int]]{type m[x] = scalaz.validationnel[string,x]; type = int}#m] [error] val r = (duration |@| nodes) { (d, ns) => ^ i using sca

version control - IntelliJ and Mecurial: Viewing Locally Committed Changes Before Push -

does know how view locally committed changes in intellij mecurial before pushing them? seems can commit them , push through mecurial context menu. in intellij, modified files blue, deleted (and untracked) files red, , new files green. after add them commit color coding should reset because looking @ latest commit differences. alternatively can right click on file, move git (and presumably mercurial) , click of "compare" options

c# - Parser Error with HIVE ODBC -

i'm writing code in c# invoke hive script via odbc. i'm using hortonworks hive odbc driver (though i've tried several others , same error). can connect fine via odbc , simple commands work (for example select * mytable limit 10; should). run trouble longer scripts have processing have multiple 'chunks' of sql (each terminated semi-colon). example, first statement creates temp table, next inserts it, maybe select different table, etc, typical sql. keep getting following error on line specifies s3 location file parser error: error while compiling statement: failed: parseexception line 8:85 missing eof @ ';' near ''s3n://somebucket/somefolder/etc' here's example of failing: create external table if not exists mytesttable( id int, anotherid int, name string ) row format delimited fields terminated '\t' lines terminated '\n' location 's3n://somebucket/somefolder/etc'; ...script continues here next chu

python - Running fig = plt.figure() in pandas opens two figures -

pretty says in title.. pandas examples suggest doing fig = plt.figure() before df.plot(..) . if that, 2 figures pop after plt.show() - first empty , second actual pandas figure.. ideas why? on dataframe, df.plot(..) create new figure, unless provide axes object ax keyword argument. correct plt.figure() not needed in case. plt.figure() calls in pandas documentation should removed, indeed not needed. there issue this: https://github.com/pydata/pandas/issues/8776 what can ax keyword eg: fig, ax = plt.subplots() df.plot(..., ax=ax) note when plotting series, default plot on 'current' axis ( plt.gca() ) if don't provide ax .

C++ Place an image on top of another image in a certain location -

Image
i'm looking way place on image on top of image @ set location. i have been able place images on top of each other using cv::addweighted when searched particular problem, there wasn't posts find relating c++ . quick example: 200x200 red square & 100x100 blue square & blue square on red square @ 70x70 (from top left corner pixel of blue square) you can create mat points rectangular region of original image , copy blue image that: mat bigimage = imread("redsquare.png", -1); mat lilimage = imread("bluesquare.png", -1); mat insetimage(bigimage, rect(70, 70, 100, 100)); lilimage.copyto(insetimage); imshow("overlay image", bigimage);

templates - Is this code from old Alexandrescu's C++ book valid? -

i reading old alexandrescu's book c++ templates , came across following code snippet explained abstractfactory pattern implementation (chapter 9.3). here is: template <class, class, class> class genlinearhierachy; template <class, class> class opnewfactoryunit; template <class> class reverse; //definitions template < class abstractfact, template <class, class> class creator = opnewfactoryunit class tlist = typename abstractfact::productlist > class concretefactory : public genlinearhierarchy< typename tl::reverse<tlist>::result, creator, abstractfact> //here. { public: typedef typename abstractfact::productlist productlist; typedef tlist concreteproductlist; }; i don't why code valid. didn't defined tl anywhere in snippet. no, code you've posted not correct. there's few typos aren't relevant i'll mention them. may in book or maybe made when posted this. don't have book ca

Permission directive in AngularJS -

let's want have directive checks permission. coud this: <a permissions="something.delete">delete</a> if "something.delete" in list of allowed permissions nothing rendered. having code: link: function (scope, element, attrs) { var permissionspromise = permissionservice.checkforpermissions(attrs.permissions); permissionspromise.then(function(result) { if (result=== false) { element.remove(); } }) } but because permissionservice.checkforpermissions() returns promise, may take time figure out permissions, meanwhile link function render a-element before knowing result of permission-check. what proper solution fix issue? reverse logic , hide element default , show based on promise value. something along lines of elem[0].style.display = 'none' -> elem[0].style.display = 'block' ask real goal, aren't implementing permissions checking on client-side (or shouldn't be). should m

xcode - WatchKit Invalid Binary -

i have uploaded app update watchkit extension keeps saying "invalid binary" in itunes connect. need tell itunes connect should include watchkit app anywhere? i checked email itunesconnect , issue app icons had alpha channel. corrected icons , works fine.

java - How can i add classes to classpath with gradle? -

i had spring mvc project xml configurations base, , change java code ones. problem is, have applicationcontexttest there specifics configurations test. when run gradle test fail error: /home/karim/workspace/spring-project/src/test/java/org/my-com/my-project/services/phoneservicetest.java:13: error: package config not exist import config.applicationcontexttest; ^ /home/karim/workspace/spring-project/src/test/java/org/my-com/my-project/services/phoneservicetest.java: error: cannot find symbol @contextconfiguration(classes=applicationcontexttest.class) ^ i think understand error means, there no config package in classpath right? the applicationcontexttest class @ src/test/resources/config . how can fix this? the resources folder for... resources (images, properties files, etc.). source files go in src/test/java .

export - How to provide a function in a Racket environment on the Raspberry Pi? -

i want execute program (written in racket) on raspberry pi when doing so, doesn't know functions defined in file. the small example below gives rise following error on raspberry pi : default-load-handler: expected 'module' declaration "test", found: else in: ... file i'm executing on raspberry pi : (require "test.rkt") (display "2 + 2 = ") (display (plus 2 2)) the "test.rkt" file : (provide plus) (define (plus b) (+ b)) when executing file doesn't display gives rise error listed above. note files don't contain : "#lang racket". because if contain it, loading file nothing. so following file nothing when loaded on raspberry pi : #lang racket ; when omitting "hello world!" displayed, else not (display "hello world!")

python - How do I draw a colourbar for basemap etopo? -

Image
basemap has etopo method draws etopo1 global relief image , suitable use background. uses blue tones bathymetry, greens , browns dry land areas, , white ice caps. poster produced noaa ( 290 mib pdf ) includes colourbar illustrating those. there builtin or otherwise simple way include colourbar within basemap? low-resolution sample obtained noaa

ruby on rails - jQuery Event listeners not working on Heroku Production -

so have small problem driving me nuts. i have rails 4 app utilizes jquery event listeners. these working great on development , staging. when push production aren't getting set. it worth mentioning 'staging' cedar-14 app on heroku 'production'. the difference being rails_env = 'staging' instead of 'production'. if initialize listeners using console, work great. changing production rails_env 'staging' listeners work too. my production.rb , staging.rb identical. right assets not being uglified or , far can see, being served client in identical fashion. so question getting set rails_env in production preventing of '$.on' listeners getting set? the versions jquery 1.11.1 rails 4.1.4 ruby 2.2.0 turbolinks 2.3.o double check order of gems in application.js //= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require turbolinks next step, make sure minification not causing issue. add g

clojure - Cider's nREPL is messing up my Set literals -

when try type in clojure set literal in nrepl adding space between '#' , '{' such nrepl stacktraces when hit return @ end of line. ; cider 0.8.2 (java 1.7.0_71, clojure 1.6.0, nrepl 0.2.6) user> ;; if type '#{' try , start set literal jacks in space user> ;; between # , { such form becomes invalid. user> ;; how stop bad behavior? user> # {"one" "two"} runtimeexception reader tag must symbol clojure.lang.lispreader$ctorreader.invoke (lispreader.java:1162) user> ;; wanted was... user> #{"one" "two"} #{"two" "one"} user> what's causing , how stop it? i don't know if .emacs.d/init.el matters, pretty lean regarding cider configuration... ; 2015-03-30 more clojure support (add-hook 'clojure-mode-hook 'paredit-mode) (add-hook 'cider-repl-mode-hook #'paredit-mode) (add-hook 'cider-repl-mode-hook #'rainbow-delimiters-mode) i'm new clojure t

batch file - "_ was unexpected at this time" error -

i made batch file, , put in code: if %var% == _,_,_ set var=%s1le1%,_,_ when tried batch file, said "_ unexpected @ time" %var% = _,_,_ %s1le1% = b can me? try : if "%var%" == "_,_,_" set "var=%s1le1%,_,_" , standard delimiter , when found if after comparison expression taken end of if. quotes should compare whole strings.

javascript - webgl manipulating two textures on one square -

i saw yesterday @ http://www.buzzfeed.com/kellyoakes/space-pictures-that-will-actually-make-you-think#.lhw29d3bmv the first image has 2 textures can slide mouse , forth change boundary of 2 textures. thought looked interesting , wanted try it. my thoughts are, need draw 2 squares , update vertices every time mouse moves , reset buffer these new points? seems there might easier , more efficient way thought i'd see if had ideas. using plain html 1 way, suggested lj_1102, , needs, maybe simpler 1 too. the process create effect webgl follows: create canvas, draw 1 square (two triangles in total) on entire canvas, take mouse position on canvas , calculate percentage of how far left/right 1 of edges; , square use fragment shader similar 1 bellow. uniform float percentage; uniform vec2 canvas_size; uniform sampler2d left_image; uniform sampler2d right_image; void main() { vec2 uv = gl_fragcoord.xy/canvas_size; if ( uv.x<=percentage ) gl_fragcol

Add Description Blogger -

i wonder how add blog description in template specific location. <data:blog.description /> returns nothing. how description of blog? it may helps you.. <meta expr:content='data:blog.metadescription' itemprop='description'/> <b:else/> <!-- show if meta description post page not active--> <meta expr:content='data:blog.pagename + &quot; - &quot; customized meta description here .&quot;' name='description'/> </b:if>

ios - How to use the selected value in UIPickerView -

new this, trying create simple app user selects birth year , corresponding variable shown. i'd @ibaction func get variable birthyear uipicker @ bottom. set datasource , delegate uipicker viewcontroller in connections inspector panel. class viewcontroller: uiviewcontroller,uipickerviewdelegate { var years = ["1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999"] let nineone = "24" let ninetwo = "23" let ninethree = "22" let ninefour = "21" let ninefive = "20" let ninesix = "19" let nineseven = "18" let 0 = "17" @ibaction func get(sender: anyobject) { if birthyear <= 1991 { println(nineone) } else if birthyear == 1992 { println(ninetwo) }else if birthyear == 1993{ println(ninethree) } else if birthyear == 1994{ println(nine

android - Two AlertDialog, onCancel, and "Attempt to finish an input event, but the input event receiver has already been disposed. " -

i have code showing dialog account picker. dialog reached clicking button 'authenticate' in alertdialog dologindialog . accountpicker = new alertdialog.builder(this) .settitle(getstring(r.string.common_select_an_account)) .setadapter(new arrayadapter<string>(this, android.r.layout.simple_list_item_1, name), new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { if (which < availableaccounts.length) { final account chosenaccount = availableaccounts[which]; authenticator.verifyaccount(chosenaccount, mainactivity.this); } else { authenticator.addnewaccount(mainactivity.this); } }}).create(); accountpicker.setcancelable(true); accountpicker.setcanceledontouchoutside(true); accountpicker.setoncancellistener(new dialoginterface.oncanc

regex - Refactor out explicit getters and setters in Objective C -

i refactoring objective-c code remove explicit getters , setters. so this: [instance member] [instance setmember:value] should become this: instance.member instance.member = value currently working on regex this, if has solved already, i'd appreciate taking advantage of else's work. to have [instance setmember:value]; calls translated instance.member = value; , use xcode's refactoring: edit > refactor > convert modern objective-c syntax . convert getters if applicable, variable = [instance member]; calls variable = instance.member; syntax. i might misunderstanding intention, i'd point out use of instance.member; bad style if you're not assigning value variable . if you're calling method because of it's side-effects, use [instance method]; instead make intention more clear. use dot-syntax read , write properties avoid confusion. xcode 6.3 warns if you've got method/property returning value , you're calling getter

C what % symbol to access arrays? -

i'm trying access single row of multidimensional array. however, keep getting following error message: format specifies type 'int' argument has type 'int *'. assume it's saying there's particular format arrays; symbol use access them if not %i? #include <stdio.h> int main(void) { int matrix1[5][4] = {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}, {17,18,19,20}}; printf ("%i",matrix1[0]); return 0; } you accessing first row of array converted type int * that's reason of compiler's message. if want print whole row can try with int i; (i = 0 ; < 4 ; ++i) printf("%d ", matrix1[0][i]); /* ^ index specify integer array */ printf("\n"); if want first row , first column of array try printf("%d\n", matrix1[0][0]);

rubygems - How to extract hyperlink address from excel cell using spreadsheet gem in ruby? -

i have tried retrieving data excel sheet cells. retrieve general text each cell. couldn't hyperlink address cell. used spreadsheet gem ruby. have used below code read excel sheet. book = spreadsheet.open('c:\downloads\callstreetdata.xls') sheet1 = book.worksheet(0) rowarray = array.new sheet1.each |row| puts row.join(',') rowarray.push(row.join(',').href) end puts rowarray i need solution ruby , spreadsheet gem here work print out both text , links: book = spreadsheet.open('c:\downloads\callstreetdata.xls') sheet = book.worksheet(0) sheet.rows.each |row| row_text = row.join(",") row_links = row.to_a.map |cell| cell.respond_to?(:href) ? cell.href : "" end.join(",") puts(row_text) puts(row_links) end

iphone - Present a rotatable view controller over another view controller locked to portrait orientation on iOS 8 -

i have fullscreen view controller, let's call background view controller, root view controller. want present view controller on top of it, in foreground, doesn't fill screen. i've done using self.presentviewcontroller() foreground view controller's modalpresentationstyle set overcurrentcontext . my problem want background view controller stay locked portrait, , want foreground view controller able rotate device. far i've been able rotate foreground view controller, background view controller rotates it. both view controllers control uiscrollviews, if make difference. i've tried overriding supportedinterfaceorientations() , setting portrait , all background , foreground view controller respectively, results in nothing rotating @ all. i've tried playing shouldautorotate() didn't help. how can accomplish this? in advance.

javascript - how to to make first tab active when I have static tab angularjs UI -

just want ask if have static tab dynamic created tabs. want make first tab of created dynamic tabs selected "active" default. tried using active select last tab code <tabset> <tab active="tab.activate" data-ng-repeat="tab in countytabs" heading="{{tab.countyname}}" data-ng-click="tab.activate = true;activatedepartmentgroupandselectbuttonsettingforcounty(tab)" select="selectalluserbycounty(tab.countyid)"> </tab> <tab heading="queue extensions"> <div data-ng-include="'/app/reception/queueextensions.html'"></div> </tab> </tabset> this unclear how data set in controller, it's difficult point error listed part of code looks good. i have simulated situation in plunker , working code looks like: // in controller $scope.tabs = [ { title:'dynamic title 1', content:'dynamic content 1', active: true }, { title:'