Posts

github - Git says file too big to push, file doesn't exist in repo -

i have large project working on lot of things unfamiliar with. 1 thing making caches. not want these in git repo, deleted them , committed. i did few more commits, , deleted caches, made .gitignore project. when went push last commit, error saying files big git (over 100 mb) it says file (folder/folder/cachefile) causing error. thing is, file not exist. cannot see it, or delete it. tried removing .gitignore , rebuilding project committing, , when go push same cache causing problems (the original ones cannot find not exist)

c# - Closing an OleDbConnection -

just general question, if open oledbconnection in program, should close @ point? ask because i've seen few tutorials presenter doesn't include statement close connection. in specific circumstances, open connection access excel file, fill datatable , grab values. after though, there no reason me have connection open , i'm thinking cause issues if left open. also, statement conn.close(); sufficient close connection? yes, should close connection done it. if use connection in 1 method , not after again, close , dispose it, can cleaned up. you should wrap creation of connection in using statement since close , dispose connection when exception occurs. using (oledbconnection conn = new oledbconnection(...)) { // use connection inside here }

i2c - Why doesn't this program in C compile? Error: undefined reference to `i2c_smbus_read_byte_data' -

edit: created other topic title , more appropriate/clear details: how resolve link error "undefined reference `i2c_smbus_read_byte_data'" __ i've tried compile single program in c read , write device through i2c bus i'm getting error: error: undefined reference i2c_smbus_read_byte_data i have installed these packages: libi2c-dev , i2c-tools . i'm using ubuntu , arm-linux-gnueabi-gcc compiler (cross compile eclipse luna ide) here whole code: /* http://www.zerozone.it/2014/05/primi-esperimenti-con-la-beaglebone-black-collegare-10dof-via-i2c/ dof10 i2c test program v0.1 - 05.05.2014 wrote program test dof10 funcionality beaglebone black. can buy dof10 module , beaglebone ebay few dollars...have fun ! written michele <o-zone@zerozone.it> pinassi blog @ www.zerozone.it feel free use code want. no warranty, in case: use @ own risks ! */ #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <linux/...

How can we automate content verification for mobile applications (iOS + Android ) without UI automation tools -

i want automate ios , android application text (content available on screens), there generic way or api available content verification of mobile application. i don't want use ui automation tools (appium,calabash). for android use accessibility service both detect user events , traverse user interfaces. depending on permissions request, can alter values , click on behalf of user. check out here: https://stuff.mit.edu/afs/sipb/project/android/docs/training/accessibility/service.html

javascript - processing drag-n-drop with nested HTML elements? -

i'm using html5 drag , drop, , have drop targets can either empty <div> or a <div> <img> child node. to make divs drop targets i'm setting ondrop= on divs. if end drop on div containing image, e.target image node. if end drop on empty div, e.target div. to process drop need find id of div, , since e.target can either image or div, i'm checking e.target.parentnode in case don't find information i'm looking in e.target . is there way can set things e.target div? or looking parentnode chain standard operating procedure? it old question, answer might someone. use div element below: <div id="my-div" ondrop="dropped('my-div');"> ... </div> you id 'my-div' in dropped if drop happened on child on level.

What is the fastest way to increase the size of a file in linux on a ext4 filesystem from a C executable without creating holes in the file? -

the fastest way increase file size know of ftruncate() or lseek() desired size , write single byte. doesn't fit needs in case because resulting hole in file doesn't reserve space in file system. is best alternative use calloc() , write()? int increase_file_size_(int fd, int pages) { int pagesize = 4096; void* data = calloc(pagesize, 1); for(int = 0; < pages; ++i) { // in real world program handle partial writes , interruptions if (write(fd, data, pagesize) != pagesize) { return -1; } return 0; } perhaps can made faster using writev. next version should faster since calloc has 0 initialize less memory, , more of data fits in cpu cache. int increase_file_size_(int fd, int pages) { int pagesize = 4096/16; void* data = calloc(pagesize, 1); struct iovec iov[16]; for(int = 0; < 16; ++i) { iov[i].iov_base = data; iov[i].iov_len = pagesize ; } for(int = 0; < pages; ++i) { // in r...

Python tornado with multi-process -

i found how execute tornado multi-process. server = httpserver(app) server.bind(8888) server.start(0) #forks multiple sub-processes ioloop.current().start() in situation there way share resource on processes? and seems using same port on processes. does tornado balance load each process? if so, how do? in general, when using multi-process mode processes communicate via external services: databases, cache servers, message queues, etc. there additional options available processes running on same machine (see multiprocessing module`), in general once no longer using single process it's better techniques continue scale when move beyond single machine. in scenario, kernel , not tornado load balancing across processes. in theory, self-correcting mechanism because new connection given process idle @ time connection arrives. however, in practice tends result in significant imbalances (the loaded process has 2-3x many connections least loaded), dedicated load bala...