Posts

c# - error CS0117 in Unity -

i working in unity 5.1 beginner, got error , i've no idea how solve this: assets/sampleassets/cameras/scripts/freelookcam.cs(39,32): error cs0117: `unityengine.screen' not contain definition `cursor' my script is: private void ondisable() { screen.cursor.lockstate = cursor.visible; } just remove screen. code becomes: private void ondisable(){ curser.lockstate = cursorlockmode.locked; } however, if want hide/display cursor use this: cursor.visible = true; cursor.visible = false;

redirect - Redirection from www.example.com to www.example.com/index.jsp -

i have setup apache2 , tomcat7 on ubuntu 14.04. my domain name www.example.com , want redirect www.example.com/index.jsp on tomcat login page. how can done? set works fine request made www.example.com/index.jsp. apache virtualhost setting is proxypass / ajp://localhost:8009/ proxypassreverse / ajp://localhost:8009/ the redirection in understanding should happen on apache. apache acting proxy , not serving requests can use directive ? , how make change. pointers appreciated i tried rewriting url in virtualhost doesn't seem working servername www.example.com <br> rewriteengine on <br> rewriterule ^http://www\.example\.com$ https://www.example.com/index.jsp [r] you can use following rewrite rule rewriteengine on rewriterule ^/$ /index.jsp [r] it search if, uri path starts , ends / redirect /index.jsp , should trick.

what does can't assign to literal mean in python? -

this question has answer here: python: can't assign literal 7 answers i have been writing programs in python, comes can't assign literal, mean? , causes it? i've searched try , find can't find it. the object on left-hand side of assignment statement can not literal. a literal string, number, tuple, list, dict, boolean, or none . example, these raise syntaxerror: can't assign literal : >>> 'foo' = 1 >>> 5 = 1 >>> [1, 2] = 3 this syntaxerror can happen through indirect assignment : >>> 'foo' in [1,2,3]: .... pass syntaxerror: can't assign literal in for-loop, python tries assign values 1, 2, 3 literal string 'foo' , raises syntaxerror. the fix, of course, supply variable name such foo , not string, 'foo' : for foo in [1,2,3]: pass

In Python, is there a way I can download all/some the image files (e.g. JPG/PNG) from a **Google Images** search result? -

is there way can download all/some image files (e.g. jpg/png) google images search result? i can use following code download one image know url: import urllib.request file = "facts.jpg" # file written url = "http://www.compassion.com/images/hunger-facts.jpg" response = urllib.request.urlopen (url) fh = open(file, "wb") #open file writing fh.write(response.read()) # read request while writing file to download multiple images, has been suggested define function , use function repeat task each image url write disk: def image_request(url, file): response = urllib.request.urlopen(url) fh = open(file, "wb") #open file writing fh.write(response.read()) and loop on list of urls with: for i, url in enumerate(urllist): image_request(url, str(i) + ".jpg") however, want download all/some image files (e.g. jpg/png) own search result google images without having list of image urls beforehand. p.s. please complete beginner , ...

java - Why is this an illegal start of expression?and not a statement? -

after using javac in cmd illegal start of expression error , not statement. string firstname= "james"; string lastname= "oliver"; //display message system.out.println( "welcome " + "firstname" + "lastname" + + age + "years old";) try system.out.println( "welcome " + firstname + lastname + "you are" + age + "years old"); if want use contents of string variables not enclose them in "" , put ; outside of parenthesis.

c - printf("%d") doesn't display what I input -

my code: printf("enter number : "); scanf("%d", &number); printf("%d entered\n", &number); i input 2 , expected output : 2 entered actual output : 2293324 entered what's problem here? printf("%d entered\n", &number); is wrong because %d (in printf ) expects argument of type int , not int* . invokes undefined behavior seen in draft (n1570) of c11 standard (emphasis mine) : 7.21.6.1 fprintf function [...] if conversion specification invalid, behavior undefined. 282) if argument not correct type corresponding conversion specification, behavior undefined . fix using printf("%d entered\n", number); then, why scanf require & before variable name? keep in mind when use number , pass value of variable number , when use &number , pass address of number ( & address-of operator). so, scanf not need know value of number . needs address of (an int* i...

c# - Library/API for tor .onion web calls -

is there library making web requests .onion websites? without using tor " firefox " needs cant use tor browser. i did googling , did not found solution regarding making simple web request .onion without using tor browser. there isn't library per se, way start tor , use proxy application. on linux starting tor without browser relativly straightforward. edit: looks tor.exe --defaults-torrc [path torrc] way start on windows.