Posts

Showing posts from July, 2011

webgl - three.js - how to replace a mesh geometry w/o recreating the mesh -

i'm loading several stl files (one one) same scene. files different lods of same model (from low-poly high-poly). i'd simulate continuous model update low high resolution. i tried create separate mesh each lod , add scene when removing previous one. unfortunately, lods bigger, there significant delay in rendering. see example , full code my questions: - if replace geometry in same mesh without recreating mesh? if so, how force rendering update? tried use mesh.setgeometry , doesn't seems work stl geometry - new geometry shown (perfectly works cube, reason). - possible speed update somehow sort of pre-calculations or caching? thanks lot in advance hints. simon

python - Tkinter: String variables not working -

i have made program science asks symbol of n element , must type in element problem can't tell if got answer wrong keeps saying correct!, here code, # import modules tkinter import * import random, time # window setup root = tk() root.title('element finder') root.state('zoomed') # elements """ = h, hydrogen b = he, helium c = o, oxygen d = c, carbon e = n, nitrogen f = ne, neon g = u, uranium h = na, sodium = ar, argon j = k, potassium k = mg, magnesium l = cl, chlorine m = b, boron n = au, gold o = pd, palladium p = kr, krypton q = ca, calcium r = pm, promethium s = ag, silver t = rb, rubidium u = y, yurium v = ir, iridium w = pt, platnium x = ti, titanium y = hg, mercury z = er, erbium """ # variables element = stringvar() guess = stringvar() answer = stringvar() def question(): guess.set('') element.set('') r = random.randint(1, 26) if r == 1: element.set...

ios - can't make tab bar hidden when using container views -

Image
my app uses view controllers each containing 2 container views intermediaries between tab bar controller , navigation controllers. purpose of managing menu embedded in 1 of container views in each intermediary. i need hide tab bar (aka bottom bar). i have tried sending sethidesbottombarwhenpushed:yes every view controller, , have tried selecting "hides bottom bar on push" in storyboard every vc. why aren't these things working? assume must architecture: can see, navigation controllers embedded within container views vcs linked tab bar controller. how can hide tab bar in situation? sethidesbottombarwhenpushed: has optional toolbar can added navigation controller, not tab bar. think if add line self.tabbarcontroller.tabbar.hidden = yes; initial controller in each tab (the 1 container view), hide tab bar. think though, leave space @ bottom tab bar was. i'm not sure best way fix be. perhaps, if you're hiding tab bar, shouldn't using tab ba...

html - Add a date picker to a JetStrap page (Twitter Bootstrap) -

just started using jetstrap tonight build basic entry forms. lots of cool tools , fields, no date picker. ( check out if haven't! ) other topics discuss being done twitter bootstrap, not directly... can extend libraries / controls available in jetstrap page pulling in other web sources (a google hosted library example) add in additional functionality? i'm new web front end work , work in jetstrap possible without having download code locally , set own local iis site. i 1 of creators of jetstrap. we adding easy external js/css feature soon, in mean time, can load script dynamically javascript in js editor: $(function() { $.getscript('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.0.2/js/bootstrap-datepicker.min.js', function() { $('.datepicker').datepicker(); }); }) and in markup can add: <input type="text" value="02-16-2012" class="datepicker">

JSON deserialization in C# sub array -

i'm trying desearialize following using newtonsoft.json { "max_id_str":"1234567", "results":[{ "created_at":"tue, 21 may 2013 03:06:23 +0000", "from_user":"name here", "from_user_id":33333, "text":"the text goes here" }], "results_per_page":1, "since_id":0, "since_id_str":"0" } i can retrieve max_id_str using desearialization cannot of data in "results" here's code have public class tweet { public string max_id_str { get; set; } public string text{ get; set; } public string results_per_page{ get; set; } public string since_id { get; set; } public string since_id_str { get; set; } } i create object of class , attempt desearlize object tweet t = new tweet(); t = jsonconvert.deserializeobject<tweet>(e.result);...

Linux Shell - String manipulation then calculating age of file in minutes -

i writing script calculates age of oldest file in directory. first commands run are: oldfile=`ls -lt $dir | grep "^-" | tail -1 ` echo $oldfile the output contains lot more filename. eg -rwxrwxr-- 1 abc abc 334 may 10 2011 abcd_xyz20110510113817046.abc.bak q1/. how obtain output after last space of above line? give me filename. realise sort of string manipulation required new shell scripting. q2/. how obtain age of file in minutes? to obtain oldest file's name, ls -lt | awk '/^-/{file=$nf}end{print file}' however, not robust if have files spaces in names, etc. generally, should try avoid parsing output ls . with stat can obtain file's creation date in machine-readable format, expressed seconds since jan 1, 1970; date +%s can obtain current time in same format. subtract , divide 60. (more awk skills come in handy arithmetic.) finally, alternate solution, @ options find ; in particular, printf format strings allow extract fi...

what is Querydsl 'Q' -

i saw example of querydsl didn't understand qemployee in that qemployee employee = qemployee.employee; qemployee e = new qemployee("e"); query.from(employee) .where(employee.weeklyhours.gt( new hibernatesubquery().from(employee.department.employees, e) .where(e.manager.eq(employee.manager)) .unique(e.weeklyhours.avg()) )).list(employee) someone please explain ' q ' the "q" classes auto-generated query types, based on entities, used querying in querydsl. see here (section 2.1.5): http://www.querydsl.com/static/querydsl/latest/reference/html/ch02.html#d0e184

jquery - onclick print content which inside the iframe -

i facing problem on print content inside iframe. this anchor tag outside iframe : <a href=”#” onclick='window.print()' >print</a> here iframe <iframe name="newtest" src="https:xyz.com" ></iframe> i want print page inside iframe on click of anchor tag outside iframe <iframe src="" id="iframeid"></iframe> document.getelementbyid("iframeid").contentwindow.print(); if trying print remote site, can't in way. if http://yoursite.org , iframe <iframe src="http://google.com"> can't that, site domain must match instead if page local page <iframe src="page.htm"> work

python - Convert List of strings to ints without removing 0 -

so have list of strings want convert list of ints ['030', '031', '031', '031', '030', '031', '031', '032', '031', '032'] how should go new list not remove zeroes i want this: [030, 031, 031, 031, 030, 031, 031, 032, 031, 032] not this: [30, 31, 31, 31, 30, 31, 31, 32, 31, 32] thanks the value of int("030") same value of int("30") . leading 0 doesn't have semantic value when talking number - if want keep leading 0 , no longer storing number, rather representation of number, needs string. the solution, if need use in both ways, store in commonly used form, , convert need it. if need leading 0 (that is, need string), keep is, , call int() on values required. if opposite true, can use string formatting number padded required number of digits: >>> "{0:03d}".format(30) '030' if 0 padding not consistent (that is, it's imp...

java - How to set orientation dynamically based on devices? -

is possible dynamically setting portrait mode , landscape mode ? example, need make application workable in landscape , portrait mode large mdpi, large hdpi , xlarge for other resolutions such normal hdpi,normal hdpi , other , need portrait mode. can me in this? yes possible force such things. can detect density of device , can load appropriate xml file. you can detect density looking @ display metrics: displaymetrics metrics = getresources().getdisplaymetrics(); then looking @ metrics.densitydpi . can load different resources accordingly. int layoutid; switch(metrics.densitydpi) { case displaymetrics.density_low: layoutid = r.layout.lowthingy break; case displaymetrics.density_medium: layoutd = r.layout.mediumthingy break; ... (for other densities) } setcontentview(layoutid); but because can this, doesn't mean should. , think not best approach. think should read documentation.

How can I manually modify models retrieved from the database in Django? -

i wish such following: people = people.objects.filter(date=date) person = people[0] person['salary'] = 45000 the last line results in error: object not support item assignment to debug find easier start working , modify line line until breaks. i want modify object rendering in template. if try: person.salary = 45000 there no error trying print person.salary immediately afterwards results in original value being printed. update: in code doing: people[0].salary = 45000 which doesn't work. reason person = people[0] person.salary = 45000 does work. thought 2 pieces of code same looking @ ids, seems when assign entry variable, copy, not original reference: in [11]: people = people.objects.filter(salary=100) in [12]: person = people[0] in [13]: person.salary = 5000 in [14]: print person.salary 5000 in [15]: people[0].salary out[15]: 100 in [16]: id(people[0]) out[16]: 35312400 in [17]: id(person) out[17]: 35313104 so, let's @ ha...

c - How does this code counting the number of characters, lines, and words work? -

while (fgets(line, max_line_len-1, infile) != null) { num_lines += 1; num_chars += strlen(line); if (strncmp(line, "", max_line_len) != 0) { num_words++; } } the whole program counts number of words. chunk of code increases line number of text , count words, don't know what's going on here. how work? strlen( line ) give number of characters in line . (check man strlen .) num_chars += strlen( line ) add number num_chars . strncmp( line, "", max_line_len ) compare contents of line empty string (but on safe side, not read more max_line_len characters of line , in case not null-terminated). return 0 if equal. (for further details, refer man strncmp .) if (strncmp(line, "", max_line_len) != 0) { num_words++; } add 1 num_words if line not equal empty string. note num_words misnomer, there no word counting going on here, counting of non-empty lines.

How to set active a button in xslt? -

i have code in xslt selecting 2 values using buttons.i need check value , set active corresponding button.here code <ul class="switch"> <li class="private-btn"> <xsl:if test="library:requestquerystring('at') = 'privat'"> here need active btn code </xsl:if> <input type="button" class="privat" value="privat"></input> </li> <li class="business-btn"> <xsl:if test="library:requestquerystring('at') = 'erhverv'"> here need active btn code </xsl:if> <input type="button" class="privat" value="erhverv"></input> </li> </ul> can help? if understand correctly, want conditionally set disabled html attribute (and possibly other attributes) on button. you can conditionally add attribute so: <input type="button" class="priva...

java - Stop and play mp3 in mediaplayer -

i have placed 2 mp3 songs in raw folder. have used 2 buttons play them. calling below: public class songs extends activity implements onclicklistener { private button mbtn1, mbtn2, mbtn3, mbtn4, mbtn5, mbtn6, mbtn7, mbtn8, mbtn9, mbtn10; mediaplayer mp; boolean playing = false; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.songs); mbtn1 = (button) findviewbyid(r.id.button1); mbtn2 = (button) findviewbyid(r.id.button2); mbtn1.setonclicklistener(this); mbtn2.setonclicklistener(this); } @override public void onclick(view v) { // todo auto-generated method stub else if (v.getid() == mbtn1.getid()) { if (playing) { mp.stop(); mp.pause(); playing = false; } else { mediaplayer mp = mediaplayer.create(songs.this, r.raw.cha...

javascript - Using <div>s as slides instead of images in ImageFlow Slider -

i using imageflow making image slider. want use <div> s instead of images slides. how can it? i checked out link comments - write can't edit actual code wrap div around each individual img. trying change way gallery works instead of inputing img can insert divs , have slider js still work? i took html below link posted earlier : <div id="myimageflow" class="imageflow" style="visibility: visible; height: 517px; "><img src="img/9_comtech_o.jpg" id="id11" height="360" width="300" longdesc="img/img11.png" alt="img11"><img src="img/8_psabuilding.jpg" id="id9" height="360" width="300" longdesc="img/img9.png" alt="img9"><img src="img/7_mbc.jpg" id="id7" height="360" width="300" longdesc="img/img7.png" alt="img7"><img src="im...

Complex SQL Query with group by Clause -

i not sql expert have got query use msdb declare @jobstepcount int, @jobname sysname, @jobid uniqueidentifier declare @jobstatus table (jobstatusid int, jobstatus varchar(20)) insert @jobstatus (jobstatusid, jobstatus) values (0, 'failed'), (1, 'succeeded'), (2, 'retry'), (3, 'cancelled') set @jobname = 'expedient bookingrefresh' select @jobid = job_id sysjobs j j.name = @jobname select @jobstepcount = count(*) dbo.sysjobsteps job_id = @jobid select rundate, runtime, runduration, jobstatus ( select jstart.instance_id, rundate, runtime, runduration, min(h.run_status) run_status sysjobhistory h inner join ( select instance_id, jstart.instance_id - @jobstepcount instance_range, jstart.run_date rundate, convert(time, left(jstart.run_time, 2) + ':' + substring(jstart.run_time, 3, 2) + ':' + right(jstart.run_time, 2)) runtime, conv...

jquery - Autocomplete not allowing spaces -

i using autocomplete in site this: $(document).ready(function(){ $('input[type="text"]').each(function(){ var $this = $(this); $this.autocomplete({ minlength: 1, source: "{site_url}publish/my_autocomplete?key=" + $this.attr('id') }) }); }) it working fine when there word 'harley motor' , if have typed 'ey ' space not displaying. suggestions how can select harley motor typing ey trailing space? the url needs escaped, since not have issue: blank spaces in ajax request jquery you need escape : source: escape("{site_url}publish/my_autocomplete?key=" + $this.attr('id'))

inline - What is the benifit of inlining methods -

i've seen util class written friend having many inline methods. class images , has methods like public static inline function resize ( img:image, width:int, height:int) { //... method implementation goes here. } i've asked him why usage of inline . know compiler changes var img:image = imgutil.resize(img, 100, 100); to var img:image = // implementation of method here he said reduces calls functions , use them on utility methods. doesn't copying same code every time increase program size? is needed nowadays? if needed, when should 1 use them? edit i'm listing problems , advantages in list given in link patrick provided future viewers don't want go through links. problems replacing call site expanded function body can worsen performance in several ways : in applications code size more important speed, such many embedded systems, inlining disadvantageous except small functions, such trivial mutator methods. the increase in code siz...

Sqlite check for multiple values- Android -

i have requirement need check multiple values in sqlite clause. query goes this. string sql = "select * _jobcard_table t1 " + " left join _customer_table t2 on (t1._custid=t2._custid) " + " left join _make_table t3 on (t1._job_make=t3._makeid) " + " left join _model_table t4 on (t1._jobmodel=t4._modid) " + " _addedby='" + globals.mid + "' , _jobestimatedate='"+curr+"' " + " group _jobregno order _custname"; here curr, arraylist of values, need check if date 1 of values in arraylist, return row, how can that? able check 1 value curr.get(0). not sure how check multiple values, please help! use in keyword. "_jobedtimatedate in (\"value1\", \"value2\", \"value3\")"

Converting String List into Int List in SQL -

i have nvarchar(max) in stored procedure contains list of int values, did it not possible pass int list stored procedure , but, getting problem datatype int , want compare list of string. there way around can same? ---myquerry----where status in (@statuslist) but statuslist contains string values not int, how convert them int? update: use [database] go set ansi_nulls on go set quoted_identifier on go alter procedure [dbo].[sp] ( @fromdate datetime = 0, @todate datetime = 0, @id int=0, @list nvarchar(max) //this list has string ids// ) as set fmtonly off; declare @sql nvarchar(max), @paramlist nvarchar(max) set @sql = 'select ------ , code in(@xlist) , -------------' select @paramlist = '@xfromdate datetime,@xtodate datetime,@xid int,@xlist nvarchar(max)' exec sp_executesql @sql, @paramlist, @xfromdate = @fromdate ,@xtodate=@todate,@xid=@id,@xlist=@list print @sql so when implement function s...

iis 7 - Why is Railo in conjunction with IIS performing slowly? -

i have coldfusion installed in machine. just have downloaded , installed railo . i have stopped coldfusion application server. i have created simple app , mapped iis . railo taking huge amount of time run single .cfm file. so can please suggest how railo iis should configured run faster? it works fine tomcat, want use iis. iis trying connect coldfusion before railo , you've stopped cf service it's waiting timeout. you should remove/disable coldfusion connector.

gitignore - Git: Add only a specific set of wildcards and ignore everything else -

i'm working on project , want ignore not .cpp , .h , .cxx , .hpp files example. how can that? tried adding following lines .gitignore file still adds libs , png files , other junk: !*.cpp !*.h !*.hpp !*.hxx !*.cxx !*.c how can ignore these extensions? thanks! you can add *.* at beginning of .gitignore file. that ignore every file except ones defined below '!'. you can find lot of useful .gitignore file on github or on gitignore.io

enumerator - How enum#feed works in ruby? -

enum#feed sets value returned next yield inside e.if value not set, yield returns nil.this value cleared after being yielded. i tried 1 example not 1 think understand #feed method. a = [1,2,3,4].to_enum p a.next #=> 1 a.feed 'foo' p a.next #=> 2 , expected here 'foo' can give me example understand how #feed method works? based on documentation linked to, it's enumerable object in question decide feed call. in case, default behavior ignore it. if write own custom enumerable class, accept , treat will. i have never seen feed used, again, it's sort of thing that's put there occasions when might need it. can't think of use thing @ all, honest. you'll have test various things support, i'd surprised if find objects use presume.

cordova - storing backbone model and collections in phonegap singlep page apps before sync -

i developing single page phonegap applications , using backbone, require.js, underscore. need enter patient, , doctor information. means have backbone model patient , doctor. now, may enter 3 patient , 3 doctor information. mean have form collection of pateint , doctor. now, when device offline, want store them locally. , when device online, want sync them server. i wondering idea here use. should use phonegap sqlite, or backbone adopter local storage or html5 local storage efficient , reliable means? , can suggest me sample on git hub or examples on doing this? i think on right track. there several step accomplish it, each of represent it's own problem. detect application goes offline. once offine, switch backbone.sync ajax-based, localstore (you mentioned sqllite, if there api in javascript , backbone plugin it's nice too). you track "sync" happens during offline mode. once application goes online again, not-sync changes uploads server. plea...

android - Setting MinDate on DatePicker moves CalendarView to 1964 -

Image
i'm debugging issue calendarview in datepicker moves october 1964 if there non-default minimum date set. reproduces @ least on api17 nexus7 emulator there reports issue on other devices platform style includes both spinners , calendar view in date picker. here's code snippet demonstrating issue: class datepickerdialog1964 extends datepickerdialog { datepickerdialog1964(context c) { super(c, null, 2013, 4, 21); @suppresswarnings("deprecation") date min = new date(2013-1900, 4, 21); datepicker p = getdatepicker(); p.setmindate(min.gettime()); } } ... new datepickerdialog1964(context).show(); screen shot: of course, expectation spinners , calendar view showing same date. i'll keep on debugging if users have experience or other insight, please share. related: issue 42750: calendarview scrolls year 1964 using calendarview pick date in future (android-developers) tl;dr it's no...

PHP combinations of array elements -

i want generate possible combination of array elements fill placeholder, placeholder size vary. let have array $a = array(3, 2, 9, 7) , placeholder size 6 . want generate following: 3,3,3,3,3,3 2,3,3,3,3,3 2,2,3,3,3,3 ........... ........... 7,7,7,7,7,9 7,7,7,7,7,7 however (2,3,3,3,3,3) considered same (3,2,3,3,3,3) later 1 doesn't count. could point me right direction? know there math_combinatorics pear package, 1 applicable placeholder size <= count($a) . edit thinking 1 similar bits string combination though different number base i have no php source code sources might help. some c code. @ 2.1: http://www.aconnect.de/friends/editions/computer/combinatoricode_g.html delphi code: combination without repetition of n elements without use for..to..do wiki article here

android - When cover the installation,Console print INSTALL_FAILED_UID_CHANGED.Please help me -

i have app @ version 3.7.there no property "android:shareduserid" in androidmanifest.xml. but now,i'm going update app 3.8. , add "android:shareduserid" androidmanifest.xml plugin function. after finish that, cover installation, 3.7 3.8, can't that. in console window ,print out "install_failed_uid_changed". besides that, remove "android:shareduserid", runs well. anybody has idea this? and add "android:shareduserid" androidmanifest.xml plugin function. that not work. can never change android:shareduserid value whatever had been (including setting value had not set before). please use other mechanism, signature-level permissions, secure communications plugins.

c++ - Is there a design reason why std::set doesnt have front and back member functions? -

i know can use *s.begin() , same argument can used vector , has front / back often use ordered property of set/map "smallest" element/key - ofc fact i not reason have it, example :) here i'm talking design reasons why front / back bad design, please skip obvious reasons committee forgot it... i imagine words "front" , "back" reserved sequence containers (i.e. order of elements determined order of insertion), , words meant suggest physical position in sequence. since set not sequence container (but instead associative container), isn't appropriate. in particular, note meaning of "front" can change later insertions of unrelated element.

Custom MembershipProvider IN ASP.NET MVC4 -

i'm trying extend membershipprovider use own table. did new asp.net mvc 4 site, extend membershipprovider , added customprovider in web.config under system.web now when i'm running app, i've issue: erreur de configuration description : une erreur s'est produite lors du traitement d'un fichier de configuration requis pour répondre à cette demande. veuillez consulter ci-dessous les détails relatifs à l'erreur en question, puis modifier votre fichier de configuration de manière appropriée. message d'erreur de l'analyseur: cette méthode ne peut pas être appelée lors de la phase d'initialisation de pré-démarrage de l'application. erreur source: ligne 34 : <providers> ligne 35 : <clear/> ligne 36 : <add name="custommemberprovider" type="erp.dal.connection.custommemberprovider" /> ligne 37 : </providers> ligne 38 : </membership> fichier source : e:\de...

Android - Function execute listener -

hey don't know if that's right way if how can it... i have 1 abstact class asynctask public abstract class a{ a(){ new task().execute(); } public abstract void postaction(); private class task extends asynctask<string, string, string>{ protected string doinbackground(string... args) { //smth } protected void onpostexecute(string file_url){ postaction(); } } } after have class extends class , overrides it's postaction() method: public class b extends a{ b(){ //smth } postaction(){ //some action } } in activity have instance of b , want perform action when postaction called... want function listener if possible , how can class c extends activity{ public void oncreate(bundle savedinstance) { super.oncreate(savedinstance); //somethingggg happeiningggg } mylistener listener = new mylistener(){ onpostactioncalled() { //start activity or sm...

ios - Generate PDF via objective-C in Cordova app -

i followed guide http://www.ioslearner.com/convert-html-uiwebview-pdf-iphone-ipad/ generate pdf uiwebview. need generate pdf cordova uiwebview in app. know how this? think necessary write plugin this.. thank in advance. use kapdfplugin .add plugin project , follow instructions link code.

Service is not starting up in android -

i using following code startservice(new intent(loading.this, appservice.class)); public class appservice extends service { private timer timer; @override public ibinder onbind(intent arg0) { return null; } @override public void oncreate() { timer = new timer(); timer.scheduleatfixedrate(new timertask() { @override public void run() { sharedpreferences customsharedpreference = getsharedpreferences( "usersharedprefs", activity.mode_private); boolean isloggedin = customsharedpreference.getboolean("isloggedin", false); if (isloggedin) updatecontact(); } },0 , 120 * 1000); } @override public int onstartcommand(intent intent, int flags, int startid) { return service.start_not_sticky; } @override publ...

android - Activities and It's Subactivities issue in Tabhost -

i having tabhost in application, in first activity 1 listview there..now when scroll , click on listview subactivity called.. now, when come secondactivity first activity listview scroll first.. want list stayed @ position clicked go secondactivity.. using tabgroupactivity. here tabgroupactivity class. public class tabgroupactivity extends activitygroup { private arraylist<string> midlist; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); if (midlist == null) midlist = new arraylist<string>(); } /** * called when child activity of 1 calls finish method. * implementation calls {@link localactivitymanager#destroyactivity} on * child activity , starts previous activity. if last child * activity called finish(),this activity (the parent), calls finish * finish entire group. */ @override public void finishfromchild(activity child) { ...

javascript - Can a webservice not support JSONP? -

i trying data using worldbank api . webservice call making this . code doesnt work. $.ajax({ type: 'get', url: 'http://api.worldbank.org/countries/indicators/3.1_low.sec.new.teachers?per_page=50&date=1960:2013&format=json', jsonpcallback: 'jsoncallback', contenttype: "application/json", datatype: 'jsonp', success: function(data) { console.log(data); }, error: function(e) { console.log(e.message); } }); any appreciated! json , jsonp entirely different things. you're asking json, telling jquery you're asking jsonp. that's not going work. it support jsonp if tell to. should use format=jsonp , prefix=the_name_of_your_callback . since want jquery control callback name, want jsonp argument tell api uses non-standard prefix argument (rather callback , standard one). $.ajax({ url: 'http://api.worldbank.org/countries/indicators/3.1_low.sec.new.teachers?per_page=50&date=...

opencv - A good approach for detecting lines in an image? -

Image
i've written code uses opencv libraries detect white lines painted on grass. need someone's opinion on approach used (as i'm sure there's better way mine). also, results i'm getting not expected because slight variations in image require tweaking parameters (and need operate on fixed parameters). my approach far: grab image webcam (and turn grayscale obviously) run through threshold filter (using thresh_to_zero mode, zeros out pixels below threshold value). blur image run through erosion filter run through canny edge detector finally, take processed image , find lines using probabilistic hough transform houghlinesp should change sequence of filters? p.s. i'm not concerned processing power; i'm running houghlinesp on gpu b-) also, here sample image: the results i'm getting: canny without canny (slightly tweaked parameters) any or guidance appreciated! have no idea improve it! update after using quick skeleton implementation (w...

sql - How to get a list from comma seperated data in mysql -

i want use sql this: select * product productid in (select relatedproductids product productid = 11) relatedproductids contains '2286,11212,11031,11212,11212,4082,9339,9214' do have suggestion? use find_in_set() select a.* product inner join product b on find_in_set(a.productid, b.relatedproductids) > 0 b.productid = 11 as advice, should normalize table. saving comma separated value in column bad design. mysql find_in_set

how to deploy guvnor in embeded jetty -

background: i use eclipse, maven, embeded jetty, drools , guvnor in project, , want deploy guvnor embeded jetty, , try call rest api in java. here i've done: (1) download "guvnor-5.5.0.final-tomcat-6.0.war" , , use embedded jetty start it. server server = new server(8084); webappcontext webapp = new webappcontext(); webapp.setcontextpath("/"); webapp.setwar("src/main/resources/meta-inf/guvnor-5.5.0.final-tomcat-6.0.war"); server.sethandler(webapp); server.start(); (2)the server started normally, when try open http://localhost:8084/org.drools.guvnor.guvnor/guvnor.jsp? in chrome, gives fault page, it's same error in ie. @ same time, in eclipse console, printed error message. however, when deploy guvnor in tomcat 6.0, ok. have me on issue? thank yo much. eclipse console: error 21-05 15:51:34,340 (logginghelper.java:error:74) character encoding '(null)'. expected 'utf-8' chrome: ...

javascript - how to verify style attribute in Selenium IDE -

i have following code: <div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all ui-multiselect-single" style="width: 192px; top: 172px; left: 299.9px; display: none;"> how can use verifyattribute or other command validate style display: none; ? xpath have /html/body/div[3] better late never... command: assertattribute target: css=#div_id@style value: display: none

c# - Make sure attribute is used with static methods only -

is there way tell attribute work when used static methods? attributeusage class not seem allow such specyfic usage. [attributeusage(attributetargets.method, inherited = false, allowmultiple = false)] no, there no way restrict this. - use reflection @ run-time enforce this.

android - Google Play - wrong minimum API detected -

i've uploaded apk google play console. problem on app site on google play requires android field wrong. shows 1.6 while i've set in manifest file 2.3 . suppose users lower apis can download app , bad experience crash. whats wrong? fragment of manifest.xml: <uses-sdk android:minsdkversion="9" android:targetsdkversion="17" /> this issue still persists (as of december 2013), in beta , alpha tracks. correct "requires android" version displayed promote application production.

Java bytecode to exe and combing c++ and java -

i have read many articles , posts im still confused how make/convert bytecode exe can run on standalone machine withour jre,jvm or other kind of thing. what combining c++ , java program means? and if it's possible combine c++ , java program , how so? bytecode exe can run on standalone machine: don't think can done. java assembly differs in architecture x86 assembly. maybe can go java source code .exe. combining c++ , java program done via jni. write c++ dll using specific library convert between java , c datatypes, , call dll java code. combine c++ , java program , how so: http://www.ibm.com/developerworks/java/tutorials/j-jni/section2.html best way want: in c++. keylogger uses native system calls key state, it's better if it's written in c/c++, learn winsock c++ send data. victim client, , server http://www.binarytides.com/winsock-socket-programming-tutorial/ see "sending data" section. here sample code client-victim: #include<...

ClickOnce application creating a new firewall rule on every update -

i have application uses tcp allow instant notification on our internal network , published using visual studio professional 2012 . i'm finding on each update though (still using auto updating feature provided clickonce ), it's adding in new firewall rule, because it's installed in different folder (for example, c:\users\username\appdata\local\apps\2.0\vhhecqeo.hox\eqaz9px7.kdb\mant..tion_0000000000000000_0001.0002_ebb40fc614f8be21\mantra.exe next time: c:\users\trent.jones\appdata\local\apps\2.0\vhhecqeo.hox\eqaz9px7.kdb\mant..tion_0000000000000000_0001.0002_ae7718736748fac0\mantra.exe). marginally different, clickonce doesn't allow me specify install folder (due how clickonce files work . i use netsh add in/check rules manually, that's horrible because still need run administrator/local administrator , users aren't. plus, i'm not sure stop windows firewall checking/adding own version of rule.. is there way of fixing this?

javascript - Iscroll is slow and doesnt move smooth when there are 30+ items in it -

when have more items ( 30 ) in iscroll iscroll plugin on mobile becomes slow ( think because there unnecessary paints or mobile phone slow ?) , doesnt move smooth. http://www.html5rocks.com/en/tutorials/speed/unnecessary-paints/ have suggestions plugin or how fix ? im using handelbars render it. html structure looks : <div id="notificationsscroll"> <div id="notificationlist" class="friends-tiles"> <div class="smooth friend"> </div> </div> </div> and css looks this #notificationsscroll{ position:relative; z-index:1; width: auto;/* desired width, auto , 100% fine */; height: 73%; //height: 334px;/* element height */; overflow: scroll; } im using iscroll v4.1.6 your code snippets don't show you've applied iscroll - may oversight in pasting code, or problem...iscroll overrides native scrolling historically slow , unintuitive in touch in...

c# - Cross Thread after 20 seconds running -

i receive data serial port , show received data in format arrive in multiline text box. serial monitor "txtoutput". after have validated data complete messages , filtered out few characters (in separate class), need show data additional text boxes (textbox7, 2 , 6). reason not able understand, after 10 20 seconds of debugging, messages coming in continuously (200-300 ms), cross thread error, "cross-thread operation not valid: control accessed thread other thread created on". this code: serial port reading private void serialport1_datareceived(object sender, system.io.ports.serialdatareceivedeventargs e) { try { settext(serialport1.readexisting()); } catch (exception ex) { settext(ex.tostring()); } } delegate settext delegate void settextcallback(string text); receive serial port data , elaborate private void settext(string text...

woocommerce - Create Attributes and Linking Attributes to Product -

i'm having trouble creating attributes products using woocommerce. example have products have different color. main attribute color , variables red , orange , purple . i have tried following unable set it. wp_set_object_terms( 165, 'color', 'pa_colour' ); wp_set_object_terms( 165, array("red", "orange", "purple"), 'pa_colour' ); how create attributes first , link them product? there simple way first create attribute create variables link product? update: i've been able research , able create attribute. $wpdb->insert( $wpdb->prefix . 'woocommerce_attribute_taxonomies', array( 'attribute_label' => $data['attributelabel'], 'attribute_name' => $data['attributename'], 'attribute_type' => $data['attributetype'], 'attribute_orderby' => $data['attributeorder'], ) ); however...

protocol buffers - Error while adding protobuf dependency to maven -

i trying add protobuf dependency maven project. have installed protobuf jar file using mvn install:install-file -dpackaging=jar\ -dgeneratepom=true\ -dgroupid=com.google.protobuf\ -dartifactid=protobuf-java\ -dfile=protobuf-java-2.5.0.jar\ -dversion=2.5.0 mypom.xml file follows: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>protobufexample</groupid> <artifactid>protobuftest</artifactid> <packaging>jar</packaging> <version>1.0-snapshot</version> <name>protobuftest</name> <url>http://maven.apache.org</url> <properties> ...

c# - Is there a way to monitor the state of a console application? -

is there way monitor state of console application? i trying build user interface shows whether or not console application running on server (processing files). if running, show current state: how many files processed, file being processed, etc. the way can think of doing this: create text/xml file when application started update text file information current state each object processes delete text file when application finished processing to me, doesn't seem or efficient way it. there way detect if clickonce application running, , perhaps other way access "messages" or log of show progress? note - looking using nodejs this, unsure if has capability. first, should consider writing windows service instead of console application. that said, scraping log file application writing reasonable approach. ensure never gets big. alternatively, @ using custom performance counters . open door using system monitor/perfmon monitoring tool, no need write ...

sql - Insert Number values -

when inserting values database, , datatype number, number need in quotation marks: here object code: create type computerfile_objtyp object ( computerfileno number, comp_ref ref computer_objtyp, computerfilename varchar2(50), computerfilesize number ) / here insert code: insert computerfile_objtab select 1, ref(cobj), 'c:\app1\app1.exe', 1000 computer_objtab cobj cobj.compno = 1; does code above work, or need this: insert computerfile_objtab select 1, ref(cobj), 'c:\app1\app1.exe', '1000' computer_objtab cobj cobj.compno = 1; (i referring 'computerfilesize number' attribute) i cannot test out database not running @ moment. no, numbers should not put between quotes in oracle.

iphone - Unable to send app invitation to facebook friends -

when send invitation friends, friends receive invitation nothing has opened. when user invitation , click url made given below - https://apps.facebook.com/invitationitesting/?fb_source=notification&request_ids=528827943820609&ref=notif&app_request_type=user_to_user&notif_t=app_invite this not working url same url :- https://apps.facebook.com/farmville-two/?fb_source=notification&request_ids=119410701597152&ref=notif&app_request_type=user_to_user&notif_t=app_invite i think forgot formalities in app setting. please me solve problem . in advance. please check below link describe step-by-step process. http://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/ hope usefull

asp.net - Back button returns empty value of dropdown in IE -

hi have drop down field on 1 form,which send data form searchresult.aspx however, if 1 clicks on button in internet explorer, fields default.aspx cleared. have stored drop down value in hidden field,but empty when navigating through button. works fine firefox , chrome. has idea , have make work? im using jquery mobile using asp.net could ie caching blank page , pulling when hit button, using fiddler can see if it's loading page or pulling cache. otherwise try saving dropdown value in session before go next page, when come search page update code check session value, if there use select dropdown otherwise if not there select default value.

java - logic for matching two images in a game -

hi want compare logic matches in image-grid populated on random. right have 2 arrays the images on matching positions in arrays "logic match". i loop them arraylist shuffle , populate grid implements checkable. but want able assign kind of constant value drawabls in original arrays when looping them arraylist in end can chose 2 images think match , compare value. but don't relay know how go this. many tanks. i created game may you? try this: http://jsfiddle.net/jmccommas/ahpfv/ jquery code var lastselected; var score = 0; var boxopened = ""; var imgopened = ""; var num = 0; var moves = 0; $(function () { $("div.row div img").addclass('hidden'); addimg(); click(); check(); shuffle(); }); function randomfromto(from, to) { return math.floor(math.random() * (to - + 1) + from); } function shuffle() { var children = $("#boxcard").children(); var child = $("#boxcard div:...