Posts

Showing posts from May, 2013

treeview - Is there a way to not display empty TreeCells in JavaFX? -

Image
my treeview displayed though there no treeitems in it. there way not display treecells before have corresponding treeitem display? this how looks without items: this how looks when 1 item added root: thanks suggestions :) i think can not prevent empty treecell s being added treeview , if care appearance, can define different style empty cells. empty cells have :empty pseudo class, can use in css: .tree-cell:empty { -fx-background-color: transparent; }

html - Create an image button that allows you to only click the non-transparent part -

i have wierdly shaped image on photoshop file. made background transparent. made file image button on website. problem can still click transparent part of image when on site. want able click part isn't transparent image button. have tried html mapping did not work me because when clicked portion have mapped blue line comes annoying. any tips extremely helpful. have been stuck on issue few days here link image created: http://picpaste.com/thebestthingever-s3llpupk.jpg the blue line appears, sounds dotted line when button has focus. if problem, can solve using bit of code :focus { outline: 0; -moz-outline-style: none; }

java - CSS and JS are not rendered when index.jsp is set as welcome file -

i facing problem in jsp-servlet, when setting index.jsp welcome-file (default page run first project gets run) @ time css , js files not rendered. project hierarchy this -projectname         -user              -css              -js              -index.jsp and when run project url in browser localhost:8080/projectname here index.jsp called without css , js files. edit: finally, had solved issue copying css , js root directory also. i.e. have css , js @ "user" "projectname". try context path, <link href="${pagecontext.request.contextpath}/css/style.css" rel="stylesheet" type="text/css"> will path of css file in css folder. or scriptlet , <link rel="stylesheet" type="text/css" href="<%=request.getcontextpath() %>/css/style.css"> however, not recommended use scriptlets in jsp.

javascript - Make a div's size and position the same as a video's -

i have html5 video width of 100% , height of 100% , , want wrap div fit size , position of video (not video tag, video itself) using necesary. [see fiddle] html: <div id="wrapper"></div> <video id="vid" controls preload="none" width="100%" height="100%" poster="http://video-js.zencoder.com/oceans-clip.png"> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'/> <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'/> <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg'/> </video> css: #wrapper{ width: 2px; height: 2px; border: solid 2px red; position: absolute; } js (jquery): setinterval(function(){ $("#vid").height($(window).height() - $("header").height() - 7); /*there header , bunch of other stuff...

php - Function file will not recognize included PDO database connection -

i have func.php file contains function gets user's details: require_once 'connection.php'; function getui($username){ $query = "select * usernames username = ?"; $sth = $pdo->prepare($query); $sth->bindvalue(1, $username); $sth->execute(); $result = $sth->fetch(pdo::fetch_assoc); return $result; } in connection.php have: require_once 'details.php'; $pdo = new pdo("mysql:host=" . $dabhost . "; dbname=" . $dabname ."", $dabusern, $dabpassw); and in details.php have: $dabhost = "localhost"; $dabname = "dab1"; $dabusern = "root"; $dabpassw = "root"; and ultimately, have userdetails.php has bunch of html code , displays results function getui() bring back. require func.php @ beginning: require_once 'folder1/func.php'; my directory looks this: rootfolder/userdetails.php rootfolder/folder1/details.php rootfolder/folder1/...

Getting names of all kernel modules used by a particular module -

in output of lsmod command, used by column not have name of kernel modules used module. example, consider following part-output of lsmod command: module size used xen_blkfront 16512 4 ext3 137007 1 jbd 54383 1 ext3 mbcache 7438 1 ext3 in above output, ext3 module used 1 module, name not there. similarly, xen_blkfront module used 4 modules, there no names modules. but, jdb , mbcache modules used ext3 module. so, there way these missing module names ? i need because kernel not allow me rmmod ext3 module saying "error: module ext3 in use". the "used by" column shows not number of referencing modules, numer of times any kernel code has taken reference module. for file systems , device drivers, typically happens when file/device opened. the source of references not tracked.

ajax - Basic Authentication fails in cordova ios -

i trying make ajax call basic authentication on hybrid mobile ios application. ajax call returns nothing hangs no success nor failure. same ajax call fires android. while checking outgoing request wireshark found authentication header missing , 401 returning server , on subsequent call authentication header send along request returns 301. but works android the same api working fine dev server in ios fails in prod server any suggestions appreciated i'm using cordova 4.2.0. i have observed in case of 401 response "www-authenticate: basic" header, ios/uiwebview seems swallow response instead of passing application layer, gives effect of service never responding. perhaps prevent authentication popups. in event behavior unexpected! edit: found cordova bug report problem: https://issues.apache.org/jira/browse/cb-2415

c# - Bundling javascript files in MVC 4.0 -

i'm trying bundle javascript files in web application increase performance. i'm trying load minified version of jquery example when run web application jquery not loaded. bundle config: public class bundleconfig { public static void registerbundles(bundlecollection bundles) { bundles.add(new scriptbundle("~/bundles/jquery").includedirectory("~/scripts/","jquery-1.8.2.min.js")); //also tried this: //bundles.add(new scriptbundle("~/bundles/jquery").include("~/scripts/jquery-1.8.2.min.js")); bundles.add(new stylebundle("~/content/css").include("~/content/site.css")); } } master page: @using system.configuration <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <meta name="apple-mobile-web-app-capable" ...

c# - OData routes return 404 Not Found -

i've started including odata in webapi2 project (currently hosted in iis8 express on dev machine). odata config class looks this: public class odataconfig { private readonly odataconventionmodelbuilder modelbuilder; public odataconfig() { modelbuilder = new odataconventionmodelbuilder(); modelbuilder.entityset<category>("category"); } public iedmmodel getedmmodel() { return modelbuilder.getedmmodel(); } } then added following in webapiconfig class: odataconfig odataconfig = new odataconfig(); config.mapodataserviceroute( routename: "odataroute", routeprefix: "myserver/odata", model: odataconfig.getedmmodel(), defaulthandler: sessionhandler ); and started basic controller , 1 action, this: public class categorycontroller : odatacontroller { [httpget] public ihttpactionresult get([fromodatauri] int key) { var entity = categoryservice.get(key); ...

ruby on rails - Net::HTTPBadResponse (wrong status line: "<html>") -

i using active admin save email templates. using mail gun send emails. the whole process works absolutely fine if define email boday text such as: body = "this text in email" if attempt use template made in active admin so: body = load_rendered_template("new_quote_email") i error: wrong status line: '<html>' the app using ssl have it? same error both in production , development.

iphone - UITabBarController inside UINavigationController works on iOS 8 but not 7 -

in ios 7 view controller in uitabbarcontroller in uinavigationcontroller , navigation bar covers content. in ios 8 not case, , items have constraints in relation top layout guide positioned. if embed each tab's view controller in uinavigationcontroller , looks in ios 7, in ios 8 there's white gap between navigation bar , content of view controllers. i understand apple explicitly forbids in documentation. uitabbarcontroller should not pushed onto uinavigationcontroller 's stack. effect want achieve: start app @ login screen (this root of uinavigationcontroller ). there no tab bar yet. if login successful, push new uitabbarcontroller onto stack. @ point, logged in user can switch between different parts of app switching tabs. is there workaround? or there different way achieve effect? couldn't find satisfactory way go it. ended restructuring app uitabbarcontroller root , login view controller presented modally initially.

delphi - Different cookie handlers for two chromium instances on one form -

i'm using dcef3 on delphi xe3. task is : create different cookie storages different tchromium instances. problem : i'm creating different icefcookiemanager instances each tchromium instances , returning in getcookiemanager event. example code: type tform1 = class(tform) button1: tbutton; button2: tbutton; chromium1: tchromium; chromium2: tchromium; procedure button1click(sender: tobject); procedure button2click(sender: tobject); procedure formcreate(sender: tobject); procedure chromium1getcookiemanager(sender: tobject; const browser: icefbrowser; const mainurl: ustring; out result: icefcookiemanager); procedure chromium2getcookiemanager(sender: tobject; const browser: icefbrowser; const mainurl: ustring; out result: icefcookiemanager); private { private declarations } cookiemanager: icefcookiemanager; cookiemanager2: icefcookiemanager; public { public declarations } end; var ...

How to include in CMake the files on which Eigen depends? -

i working on c project downloaded internet. trying add functions in eigen used linear algebra. to end, added following lines cmakelists.txt : pkg_check_modules(eigen3 required eigen3) include_directories(${eigen3_include_dirs}) link_directories(${eigen3_library_dirs}) add_executable(main main.c) target_link_libraries(main ${eigen3_libraries}) and no errors when running cmake . , make the issue when try include <eigen/dense> in 1 of c functions, following error when try make: /usr/include/eigen3/eigen/core:28:19: fatal error: complex: no such file or directory #include <complex> eigen/dense includes eigen/core , eigen/core includes <complex> think it's not looking in correct directory find complex ... how make there? eigen in c++ library, while application source c file ( main.c ). since has .c extension, cmake threats c source , use c compiler, doesn't know c++ standard library ( <complex> ). rename main.c main.cpp . ...

update from SSL 3.0 to TLS Paypal -

not sure if correct place ask question, received email paypal today i own ecommerce site in uk is major technical job webmaster do, ie charging me huge bill work wasnt fault. please advise. thanks. the issue related poodle attack vulnerability causing sslv3 versions bleed sensitive information. discovered in september 2014, , has affected technological companies. for reason, paypal has disabled sslv3 encryption, , have led upgrade system use newer version of tlsv1 encryption. i cannot answer need major technological job, however, need update system latest versions, or follow instructions provided here @ https://ppmts.custhelp.com/app/answers/detail/a_id/1182

matlab - Save output to another directory when output was made with cell2csv -

i using fileexchange code cell2csv save cell in code. i'd output file, csv file, saved different directory. how can done? here's current code saving cell: cell2csv([fname(13:16), '-', u_id{k}, '_24hrblkavg.csv'], site_data, '\t'); % cell2csv(filename,cellarray,delimiter) you can use fullfile construct path in system-independent way %// not put in 1 line, code should readable human: filename = [fname(13:16), '-', u_id{k}, '_24hrblkavg.csv'] filepath = fullfile(beetroot_folder, daughter_folder, subsubfolder, filename) cell2csv(filepath, site_data, '\t'); if need save in subfoder, use '.' current folder, or saving in sister folder use '..' parent folder: filepath = fullfile('.', filename)

javascript - Google Script: How to get Recurring Events from Google Calendar? -

there's popular script on various websites allows 1 export google calendar events google spreadsheet. works fine ... except not work recurring events. here's crux of code: var mycal = "sample@gmail.com"; var cal = calendarapp.getcalendarbyid(mycal); var events = cal.getevents(new date(startdate), new date(enddate)); then 1 needs iterate through members of 'events'. problem appears recurring events defined in way 'getevents' not understand. query of date range containing recurring events finds nothing. i'm wondering if has written code query recurring events? robert your assumption not correct, recurring events returned other ones. i don't know script use if can't recurring events guess script not good. i'm not going publish whole code here because version use bit long can make copy of spreadsheet , test yourself. https://docs.google.com/spreadsheets/d/1h0uayz7fachbnhifwwy-xyluomdsfkqblbrhcgnwthy/edit?usp=...

Cant run android emulator on mac -

when try run android emulator get: error: x86 emulation requires hardware acceleration! please ensure intel haxm installed , usable. but have installed sdk manager. i'm using mac , emulator try run platform:5.0, cpu: google apis intel atom x86. ideas? thanks if remember correctly, sdk manager doesn't install haxm though installed. downloads installer, must run install machine.

networking - What stops a TCP endhost from being a bad player? -

i'm talking congestion control specifically. in tcp, when host detects congestion via dropped packets or whatnot, it's supposed decrease flow improve network condition whole. however, couldn't bad host keep sending packets @ max rate @ cost of others? if there million hosts , 1 bad host, congestion can still largely avoided (because other hosts correctly implement congestion control algorithm), 1 bad host have advantage in terms of packet transmission rate. question is, there prevents host behaving selfishly such? yes, inadvertantly or deliberately broken tcp/ip stack cause harm , there lots of broken stacks out there. but, in case there conflicting interests in tcp stack: on 1 side want send fast possible on other side need have reliable delivery. latter means have buffer data until ack peer. if don't decrease bandwidth when packets lost loose more packets , have buffer them inside hosts until ack more , more increase memory usage of host.

html - PayPal form creation -

i'm having trouble form i'm trying create in paypal wordpress website. it's form allows different types of registrations , quantities - both of these work. @ end, client wants option donate amount - not working. the code @ bottom adding amount entered 'note' paypal, not actual monetary value amount being paid. i've tried 'name="amount"' well. <table> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input name="business" type="hidden" value="email" /> <input name="cmd" type="hidden" value="_xclick" /> <input name="item_name" type="hidden" value="camper registration" /> <input name="currency_code" type="hidden" value="usd" /> <!-- provide dropdown menu option field quantity. --> <tr> <td><input type="hidden" value=...

scala - Pattern for chaining together calls that take in Options -

i'm finding have chain functions work on option , return different option this: if(foo.isdefined) somefunctionreturningoption(foo.get) else none is there cleaner way this? pattern gets quite verbose more complicated variables. i'm seeing fair bit in form handling code has deal optional data. it'll insert none if value none or transformation (which potentially fail) if there value. this the ?. operator proposed c# . you can use flatmap : foo.flatmap(somefunctionreturningoption(_)) or in for-comprehension: for { f <- foo r <- somefunctionreturningoption(f) } yield r the for-comprehension preferred when chaining multiple instances of these functions together, de-sugar flatmap s.

image processing - How to assign a value to multiple cells in a n-dimensional array in Octave -

suppose have 3x3x3 3d-array called , 3x3 matrix called b, created following: a = zeros(3,3,3); b = magic(3); my intention turn elements @ 2nd , 3rd positions of a's 3rd dimension matrix b, like a(:,:,1) = a(:,:,2) = a(:,:,3) = 0 0 0 8 1 6 8 1 6 0 0 0 3 5 7 3 5 7 0 0 0 4 9 2 4 9 2 my first try make a(:,:,2:3) = b but following: error: a(i,j,...) = x: dimensions mismatch it feels strange me, since, instance, b(1,1:2) = 10 would produce correct result. how solve this? thanks in advance forget it, solved following: a(:,:,1:2) = repmat(b, [1 1 2]) :)

asp.net - How can I define the clientID (or other data) in a bearer / access token using OWIN -

i trying figure out how put clientid (or additional data might need) inside bearer/access token. i using owin oauth create tokens. can add claims identity ticket ecnrypted/serialized token , passed client. the client calls protected api , api de-serializes token , sets iprinciple user. identity object contains username, , scopes in claimsidentity. i additional information, such clientid made request token in first place. i can put data inside claim; works hack. i've done quite bit of searching , not sure how, if possible, store additional data inside bearer/access token. thanks in advance! you can store in authenticationproperties object code below: var props = new authenticationproperties(new dictionary<string, string> { { "as:client_id", (context.clientid == null) ? string.empty : context.clientid }, { "username", ...

python - The program can't start because msvcr90.dll is missing -

i have using 'pythonwin' build 218 64 bit windows 7 , using 'python 2.7.8' when run application msvcr90.dll missing error. when run dependency tool on exe see python 27.dll can find msvcr90.dll needs win sxs folder. pywintypes27.dll not able load same dll. tried running 'sxstrace'. produces binary trace file, when parse file produces empty output file ! i have installed vc++ redistribute , sp1. how find out version of side side dll pywintypes.dll dependent on. tried copying 64 bit versions of msvcr90.dll have in machine 1 one exe path, no luck. there way force use 1 of msvcr90.dlls ?

Magento, category, details button -

i'm trying teach myself magento, , basic programming. in product lists have, beside "add cart" button "details" button. has typo in label, , says "deta li s". i need fix this, can't find where/which file in. can point me in right direction? generally,product list layout came list.phtml file. file location:app/design/frontend/default/my_theme/template/catalog/product/list.phtml (or) please enable path hints via admin panel.it's show block paths. how turn on template path hints? to turn on template path hints in magento: log magento back-end admin go system -> configuration in main menu go developer on bottom left under advanced switch store view on top left current website or store view. under debug tab of same developer config page see new option appear allow turn on/off template path hints. remember clear cache.

javascript - Make a div slide in on load -

i have website have div header, menu, , content content div within own wrapper div. animate divs making header , menu appear fading in, , after fade animations complete, have content slide in left. ideally want use jquery make animations. how can this? any appreciated, thanks! this you, $('#hidden_div_id').slidedown('slow'); display:block should done along it. fiddle

javascript - Revert to initial active tab when mouse leaves area, or using JS in Zurb Foundation -

i want revert active tab when user moves mouse away menu. i have left top-level menu changes active tab on hover, using data-options="is_hover:true" when hovering on of tabs, displays second-level menu in place of main content (which displayed in tab, displayed default on page load). i want default content tab display whenever mouse leaves 1st or 2nd level menu area. alternatively, can make other elements detect mouse hover , use js command initial tag active. cannot find documentation on js should say, eg: $( ".detect" ).hover(function() { $( set tab1 active please }); in end did put default content out of tab own div (where tabs go). i made none of tabs active default in css. then used js deactivate active tabs on hover of element class "detect": $( ".detect" ).hover(function() { $(".content.active").removeclass( "active" ); $("li.active").removeclass( "active" ); }); ...

ruby - Using Net::SSH in an `initialize` block does not work -

i want connect remote server , run commands there. writing following ruby script , works fine. @hostname = "server_name" @username = "user" @password = "pass" @cmd = "ls -alt" begin @ssh = net::ssh.start(@hostname, @username, :password => @password) puts "#{@ssh}" res = @ssh.exec!(@cmd) @ssh.close puts res rescue puts "unable connect #{@hostname} using #{@username}/#{@password}" end but when try put same code in initialize block not working. below code that: def initialize(hostname, user, password) @hostname = "#{hostname}" @username = "#{user}" @password = "#{password}" begin puts "entered begin" @ssh = net::ssh.start(@hostname, @username, :password => @password) puts "#{@ssh}" res = @ssh.exec!(@cmd) puts "#{res}" # @ssh.close puts res rescue => e puts e puts "#{@ssh} unable connect ...

Jquery fileupload: upload a file to a new folder with name changed in php -

hi all: have challenge: im using jquery fileuploader php blueimp: https://github.com/blueimp/jquery-file-upload i'm modifying code implement uploader in web. can use correctly, documentation poor adds or mods: i'm trying modify file uploaderhandler.php create folder username(unique), don't know put mkdir() function... and want upload files changing names 1.txt,2.pdf,3.doc...etc,etc,etc any help? pd: i'm thinking 3 solutions: 1) put mkdir() function in login.php, , when user logs in, check folder exists , it's empty... , each time reloads .php files. not best solution, guess. 2) put mkdir() function in get_upload_path uploadhandler.php 3) put rename() function in get_unique_filename uploadhandler.php edit: tryied 2) option: modified uploadhandler.php. it works, create folder username, , put uploaded file in folder. in ajax don't receive response , , don't create response line: uploadhandler.php: function __construct($options = nu...

php - Laravel replace property with another if it is 0 -

i have 2 columns, price , offer_price. when call $products->price, bring offer_price if above 0, if not, return price. my modal: class product extends eloquent { protected $table = 'products'; public function type() { return $this->hasone('producttypes', 'id', 'type_id'); } public function brand() { return $this->hasone('productbrands', 'id', 'brand_id'); } public function image() { return $this->hasmany('productimages'); } public function toarray() { $ar = $this->attributes; $ar['type'] = $this->type; $ar['brand'] = $this->spec_brand; $ar['price'] = $this->price; return $ar; } public function getspecbrandattribute() { $brand = $this->brand()->first(); return (isset($brand->brand) ? $brand->brand : ''); } publ...

jquery - Loading static JSON from local FS or remote rails server -

i've looked @ several questions in , been lead in couple of directions have not bore fruit. here jquery/html: <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <body> <script> $(document).ready(function(){ alert ("hi"); $.getjson("/users/rabdelaz/desktop/actfast/pm-md.json",function(result){ //this version 1 //$.getjson("http://172.28.101.197:3000/tests.json",function(result){ //this version 2 alert ("file good"); }); });</script> </body> </html> first, tried open -a "google chrome" --args --allow-file-access-from-files (i'm on os x) before opening file. used version 1 as shown in code above part. gave me this: xmlhttprequest cannot load file:///users/rabdelaz/desktop/actfast/pm-md.json. cross origin requests support...

c# - ASP.net web forms app "on server" getting old data values using Entity framework -

i published asp.net web forms app on hosting server, after updating data in sql database using entity framework, app still returning old values . is possible , or i'm going crazy. the problem i'm using static datacontext in entity framework. huge mistake unit of work object. my references: should data contexts static? entity framework context static linq sql datacontext lifetime management

css - WordPress Twenty Fourteen theme 3rd level rollover goes off screen on small monitors -

i have client wants 3 levels of navigation in primary-navigation. (not recommending accessibility reasons.) problem third level sits right of second level , goes off screen when screen 1000 pixels wide or less. mitigate this, client third menu sit on left of 2nd (dropdown) menu. i'm having difficulty figuring out layer controls position of menu. clues appreciated! well, brain wouldn't let go, , realized needed search :hover. here correct layer in parent theme. .primary-navigation ul ul li:hover > ul, .primary-navigation ul ul li.focus > ul { left: -150px; } you can see effect on http://lincolnmontana.com/ . left overlapping 2nd level menu bit.

Conjunctions of disjunction in java -

is there way in java conjunctions of disjunctions of strings, i.e, example if have 2 string str1="a" , str2="c or d", "or" here disjunction. need output of conjunction of these 2 strings, i.e, , (c or d) = (a , c) or (a , d) is possible in java ?

osx - SWF not loading in browser on SX Yosemite -

Image
just question, have been using flash years , since have updated yosemite, cannot load swf files in browser on site, have been hahving issues html5 video, not play either. any thoughts? here page cannot see. locally or remotely. have contacted tech support hosting, , on pc on browsers technician said can see it...they encoded usual h:264 , aac audio. http://www.julianhunt.ca/ae.html#home and yes have been teaching , using flash 15 years , usual settings okay. it appears path issues between preloader, player, , content. it cannot load: http://www.julianhunt.ca/content.swf (404 not found) it's not yosemite, happens on mavericks , browsers. handling ioerrorevent in loaders provide visibility issues. perhaps refactored site, made updates, or changes web host placed different file permissions on assets host.

winapi - How to use Win32 API to specify directory to write file to using WriteFile? -

i've used following handle file: char *filepathandname = "c:\projects\pic.bmp"; handle hfile = createfile(_t(filepathandname),generic_write, 0, null, create_always, file_attribute_normal, null); and i've used following write file: writefile(hfile, (lpstr)&bmfheader, sizeof(bitmapfileheader), &dwbyteswritten, null); writefile(hfile, (lpstr)&bi, sizeof(bitmapinfoheader), &dwbyteswritten, null); writefile(hfile, (lpstr)lpbitmap, dwbmpsize, &dwbyteswritten, null); however, file writes project directory (i.e. microsoft visual studio solution file exists) rather c:\projects\ directory. how can write .bmp file specified directory? the _t() macro can used literals (same text() macro). , not escaping slashes in literal. the c runtime uses _t() macro. win32 api uses text() macro. should not mix them, though same thing. use correct macro api using. and don't need type-cast data lpstr when calling writefile() . use in...

angularjs - What's the difference between these watch expressions? -

scope property: $scope.$watch('foo', fn) $scope.$watch(function() {return $scope.foo}, fn) non-scope objects: $scope.$watch(obj.prop, fn) $scope.$watch(function() {return obj.prop}, fn) the pair non-scope objects produced different outcomes, in former expression didn't execute when obj.prop changed. why? $scope.$watch('foo', fn) this use $parse service watch value of $scope.foo , , compare old values against new. $scope.$watch(function() {return $scope.foo}, fn) this same first, uses lambda. function() {return $scope.foo} executed on each $digest , old return values compared return new. $scope.$watch(obj.prop, fn) this 1 weird , not-recommended, because behavior depends entirely on type of obj.prop . example if obj.prop === "foo" , same $scope.$watch('foo', fn) . if obj.prop === function(){ return math.random(); } got weird thing. if expecting angular $watch value of obj.prop changes obj.prop , wont w...

android - I want to decompile only xml files from apk without disturbing resources -

how decompile specific files apk file? want xml files decrypted without disturbing other code / resources. by using dex 2 jar can track apk file code. not able see native code completly or wont able see c code. atleast can see xml file when loaded in jd-jui. note: not ethics programmers if trying peek in other source code or other project files. programmers never unethical hacks. use resources intentions.

java - What if a HashMap is full? -

i know java hashmap has capacity , load factor parameter.so , if number of items in hashmap more capacity* load factor, new hashmap reconstructed.i have questions re-constructions of it: the previous hashmap reclaimed or still in use if reconstruction happened? since need larger size hashmap , , hash function changed ? for concurrenthashmap , if 1 thread inserting(of cource, insert operation has lead re-construction) , thread reading?for example, read old hashmap or new hashmap? the previous hashmap reclaimed or still in use if reconstruction happened? it's still same hashmap, internal storage reconstructed. after reconstruction old bucket array not needed anymore , gc'ed. update : internally hashmap has node<k,v>[] table . during resize new array constructed, elements moved , table replaced new array. after operation map not reference old array anymore unless there no other references (which unlikely due table being package private) elligibl...

javascript - Dynamic loading of Markers on Google Maps -

i want dynamically load markers on google map, mysql database. markers in 20km radius of center of map should appear , center of map changed/panned old markers lying outside 20km radius should disappear , new markers within 20km radius of new center should appear. right able load markers in 20km radius of center of map once webpage opened. any suggestive tutorial or same bind center_changed event listener on map object. when create markers, push them array (push each marker object). on center change (#1), loop through markers array , call setmap(null) on each marker. query database again new center coordinates. follow each step again #2 here quick code idea: // create array of markers var markers = []; // create map , stuff need // bind event listener google.maps.event.addlistener(map, 'center_changed', reloadmarkers); // function reload markers function reloadmarkers() { (var = 0; < markers.length; i++) { // remove each marker m...

sql - Special TABLE sorting -

i have 2 column table previous query this: +--------+--------+ | id_no1 | id_no2 | +--------+--------+ | 1 | 2 | | 1 | 2 | | 1 | 3 | | 1 | 5 | | 2 | 1 | | 2 | 3 | | 2 | 3 | | 2 | 5 | | 3 | 1 | | 3 | 2 | +--------+--------+ the table order id_no1, id_no2 i want id_no1 , id_no2 paired this: +--------+--------+ | id_no1 | id_no2 | +--------+--------+ | 1 | 2 | | 1 | 2 | | 2 | 1 | | | | | 1 | 3 | | 3 | 1 | | | | | 1 | 5 | | | | | 2 | 3 | | 2 | 3 | | 3 | 2 | | | | | 2 | 5 | +--------+--------+ id_no1 , id_no2 shops, sender , recipient. want group exchange between shops. your requirement apparently sort data in order of parties involved. that, trying sort first lowest party involved (ascending), highest party involv...

objective c - Mixpanel disable tracking in certain environment for iOS app -

i disable tracking mixpanel when app in development profile. can done in google analytics ios calling method disable tracking . mixpanel ios ,i couldn't find similar method. idea how implement ? thanks you can not initialize mixpanel, using debug define like: #ifndef deugb // debug not defined [mixpanel sharedinstancewithtoken:mixpanel_token]; #ednif

html - Site is not displayed correctly on smart phone size screen -

used foundation first time thought easy way make responsive site resolutions. not responsive @ all. not knowledgeable regarding web design understand how things work. the site works down ipad , looks great on smart phone falls pieces, background image not fill screen , nav menu split onto 2 lines. any advice?

php - Links to pages except current domain -

as title says have array domains of site different countries. want loop array , echo browser don't want include current domain list. example: domains = ['test1.com', 'test2.pl','test3.it','test4.uk','test5.de'] i want foreach loop print above domains except 1 user visits, if visit test1.com page, other pages should listed. i'm using php framework it's irrelevant. this current code: @foreach(sites $site) <a class="" href="http://{{ $site }}">{{ $site }}</a> @endforeach try feeding $site through parse_url . can extract hostname , match against requested hostname (via $_server variable)

javafx binding combobox itemsProperty -

i have customized combobox in order add , remove item in combobox. bind customized combobox, not working , don't understand happen. here sample example : public class cbbxeditsuppr extends combobox<boxitem> { private textfield editor = null; private observablelist<boxitem> items = null; /** * constructeur. * * @param addeditems observablelist<string> * @param prefwidth double largeur préférée */ public cbbxeditsuppr(observablelist<string> addeditems, final double prefwidth) { // initialisation des attributs editor = this.geteditor(); items = this.getitems(); this.setprefwidth(prefwidth); // initialisation du contenu de la cellule this.setcellfactory(new callback<listview<boxitem>, listcell<boxitem>>() { @override public listcell<boxitem> call(listview<boxitem> p) { final listcell<boxitem> cell = new listcell<boxitem>() { @override ...

c# - SOLID-principle attempt, solid or not solid? -

in our layered architecture designing bll logic component called apphandover , have written basic high level code this. want follow solid-principles , loosly coupled, adopt separation of concern , testable. here apphandover should do check if user owns app. if not throw error remove history if possible (ie no more apps assigned user) transfer ownership next instance quesion is, on right track , following sample seem solid? public interface itransferownership { void transferownership(string userid, string appid, transferdirection transferdirection); } public interface iownershipverification { bool userownsapp(string userid, int budgetid, string appid); } public interface ipreservehistorycheck { bool shoulddeletetemporarybudgetdata(string userid, int budgetid); } public interface iremovehistory { void deletetemporarybudgetdata(string userid, int budgetid); } handover process implementation public class apphandoverprocess : konstruktdbcontext, itran...

parameter passing - C++ Error C2660: Function does not take 3 arguments -

i'm racking brain figure out.. know simple need new set of eyes figure out i'm missing? line contains ** below, 7th line bottom i'm getting error c2660: 'drilloneproblem' : function not take 3 arguments. please! // drill problem void drilloneproblem() { int c, r1, r2; // passed-in parameters int corans; // correct answer int reply; // user's answer // ask first part of question , display first random number cout << "\nwhat " << r1; // display sign based on user's answer switch (c) { case '1': cout << " + "; corans = r1 + r2; break; case '2': cout << " - "; corans = r1 - r2; break; case '3': cout << " * "; corans = r1 * r2; break; } // finish question , display second random number // ask answer, validate answer , display message cout << r2 << " ? "; cin >> reply; if (reply == corans) { cou...

javascript - Obtain access to a controller from a child directive in AngularJS -

i have small angular application needs list list of entities (endpoints in case). entities saved in array. purpose of example, let's they're on controller. to better separate logic, created 2 directives: endpointlist , endpoint, this: the directives declared this: myapp.directive('endpointlist', function () { return { restrict:'ea', controller:'endpointctrl', controlleras:'epctrl', transclude: true, replace: true, templateurl: 'endpoint-list.html' }; }) .directive('endpoint', function ($compile, $log) { return { scope: { scope:'=ngmodel', func:'&', index:'@' }, restrict:'ea', replace:true, templateurl: 'endpoint.html', require:'?^endpointlist', ...

android - Oauth 2.0 Authentication within application console(not in browser) is possible or not -

in android app need authentication through oauth 2.0 dropbox api. done through browser only(redirected browser , authenticate) . possible make authentication login page in application . you have redirect user dropbox login page , user must allow application access dropbox in behalf, can have oauth token.by default, dropbox api takes browser during authentication, may implement webview within application , redirect user within application itself.

asp.net - Conflict on submit button when Hit login submit button -

i have 2 submit button in various 2 purpose. when hit enter button,but top submit button working. how can rectify problem. please guide me. hope point. form below url http://i.stack.imgur.com/zlnxi.jpg try use asp panel control group login controls , signup controls. , set defaultbutton property desired button. here sample code, how use panel <asp:panel id="panel1" runat="server" defaultbutton="buttonok"> <table > <tr> <td> <asp:label id="label1" runat="server" text="label"></asp:label> </td> <td> <asp:textbox id="textbox1" runat="server"></asp:textbox> </td> </tr> <tr> <td> <asp:label id="label2" runat="server" text="label"></asp:label...

Formating the json data in php -

i have json data in following format ["0","0","0","0","0","0","0","2","5","4","3","0"] i want convert above data in following format using php [0,0,0,0,0,0,0,2,5,4,3,0] how can using php thanks you can use array_map typecast items in array integer callback intval. for integers in array: $array = array_map('intval', json_decode('["0","0","0","0","0","0","0","2","5","4","3","0"]')); retrieve json array: echo json_encode($array);

javascript - Gmap with multiple marker -

hi have code used map contact , want add 2 more places on can me please: /* --- google map --- */ var mapoptions = { center: new google.maps.latlng(49.5564021,5.8628159), zoom: 15, maptypeid: google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("map-canvas"),mapoptions); var image = "img/marker.png"; var marker = new google.maps.marker({ position: mapoptions.center, map: map, icon: image }); you need define position second , third markers , add them added first one var image = "img/marker.png"; var marker = new google.maps.marker({ position: mapoptions.center, map: map, icon: image }); var position2={lat:49.555,lng:5.861}; var marker2 = new google.maps.marker({ position: position2, map: map, icon: image }); var position3={lat:49.557,lng:5.863}; var marker3 = new google.maps.marker({ position: position3, map: map, i...

xamarin.ios - C# Binding for Objective-C: @property (strong, nonatomic) void (^animations)(void); -

how should declare following property: @property (strong, nonatomic) void (^animations)(void); in c# binding (apidefinitions.cs) ? after having smoke became obvious :-) outside interface: delegate void animationsblock(); inside interface: [export("animations")] animationsblock animations { get; set;}

node.js - NodeJS client library for riak -

i starting project use riak nodejs. see number of community supported libraries in nodejs riak in basho site -- http://docs.basho.com/riak/latest/dev/using/libraries/#basho-supported-libraries . can point me research or experience of these , specific advantage / disadvantage faced while using of these libraries ? shall research in parallel , update group results. basho released official client today: https://www.npmjs.com/package/basho-riak-client

Laravel PHP: Uploading Image with Large file size results in 'getClientOriginalName()' being 'null' -

i'm using laravel php , have photo gallery allows user upload images album. when upload images normal file size , less 8mb, uploaded , saved photo album fine. however, when try upload images bigger 8mb, keep getting ' call member function getclientoriginalname() on null' error . to account large images being uploaded photo gallery, edited 'nginx.conf' , 'php.ini' respectively previous line in ' nginx.conf ' client_max_body_size 8m; was changed client_max_body_size 25m; and in 'php.ini', line: upload_max_filesize = 8m was changed to: upload_max_filesize = 25m after making changes in both these files, in putty ran: sudo service nginx restart sudo service php5-fpm restart here controller uploading new photos: public function store() { $input = \input::all(); $validation = new validators\stone_photo; $filename = str_random(4) . \input::file('photo_path')->getclientoriginalname(); ...

jquery - Cannot get isotope to sort by number -

i'm trying isotope sort number in p.number (one p.number inside each div.box) , of div.box inside #content (my jquery below build markup) right of div.box divs stacking on top of each other --- want when when click on button, div.box sort number found in p.number tag this error in web console: typeerror: '.number parseint' not function (evaluating 'ea') <body> <div class="wrapper"> <div id="sorts"> <button>sort number</button> </div> <div id="content"> </div> </div> <script> var mydata = [ { "number" : "15", "promoimage_title" : "title here item 1" }, { "number" : "28", "promoimage_title" : "title here item 2" }, { "number" : "58", ...

android: how to run ui test in java -

in android dev , google tell me how run ui test cli following: adb shell uiautomator runtest launchsettings.jar -c com.uia.example.my.launchsettings i hope can run ui test following: public static void main(string[] args) { uitestrunner.run(uitestfile); } my question is: how run android ui test in java? i hope can debug ui test intellij idea or eclipse , encapsulate it. the uiautomator test case doesn't need runners unlike junit test. can write test code (in android dev's example, launchsettings.java) , compile it, put device app. see example test code. http://developer.android.com/tools/testing/testing_ui.html#sample

java - Reading Category and Items From excel -

Image
i wanna read category excel file cant read row number because items may vary. using jxl . can take each cell type im getting type label every cell try { workbook workbook = workbook.getworkbook(new file( "path excel file")); sheet sheet = workbook.getsheet(0); int colcount = sheet.getrows(); (int = 0; < colcount; i++) { cell cell = sheet.getcell(0, i); system.out.println(cell.gettype() + " " + cell.getcontents()); } } catch (biffexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } i need take category names separately. as alternative, read column quantity. the first row contains "category" - retrieve , save (or whatever). retrieve numeric value cell, call sum . then, continue reading thw cells below. retrieve ...

character encoding - Why file's name get messy using archive/zip in golang, linux? -

i'm using golang's standard package archive/zip wrap several files zipfile. here code test: package main import ( "archive/zip" "log" "os" ) func main() { archive, _ := os.create("/tmp/测试file.zip") w := zip.newwriter(archive) // add files archive. var files = []struct { name, body string }{ {"测试.txt", "test content: 测试"}, {"test.txt", "test content: test"}, } _, file := range files { f, err := w.create(file.name) if err != nil { log.fatal(err) } _, err = f.write([]byte(file.body)) if err != nil { log.fatal(err) } } err := w.close() if err != nil { log.fatal(err) } } results: zip file named 测试file.zip under /tmp expected. after unzip it, 2 files: test.txt , ц╡ЛшпХ.txt , , mess. contents in both of 2 files normal expect...

php - How to select DISTINCT using WHERE and OR -

i new php , have searched google, other forums, web site , looked @ several books cannot see how this. please not castigate me ignorance. want select distinct entries field (category) based on criteria field (code) , display drop down list containing distinct categories. field named 'code' contains 1 of 3 data values, being 1, 2, or 4. want select distinct category if code field has '2' or '4', not if contains value '1'. i have tried several ways of doing confirmation database connection worked drop down box below has no content. my current code after many trials is: if ( ! $_post['submit'] ) { // form not submitted, display form input user echo '<form method="post" id="form_id" action="' . htmlspecialchars($_server["php_self"]) . '">'; try { $dbh = new pdo("mysql:host=$hostname;dbname=gosdirect", $username, $password); $...

sublimetext - Programmatically set 'Monitor File (upload on External Save)' on specified files in sublime text app -

Image
every time close sublime text application. have re-click 'monitor file 'external save' on css files when compile, uploaded server. is there way add code name.sublime-project or sftp-config.json file programmatically 'monitor file (upload on external save)' specified files? thanks

java - How to know if MouseWheelListener can receive events? -

there 1 jpanel attached mousewheellistener . panel has on top several other jpanels, , occupies parent jpanel area. want know if mousewheellistener can receive events when mouse on parent jpanel . if attach mouselistener parent jpanel - not receiving events, because on top of there several other jpanels. maybe there method find out when mousewheellistener can receive events? mean if standing on jscrollpane - can move scrollbar (and not important how many jpanels on it). edit: the awteventlistener didn't helped - upper jpanels still blocking parent jpanel events.. : awteventlistener awt = new awteventlistener() { @override public void eventdispatched(awtevent e) { if (mouseevent.mouse_entered == e.getid()) { mouseevent event = (mouseevent) e; (component c : getcomponents()) {//get parent jpanel components if (event.getcomponent().equals(c)) { active = true; ...

c# - Clipboard.SetFileDropList doesn't work fine -

i have lines of code in method change clipboard content: system.collections.specialized.stringcollection stc = new system.collections.specialized.stringcollection(); stc.addrange(system.io.directory.getdirectories(temppath)); stc.addrange(system.io.directory.getfiles(temppath)); clipboard.clear(); clipboard.setfiledroplist(stc); when go in debug mode , put breakpoint method works fine , clipboard updated, content in clipboard not available when method ends (my folder not destroyed obviously). some ideas? edit: if break execution message box before exit works, otherwise not. tried setdata object, same. edit 2: the filedroplist seems clipboard paste disabled in system. edit 3: i think i've found problem: reason can because app takes ownership of clipboard , not release until closed, not allow external usage of actual content. way invoke win32 dll. the clipboard class can used in threads set single thread apartment (sta) mode. options are mark main ...