Posts

Showing posts from February, 2014

Android AlarmManager won't call BroadcastReceiver -

i'm trying call alarmreceiver extends broadcastreceiver . after run code, can't see of logs. please me in issue. :d here's try call alarmreceiber public void downloadtweets(context context) { connectivitymanager connmgr = (connectivitymanager) context.getsystemservice(context.connectivity_service); networkinfo networkinfo = connmgr.getactivenetworkinfo(); if (networkinfo != null && networkinfo.isconnected()) { intent alarmintent = new intent(context,appservice.alarmreceiver.class); alarmintent.putextra(appservice.screen_name, screenname); pendingintent pi = pendingintent.getbroadcast(context,0,alarmintent,pendingintent.flag_update_current);//getbroadcast(context, 0, i, 0); alarmmanager am=(alarmmanager) context.getsystemservice(context.alarm_service); log.v(log_tag, "shot"); am.set(alarmmanager.rtc_wakeup, system.currenttimemillis() + 1, p...

r - Distance origin to point in the space -

i want equalize distance origin points, points given data frame 2 coordinates. i have points as: x y 1 0.0 0.0 2 -4.0 -2.8 3 -7.0 -6.5 4 -9.0 -11.1 5 -7.7 -16.9 6 -4.2 -22.4 7 -0.6 -27.7 8 3.0 -32.5 9 5.6 -36.7 10 8.4 -40.8 to distance apply euclidean distance vector. have tried this: distance <- function(trip) { distance = lapply(trip, function (x) sqrt( (trip[x,]-trip[1,] )^2+ trip[,x]-trip[,1] )^2)) return(distance) } and well: distance = apply(trip,1, function (x) sqrt( (trip[x,]-trip[1,] )^2+ (trip[,x]-trip[,1] )^2)) return(distance) there's no need loop through individual rows of data apply function. can compute distances in 1 shot vectorized arithmetic in r: (distance <- sqrt((trip$x - trip$x[1])^2 + (trip$y - trip$y[1])^2)) # [1] 0.000000 4.882622 9.552487 14.290206 18.571484 22.790349 27.706497 32.638168 37.124790 41.655732 computi...

php - Using LEFT OUTER JOIN to build query results -

there 3 tables this: store_stock: id itemweavetype itemmodel cost price 7 3 4 10.00 15.00 store_item_weaves: id weaveid 3 mc store_item_models: id modelid 4 hv i trying query gather of data item stock id of 7. finished result, array like: array ( [id] => 7 [itemweavetype] => mc [itemmodel] => hv [cost] => 10.00 [price] => 15.00) so, need join data tables store_item_weaves , store_item_models . here have far: $query = $db->query("select * `store_stock` s left outer join `store_item_weaves` w on w.`id`=s.`itemweavetype` left outer join `store_item_models` m on m.`id`=s.`itemmodel` s.`id`=7"); this returns array like: array ( [id] => 7 [itemweavetype] => 3 [itemmodel] => 4 [cost] => 10.00 [price] => 15.00 [weaveid] => mc [modelid] => hv ) so, i'm there. instead of using values of weaveid , modelid itemweavetype , itemmodel , adding onto array. any i...

python - Reverse for 'password_change_done' with arguments '()' and keyword arguments '{}' not found -

background i trying customize authentication views in django project, can't seem customized password_change view run. use django 1.8.2 , python 2.7. the urls.py of module userauth looks following: from django.conf.urls import patterns, include, url urlpatterns = patterns('django.contrib.auth.views', url(r'^login/$', 'login', {'template_name': 'userauth/login.html'}, name='userauth_login'), url(r'^logout/$', 'logout', {'next_page': '/'}, name='userauth_logout'), url(r'^password-change/$', 'password_change', {'template_name': 'userauth/password_change_form.html'}, name='userauth_password_change'), url(r'^password-change-done/$', 'password_change_done', {'template_name': 'userauth/password_change_done.html'}, name='userauth_password_change_done...

java - Resolve method call in annotation processor -

i want write annotation processor check method called in specific places. example: interface command { @mustonlybecalledbyworker void execute(); } class worker { void work(command cmd) { cmd.execute(); // ok annotation processor } } class hacker { void work(command cmd) { cmd.execute(); // annotation processor gives error } } i have annotation processor @supportedannotationtypes("*") uses compiler tree api methodinvocationtree s. i thought there, declaration of called method. now can method name , argument expressions. but want distinguish between overloaded execute() methods same number of arguments. need handle whole overload resolution myself? think mean manually resolve static types of arguments, , in cases type arguments of other methods. so here question: how can correct declaration of potentially overloaded method? maybe can somehow out of javactask ? i using intellij idea 14 , oracle's java 8 compiler. s...

character encoding - What is a code point and code space? -

i reading wikipedia article on code points, not sure if understand correctly. for example, character encoding scheme ascii comprises 128 code points in range 0hex 7fhex so 0hex code point? also not find on code space. ps. if it's duplicate please post link in comments , i'll remove question. a code point numerical code refers single element/character in specific coded character set, sentence means ascii has 128 possible symbols (only part of printable characters) , each 1 of has related numerical code can identified/addressed, code point . for alternative wording, check out this joel's post , this summary oracle introduces concept of code unit :) to give real world example of code points are, consider unicode character snowman ☃ , code point (with unicode syntax u+<code point in hex> ) u+2603 .

java - Exception in program for search anagrams in 2 strings -

this question has answer here: how check if 2 words anagrams 37 answers i have problem little program in java checks if 2 strings anagrams or not. i stringindexoutofboundsexception : exception in thread "main" java.lang.stringindexoutofboundsexception: string index out of range: 6 @ java.lang.string.charat(unknown source) @ areanagrams.areanagrams(areanagrams.java:9) @ areanagrams.main(areanagrams.java:30) this code: public class areanagrams { public static boolean areanagrams(string a, string b) { int j = 0; int = 0; if (a.length() == b.length()) { while (i < a.length()) { if (a.charat(i) == b.charat(j)) { j++; = 0; } else { i++; if (j > a.length()) { return...

java - How StringBuffer behaves When Passing Char as argument to its Overloaded Constructor? -

stringbuffer sb = new stringbuffer('a'); system.out.println("sb = " + sb.tostring()); sb.append("hello"); system.out.println("sb = " + sb.tostring()); output: sb = sb = hello but if pass string instead of character, appends hello . why strange behavior char ? there no constructor accepts char . end int constructor due java automatically converting char int , specifying initial capacity. /** * constructs string buffer no characters in , * specified initial capacity. * * @param capacity initial capacity. * @exception negativearraysizeexception if <code>capacity</code> * argument less <code>0</code>. */ public stringbuffer(int capacity) { super(capacity); } cf. minimal example: public class stringbuffertest { public static void main(string[] args) { stringbuffer buf = new stringbuffer('a'); system.out.println(buf.c...

javascript - Connecting two rectangles in d3js -

i trying connect 2 rectangles line in d3. behaviour should this, let's have rectangles & b. have first click rectangle , when move mouse line has move mouse, when click b. line should connect & b. this have now. can't update line. keeps adding new line objects. <svg id="main" width="500" height="500" style="background-color: red"> <rect id="a" x="100" y="100" height="50" width="50" style="fill: blue"></rect> <rect id="b" x="400" y="400" height="50" width="50" style="fill: blue"></rect> </svg> <script> d3.select("#a") .on('click', function(d){ var elem = d3.select(this); var mouseloc = d3.mouse(this); d3.select("#main") .on('mousem...

class - Java riddle: static binding -

i'm given class c , interface a , i'm not allowed changes in them. should write class b code output success! there 2 things don't understand in code of class c inside loop. 1) don't understand bar method called. 2) when return reached return to? should change implementation of b in order work? public interface { public string bar(); } public class c extends b { public int foo = 100; public c(string s) { super(s); } @override public void barbar() { foo++; } public static void main(string[] args) { string input = args[0]; stringbuilder builder = new stringbuilder(input); c c = new c(input); //c=args[0] b b = c; //b=args[0] a = b; //a=args[0] (int = 0; < args.length; i++) { if (!builder.tostring().equals(a.bar())) { //which bar called? return; //where return to? exist loop? } builder.append(input)...

Python ABC not working properly in Python 2.7.6? -

why can this? from abc import abcmeta, abstractmethod class abstractclass(object): _metaclass__ = abcmeta @abstractmethod def foo(): pass @abstractmethod def bar(): pass class concreteclass(abstractclass): pass = abstractclass() nb = concreteclass() there no error. runs perfectly. why can instantiate abtract class , why can instantiate object of concreteclass though did not implement abstract methods? you missing _ __metaclass__ = abcmeta

Android studio not fetching libs for my android twitter app -

dependencies { compile('com.twitter.sdk.android:tweet-ui:1.2.0@aar') { transitive = true; } } as described in https://dev.twitter.com/twitter-kit/android/twittercore but not importing library android studio error error:failed resolve: com.twitter.sdk.android:twitter-core:1.3.3 did include fabric/twitter maven repository @ top of build.gradle ? buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } }

python - Flyweight pattern - Memory footprint -

i'm learning python , i've thought nice excuse refresh pattern knowledge , in case, flyweight pattern. i created 2 small programs, 1 not optimized , 1 implementing flyweight pattern. tests purposes, i'm creating army of 1'000'000 enemy objects. each enemy can of 3 types (soldier, ninja or chief) , assign motto each type. what check that, un-optimized program, 1'000'000 enemies with, each , of them, type , "long" string containing motto. optimized code, i'd create 3 objects ( enemytype ) matching each type , containing 3 times motto's strings. then, add member each enemy , pointing desired enemytype . now code (excerpts only) : un-optimized program in version, each enemy stores type , motto. enemylist = [] enemytypes = {'soldier' : 'sir, yes sir!', 'ninja' : 'always behind !', 'chief' : 'always behind ... lot of lines '} in range(1000000): randomposx = 0 # random.choice(ran...

Python find list of surrounding neighbours of a node in 2D array -

i've been working on code (py 2.7) generates array of elements each node assigned random numbers. now, wish make list of surrounding elements, , find index of max value. array size variable (i considered col = array column size). have assigned numbers each node (i called 's' in below) can find 2d index of array element. here wrote rn = s/col; cn = s%col; b = [rr[rn,cn+1],rr[rn-1,cn+1],rr[rn-1,cn],rr[rn-1,cn-1],rr[rn,cn-1],rr[rn+1,cn-1],rr[rn+1,cn],rr[rn+1,cn+1]] ma = max(b) = [i i,j in enumerate(b) if j == ma] is there short method find neighbours without need number each array element ? (like did using s). you can use numpy this. first, let's create random 5x5 matrix m testing... >>> m = np.random.random((5, 5)) >>> m array([[ 0.79463434, 0.60469124, 0.85488643, 0.69161242, 0.25254776], [ 0.07024954, 0.84918038, 0.01713536, 0.42620873, 0.97347887], [ 0.3374191 , 0.99535699, 0.79378892, 0.0504229 , 0.05136...

C# & CLIPS. Using .clp in more than in one Form -

i want use .clp file in c# project. project contain several forms. can load *.clp once , use in forms (create/delete facts, etc.)? (i using clipsnet.dll .) upd. there form1. on close save facts. in second form (form2) want same thing if load .clp file in block of form2 i've lost facts entered @ first form. how can avoid situaton? need opened clips file through c# solution. want ask - or not? upd1. use mvs community 2013. dude, create class working clips project! that's it.

android - What does this log file mean? -

i installed cwm recovery on rooted xperia p jellybean. app rom toolbox pro jrummy won't start. crashes every time open it. so saved log file using logcat app. here goes - 06-13 17:54:25.784 d/romtoolboxhelper(16322): com.aokp.romcontrol not found packagemanager 06-13 17:54:25.784 d/romtoolboxhelper(16322): com.cyanogenmod.cmparts not found packagemanager 06-13 17:54:25.784 d/romtoolboxhelper(16322): com.noshufou.android.su not found packagemanager 06-13 17:54:25.784 d/romtoolboxhelper(16322): com.jrummy.busybox.installer not found packagemanager 06-13 17:54:25.784 d/romtoolboxhelper(16322): com.jrummy.busybox.installer.pro not found packagemanager 06-13 17:54:25.784 d/romtoolboxhelper(16322): com.tmobile.themechooser not found packagemanager 06-13 17:54:28.526 e/romtoolboxhelper(16322): failed reading news 06-13 17:54:28.526 e/romtoolboxhelper(16322): org.json.jsonexception: no value id 06-13 17:54:28.526 e/romtoolboxhelper(16322): @ org.js...

windows runtime - Layout hides behind sticky bottom app bar -

i have added bottombar in windows winrt application this. <page.bottomappbar> <commandbar requestedtheme="dark" background="#fff3a716" issticky="true" isopen="true" > ... </commandbar> </page.bottomappbar> but after adding issticky property content starts hiding behind app bar. is there way app bar doesn't open above layout. it should open below layout. layout doesn't shows correctly. just added margin = 120 bottom of layout , solved issue.

jena - malformed sparql delete query -

i update data property assertion using sparql, malformed query exception @ delete statement when try run in protege. i'm new sparql , can't figure out what's wrong query : prefix m: <http://www.semanticweb.org/exemple#> delete { ?o owl:minqualifiedcardinality ?min. } insert { ?o owl:minqualifiedcardinality “2000”^^xsd:decimal. } { m:revenu rdfs:subclassof ?o. ?o owl:minqualifiedcardinality ?min. } have @ sparql.org's update validator . when paste query there, , after adding missing prefixes, get: lexical error @ line 10, column 45. encountered: "\u201c" (8220), after : "" if closely, you'll notice you're using "smart quotes" (i.e., “ , ”) rather "straight quotes" (i.e., "). if you're not using one, may want plain text editor composing queries.

how to write a complex quartz cron expression -

i need develop web service, client periodic job, api void dojob(int jobtype, string cronexpression); because client/user want, want know cron expression support situation below: the job fire in following times: 9:10am 10:50am trigger @ every 8 minutes, every day. from 9:00 10:00 maybe easier, still cannot find correct cron expression 9:10am 10:50am. not sure if can using 1 cron expression, can using two. eg 0 10,18,26,34,42,50,58 9 1/1 * ? * 0 6,14,22,30,38,46 10 1/1 * ? *

android - Lock application while factory reset Programmatically -

i'm developing application runs in stealth mode , don't want t uninstalled when user applies factory reset cell phone. there way lock application may not uninstalled during factory reset? build own custom rom. pre-install app on custom rom. factory-resets device running rom app back, though not data. beyond that, there should no way survive factory reset, outside of security flaws.

jQuery - Define variables based on array values -

i m not sure if proper way of defining variables based on array values. the getparameterbyname() function returns url parameters var t = gettab(); var paramarray = { 'year' : 'y', 'condition' : 'c', 'sort' : 's' }; /*below vars defined $.each var y = getparameterbyname('y'); var c = getparameterbyname('c'); var s = getparameterbyname('s'); */ $.each(paramarray, function(key, value) { //define y,c,s variables var value = getparameterbyname(value); console.log(value);//logs blank (nothing) if(value != "") { $("#sort-filter-number").append('<button id="'+value+'" class="refresh refresh-'+key+' btn btn-info btn-sm">'+value+' <i class="fa fa-times"></i></button>'); } }); tosort(y,c,s); //line 55 error : uncaught referenceerror: l not defined you can define...

PHP Ratchet: Class Memcache not found -

i following ratchet's tutorials. sessionprovider page, code this: <?php // shell script use ratchet\session\sessionprovider; use symfony\component\httpfoundation\session\storage\handler; use ratchet\app; $memcache = new memcache; // class not found on line 7 $memcache->connect('localhost', 11211); $session = new sessionprovider( new myapp , new handler\memcachesessionhandler($memcache) ); $server = new app('localhost'); $server->route('/sessdemo', $session); $server->run(); php throws fatal error when run script in command-line : class memcache not found in on line 7 this code placed in bin\chat-server.php wierd stuff the class not available chat-server.php script. there 2 distinct php extensions service memcached : memcache memcached <-- note d looks have installed latter one, while need first 1 application. you can find right extension windows here

java - PHP SoapClient get: ServerCan't find bundle for base name -

i working php soapclient , error. $client = new soapclient("https://example.org/site-service/webservice/dataprovider?wsdl", array('trace' => true)); $client->modifydata($data); (or $client->modifydata(), or $client->savestudents) var_dump($client->__getlastrequest()); var_dump($client->__getlastresponse()); always exception: servercan't find bundle base name i18.exceptions, locale lt the server administrator said problem on php server. i found online solutions java. can not access java. please help. p.s. sorry, poor english.

javascript - Uncaught TypeError: Cannot read property 'map' of undefined in React.js after update from 0.11 to 0.13 -

after update react.js 0.11 0.13 there appear error in getoptiontorender. i read changelog havent found usefull. whats problem here? here code: 'use strict'; var react = require('react'); var option = require('./option'); module.exports = react.createclass({ displayname: 'categoryselecter', shouldcomponentupdate: function () { return false; }, getoptionstorender: function () { return this.props.categories.map(function (category) { return ( react.createelement(option, {key: category.display, input: category}) ); }); }, handlechange: function (event) { this.props.changecategory(event.target.value); }, render: function () { return ( react.createelement("div", {classname: "container top15"}, react.createelement("form", null, react.createelement("div", {classname: "form-group"}, react.createelement("select...

iis - Are Windows apps in 32-bit and 64-bit folders the same -

i need install , manage iis on 64-bit windows 2008 server through command prompt. to install iis & configure required packages iis, need use pkgmgr.exe and manage website, create app pools, need use appcmd.exe now, both pkgmgr.exe , appcmd.exe avaialble in both c:/windows/system32/ , c:/windows/syswow64 folders. 1) both these applications in both these folders same or there difference? 2) there problems if install use both these apps system32 bit folder on 64 bit os? there not same, programs under syswow64 32bit binaries, under system32 64bit binaries. they have exact same functionality may affect either 32bit or 64bit parts of os. the programs in syswow64 backwards compatibility. 32bit version of iis installed here run 32bit worker processes. for installation , configuration should use system32 64bit versions. in case of appcmd.exe shouldn't make difference anyways, i'm not sure 32bit pkgmgr.exe having access system32 always use p...

maven - Include ftl file in ext plugin -

i have ext-plugin , override file: portal-impl\src\com\liferay\portlet\dynamicdatamapping\dependencies\ddm\documentlibrary.ftl. after maven build, file isn't include in porta-impl-ext.jar. in portal-impl-ext's pom.xml have code: <build> <plugins> <plugin> <groupid>com.liferay.maven.plugins</groupid> <artifactid>liferay-maven-plugin</artifactid> <version>${liferay.maven.plugin.version}</version> <configuration> <apibasedir>${basedir}/../my-ext-service</apibasedir> <implbasedir>${basedir}</implbasedir> <sqldir>${basedir}/../my-ext/src/main/webapp/web-inf/sql</sqldir> <webappbasedir>${basedir}/../my-ext-web</webappbasedir> </configuration> </plugin> </plugins> </build> in portal-ext's pom.xml...

Android Content Resolver takePersistableUriPermission API below 19 no such method -

i`m using in order achieve following behavior: user selects files via intent.action_open_document api above 19 (the new storage access framework) or via intent.action_get_content api below 19. files should stored in app`s list later use (open them). after files use: uri uri = fileuri; final int takeflags = data.getflags() & (intent.flag_grant_read_uri_permission | intent.flag_grant_write_uri_permission); getapplicationcontext().getcontentresolver().takepersistableuripermission(uri, takeflags); for cases of api above 19 works fine, api below 19, example test api 14, got anr following error: java.lang.nosuchmethoderror: android.content.contentresolver.takepersistableuripermission what can problem? thanks, update: seems it`s (persistent permission) done automatically in api below 14, means comment out code if api below 14.

javascript - Why can scripts inserted with document.write change variables -

why below script printing 33 rather 31? <script> var = 1; document.write("<script> i=3; document.write(i); </scr" + "ipt>"); document.write(i); </script> this 1 prints 31, difference? <script> var = 1; document.write("<script> i=3; document.write(i); </scr" + "ipt>" + i); </script> this order of how it's working: you define variable called i value of 1 . you write new script document 2.1. new script redefines i 3 . 2.2. script writes i (keep in mind, 3 ) document. you write i again (value still same when redefined it, 3 ) document. end result 33 , because wrote 3 twice. order of second block: you define variable i value 1 . javascript concatenates string , i , creating "<script> i=3; document.write(i); </script>1" (notice 1 @ end, concatenation) javascript writes new concatenated string document. 3.1. i redefined 3 . 3.2. d...

c# - More Fluent Image Movement -

this question has answer here: controling moving picturebox 2 answers so i'm messing around, getting hang of things , i'm making picture box move, have done. show me how make movement more fluent not slow down much? code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace meh { public partial class form1 : form { picturebox test = new picturebox(); public form1() { initializecomponent(); formborderstyle = formborderstyle.none; windowstate = formwindowstate.maximized; test.image = properties.resources.platinumgrass; test.location = new point(0, 0); test.width = 32; test.height = 32; this....

Custom Increment by given array in php -

i have array array ( [0] => f [1] => f [2] => n [3] => ) how run 2 loops above array ? for ($x = 0; $x <= 2; $x++) { //in loop need output above f-01 f-02 } i have loop im fetching data in like for ($x = 0; $x <= 1; $x++) { //in loop need output above n-01 } for on need below <?php $myarray = array ( 'f' ,'f' ,'n' , 'l'); $j =0; for($x = 0; $x < 2; $x++ ){ echo $myarray[$x].'-'.$j.$x; echo "<br>"; } echo "<br>"; $m=0; for($k=2;$k<=3;$k++){ echo $myarray[$k].'-'.$j.$m; echo "<br>"; } ?> i hope you.

Confusion over how Java's Garbage Collector works (Nodes + Queue) -

this question has answer here: what nullpointerexception, , how fix it? 12 answers so been trying implement linkedlist, stack, queue in java. for each 1 i'm using node class such that, don't want discuss how implementation since aware there better ways it, want focus on question. public class node<e> { private e data; private node<e> next; private node<e> prev; public node(e data) { this.data = data; this.next = null; this.prev = null; } public e getdata() { return this.data; } public node<e> getnext() { return this.next; } public node<e> getprev() { return this.prev; } public void setprev(node<e> prev) { this.prev = prev; } public void setdata(e data) { this.data = data; } public void s...

python - Commenting style guide for restful apis in django / flask -

is there de-facto commenting style restful api classes or functions? if there's no such, how apply google / sphinx commenting style rest apis? for example, how write comment for class mylistapi(apiview): def get(self, request, **kwargs): ... if api takes query string parameters? you can check out swagger extension flask or django swagger can generate html page docs , testing. you can at: http://www.django-rest-framework.org/topics/documenting-your-api/ https://github.com/noirbizarre/flask-restplus https://github.com/hobbeswalsh/flask-sillywalk https://pythonhosted.org/sphinxcontrib-httpdomain/#module-sphinxcontrib.autohttp.flask

seo - Joomla website google reindex title -

i have problem 1 of websites running on cms joomla - http://www.luxusni-apartman.cz when wrote website google search show website old title , because of have problem seo optimalization, can me? version of website running 3 months, before there old version different title. if change description or keywords google change , show correctly. wrong? how force google change title? thank ...

Date conversion in R not registering string correctly -

can please tell me why doesn't work: as.date("01/08/15", format = "%m/%d/%y") [1] "0015-01-08" thanks! you need use lower-case %y . upper-case %y requires 4-digit year. (in opinion, entire command should have failed error message, unfortunately didn't.) see strptime() , documents format codes. as.date("01/08/15", format = "%m/%d/%y") ## [1] "2015-01-08"

Asynchronous JavaScript calls from Android WebView -

i'm building hybrid android app webview communicates device javascriptinterface annotation from webview: webview.addjavascriptinterface(someservice, "someservice"); the service implementation: @javascriptinterface public void somemethod() { //do business logic.. } problem javascript run this: function callsomemethod() { someservice.somemethod() }; this call synchronous, , run asynchronously like: function callsomemethod(callback) { someservice.somemethod(function(result) { if (result == 'success') callback(); }) }; preferably using promise: function callsomemethod() { return someservice.somemethod() //somemethod returns promise }; does android webview has built in support running javascript code asynchronously? that solely depends on you. need return injected method, able call js code when execution complete. (note it's rough sketch): private webview mwebview; private final objec...

vba - excel click object stores value from one cell to another -

i'm trying work on in excel vba can't seem make work fine. here's how should work: need copy , paste value of "j21" cell 1 sheet another. but, value of j21 keeps on changing every week. thought if create code i'll press object (say "store!") , copies value of "j21" sheet1 "c3" sheet 2. when value of j21 changes, press "store!" again , copy value of j21 , paste on "c4" sheet 2 without changing previous value on "c3" sheet 2. here's latest attempt: dim mycell range, myrange range, long = 3 set myrange = sheets("summary").range("c3") set myrange = range(myrange, myrange.end(xldown)) sheets("sheet1").select range("j21").copy sheets("summary").select cells(i, 3).select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks:=false, transpose:=false = + 1 mycell , myrange used previous at...

.net - What is the difference between member val and member this in F#? -

when created class containing generic, mutable .net stack in f# example below, stack ignores push onto it. open system.collections.generic type interp(code: int array) = member val pc = 0 get, set member this.stack: stack<int> = new stack<int>() member this.code = code let interp = interp([|1;2;3|]) interp.stack.push(1) printfn "%a" interp.stack // prints "seq[]" wat?! yet if make stack mutable via property: open system.collections.generic type interp(code: int array) = member val pc = 0 get, set member val stack: stack<int> = new stack<int>() get, set member this.code = code let interp = interp([|1;2;3|]) interp.stack.push(1) printfn "%a" interp.stack // prints "seq[1]" everything magically works i'd expect. what on earth going on here? understanding of immutability previous languages (c# mostly) though stack in first example immutable member, immutablity should go far refer...

ios - Returning Self in Swift -

aim: make generic viewcontroller , tableviewcontroller able return existing storyboards , subclassed other view controllers , allow them use functionality. class generictableviewcontroller: uitableviewcontroller { //mark: storyboard class func storyboardname() -> string { return "" } class func storyboardidentifier() -> string { return "" } class func existingstoryboardcontrollertemplate() -> self { return uistoryboard.storyboardwithname(storyboardname()).instantiateviewcontrollerwithidentifier(storyboardidentifier()) as! self } } the problem is.. compiler forces me change self "generictableviewcontroller" , if change it... complains no longer return "self". is there can fix this? doing following should work: class func existingstoryboardcontrollertemplate() -> self { return existingstoryboardcontrollertemplate(self) } private class func exis...

image slide left to right bottom of the corner jquery -

i trying slide image left right bottom of corner. i using code js not supported (direction ) paramerer.. <script type="text/javascript"> $(window).load(function () { $("#man").show("slide", { direction: "down" }, 2000); }); </script> <style type="text/css"> #man { display: none; position: fixed; bottom: 0px; right: 0px; } </style> the slidetoggle method pretty easily. demo html <div id="man"></div> jquery $(function(){ $("#man").slidetoggle(500); }); css #man { display: none; position: fixed; bottom: 0px; right: 0px; width: 200px; height: 400px; background: grey; }

jquery - Click icon, pop up div, and click elements except div disappear -

.menuleft menu icon. .mainmenu whole div menu pop up. following code, works fine except when mainmenu on, clicking .menuleft let .mainmenu disappear , pop again... other types of ways more welcome. cheers. $(document).ready(function(){ $('.menuleft').click(function() { $('.mainmenu').slidetoggle('fast'); }); $(document).mouseup(function (e){ var container = $('.mainmenu'); if (!container.is(e.target) && container.has(e.target).length === 0) { container.hide('slow'); } }); }); html following: <div class="headermain mobile_disappear"> <div class="container"> <div class="menuleft cur"> <i class="fa fa-bars"></i> </div> <div class="mobil...

android - Hyper V checkbox is missing -

Image
when trying fix haxm problem i don't know why hyper v missing turn window feature on or off , have followed youtube video tutorial system missing hyper v check box please check image link. and using windows 7 home basic sp1 system detail image here: your system missing hyper-v feature because of 1 of 2 reasons. hyper-v hardware implementation , therefore requires physical component on pc might missing. hyper-v needs turned on in bios , may not enabled. to enable hyper v need turn on hardware virtualization described in this forum post fundamentally boils down turning on “execute disable bit” , “intel virtualization technology” in equivalent bios settings of motherboard.

formatting - Why is this Java formatted output not right-justified? -

i'm beginner, , i'm experimenting formatted output. i'm trying produce table of decimals: for (int = 0; < 8; i++) { (int j = 0; j < 8; j++) { row = (double) 5*i; column = (double) j + 1; system.out.format("% 6.3f", row/column); system.out.print("\t"); } system.out.format("%n"); } this produces: 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 5.000 2.500 1.667 1.250 1.000 0.833 0.714 0.625 10.000 5.000 3.333 2.500 2.000 1.667 1.429 1.250 15.000 7.500 5.000 3.750 3.000 2.500 2.143 1.875 20.000 10.000 6.667 5.000 4.000 3.333 2.857 2.500 25.000 12.500 8.333 6.250 5.000 4.167 3.571 3.125 30.000 15.000 10.000 7.500 6.000 5.000 4.286 3.750 35.000 17.500 11.667 8.750 7.000 5.833 5.000 4.375 the api says if '-' flag not thrown, output right-justified, want. have put ' ' aft...

ios - What's Apple's Guideline on when to use modal vs pushed view controller? -

apple's guideline on when use modal vs pushed view controller upon tapping table view cell seems confusing. take settings->twitter example. if tap add account cell, view pushed in sign in. if click on existing account, modal view shown instead. in other places in settings, pushed view used instead. in contacts' edit mode, modal used instead. can't find common pattern on when use which. what's apple's guideline on when use modal vs pushed view controller when tapping table view cell?

passing a pointer through a function c -

i'm trying exit while loop within function don't think i'm writing pointer correctly, c new me , reading examples online confusing. i appreciate feed on i'm writing incorrectly. int logon(int *log); int main(void) { int log; log = 1; while(log = 1) { int logon(log); } while(log = 2) { int mainmenu(); } printf("\ngood bye"); } int logon(*par) { char p; printf("would log on (y/n): "); scanf("%s", &p); if(p="y") { par = 2; } else if(p="n"); { par = 3; } else { printf("\nerror entering command\n") } return 0; } i've updated code , fixed lot of errors guys helped identify. now reason goes through logon loop twice if hit key neither 'y' or 'n' this current code looks like include int logon(int *log); int mainmenu(int *log); int main(void) { ...

java - ListView doesn't appear in the MainActivty of my app (An image attached) -

after save note in android app, note (or listview) of note/s doesn't appear in mainactivity . mainactivity class of app is: package com.twitter.i_droidi.mynotes; import android.app.alertdialog; import android.content.dialoginterface; import android.content.intent; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.contextmenu; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.view.view; import android.widget.adapterview; import android.widget.arrayadapter; import android.widget.listview; import android.widget.toast; import java.util.list; public class mainactivity extends actionbaractivity implements adapterview.onitemclicklistener { listview lv; notesdatasource nds; list<notesmodel> noteslist; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); ...

php - Show product's image in “Orders” page - Woocommerce -

i working wc first time , chasing tail one. in "orders" page customer's can see purchases they've made array shows basic info order. need show image of product customer bought. orders seems custom posts, how image product? i realize question vague. pointers big great help. orders custom post types of shop_order type. orders not have thumbnails themselves, orders have list of products purchased , each product has possibility of thumbnail. you can see in order-details.php template how items/products associated order object... $order->get_items() this returns array of data stored in separate database tables. $item variable can original product , can see in linked template $product variable being sent order-details-item.php defined order->get_product_from_item( $item ) . anyway, once have $product object can use $product->get_image() retrieve product's image. as simplified example, show thumbnails products purchased in order ...

c# - Infinite while loop issues -

i barely started programming in c# , running small issue background threads running infinite while loops inside of them. a little background: trying make physical notification light outlook. right making in wpf application test before throw in outlook add-in. i have button opens new background thread , runs new instance of class: public class lightcontrol { private byte light; public byte light { { return light; } set { light = value; } } private string color; public string color { { return color; } set { color = value; } } private int delay; public int delay { { return delay; } set { delay = value; } } private bool status; public bool status { { return status; } set { status = value; } } public void notification() { action<byte, string, int, bool> lightnot = delegate(byte i, string c, ...