Posts

Featured post

iphone - UIScrolview Prioritize vertical and horizontal scrolling -

i've scenario using list of views scrolls horizontally, pagination. , each view has tableviews scrolls vertically. issue when want scroll vertically. hardly allows me that. vertically it's fine. can arrange in way vertically scrolling should have higher priority horizontal? both should accessible. well, have uiscrollview horizontal scroll , couple of uitableview s inside pages? think issue lays in uiscrollview intercepts vertical pan gesture. try disable vertical scrolling uiscrollview , should help.

wireshark - USB mapping with python -

while reading ctf write-ups came across script #!/usr/bin/env python import struct import image import dpkt init_x, init_y = 100, 400 def print_map(pcap, device): picture = image.new("rgb", (1200, 500), "white") pixels = picture.load() x, y = init_x, init_y ts, buf in pcap: device_id, = struct.unpack("b", buf[0x0b]) if device_id != device: continue data = struct.unpack("bbbb", buf[-4:]) status = data[0] x = x + data[1] y = y + data[2] if (status == 1): in range(-5, 5): j in range(-5, 5): pixels[x + , y + j] = (0, 0, 0, 0) else: pixels[x, y] = (255, 0, 0, 0) picture.save("riverside-map.png", "png") if __name__ == "__main__": f = open("usb.pcap", "rb") pcap = dpkt.pcap.reader(f) print_map(pcap, 5) f.close() and

java - What is the equivalent of @Value in CDI world? -

what way 1 inject property value property placeholder cdi bean? in spring 1 write: @org.springframework.beans.factory.annotation.value("${webservice.user}") private string webserviceuser; what sets webserviceuser field property webservice.user property file/property placeholder. how cdi? i've tried find answer, couldn't find equivalent. however, people write, can use cdi spring substitute on application servers, , use case basic, surely there must easy way, unfortunately i've failed find it. cdi specification dependecy injection , context doesn't have such configuration things out of box. provides powerful extension mechanism allows third party projects add new portable features (i.e works cdi implementation , not tied server). important project providing cdi extensions apache deltaspike , news, provides need. so need add deltaspike-core in project. if use maven, need add dependencies pom.xml <dependency> <group

c++ - nodejs socket.io closes connection before upgrading to websocket -

i'm trying write c++ client talk websocket server written using nodejs , socket.io. can't c++ client establish websocket connection; server drops connection right after client requests http connection upgraded websocket. i used tcpdump watch packets going , forth. when use websocket server browser, works great , tcpdump output shows packets going , forth. when try connect server using c++ client, websocket connection never gets established. output tcpdump shows upgrade request being sent server followed server dropping connection. i tried replicating sequence of events using nc . connected server (running on port 8080) , copy-pasted exact set of headers sent browser, captured tcpdump. duplicate of working headers, connection dropped. there no output on server end indicating why connection gets dropped. here headers sent: get /socket.io/?type=player&eio=3&transport=websocket&sid=7mdclht_8ctsd6f4aaac http/1.1 host: localhost:8080 connection: upgrade prag

python - PyQt: Label not showing correct number of length -

i making quiz application in pyqt4, there 3 main generators: incorrect , correct , timeout . all answers connecting scorecheck function: def scorecheck(self, sendercheck): if ( sendercheck == self.answ ) or ( sendercheck == self.answ1 ) or ( sendercheck == self.answ5 ) or ( sendercheck == self.answ7 ) or ( sendercheck == self.answ8 ) or ( sendercheck == self.answ10 ): self.wronganswers.append(1) elif ( sendercheck == self.answ2 ) or ( sendercheck == self.answ4 ) or ( sendercheck == self.answ9 ): self.correctanswers.append(1) elif sendercheck == self.tmr3: self.timeouts.append(1) print "worked" print len(self.timeouts) else: pass self.wronganswerlabel = qtgui.qlabel(str(len(self.wronganswers)), self) self.wronganswerlabel.setgeometry(220, 40, 200, 200) self.wronganswerlabel.setobjectname('wronganswercount') self.wronganswerlabel.setstylesheet("#wronganswercount { font-size

Deploying Qt Application on Android is really slow? -

as may know there 3 ways deploy qt application on android : use ministro service install qt deploy local qt libraries temporary directory bundle qt libraries in apk the first method takes 30 seconds , needs install apk . ministro . second takes 1 minute me ! , anytime try run program qt creator pushes qt libraries device. third 1 makes .apk file big , again takes 1 minute me. think situation that's not reasonable develop android application using qt. there way make deploying process faster? almost full year since op , things have not changed @ all. deployment of 7 mb apk takes on minute , half project compiles in 5 seconds. reason answering not problem got resolved, offer alternative solution. i've implemented "workaround" consisting of 2 applications work in tandem - 1 on pc , 1 on device - created compile files remotely, turned out faster alternative deployment well. on host create application launches compilation in separate process, when do

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

i trying rename upload image permission denied @ sys_fail2 - (d:/ror/projects/grp/public/uploads/gallery/test.jpg, d:/ror/projects/grp/public/uploads/gallery/qinsnvzicc20160509132021.jpg) my code : photo = params[:gallery][:gal_img] name = photo.original_filename directory = "#{rails.root}/public/uploads/gallery/" path = file.join(directory, name) uniq_name = (0...10).map { (65 + rand(26)).chr }.join time_footprint = time.now.to_formatted_s(:number) file.open(path, "wb") |file| new_file_name = uniq_name + time_footprint + file.extname(file) file.write(photo.read) @uniq_path = file.join(directory, new_file_name) file.rename(file, @uniq_path) end i have checked , giving privilege in ruby directory. please let me know why getting permission denied error?