Posts

Showing posts from April, 2013

winapi - Visible separators in win32 api toolbars (not just gaps)? -

Image
i want (just separator) this have: how go doing this? the separator @ moment this, nothing else in tbbutton struct set separator tbb[3].fsstyle = tbstyle_sep; the win32 control draws vertical separator lines if toolbar uses flat style. can achieve effect want including tbstyle_flat style when create toolbar window.

html - slidedown menu, synchronise sliding content jquery -

hi have built simple slide down menu jquery , can found @ http://testsiteproject.bugs3.com/ my question rises when click on grey top button, want black button follow down menu instead of appearing after div has slided down. there way achieve this? <div id="topmenu"> <div id="top-top"></div> <a href='javascript:slidemenuup();'> <div id="top-bottom"></div> </a> </div> i should slide down "topmenu" includes both "top-top" , "top-bottom". slides "top-top". function slidemenu(){ if ($("#topmenu").is(":hidden")) { $("#topmenu").slidedown("slow"); } else { $("#topmenu").hide(); } } what if try positioning whole #topmenu div off screen (with negative top value), animating on top property instead of slidedown . a quick mockup of mean: fiddle: http://jsfiddle.net/vleyf

opencv - Implementing Hough Transform for Lines -

i trying implement hough transform line detection in pre-processed image. input image black-white edge image, 0 - background , 255 - foreground. not wish use inbuilt houghlines library opencv. stuck creating accumulator , increasing values properly. cant figure out went wrong, here code block : int diagonal = sqrt(height * height + width * width); iplimage *acc = cvcreateimage (cvsize(180, 2 * diagonal),ipl_depth_8u, 1); unsigned char* accdata = (unsigned char *)acc->imagedata; (int i=0; i<height; i++) { (int j=0; j<step; j++) { if (data[i*step + j] > 200) { (int theta=0; theta<180; theta++) { int p = j * cos(theta) + * sin(theta); if (p > 0) accdata[theta*180 + p] += 1; } } } } the output image in acc not should like. not getting sinusoids, instead white patches here , there. can provide feedback went wrong ? what see there d

Forcing whitespace in Bash arrays being passed into grep -

i have pretty simple bash script should grep file multiple phrases want flag. it works until point, falling on when want grep ' print ' or ' puts ' (note whitespace before , after word). the grep ignoring whitespace in input. here code (stuff isn't relevant has been cut out) #!/bin/sh bad_phrases=('console.log(' 'binding.pry' ':focus,' 'alert(' ' print ' ' puts ') bad_phrase_found=false file='my_test_file.txt' bad_phrase in ${bad_phrases[*]} ; if grep -q "$bad_phrase" $file ; bad_phrase_found=true echo "a '$(tput bold)$(tput setaf 1)$bad_phrase$(tput sgr0)' found in $(tput bold)$(tput setaf 5)$file$(tput sgr0)" fi done if $bad_phrase_found ; exit 1 fi exit 0 i have looked @ setting ifs '~' , splitting array way, killed grep command completely. the example output of script is; 'print' found in my_test_file.txt any appreciated.

mysql - magento enterprise_targetrule/index model not saving -

i executing code: $model1 = mage::getmodel('enterprise_targetrule/index')->load(5511); var_dump($model1); $model2 = mage::getmodel('enterprise_targetrule/index')-> load(5511)-> setflag('0')-> save(); var_dump($model2); $model3 = mage::getmodel('enterprise_targetrule/index')->load(5511); var_dump($model3); die(); the outputs var_dump calls expect: $_data[flag] 1 $model1 , 0 $model2 , $model3 , , $_origdata[flag] 1 $model1 , $model2 , , 0 $model3. so far, looking right. however, when (immediately after running code), execute select * enterprise_targetrule_index on database, result: mysql> select * enterprise_targetrule_index; +-----------+----------+-------------------+---------+------+ | entity_id | store_id | customer_group_id | type_id | flag | +-----------+----------+-------------------+---------+------+ | 5511 | 7 | 0 | 1 | 1 | why? why flag not getting updated? mo

visual studio 2010 - Undefined behaviour in C++ asserts: accessing an invalid/null pointer -

under visual c++ 2010, following snippet hides dubious behaviour: cobject* myobjectptr = cobjectfactory::makeanobject(); assert( myobjectptr->candosomework() ); // myobjectptr can null due logical errors the following snippet, when placed in function, did not trigger assert when pointer null , function returned immediately. aside null pointer check obvious fix suggest, made code behave in such way? shouldn't complain memory access violation error if error occurs within assert? myobjectptr->candosomework() if candosomework not virtual function compiler rewrites c_object::candosomework(myobjectptr) this doesn't involve dereference of object pointer @ won't crash or fail. if it's virtual function crash use pointer find vtable. of course none of guaranteed in standard, it's undefined behavour, explains seeing happen.

sql - duplicate issue when inserint value to varbinary -

we face weird issue. we have 1 table in our mssql 2008 r2 db when table column follow: userid - int username - varbinary(256) usertype - int and username column unique we preform following query again table: insert table_name (userid, username, usertype) values ( 1 , 0x5942c803664b00, 0) and after query following query : insert table_name (userid, username, usertype) values ( 2 , 0x5942c803664b, 0) and following error: cannot insert duplicate key row in object 'table_name ' unique index 'table_name _username_u'. although 0x5942c803664b , 0x5942c803664b00 different values?? any idea ? the trailing "zero-bytes" 0x00 in varbinary column insignificant trailing spaces " " in varchar column. therefore, values duplicates. in other words, 2 values (in byte order) 1 2 3 4 5 6 7 --- bytes in binary value 59 42 c8 03 66 4b 59 42 c8 03 66 4b 00 the last byte (8 bits of 0) considered insignificant pur

generics - C++ : Vector of template class -

i have template class named cell follows:- template<class t>class cell { string header, t data; } now want class named row. row have vector named cells such can add both cell , cell type elements vector. possible? if so, how can that? in advance. with detail you've provided, first 2 answers won't work. require type known variant cell , can have vector of those. example:- enum celltype { int, float, // etc }; class cell { celltype type; union { int i; float f; // etc }; }; class vector { vector <cell> cells; }; this, however, pain add new types requires lot of code maintain. alternative use cell template common base class:- class icell { // list of cell methods }; template <class t> class cell : public icell { t data; // implementation of cell methods }; class vector { vector <icell *> cells; }; this might work better have less code update add new cell type have use pointer type in cel

scaladoc - Why is it so difficult to browse through Scala api? -

firstly had issue finding #:: method of stream. got resolved this . now looking below method in stream def iterate[a](start: a, len: int)(f: => a): stream[a] the stream api has no mention of it. secondly in scala doc, why can't have inner classes defined in same respective parent class itself. why user has go , click @ c character on left panel search stream.conswrapper when directly read inside documentation stream itself? am missing something? scala newbie (3 months), if new user can't used it, of not able to. iterate not method of stream class, method of stream object. described here . from scaladoc page stream class linked, can go directly scaladoc page stream object clicking on "c" (for "class") icon @ top, , clicking on "o" icon. as finding operators, can click on "#" @ top of left search panel, brings this page lists operators of standard library. there can find mention of #:: operator , c

Delphi interface implements -

i expect reference counting should work on outer aggregating object in interface implementation. if can refer example: clarity in classes implementing multiple interfaces (alternative delegation): here minimal reproduction of behaviour: program so16210993; {$apptype console} type ifoo = interface procedure foo; end; tfooimpl = class(tinterfacedobject, ifoo) procedure foo; end; tcontainer = class(tinterfacedobject, ifoo) private ffoo: ifoo; public constructor create; destructor destroy; override; property foo: ifoo read ffoo implements ifoo; end; procedure tfooimpl.foo; begin writeln('tfooimpl.foo called'); end; constructor tcontainer.create; begin inherited; ffoo := tfooimpl.create; end; destructor tcontainer.destroy; begin writeln('tcontainer.destroy called');//this line never runs inherited; end; procedure main; var foo : ifoo; begin foo := tcontainer.create; foo.foo; end; begin main; readln

javascript - Trying to use two <div> inside a <li>, which are supposed to run a script. [Not sure if it's possible] -

not sure if trying going work, want insert inside li 2 div run script links inside them. bit confusing, know, cant explain in better way. take @ code: inside body of html <ul> <li> test </li> <li> test 2 <ul> <li> <div id="dock2" class="dock"> <div class="dock-container2" style="left: 760px; width: 400px;"> <ul> <li><a class="dock-item2" href="#" style="width: 40px; left: 0px;"><span style="display: none;">home</span><img alt="home" src="inc/images/dock/home.png"/></a> </li> <li><a class="dock-item2" href="#" style="width: 40px; left: 40px;"><span style="display: none;">contact</span><img alt="contact" src="

c# - Windows 8 Web Authentication Broker can't connect to the service -

can web authentication broker used non oauth authentication ? i have created asp.net mvc2 website login page want use through web authentication broker retrieve , persist authentication cookie. here code : webauthenticationresult webauthenticationresult = await webauthenticationbroker.authenticateasync( webauthenticationoptions.none, new uri("https://localhost:44301/account/logon"), new uri("https://localhost:44301/")); when loaded wab returns following message "can't connect service" , when looking event viewer there navigation error event. is wrong code or there no way connect cookie based login page ? web authentication broker meant winrt applications. in case have several options. use dotnetopenauth directly upgrade mvc4 , use support provided via asp.net 4.5's addition of oauth functionality included in default templates. see using oauth providers mvc it's super easy integrate mvc app.

objective c - Connect Webservice through XML -

nsurl *url = [nsurl urlwithstring:@"http://192.168.1.56/amsp/amspws.asmx"]; nsstring *soapmsg=[nsstring stringwithformat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>" "<soap:envelope xmlns:xsi=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd=\"http://www.w3.org/2001/xmlschema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" "<soap:body>" "<postxmlstr xmlns=\"http://tempuri.org/\">" "<cust>%@</cust>" "<tran>%@</tran>" "<ret>%@</ret>" "<ppay>%@</ppay>" "<recp>%@</recp>" "<scode>%@</scode>" "<companyshortname&

visual studio 2012 - I can't find Change Source Control in VS -

it should under file -> source control. want move project 1 tfs another, disconnecting project, login user , upload. but cant find log out :-/ make sure have solution checked-out. once, solution checked-out, go file->source control again

xml - cannot create jdbc driver of class '' for connect url 'null' postgresql -

i'm getting error when try deploy war application. org.apache.tomcat.dbcp.dbcp.sqlnestedexception: cannot create jdbc driver of cla ss '' connect url 'null' @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(b asicdatasource.java:1452) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createdatasource(basicdat asource.java:1371) @ org.apache.tomcat.dbcp.dbcp.basicdatasource.getconnection(basicdataso urce.java:1044) @ kimet.conexionsql.getconexion(conexionsql.java:20) @ kimet.global.cargarhashtablesaux(global.java:2360) @ kimet.inicio.init(inicio.java:33) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper. java:1206) @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:10 26) @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontex t.java:4421) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4 73

PHP script to download a website with its files -

i need php script similar "save page as" button in firefox or other browsers. is: given url, downloads associated html file, images , other files displayed in it. file_get_contents() function gets me halfway there, getting html file not images or other files. solution read through html returned file_get_contents() , every file link found, apply file_get_contents() it. yet suspect there must more standard solution already. in advance. the easiest way use wget command: wget --page-requisites http://www.yourwebsite.com/directory/file.html from php can invoke using exec or system .

.htaccess - Trying to redirect one page to another, but my redirect rule doen't respond -

i've removed and/or combined couple of pages on site, , need set 301 redirect. thougt doing in .htaccess best bet, rules trying add doesen't noticed or something. don't respond @ all... these rules i've tried far: redirect 301 /?page=spage&spage=our-store %{server_name}?page=spage&spage=about-us rewriterule ^/?page=spage&spage=our-store$ %{server_name}?page=spage&spage=about-us[r=301,nc,l] rewritecond %{http_host} !^%{server_name}$ [nc] rewriterule . %{server_name}%{request_uri}?page=spage&spage=about-us [r=301,l] this last 1 messed css , js src's... i have @ top: rewriteengine on rewritebase / any suggestion? update : follow question have 3000+ equal url strings ending id different. how redirect requests? old url : ?page=tuninglist&car=* , new 1 : ?page=tuning&view=vehicle&type=car&id=* * value of id= integers... was hoping work, no - got 500 server error instead... rewritecond %{query_stri

java - Weird copy constructor -

Image
i have 2 classes: abstractmailingdirections , directionload . both have copy constructor follows: public abstractmailingdirections(abstractmailingdirections tocopy) { this.message = tocopy.message; this.defaultdirection = new directionload(tocopy.defaultdirection); (final directionload dls : tocopy.directionloads) { this.directionloads.add(new directionload(dls)); } } and public directionload(directionload tocopy) { this.direction = tocopy.direction; this.transportationcontract = tocopy.transportationcontract; this.pickuptime = tocopy.pickuptime; this.acceptancetime = tocopy.acceptancetime; this.acceptancelocation = tocopy.acceptancelocation; this.information = tocopy.information; } now when call mailingdirections copy constructor (which super(tocopy) ) don't fields of defaultdirection copied. or not of them. , using eclipse debugger stranger: here have clicked on abstractmailingdirections copied. see how defaultdir

ember.js - Setting and EmberJS models owner with a simple ID -

i have code tries set owner of model instance setting id of owner follows: tablejson = {id: 1, room_id: 1} rec = app.table.createrecord(); rec.setproperties(tablejson); app.store.commit(); i using localstorage ember adapter . it not set room on table model. model specifies table belongs room. when call table.get('room') , returns null. any ideas?

html5 - SoundCloud embedded track: How to refresh page after the track ends playing? -

first off, quite noob. ok, have embedded soundcloud track webpage. question is, how refresh page (or else) when track ends? can getduration(i found on soundcloud api page)? i tried code it. in code tried duration of track , print on screen/webpage. wrong code? <script src="https://w.soundcloud.com/player/api.js" type="text/javascript"></script> <span id="headerleft-content"> <script type="text/javascript"> var duration = 0; (function(){ var widgetiframe = document.getelementbyid('sc-widget'), widget = sc.widget(widgetiframe); widget.bind(sc.widget.events.ready, function() { widget.getduration(function(val) { duration = val; }); }); }()); document.write(duration); </script> </span> if worked, put wait(duration) , refresh... in other words, can

date - Can anyone explain this curious batch behavior using "%~t1" and give a solution -

can explain following me: the code: @echo off setlocal disabledelayedexpansion set pf=c: set url=http://www.rarlab.com/rar set fn=config.sys call :sub1 "%url%" "%fn%" goto :eof :sub1 echo:path=[ %pf%\%~2 ] if exist %pf%\%~2 (call :readdate "%pf%\%~2") & set "_datum1=%_result%" echo:date1=[ %_datum1% ] if exist %pf%\%~2 (call :readdate "%pf%\%~2") & set "_datum2=%_result%" echo:date2=[ %_datum2% ] goto :eof :readdate setlocal %%a in (%~1) set "_tvar=%%~ta" echo:date=[ %_tvar% ] endlocal & set "_result=%_tvar%" exit /b 0 :end the output: path=[ c:\config.sys ] date=[ 10.06.2009 23:42 ] date1=[ ] date=[ 10.06.2009 23:42 ] date2=[ 10.06.2009 23:42 ] so if @ line 3 of output there no date/time - why ????? if it's not big bug of cmd.exe can please me solving problem. need both date/time data comparison. addendum: is somehow possible read date/time in first "sub"

php - Replace simple quote and double quote -

i have variable in mysql database. want variable handle both simple , double quotes. for example: $variable = "i'm happy" or $variable = i'm happy or $variable = "i happy" in db, first example this: "i'm happy" , works me. problem on js function because want call data: namefolder = "<?php echo $variable ; ?>" but, if $variable = "i'm happy" , i've got double "" js error. , if put single quote, problem same case. any ideas? the best way echo data javascript use json_encode : var namefolder = <?php echo json_encode($variable); ?>; n.b.: there shouldn't surrounding quotes, function handle you.

c++ - passing pointer type to template argument -

i wrote following code: template <typename t> void myname(t* x) { cout<<"x "<<x; } and invoked: char *p="stackoverflow"; myname(p); it prints stackoverflow . but if change template argument (t* x) (t x) same result. so difference between 2 template parameters? void myname (t x) and void myname (t* x) first case - t deduced char, t* char* . second case - t deduced char* . differences here in call such function for first case should be myname<char>(p); and second myname<char*>(p); also, differences when use type t in function.

Incrementing (iterating) between two hex values in Python -

i'm learning python (slowly surely) need write program (among other things) increments between 2 hex values e.g. 30d681 , 3227ff. i'm having trouble finding best way this. far have seen snippet of code on here separates hex 30, d6 , 81, works this- char = 30 char2 = d6 char3 = 81 def doublehex(): global char,char2,char3 x in range(255): char = char + 1 = str(chr(char)).encode("hex") p in range(255): char2 = char2 + 1 b = str(chr(char2)).encode("hex") y in range(255): char3 = char3 + 1 b = str(chr(char2)).encode("hex") c = a+" "+b print "test:%s"%(c) doublehex() is there simpler way of incrementing whole value, e.g. like char = 30d681 char2 = 3227ff def doublehex(): global char,char2 x in range(255): char = char + 1 = str(chr(char)).encode("hex") p in range(255):

php - how to have a pop up contact form on submit display a confirmation message in the popup? -

i'm having great issues making contact form can seen on below visual. want contact form display on submit thank message or message of confirmation instead of redirecting contact.php file there isn't styles can see in action on provided link. i've found information can jquery ajax i've tried displayed below, still can't seem work on submit show message in pop up. does know easier way or maybe point me in right direction i've been trying fix god knows how long. thank help visual: http://madaxedesign.co.uk/dev/index.html php & html: <?php $your_email = "maxlynn@madaxedesign.co.uk"; $subject = "email madaxe"; $empty_fields_message = "<p>please go , complete fields in form.</p>"; $thankyou_message = "<p>thank you. message has been sent. reply possible.</p>"; $name = stripslashes($_post['txtname']); $email = stripslashes($_po

Visual Studio error while trying to run project -

i have following scenario: visual studio 2010 solution 1 wpf-project, output file "tool.exe" eclipse shared library project, output file "tool.dll" i place dll in same folder exe , try debug using visual studio; following error: error while trying run project: not load file or assembly 'tool' or 1 of dependencies. module expected contain assembly manifest. i have managed find solution problem, rename dll, apparently exe , dll cannot have same name. question is, why error occuring in first place? why name of dll affect visual studio? error occurs before trying pinvoke dll. if run application without visual studio works perfectly, want able debug of course. right renaming dll plan b, before know if there else can fix problem? thanks in advance. i found simple steps solve error. 1- change windows. 2- install symantec endpoint protection client 12.1.6318.6100 x32 or x64 bit. you can geting software(32 bit) link: ( ftp://19

python - Twisted : How to print message at the server? -

i beginner using twisted framework. i developing simple client server program using twisted library in python. i using code @ server side. factory = protocol.serverfactory() factory.protocol = echo portno = 8000 reactor.listentcp(portno,factory) reactor.run() i print message @ server side, whenever client closes connection. any idea how ? thanks extend connectionlost method of protocol want use. def connectionlost(self, reason): self.factory.numprotocols = self.factory.numprotocols-1 // stuff for more references: http://twistedmatrix.com/documents/12.2.0/core/howto/servers.html#auto2

html - Make CSS popup always stay on top of it's parent -

i have 2 divs. one position relative, , 1 position absolute. they act somehow popup button. is there way of forcing div position: absolute stay on top of it's parent, no matter height has? on top mean "standing on top of it", not z-index property jsfiddle example <div style="position: relative; border: 1px solid #000; padding: 2px;"> <span>popup container</span> <div style="position: absolute;"> <div style="height: 100px; background-color: #f0f0f0; top: 0;"></div> </div> </div> sizes calculated based on container not itself so need give bottom:100%; demo @ http://jsfiddle.net/gaby/rhb3m/4/

python - Putting a multiprocessing.Queue in a multiprocessing.Queue explodes -

the following code throws exception , prints 123 in both python 2.7 , 3.3. from multiprocessing import queue class pool(object): def __init__(self): self.q = queue() p = pool() p.q.put(p) print(123) it's sort of race condition can seen here: yuv@yuvpad2:~/$ python3.3 t.py 123 traceback (most recent call last): file "/home/yuv/downloads/python-3.3.0/lib/multiprocessing/queues.py", line 249, in _feed yuv@yuvpad2:~/$ the full error runtimeerror: queue objects should shared between processes through inheritance , traceback doesn't @ explain how/where happens. source of problem object in queue can't reference queue. real use case worker object , pool object, worker reports finished working pool's queue . wanted worker send worker queue . the reason i'm not using queue.queue ,although multithreading work case, because in python 2.7 there's bug makes queue.get() ignore ctrl-c annoying. is there way pattern cleanly? the real

Plone: Email contents in content rule action -

i have plone site configured ploneformgen. i'm using save-data-to-content adapter create page each submission, unique number title/id. have content rules set various roles notified when submitted form transitions along workflow. is there way include content of submitted in these emails? know ploneformgen can send content of form in initial email @ submit time, need send same information later. i'm pretty @ figuring things out, i'm no plone expert appreciated. additional info: i'm using uwosh.pfg.d2c adapter perform pfg -> contenttype conversion, works well. content type set 'page' in settings uwosh.pfg.d2c plugin. content rules send emails various groups or roles based on state transition of resulting content, works in normal way - when transition occurs, rule executes. effectively, have pages being generated form when user clicks submit. done through plugin in ploneformgen. may provide info: http://pythonhosted.org/uwosh.pfg.d2c/ - i'm not, ad

ios - How to get App Link of an iPhone App -

this question has answer here: how link apps on app store 20 answers i making iphone app in need email link app. i not getting how link. can me issue ? use mechanism: for eg: headlines app name of app then: http://appstore.com/headlinesapp or first company name followed appname http://appstore.com/u2opiamobilepteltd/headlinesapp replace appname appname , company name yours. hope helps.

android - Issue with back button between Fragments (backstack) -

i have app 3 tabs. 2 of theese tabs have buttons change current fragment new 1 code: mapfragment newfragment = new journeymapfragment(mcontext, getfromdestinationcoordinate(), gettodestinationcoordinate()); android.app.fragmenttransaction transaction = getfragmentmanager().begintransaction(); transaction.setcustomanimations(android.r.animator.fade_in, android.r.animator.fade_out); // replace whatever in fragment_container view fragment, // , add transaction stack transaction.replace(r.id.fragment_container, newfragment); transaction.addtobackstack(null); if(newfragment.ishidden()){ transaction.show(newfragment); } transaction.commit(); for on of tabs normal fragment, changing map fragment button takes me original fragment no issuse. however, tab mapfragment, changing normal fragment not g

json - Rails MultiJson::LoadError -

i trying fetch json feed , multijson::loaderror the reason in feed there trailing "," after last node. {"first_element" : "value", "second_element" : "value",} is there way output json without loaderror. there raw function ignores this. i using httparty fetch url

mysql - Make subquery with like -

i have following 2 tables. how can make query table b variant_id matched in table combination? tablea product_id combination ean 1 952_4038 123456789 2 946_3989 101010101 tableb variant_id desc 4038 text1 3989 text2 thanks! select a.*, b.* tablea inner join tableb b on a.combination concat('%', b.variant_id) this query terribly slow on large databases. consider normalizing table properly. my proposed table schema: tablea productid (1) intcolumn (952) combination (4038) ean (123456789) tableb combination (4038) desccolumn (text) [ don't use reserved keyword ] make sure have indexes on linking fields. followup question: table main table , dependent table?

ios - Image insides UIBubbleTableView -

i making ios chat app. use uibubbletableview display texts , images. now ,i want image can click , move view (which people can see in full size). uibubbletableview seems doesn't support it, how can fix it? here code in viewdidload: - (void)viewdidload { //something here// [super viewdidload]; nsbubbledata *photobubble = [nsbubbledata datawithimage:[uiimage imagenamed:@"halloween.jpg"] date:[nsdate datewithtimeintervalsincenow:-290] type:bubbletypesomeoneelse]; //something else here// } with these codes shows image. i know isn't recommended or ideal way it, have done time being. come , "correctly" later when find way. for each nsbubbledata object, add touch gesture it's view. when user touches, toucheventonimage: method called. sender, can gesture recognizer, view of uiimageview set nsbubbledata. can display image full screen. this code used: - (void)addtouchgesturetobubble:(nsbubbledata

python - Multiple inheritance issue, add threading.Thread to the class -

first of let me explain what want do : basic overview : data twitter in 1 class , print in class. little deeper: want customstreamlistener able run separate thread. , every single status, i'm getting in on_status method put in queue. twitter() class pull queue out , print it. now what don't understand : what should put in run() function? (should call on_status() ?) in case if customstreamlistener how should call it?? ( in order me call class without thread should this: l = customstreamlistener() stream = tweepy.streaming.stream(self.auth,l) stream.filter(follow=none, track=hashtag) now if want call threading.thread have call start() , somewhere after pull queue out. part little confusing me. i'm open other way similar result. thank you. import sys, os, time import tweepy import simplejson json import threading, queue queue = queue.queue() #settings : #output = open(os.path.join(os.path.expanduser('

How can i get the dynamic IP address assigned by my ISP using C#? -

i have searched lot dynamic ip address assigned isp using c# none have turn out so, how can dynamic ip address assigned isp using c# ? works querying external websites like; lynx --dump http://ipecho.net/plain

eclipse - Maven project doesn't see /target/classes nor /target/monitoring/WEB-INF/classes as classpath root -

i have maven project spring+jsf2+hibernate should deployed tomcat 7. after building , deploying following exception: grave: unable load annotated class: target.classes.com.barcelo.monapp.web.controller.monitoringbean, reason: java.lang.noclassdeffounderror: target/classes/com/barcelo/monapp/web/controller/monitoringbean (wrong name: com/barcelo/monapp/web/controller/monitoringbean) grave: unable load annotated class: target.monitoring.web-inf.classes.com.barcelo.monapp.web.controller.monitoringbean, reason: java.lang.noclassdeffounderror: target/monitoring/web-inf/classes/com/barcelo/monapp/web/controller/monitoringbean (wrong name: com/barcelo/monapp/web/controller/monitoringbean) the /target/classes , /target/monitoring/web-inf/classes doesn't belong there. here's pom.xml : <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.

ios - When subclassing UIToolBar to have a custom background the bottom half of toolbar is black? -

i'm subclassing uitoolbar, here how override drawrect method of uitoolbar: - (void)drawrect:(cgrect)rect { uiimage *backgroundimage = [uiimage imagenamed:@"uitoolbar_background.png"]; [backgroundimage drawinrect:cgrectmake(0, 0, self.frame.size.width, self.frame.size.height)]; } the app uses uinavigationcontroller paradigm initialized initwithnavigationbarclass method. the issue bottom half of toolbar black? uitoolbar_background.png 44 pixels height (or 88 retina). should not have it's bottom half black. by subclassing uitoolbar , overriding drawrect, eliminate of uitoolbar's own drawing. why not use appearance api set background image: [[uitoolbar appearance] setbackgroundimage:[uiimage imagenamed:@"uitoolbar_background.png"] fortoolbarposition:uitoolbarpositionbottom barmetrics:uibarmetricsdefault]; alternatively, use subclassing route, make sure call [super drawre

geolocation - Save the current device location in one variable in jQuery -

i want save devices current location 1 variable. possible? you can use geolocation apis current location. http://mobile.tutsplus.com/tutorials/mobile-web-apps/html5-geolocation/ save location in variable using api have mentioned above as: var currentlocation; //this variable store current location. jquery(window).ready(function(){ jquery("#btninit").click(initiate_geolocation); }); function initiate_geolocation() { //store current location currentlocation = navigator.geolocation.getcurrentposition(handle_geolocation_query); } function handle_geolocation_query(position){ alert('lat: ' + position.coords.latitude + ' ' + 'lon: ' + position.coords.longitude); }

ios - Switch between two UIWindow's -

i integrating pushwoosh sdk push notification, using uiwindow represent html page sent pushwoosh portal - (void) showwebview { self.richpushwindow.alpha = 0.0f; self.richpushwindow.windowlevel = uiwindowlevelstatusbar + 1.0f; self.richpushwindow.hidden = no; self.richpushwindow.transform = cgaffinetransformmakescale(0.01, 0.01); [uiview animatewithduration:0.3 animations:^{ self.richpushwindow.transform = cgaffinetransformidentity; self.richpushwindow.alpha = 1.0f; } completion:^(bool finished) { }]; } - (void) showpushpage:(nsstring *)pageid { nsstring *url = [nsstring stringwithformat:kservicehtmlcontentformaturl, pageid]; htmlwebviewcontroller *vc = [[htmlwebviewcontroller alloc] initwithurlstring:url]; vc.delegate = self; vc.supportedorientations = supportedorientations; self.richpushwindow.rootviewcontroller = vc; [vc view]; } and on closing on html page calls self.richpushwindow.transform = cgaffin

java - Mapping one-to-many relationship using QueryDSL SQL -

lets have 2 bean entities: public class audit { private string code; private java.sql.timestamp creationdate; private string creatorid; private java.sql.timestamp deletiondate; private string description; private string id; private string name; private string notes; private short status; private list<auditparticipant> participants; } and : public class auditparticipant { private string auditid; private string department; private string id; private string name; private string notes; private string role; private string surname; } ... audit can have 1..n participants , how can use querydsl sql project list of participants audit bean (get participants belongs audit)? the beans generated using querydsl code generation. thanks querydsl provides result aggregation functionality such cases http://www.querydsl.com/static/querydsl/3.1.1/reference/html/ch03s02.html#d0e1634 in cas

javascript - How do I change which radio button is selected using a function? -

i have radio group of 3 choices of first selected default. want make second 1 selected upon clicking item. have... function selectss() { document.getelementbyid("width").value=16; document.getelementbyid("gauge_1").checked; } i use onclick call function, value of width changes 16 supposed how select radion button id gauge_1? you have set checked state true , use: document.getelementbyid("gauge_1").checked = true; in code, you're getting , doing nothing it. reference: https://developer.mozilla.org/en-us/docs/html/element/input#attr-checked

html - how to remove controls from embedded video? -

is impossible remove ui controls embedded video? http://www.w3schools.com/html/tryit.asp?filename=tryhtml_objectmplayer <param showcontrols="false"> <param uimode="invisible"> ...showcontrols="false"... does not hide controls - contrary natural english meaning of "show controls" edit: --the following works & cross-browser (until ie10)... edit2: --but following seems cause never-ending-sendresponse-status worker processes (see https://stackoverflow.com/questions/16790199/iis7-5-wmv-requests-cause-many-workerprocesses-in-never-ending-sendresponse-stat ) <!--[if ie]> <object id="mediaplayer" style="height:100%" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" standby="loading windows media player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,7,1112"&

Can a javascript dropdown in-email like G+ be implemented by anyone, or only Google? -

Image
noticed today great trinket google: in notification emails upon new g+ followers, recipient can add circle directly dropdown in email. (see below). the html page shows related div has been attached end of body, suggesting div di not 'ship with' email , displayed via in-email javascript. is kind of interactivity available engineer / product developer? google gets because control gmail services? the google+ integration see specific gmail: http://gmailblog.blogspot.com/2012/05/better-google-notification-experience.html in general not able run javascript in gmail or other webmail providers due security concerns. there ways of making more interactive emails, platform specific. example: gmail offers contextual gadgets (used xobni , other inbox apps) outlook/hotmail offers active views

NSMutableArray in NSUserDefault -

i've problem table! i use parsing tableview when change view, table loses data. decide save data nsuserdefault; but, here problem, nsuserdefault warns me: "note dictionaries , arrays in property lists must contain property values." nb: itemstodisplay nsmutablearray , contain title, url, data , summary of parseditems. well, here code: self.itemstodisplay = [[[nsuserdefaults standarduserdefaults] arrayforkey:@"items"] mutablecopy]; if (!self.itemstodisplay) { self.itemstodisplay = [[nsmutablearray alloc] init]; } self.itemstodisplay = [[nsmutablearray alloc]init]; self.itemstodisplay = [parseditems sortedarrayusingdescriptors: [nsarray arraywithobject:[[[nssortdescriptor alloc] initwithkey:@"date" ascending:no] autorelease]]]; [[nsuserdefaults standarduserdefaults] setobject:self.itemstodisplay forkey:@"items"]; [[nsuserdefa

c# - Is it possible to validate a String Property to see if it is a valid date using Data Annotations? -

i have string property entity. putting date value ie "01/01/2000" via form. possible validate data entered see if valid ie: assuming uk date format below: "32/01/2000" not valid, "31/01/2000" valid, "test" not valid my poco ef property code looks like: [system.componentmodel.dataannotations.datatype(system.componentmodel.dataannotations.datatype.date, errormessage = @"not valid date")] public virtual string dateofbirth should work .... or...... thanks. you use regularexpression annotation, that's gonna make things messy least. you're best off converting property datetime . here's how using regularexpression ( shield eyes ): [regularexpression("@(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2f(((0[1-9])|(1[0-2]))|([1-9]))\x2f(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)", errormessage = @"not valid date")] public virtual string dateofbirth { get; set; }

c++ - Making webserver communicate with PHP -

i have webserver written in c++. working want communicate php. googled , discovered can done through cgi, fastcgi, or module. have decided use cgi , found out can done creating pipe php-cgi.exe. need pointer on how can done (i mean pipe php-cgi.exe)

regex - how to match any string in Emacs regexp? -

i'm referring page: http://ergoemacs.org/emacs/emacs_regex.html which says capture pattern in emacs regexp, need escape paren this: \(mypattern\) . it further says syntax capturing sequence of ascii characters [[:ascii:]]+ in document, i'm trying match strings occur between <p class="calibre3"> , </p> so, following syntax above, replace-regexp <p class="calibre3">\([[:ascii:]]+\)</p> but finds no matches. suggestions? regexps not general-purpose html parsing, paragraph tags cannot validly nested, following going fine (provided mark-up valid & well-formed). <p class="calibre3">\(.*?\)</p> *? non-greedy zero-or-more repetitions operator, match little possible -- in case until next </p> (as opposed greedy version, match until final </p> in text). the [^<] approach fine if fits data in question, won't work if there other tags within paragraphs.

Jquery flickering background image -

i have 2 questions regarding jquery , background image. have simple html page: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>dreamweaver test</title> <link rel='stylesheet' type='text/css' href='stylesheet.css'/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> </head> <body> <div id="outer"> <div id="container"> <div id="inner"> </div> </div> </div> </div> </body> </html> and css: @charset "utf-8"; /* css document */ * {margin:0;padding:0} /* mac hide \*/ html,body{height:100%;width:100%;} /* end hide */ body { background-color: black; text-align:center;