Posts

ios - Can we create subdivisions of #pragma mark in Objective C? -

Image
we using #pragma make code more readable, accurate , separated groups. for example: i'm using #pragma below: //--------------------------------------------------------------- #pragma mark #pragma mark prefrences methods //--------------------------------------------------------------- however there wondering, can create sub section of #pragma in can divide in 1 more layer. like have lots of related methods below: you can see these preference related methods , can not divide other #pragma . just want know whether there constants in xcode #subpragma or can divide #pragma ? possibility: category: #pragma mark #pragma mark level 1 the 2 lines (two #pragma mark ) create "separator". subcategory: #pragma mark — sublevel the single line (one #pragma mark ) give title. used — change "indent" of text. sample: render: code: #pragma mark #pragma mark life cycle -(id)init { self = [super init]; if (self) { ...

Python - Get total amount of bytes used by files -

i'm trying total amount of bytes used files. what i've got far following. def getsize(self): totalsize = 0 size = 0 root, dirs, files in os.walk(r'c:\\'): files in files: size = os.stat(files).st_size totalsize = totalsize + size however, when running this, following error pops filenotfounderror: [winerror 2] system cannot find file specified: 'hiberfil.sys' does know how can fix error , correctly calculate total bytes on disk? edit: after looking @ more, came following code. def getsize(): print("getting total system bytes") data = 0 root, dirs, files in os.walk(r'c:\\'): name in files: data = data + getsize(join(root, name)) print("total system bytes", data) however following error. permissionerror: [winerror 5] access denied: 'c:\\programdata\microsoft\microsoft antimalware\scans\history\cachemanager\mpscancache-1.bin' this m...

vmware - Unable to delete Snapshot from Snapshot Manager in Virtual machine -

i have virtual machine many snaps. when going delete of snap snapshot manager shows error the virtual machine template , not allow me delete snap. can 1 tell me why has been happened? there 1 problem, in snapshot manager if check checkbox show autoprotect snapshots shows many hidden shapshots. how can delete snapshots? any type of suggestion or can appreciated. the following kb should assist in changing template vm http://kb.vmware.com/selfservice/microsites/search.do?language=en_us&cmd=displaykc&externalid=1004538

php - Route "does not exist" in Symfony even though it's declared in main routing file -

here contents of relevant files : contents of app/config/routing.yml : horse_route: path: /horse defaults: { _controller: appbundle:horse:show } app: resource: "@appbundle/controller/" type: annotation contents of src/appbundle/controller/walruscontroller.php : <?php namespace appbundle\controller; use sensio\bundle\frameworkextrabundle\configuration\route; use symfony\component\httpfoundation\response; use symfony\bundle\frameworkbundle\controller\controller; class walruscontroller extends controller { /** * @route("/walrus/red") */ public function walrusredirect() { return $this->redirecttoroute('/horse', array(), 301); } } contents of src/appbundle/controller/horsecontroller.php : <?php namespace appbundle\controller; use sensio\bundle\frameworkextrabundle\configuration\route; use symfony\component\httpfoundation\response; use symfony\bundle\frameworkbundle\con...

makefile - Why GNU Make's secondary expansion does not work with pattern rules for dependencies? -

consider makefile: %: %.c @echo making $@ @touch $@ .secondexpansion: %.pid: $$(basename $$@) $(<d)/$(<f) --pidfile=$<.pid here, first rule builds program , second rule starts it, producing pid-file. note: know secondary expansion unnecessary in example; real makefile more complex , need secondary expansion there. so, typing make foo.pid , expect make build foo foo.c first rule , run ./foo --pidfile=foo.pid second one. however, not seem work: $ make -f makefile.test foo.pid make: *** no rule make target 'foo.pid'. stop. this somehow relates secondary-expanded dependencies provided pattern rules. if write either %.pid: % in second rule (i. e. rid of secondary-expansion), or foo: %: %.c in first rule (i. e. write explicit static pattern rule), it works. why? limitation of gnu make? in case, i'd avoid pre-listing possible programs in first rule. i think situation described in section 10.5.5 match-anything pattern rule...

R recycling process -

please see snippet below: x <- c(23,43,54,75,76,6,87,5,43,234,2) y <- c(1,2,23,43,54,75,76,6,87,1) z <- x + y the snippet gives me warning message.when try add x , y as: #warning message: #in x + y : longer object length not multiple of shorter object length however when add: x <- c(3,4,5,8) y <- c(1,3) z <- x + y z no error message thrown , r recycles perfectly. why? first of all, important notice warning , , not error . in either case, no error thrown , vectors added. concerning absence of warning in second example, warning message states reason quite clearly: object length not multiple of shorter object length in second example, length of x twice length of y , is multiple (in contrast first example, yields warning). hence, no warning given in second example when vector y recycled.

parsing - ANTLR for IntelliJ 15 -

i trying use antlr4 plug-in intellij create simple expression analyzer. have seen few websites , questions don't seem able running. have watched this video still error can't load hello lexer or parser does have way of using antlr create grammar , using standard input or text file input test grammar , print out. trying take infix expression , convert postfix expression. also there way use intellij write, compile , run program rather swapping command line? thank you. i ran same problem. installed antlr plugin intellij 15. created java project called antlr, , created example hello.g4 text file right-clicking on src directory node , selecting new->file. once grammar typed hello.g4, compiled right-clicking on hello.g4 tab , selecting compile "hello.g4", created template files in directory "gen". i wasn't able figure out how run grun example in antlr4 reference, "hello parrt" parsed , analyzed. instead, turns out if right ...