Posts

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?

installer - ClickOnce publish with different update locations for customers -

i have wpf application needs go out lots of customers. want give them files can distribute users install. have program update automatically. i thought clickonce way go have come problems. work fine if update locations same not, customer choose files go, either web site or file share. way can see of using way create different versions each customer update path set, not acceptable. i considering wix installer instead, require lot more work clickonce wondering if there way accomplish want using clickonce first? i'm facing same scenario, , guess should let customers create , sign own deployment menifest specifies update location. see walkthrough here: http://msdn.microsoft.com/en-us/library/bb384246.aspx

python - How can i get union of 2D list items when there occurs any intersection (in efficient way)? -

i have 2d list in python list = [[9, 2, 7], [9, 7], [2, 7], [1, 0], [0, 5, 4]] i union of list items if there occurs intersection. example [9, 2, 7] , [9, 7] , [2, 7] has intersection of more 1 digit. union of [9,2,7] . how can final list follows in efficient way ? finallist = [[9,2,7], [0, 1, 5, 4]] n.b. order of numbers not important. you have graph problem. want build connected components in graph vertices elements of sublists, , 2 vertices have edge between them if they're elements of same sublist. build adjacency-list representation of input , run graph search algorithm on it, or iterate on input , build disjoint sets. here's slightly-modified connected components algorithm wrote a similar question : import collections # build adjacency list representation of input graph = collections.defaultdict(set) l in input_list: if l: first = l[0] element in l: graph[first].add(element) graph[element].add(first) ...

Django Updating Existing Model field -

i have model in django foreign key django user model. trying update model form, database isn't updating. can't figure out problem. model.py from django.conf import settings class userinfo(models.model): username = models.charfield(max_length = 30) owner = models.foreignkey(settings.auth_user_model,on_delete=models.cascade,) form.py from django import forms society.models import userinfo class editform(forms.modelform): username=forms.charfield(widget=forms.textinput(attrs={'onchange': 'this.form.submit();', 'class': 'editinput'})) class meta: model = userinfo fields ='__all__' views.py django.shortcuts import render society.models import userinfo django.contrib.auth.models import user society.forms import editform def profileview(request): user = request.user username = userinfo.objects.get(owner=user) ...

c++ - Could not locate deviceQuery on my installation Cuda toolkit v7.5 on Windows 10 -

as going through installing cuda v7.5 following link http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/#compiling-examples i not able verify installation described in section 2.5. verify installation. reason because not find devicequery program should have been located in c:\programdata\nvidia corporation\cuda samples\v7.5\bin\win64\release therefore, not run devicequery cuda verified. devicequery program located ? still precompiled , deployed installation ? no, it's not precompiled more. you have compile (build) application first, before can run it. that true cuda samples now.

android - How to get orderId for an autorenewable transaction using Google Play Developer API? -

i've developed android application, in inapp subscription done play store billing version v3. , implemented google play developer api retrieve subscription status whether autorenewable or not. the method of google play developer api returns autorenewable status along other details such expiry time, start time etc. couldn't find possible solution retrieve order id of subscription used backend processing. transaction id google play developer api from? thanks in advance. you don't need orderid, need "base orderid" , can generate current orderid starttime , expiretime from developer android ( https://developer.android.com/google/play/billing/billing_subscriptions.html#administering ): subscription order numbers to track transactions relating given subscription, google payments provides base merchant order number recurrences of subscription , denotes each recurring transaction appending integer follows: gpa.1234-5678-9012-34567 (base order num...

How to simplify the @import path for my npm sass package? -

situation i have developed small sass package , published on npm . to use package in project npm install , import main file so: @import 'node_modules/my-package/my-package.scss'; this works. question is possible allow users import so? @import 'my-package'; or @import 'my-package.scss'; i think saw packages allow this. possible? any kind of appreciated! with gulp , gulp-sass, people can specify includepaths .pipe(sass({ includepaths: [ './node_modules/your-package-name' ] })) this tell compiler includes appending path import compiling. then in *.scss files need do @import "your-package-name"; or @import "your-package-name/variables"; otherwise, don't think it's possible similar setup - after all, it's url, unless pre-processing, need specify full path it

jquery - How to display the error message -

when click button want validate fields , if there errors, want show user error message on top. i validating not able show error message. problem?. $(document).on('click', '#button', function() { var firstname = $('#fname').val(); alert(firstname); var lastname = $('#lname').val(); if (firstname.val() == '') { $("#error").append("please enter first name"); } else if (lastname.val() == '') { $("#error").append("please enter last name"); } }); <div data-role="content" style="padding: 15px;margin-top:21px"> <p id="error"></p> <label for="text">first name:</label> <input type="text" name="text" id="fname"> <label for="text">last name:</label> <input type="text" name="text" id="lname"...

java - Is it possible to use EclipseLink HistoryPolicy to track user activity? -

i using eclipselink historypolicy track changes on entities , entities have createdby , updatedby properties. with of these properties , eclipselink history queries, can user's activity related specific entity on time? for example -user1 created employee id of 34 @ 2016-04-22 13:53:44 -user2 updated employee id of 34 @ 2016-05-04 17:25:21 etc. if not, how can achieve task in efficient way?

java - Unsatisfied dependency expressed through constructor argument with index 0 -

i getting following error. have mentioned java code related error. error following error getting caused by: org.springframework.beans.factory.beancreationexception: not autowire field: private java.util.list com.hp.ccue.serviceexchange.rest.orderutilsresource.orderutils; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'saworderutils' defined in url [jar:file:/opt/hp/propel/sx/web-inf/lib/sx-adapter-saw-2.20-snapshot.jar!/com/hp/ccue/serviceexchange/adapter/saw/util/saworderutils.class]: unsatisfied dependency expressed through constructor argument index 0 of type [com.hp.ccue.serviceexchange.adapter.saw.sawoperationexecutor]: : no qualifying bean of type [com.hp.ccue.serviceexchange.adapter.saw.sawoperationexecutor] found dependency: expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: {}; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no ...

javascript - Popup no working when page change -

i have popup ajax call him table , works until perform new query changes data in table . if 'll call not work, not error(out success) my javascript <script type="text/javascript"> var thedialog = $('#my-dialog').dialog({ autoopen: false, modal: true, closeonescape: false, height: screen.availheight - 100, width: 1100, show: 'fade', hide: 'fade', resizable: 'false' }); var mydialogprogress = $('#my-dialog-progress'); var mydialogcontent = $('#my-dialog-content'); function showeventregistrantsummary(id, ui) { $.ajaxsetup({ cache: false }); mydialogprogress.show(); thedialog.dialog('open'); mydialogcontent.html(''); $.ajax({ url: 'home/popup?id=' + id + '&ui=' + ui, type: 'get', ca...

sql server - SELECT MAX(column) AND DISTINCT by one of two columns in MS SQL -

using ms sql server 2014. need select row (userid=1 or memberid=1) has max(messageid) value messages user #1 sent or received messages ordered messageid desc i tried solution here: how can select rows max(column value), distinct column in sql? , since user can send or receive messages, solution partly solves problem. message table messageid userid memberid message created -------------------------------------------------------------- 9 4 1 hi 9 2016-05-09 01:50:59.423 8 4 1 hi 8 2016-05-09 01:50:43.950 7 1 4 hi 7 2016-05-09 01:50:35.310 6 1 4 hi 6 2016-05-09 01:50:25.887 5 1 2 hi 5 2016-05-08 23:49:41.610 11 2 1 hi 11 2016-05-09 03:26:42.267 12 1 3 hi 12 2016-05-09 05:06:11.030 1 1 2 hi 1 2016-05-08 22:37:57.803 expected result messageid userid memberid me...

javascript - AjaxToolkit Not Displaying(INTERNET EXPLORER) -

i making use of line chart , bar chart ajax control toolkit(version 16.1). chats display correctly on system(internet explorer , chrome) when deploy application server chats displays on chrome. not show in internet explorer. on local machine internet explorer version 12 , google chrome 50.0.2661.94 . <ajaxtoolkit:barchart id="barchart1" runat="server" chartheight="250" chartwidth = "450" charttype="column" charttitlecolor="#0e426c" visible = "true" categoryaxislinecolor="#d08ad9" valueaxislinecolor="#d08ad9" baselinecolor="#a156ab"> </ajaxtoolkit:barchart> web page in chrome web page in internet explorer

spring - What are the Integration frameworks available. -

is jbi, sca considered integration framework. integration framework available. jbi , sca different technologies. comment on sca. if "integration framework" mean technology assists in connecting services, say, yes. fabric3 (an sca runtime) uses precise terms: http://docs.fabric3.org/