Posts

c - Making file wrap around when using fwrite -

c - Making file wrap around when using fwrite - i using embedded scheme running linux.i utilize ramdisk filesystem on embedded target. application captures real-time info , standard c "fwrite" file in ramdisk fs.as there limited amount of memory , set max size file , cause fwrite wrap around circular buffer. there way in manner transparent application ? prefer application remain unchanged when migrate filesystem on storage device (esata) having much larger capacity. there's no built in method of achieving this. the best alternative write little wrapper function takes care of file write while maintaining count of number of bytes written. once has reached maximum size set should phone call rewind() (or fseek() etc.) go start of file. it might easier utilize mmap() memory map file , treat circular buffer. 1 time again need implement wrapping yourself. c linux embedded ramdisk

objective c - Should NSWindowController always be the superclass of a window controller? -

objective c - Should NSWindowController always be the superclass of a window controller? - when reading apple's cocoa tutorial, window controller regular class , while understand fine suppose, wouldn't improve subclass nswindowcontroller? if right, nswindowcontroller convenience class has lot of functionality required window controller implemented, right? is there reason why not utilize class? you don't have to. i've implemented controllers window inherited nsobject , if didn't need added functionality of nswindowcontroller . objective-c cocoa nswindowcontroller

flex - Is it possible that zipping an swf file results in a bigger file? -

flex - Is it possible that zipping an swf file results in a bigger file? - when gzip swf file, size goes 1,21 mb 1,86 mb... so, question bit answered myself. real question how possible? guess, colleague of mine said, swf binary , can't compressed anymore. conclusions zipping swf files shouldn't done. swf encoded, , encoding includes compression. it's possible if intend compress compressed file, compression result in bigger file. happens when seek zip jpeg or png file, example. what colleague said not true though. there lot of binary files can compressed. example, bmp files. flex flash gzip

jquery ui checkbox and php problem -

jquery ui checkbox and php problem - so have list of checkboxes gets added dynamically - trying style them using jquery ui checkbox. problem can styled one. there ways create workaround dynamic id's on input tags , labels each input tag via jquery ? here syntax trying: <div id="format"> <input id="check_<?php echo $category['category_id']; ?>" type="checkbox" name="selected[]" value="<?php echo $category['category_id']; ?>" /><label for="check_<?php echo $category['category_id']; ?>">d</label> </div> jquery code: $(function() { $( "#check" ).button(); $( "#format" ).buttonset(); }); thanks! try once: $("input[id^='check_'] > label[for^='check_']").css('color', '#f3f3f3'); php jquery user-interface checkbox

Delphi DeHL Deserialize XML File in newer class? -

Delphi DeHL Deserialize XML File in newer class? - i utilize dehl serilize xml , class in delphi , if add together property class , seek deserialize xml file. have error : ‘deserializing « \tapp\fobject\test » failed. serializer reported it’s missing or other entity read!’. i understand quite problem there way set default value instead of error ? alex reply me : you should able — annotating “part2″ field [xmlnullable]. tell xml serializer set “part2″ field nil if not have xml node. note while possible it’s not recommended. deserialized content should serialized original types otherwise “bad things” may happen. i inquire question long time ago on site not able find inquire question : http://alex.ciobanu.org/?p=285#comments xml delphi xml-serialization delphi-2010 dehl

python - How to print query output in Html using google app engine -

python - How to print query output in Html using google app engine - entity kind :football entity key :ag9kzxz-ywnxdwl0d29ybgryfqsscezvb3riywxsgicagica8iskda id : 5681726336532480 email (string) manutd@gmail.com identity (string) manchester united this info in datastore. want search details based on input(emailid) . so, if input email detail, want fetch corresponding club name , print on html page. have written next code class searchapp(webapp2.requesthandler): def get(self): #self.response.out.write(que) name=self.request.get('last_name') player_key=football.query() #qry=football.key(5891733057437696) qry=player_key.filter(football.email==name) #for qry2 in qry: self.response.out.write('<b>%s</b> wrote:' % qry.identity()) from understood, qry object, need utilize loop , print result in qry2.email , qry2.identity . reason, not able hence commented part. need know how fetch d...

css - Owl Carousel Auto Width with margin not working -

css - Owl Carousel Auto Width with margin not working - i have fixed height on images , need maintain image in proportion screen width gets smaller. #owl-demo .item img { display: block; width: auto; height: 300px } this works fine until need set margin in between images. #owl-demo .item { margin:0 10px 0 10px; } the margin won't show , images side side still. margin show if set width: 100% #owl-demo .item img { display: block; width: 100%; height: 300px } but image no longer in proportion. i tried owl's own demo , case. if inspect 1 of images , alter code @ top width: auto see margin no longer works. need remove max-width: 100% img tag bootstrap also. http://owlgraphic.com/owlcarousel/demos/images.html looks you're using version 1.3.x try upgrading version 2 , you'll fine. css owl-carousel

c++ - Makefile to move programs to specific directory -

c++ - Makefile to move programs to specific directory - i have makefile didn't write, , i'm not @ bash scripting , makefiles in general, forgive me lack of knowledge beforehand; as title states want move executables when compiled ../bin/ folder. effort @ (shamelessy copied post here on so) given below (i.e. tried making phony install should move files, alas doesnt." cxx = g++ cc = g++ # define preprocessor, compiler, , linker flags. uncomment # lines # if utilize clang++ , wish utilize libc++ instead of libstd++. cppflags = -std=c++11 -i.. cxxflags = -g -o2 -wall -w -pedantic-errors cxxflags += -wmissing-braces -wparentheses -wold-style-cast cxxflags += -std=c++11 ldflags = -g -l.. mv = mv prog_path = ../bin/ #cppflags += -stdlib=libc++ #cxxflags += -stdlib=libc++ #ldflags += -stdlib=libc++ # libraries #ldlibs = -lclientserver # targets progs = myserver myclient libclientserver.a all: $(progs) # targets rely on implicit rules compiling , linking ...

mysql - Good algorithm for searching DB for a given string -

mysql - Good algorithm for searching DB for a given string - i'm working on web app (php + mysql) user can search other users inputting search string. i need match user's input string 2 columns (username , fullname) of 'user' table in db , homecoming relevant (20 or 50) matches. optimally, need take consideration misspellings. how can approach this? i'm not looking reinvent wheel here. you may using mysql total text search: please have @ this, this, this articles. i want explain boolean total text search; advise please go through full text search using query expansion also. let's @ illustration table given on dev.mysql.com: mysql> select * articles; +----+-----------------------+------------------------------------------+ | id | title | body | +----+-----------------------+------------------------------------------+ | 1 | postgresql tutorial | dbms stands database ... ...

tfs - In Microsoft Test Manager, is there a way to assign multiple roles to a single machine in an environment? -

tfs - In Microsoft Test Manager, is there a way to assign multiple roles to a single machine in an environment? - we're setting lab managed environments using tfs 2012 lab management @ company. in microsoft test manager, need define environments in tests can run. in each environment, must have 1 or more machines specified run tests. each machine can assigned role within environment. there way assign multiple roles single machine within environment ? e.g. i'd able define multiple ui test runs, have single machine perform multiple roles within our application ecosystem. it not possible assign multiple roles same machine. folks create role means 2 together. tfs tfs2012 test-environments lab-management

events - How to use generic collections with typed parameters in a generic map with wildcards (Java) -

events - How to use generic collections with typed parameters in a generic map with wildcards (Java) - this question related how create , fire collection of consumers<t> in java event listener pattern. trying utilize collection of events help batch operations up, far can't seem come right configuration of generic definitions work. here code far. private concurrenthashmap<class<? extends event>, concurrentlinkedqueue<consumer<collection<? extends event>>>> listeners; public <t extends event> void listen(class<t> clazz, consumer<collection<t>> consumer){ concurrentlinkedqueue<consumer<collection<t>>> consumers = listeners.get(clazz); if (consumers == null) { consumers = new concurrentlinkedqueue<>(); listeners.put(clazz, consumers); // complains consumers not type collection<? extends event> } consumers.add(consumer); } public <t extends event>...

python - Flask routes and views -

python - Flask routes and views - basically i'm trying create view lets user update password. code below. @app.route('/update_login_info/<password>',methods=['get','post']) def update_login_info(password): form = forms.updateloginform() if form.validate_on_submit(): try: query=models.user.update(password=models.generate_password_hash(form.new_password.data),) query.execute() flash("login info updated","success") homecoming redirect(url_for('login')) except: flash("error updating login info","error") homecoming redirect(url_for('login')) homecoming render_template('update_login_info.html',form=form) every time route flask throws 404 , cannot work out why. when user clicks on link in email route looks http://chdbfiletransferapp/update_login_info/$2a$12$hdjjbouwalvtujrlkhiryejdmo3nws0haq94/6i/du8ia...

ecmascript 6 - Is ES6 class extend fully equivalent to Object.assign based extending of an object? -

ecmascript 6 - Is ES6 class extend fully equivalent to Object.assign based extending of an object? - in other words these 2 different blocks of code equivalent? es6 class extend based class kid extends parent { // define subclass } var myinstance = new child(); object.assign based var myinstance = object.assign(new parent(), { // define subclass } in particular utilize case trying extend (facebook's) flux dispatcher. in examples utilize object.assign. es6 class extend, worried there subtle differences between 2 should stick object.assign. no, code blocks not equivalent in class inheritance new constructor makes objects having features parent class. extending objects via object.assign illustration of mixins. add together properties 1 instance not alter future children. unlike kid classes, instance after extension still have constructor property pointing parent . means can't recognize extended kid among non-extended, because have sam...

java - How do I know if mappers(or reducers) are running in parallel in Hadoop? -

java - How do I know if mappers(or reducers) are running in parallel in Hadoop? - i running mapreduce jobs on hadoop - 2.3.0 cluster 8 slave nodes, jobs taking longer expected time execute. how test whether map(or reduce) tasks running in parallel? and properties have modified in configuration files mappers(in case 8 of them) run in parallel. you should check in hadoop cluster web interface. go url track job status, line looks one: 15/04/11 17:29:07 info mapreduce.job: url track job: http://hadoopsrv:60540/proxy/application_1428349332728_0303/ this web page displays job status (succeeded/failed...), time each task complete, number of map/reduce tasks , status, logs, etc... java hadoop parallel-processing mapreduce

postgresql - Database indexable or serial overlapping possible? -

postgresql - Database indexable or serial overlapping possible? - im creating database in postgresql id of primary key serial, , im doing same within sql server, id identity(automatically adds integer id). question now, possible database create 2 id's same value, if added same time? or database sort out , give them different id's anyways? hope guys understand im trying ask, help or input highly appreciated, thanks! that not possible. if possible serial feature totally unusable. note, values can skipped or out of chronological (wall-clock) order. database postgresql

ios - How to import framework in swift? -

ios - How to import framework in swift? - what proper way of importing scheme framework in swift? there 2 ways know of, think. 1) target->build phases->link binary libraries -> + button -> add together framework. adds framework , shows graphically in navigator. 2) import framework in bridging-header.h in case of storekit framework example, method 1) add together through xcode ui. in method 2) type in import <storekit/storekit.h> in bridging-header.h which 1 of these right in swift? if correctly don't have separate build target framework (you built xcode 5) , included framework project's build target. the part of documentation you're referring frameworks within different targets. since framework in project's target part of documentation doesn't apply here. in case can't import of framework in swift file. that's why error message "no such module myframework". myframework no module -- part of project...

shell - run a java program -

shell - run a java program - i want run java programme using shell script. java programme in p2 directory , name maxconnect4 , have compiled it, class name maxconnect4. write shell commands this: java p2/maxconnect4 arg1 arg2 arg3 this shell command not work. give error: exception in thread "main" java.lang.noclassdeffounderror: p2/maxconnect however, compile java programme in way: javac p2/*.java, , works. just utilize java -cp p2 maxconnect4 arg1 arg2 arg3 . -cp sets classpath of jvm. edit: assume don't utilize bundle maxconnect4. java shell command

c# - OutOfMemoryException For Maze Solver of Large Dimensions -

c# - OutOfMemoryException For Maze Solver of Large Dimensions - the programme works arrays upto 20x20 larger throws outofmemoryexception. below code: public static point getfinalpath(int x, int y) { queue.enqueue(new point(x,y, null)); while(queue.count>0) { point p = queue.dequeue(); if (arr[p.x,p.y] == 9) { console.writeline("found destination"); homecoming p; } if(isopen(p.x+1,p.y)) { arr[p.x,p.y] = 1; queue.enqueue(new point(p.x+1,p.y, p)); } //similarly other directions } homecoming null; } public int[,] solutionmaze() { point p = getfinalpath(0, 0); while (p.getparent() != null) { solvedarray[p.x, p.y] = 9; p = p.getparent(); } homecoming solveda...

c# - MonoGame Shader - 2MGFX cant compile in SM4 -

c# - MonoGame Shader - 2MGFX cant compile in SM4 - i trying compile 3 .fx custom shader files monogame sample project, tryting running windows phone. the gaussianblur.fx file is: // pixel shader applies 1 dimensional gaussian blur filter. // used twice bloom postprocess, first // blur horizontally, , 1 time again blur vertically. sampler texturesampler : register(s0); #define sample_count 15 float2 sampleoffsets[sample_count]; float sampleweights[sample_count]; float4 pixelshaderfunction(float2 texcoord : texcoord0) : color0 { float4 c = 0; // combine number of weighted image filter taps. (int = 0; < sample_count; i++) { c += tex2d(texturesampler, texcoord + sampleoffsets[i]) * sampleweights[i]; } homecoming c; } technique gaussianblur { pass pass1 { pixelshader = compile ps_4_0_level_9_1 pixelshaderfunction(); } } i trying compile using mg2fx.exe - cloned latest monogame develop repo , built 2mgfx project...

Problems with copying file to System32 folder through a jenkin job? -

Problems with copying file to System32 folder through a jenkin job? - i trying re-create .dll file "c:\tests" "c:\windows\system32" re-create command re-create "c:\tests\windows\test.dll" "c:\windows\system32\test.dll" jenkin job output says file copied , tried printing , checking existence of file in same job , works. but after job completes , when check file in system32 , file doesn't exists. what can issue ?? cleanup settings of jenkins ? or permission issue ? when jenkins executes on filesystem, happens on master or slave node's filesystem, not filesystem of user browing/triggering job. are sure checking existence of file on same node job ran on? jenkins jenkins-plugins jenkins-cli jenkins-scriptler