Posts

Showing posts from June, 2014

Jira project components -

we have 2 groups of developers, server side , client side project components defined serverside , client side. if user creates serverside task assignee drop down box show server side group , vice versa. how can accomplish that? one way creating 2 separate jira projects 2 components , giving developers permissions appropriate project.

java - Do you know any free social network software? -

i going start project in want develop private social network accessed mobile devices. that, use framework called mobilis helps in development of services real time collaboration. service has server communicates arbitrary underlying social network server. have searched social networks , found many different products , can't test of them. know if had experience of these products, looking service these properties: free (no need pay it) api make remote calls java server it nice if didn't need deploy on own server, if use theirs the features need service basic ones: add "friends" send message some "group" our "forum" interaction so, did similar , advice use or not use? thanks, oscar have checked out eureka streams ? don't know of capabilities, free (and open source ), and, website, looks has you're looking for. (the thing unsure api make remote calls java server.)

memory - C# OleDbConnection.Open causes a buffer overrun -

i have oledbconnection trying open connection using oledbconnection.open() method throws me exception: attempted read or write protected memory does know causes or how can fixed?

Django: Where is the personal info form located? -

i can't seem locate personal info form that's used in admin. talking form containing first_name, last_name , email address when click on user. i've been browsing source code 30 minutes checking out auth , admin seems it's not in either of them. http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/forms.py def userchangeform(forms.modelform): ...

html - PHP mutliselect from three tables selected -

am sorry don't know have ask basically. have been string data in 3 tables. community table storing communities community has types of homes single family, multi family etc , string hometypeid (home types) , commid (community ) in third table. my problem have show values selected in multi select box when going edit this. have used 2 below functions not these worked problem. function showoptionsdrop($array, $active, $echo=true){ $string = ''; foreach($array $k => $v){ if(is_array($active)) $s = (in_array($k, $active))? ' selected="selected"' : ''; else $s = ($active == $k)? ' selected="selected"' : ''; $string .= '<option value="'.$k.'"'.$s.'>'.$v.'</option>'."\n"; } if($echo) echo $string; else return $string; } and other function creating multi drop down bo...

Easiest way to search records in Clojure -

i have map in clojure this: (def stuff #{ {:a "help" :b "goodbye"} {:c "help2" :b "goodbye"} {:a "steve" :b "goodbye"} {:c "hello2" :b "sue"} }) : , want provide search that: (search stuff "help") : return : #{ {:a "help" :b "goodbye"} {:c "help2" :b "goodbye"} } : simplest way this? user=> (defn search [s q] (select #(some (partial re-find (re-pattern q)) (vals %)) s)) #'user/search user=> (search stuff "help") #{{:a "help", :b "goodbye"} {:c "help2", :b "goodbye"}} this trick.

c# - Wanted: ASP.NET control to view/print PDF, TIFF, possibly more? -

i'm looking asp.net control allow viewing , printing of pdf , tiff within web form. i'm willing use more 1 control if needed (1 control pdf, 1 tiff, show , hide based on file extension), have not been able find tiff viewer. files stored on our lan in shared folder, , application intranet site. open source / free licensing preferred, i'm willing @ paid options well. i'm in total agreement @bencr on this. viewing pdfs extremely common thing do. isn't "technical" issue stretch. it sounds have type of faxing solution in place creating these documents. multi-page tiff , pdfs. if case might want convert tiffs pdfs begin , run through adobe's pdf reader. every online fax solution this.

mysql - Django: Date range query performance problem -

on mysql backend, django converts filter(date__year=2011) ... date between 2011-01-01 00:00:00 , 2011-12-31 23:59:59.99 in sql, takes 3 seconds execute. if manually remove time part , run ... date between 2011-01-01 , 2011-12-31 , execution time drops 1/100 30 msec. it seems there fundamental problem how date range queries interpreted. ideas around this? if cannot find way using django orm, add year field model store year , query on integer year field. thank time. p.s: restrictions beyond control, environment django 1.1. may fixed or better optimized in newer versions of django. have tried range ? looks django's generated sql equal raw sql. works 1.1 .filter(date__range(datetime.date(2011,1,1), datetime.date(2011,12,31)) equivalent to: select ... date between '2011-01-01' , '2011-12-31';

.net - How to get FxCop for WinXP? -

i have windows xp , visual studio 2010 installed. intended use fxcop check if solution corresponds microsoft code guides. now found out fxcop part of "microsoft windows sdk windows 7 , .net framework 4" should install thing, if have windows xp? fxcop 10 can run on windowsxp (i have installed on xp box @ work.) having said that, agree anuraj's comment - if using version of visualstudio 2010 includes code analysis, using easy place start. few exceptions, both vs , fxcop use same rule set, knowing 1 other.

sql - Mysql Help - Left join -

i read other threads , first question here. here goes; i'm trying build query involves 2 tables, course table , studentslink table. studentslink table describes link between students , course. tables below; course courseid(bigint) - pk coursename (varchar) courseinstructor (varchar) studentslink courseid(bigint) - pk studentid(bigint) - pk below sample data; course table id | coursename| courseinstructor ---------------------------------- 1 | algebra 1 | mike 2 | english 2 | james 3 | english 3 | john 4 | algebra 2 | mike 5 | history 1 | tony studentlink table studentid | courseid ---------------------- 100 | 2 101 | 3 102 | 3 102 | 4 103 | 4 100 | 1 103 | 3 103 | 2 the desired outcome below given if looking student number 103 id | coursename| courseinstructor |studentid | courseid ------------------------------------------------------...

wpf - Filtered CollectionView Gives Wrong Count -

according documentation , count of filtered collectionview should count of items pass filter. given code: list<string> testlist = new list<string>(); testlist.add("one"); testlist.add("two"); testlist.add("three"); testlist.add("1-one"); testlist.add("1-two"); testlist.add("1-three"); collectionview testview = new collectionview(testlist); int testcount1 = testview.count; testview.filter = (i) => i.tostring().startswith("1-"); int testcount2 = testview.count; i therefore expect testcount1 6, , testcount2 3. however, both 6. if manually iterate through collectionview , count items, 3, count returns 6 always. i've tried calling refresh on collectionview, see if correct result, there no change. documentation wrong? there bug in collectionview? doing wrong can't see? try icollectionview _cvs = collectionviewsource.getdefaultview(testlist); instead of collectionview te...

PHP function which returns the most recent row entered into a mysql function -

i looking php function returns recent entry mysql table. you can use mysql_insert_id() - http://php.net/manual/en/function.mysql-insert-id.php , returns recent key database. query select it. example $id = mysql_insert_id(); $result = mysql_query("select * table id = ".$id); hope helps!

delegatecommand - Using .delegate in jQuery -

i've got function works great on creating custom tooltips need event calendar. problem when user clicks go next month on calendar, new set of links made , jquery no longer selecting links. here original function: jquery(function(){ var tip = jquery("#tip"); var mytitle = ""; jquery(".eventful-pre a, .eventful a").hover(function(e){ tooltip = "<ul>"; jquery.each(jquery(this).attr("title").split(","),function(ind, val){ tooltip = tooltip +"<li>"+val +"</li>"; }); tooltip = tooltip +"</ul>"; tip.html(tooltip); mytitle = jquery(this).attr("title"); jquery(this).attr("title", ""); tip.css("top",(e.pagey+5)+"px") .css("left",(e.pagex+5)+"px") ...

php mysql shuffle output speed -

i have mysql query returns 20 results table of 110,000,000. shuffle these before echoing them out using php. is faster use order rand() or shuffle array in php somehow? depending on amount of results you're pulling mysql, order rand() faster. if you're returning 20 say, performance differences negligible. you test out , see better you, shuffle array in php use shuffle() .

ruby on rails - Conditional "or" in Thinking Sphinx search -

using ror 2.3.8. here's controller code: class citiescontroller < applicationcontroller def show @city = city.find(params[:id]) @shops = shop.search @city.name, { :conditions => {:country => @city.country && (:city => @city.name || :state => @city.state)}, :page => params[:page], :per_page => 100 } end end the :conditions => {:country => @city.country && (:city => @city.name || :state => @city.state)} doesn't work because trying explain wanna achieve. :city , :state columns spots table, not cities table. want results return either 1 of them fulfills condition. have no clue how it. thanks. tass has got right - ts search call, should this: def show @city = city.find(params[:id]) @shops = shop.search "#{@city.name} @country #{@city.country} (@city #{@city.name} | @state #{@city.state})", :match_mode => :extended, :page => params[:page...

oracle - problem with choosing data type for large file -

i create program insert large file database (around 10m). choosed blob type objects column in table. now read blob support binary object maximoum lengh of 4m. would advice me can in case upload object more 4m? i useing oracle 9i or 10g. you read appears incorrect. per oracle 10g release 2 documentation : blob datatype stores unstructured binary large objects. blob objects can thought of bitstreams no character set semantics. blob objects can store binary data (4 gigabytes -1) * (the value of chunk parameter of lob storage). if tablespaces in database of standard block size, , if have used default value of chunk parameter of lob storage when creating lob column, equivalent (4 gigabytes - 1) * (database block size).

html - Wget recognizes some part of my URL address as a syntax error -

i quite new wget , have done research on google found no clue. i need save single html file of webpage: wget yahoo.com -o test.html and works, but, when try more specific: wget http://search.yahoo.com/404handler?src=search&p=food+delicious -o test.html here comes problem, wget recognizes &p=food+delicious syntax, says: 'p' not recognized internal or external command how can solve problem? appreciate suggestions. the & has special meaning in shell. escape \ or put url in quotes avoid problem. wget http://search.yahoo.com/404handler?src=search\&p=food+delicious -o test.html or wget "http://search.yahoo.com/404handler?src=search&p=food+delicious" -o test.html in many unix shells, putting & after command causes executed in background .

SQL Server: use parameter in CREATE DATABASE -

i want specify path data file , log file created in sql script using parameters. here wrote: declare @datafilepath nvarchar(max) set @datafilepath = n'c:\programdata\gemcom\' declare @logfilepath nvarchar(max) set @datafilepath = n'c:\programdata\gemcom\' use master go create database testdb on primary ( name = n'testdb_data', filename = @datafilepath ) log on ( name = n'testdb_log', filename = @logfilepath ) go unfortunately, doesn't work. when try run in sql server management studio, got error incorrect syntax near '@datafilepath'. i wondering if intended possible? thanks you have use dynamic sql select @sql = 'create database testdb on primary ( name = ''testdb_data'', filename = ' + quotename(@datafilepath) + ') log on ( name = ''testdb_log'', filename = ' + quotename(@logfilepath) + ')' exec (@sql)

Exporting to CSV in Ruby 1.9.2 -

an existing app, using comma csv exports upgraded ruby 1.9.2 , nothing exports. basically, server sits , spins. know there fastercsv dependency comma, fastercsv no longer supported in 1.9.2 csv in core. according documentation, comma should work without fastercsv, not having experience. can't export using code: controller: format.csv @sis_action_rendered = true render :csv => current_user.authorized_clinical_stuff end model: comma # implicitly named :default user :salutation name email user :login user :ethnicity user :gender user :is_verified => 'apta trained' work_phone alternate_phone site_names site_address degree pt_degree ci_credentialed? ci_advanced_credentialed? board_certs updated_at end keep in mind model code pulling info fro several related objects generate 1 csv. fastercsv csv in 1.9.2. from the docs : this version of csv library began life fastercsv. fastercsv intended replacement ruby’s standard csv library. ...

Perl IO::Socket - Cannot determine peer address -

i having issue stemming io/socket.pm on or around line 251. croak 'send: cannot determine peer address' unless($peer); basically opening connection up, , sending data it. reason after 10-20 seconds error gets thrown. send: cannot determine peer address any ideas?? #!/usr/bin/perl package dialer; use data::dumper; use io::socket; $sock = io::socket::inet->new(peeraddr => '255.255.255.255', peerport => '5038', proto => 'tcp'); $res = $sock->send("action: login\r\nusername: dunzo\r\nsecret: 123456789\r\nevents: \r\n\r\n"); sleep(5); while(1==1) { $res = $sock->send("action: originate\r\nchannel: local/123123@dunzodial\r\nexten: 123123\r\ncontext: dunzo\r\ntimeout: 60000\r\nvariable: \r\nasync: yes\r\ncallerid: 1234567890\r\npriority: 1\r\n\r\n"); $incr++; sleep(1); pri...

java properties files, using a key as another keys value, is this possible -

i know if there way use key key's value in .properties files. for example possible, or there other way achieve similar this? key = another_key app.name=stack on flow app.title.welcome=welcome {app.name} so when value of app.title.welcome should " welcome stack on flow " the apache commons configuration project has implementation capable of doing variable interpolation. read section named variable interpolation application.name = killer app application.version = 1.6.2 application.title = ${application.name} ${application.version} you need third-party library in class path, on other hand not have worry writing yet implementation :) you might read properties how to well.

iphone - route-me won't compile in xCode 4 -

i'm trying route-me offline maps compile in xcode 4. fine in xcode 3. i believe issue architecture settings. looking @ following post , looks should change proj4 armv6 , leave main project , mapview @ standard (v6 & v7). however, still following errors: undefined symbols architecture armv6: "_objc_class_$_rmmarker", referenced from: objc-class-ref in osmapviewcontroller.o "_objc_class_$_rmdbmapsource", referenced from: objc-class-ref in osmapviewcontroller.o "_objc_class_$_rmmapcontents", referenced from: objc-class-ref in osmapviewcontroller.o ld: symbol(s) not found architecture armv6 collect2: ld returned 1 exit status any warmly welcomed. chris. it seems bug in xcode. downloaded xcode 4.0.2 , compiles , works without error or warnings!! update xcode.

How to use unsigned int to be able to use a function for JNA (Java Native Interface)? -

i'm using jna in order use c++ library in java application. using interface in java use these functions. function uses 3 arguments in c++: unsigned int, const char*, , long*. jna implements strings (according documents) in java pass in char*. likewise, uses long[] pass in long*. i'm confused, however, type should pass in unsigned int. char* passed in represents name of file, , no matter type use first argument, not seem recognize file. furthermore, last, long type returns value after function executed. if use short or int type first argument, number seems correct, however, if use long type first argument, incorrect. can help? for example, here's actual prototype in c++ followed have interface prototype in java: int jrconnect(unsigned int id, const char* config_file, long* handle); public int jrconnect(int[] id, string[] config_file, long[] handle); use jna's intbyreference .

version control - Correct way to install Mercurial on Ubuntu -

i kind of new both, mercurial , ubuntu. i seem have awkwardly installed few other software packages already, wanted see how others go doing this. should use apt-get command? if so, how use in case? best place install mercurial on file system, , how make part of shell (i thinking svn-ish) can check things in , update? thanks, alex just use: sudo apt-get install mercurial it should install in default folder , update environment variables correctly. should able use 'hg' command line, svn, although hg better source control tool.

sql drop - How can I run a script wich is generated from another script under Oracle DB? -

does know how tu run lines generated following query scripts on own right? select 'drop table '||table_name||' cascade constraints;' user_tables; what i'm trying do, delete user tables , constraints on db (this oracle). output correct, want know how run lines without copy/pasting. also, there more efficient way drop tables (including constraints)? begin in (select table_name user_tables) loop execute immediate ('drop table ' || i.table_name || ' cascade constraints'); end loop; end; / justin cave brought excellent point - following drop tables within user's schema starting @ outermost branches of hierarchy of dependencies, assuming foreign keys reference primary key, not unique constraint. tables without primary keys dropped last. begin in (select parent_table, max(tree_depth) tree_depth (select parent.table_name parent_table, child.constraint_name foreign_key, ...

sql - How can I make a copy of a table with a PK? -

in oracle 10g database, make copy of existing table. have same data , rows original table. original table uses pk though, i'm not sure how copy , keep them unique. you can make copy using create table dummy_copy select * dummy//structure , data also use dbms_metadata.get_ddl associated constraints of table , create checks select dbms_metadata.get_ddl( 'table', 'dummy' ) dual;

antlr3 - ANTLR, heterogeneous AST problem -

Image
i examine heterogeneous trees in antlr (using antlrworks 1.4.2). here example of have done in antlr. grammar test; options { language = java; output = ast; } tokens { program; var; } @members { class program extends commontree { public program(int ttype) { token = new commontoken(ttype, "<start>"); } } } start : program var function // works fine: //-> ^(program program var function) // not work (described below): -> ^(program<program> program var function) ; program : 'program'! id ';'! ; var : type^ id ';'! ; function : id '('! ')'! ';'! ; type : 'int' | 'string' ; id : ('a'..'z' | 'a'..'z')+ ; whitespace : (' ' | '\t' '\n'| '\r' | '\f')...

c# - WPF writing html to a rich text box -

i working on wpf windows application using c# code. application inherited. have limited experience using wpf. have rich text box control used build email using html. there code read rich text box contents , store results html in database. code working. need write reverse writing html rich text box appears text. below code have read rich text box. textrange xaml = new textrange(emailbodyrichtextbox.document.contentstart, emailbodyrichtextbox.document.contentend); memorystream ms = new memorystream(); xaml.save(ms, dataformats.xaml); string xamlstring = asciiencoding.default.getstring(ms.toarray()); string html = htmlconverter.htmlfromxamlconverter.convertxamltohtml("<flowdocument>" + xamlstring + "</flowdocument>"); html = httputility.htmlencode(html); to save richtextbox's content regular string can save in database: string formattedemail = xamlwriter.save(emailbodyric...

how to upload a file to my server using html -

basically have form allows user upload server: <form id = "uploadbanner" method = "post" action = "#"> <input id = "fileupload" type = "file" /> <input type = "submit" value = "submit" id = "submit" /> </form> but problem when upload file, click submit, don't see file upload in server directory. <form id="uploadbanner" enctype="multipart/form-data" method="post" action="#"> <input id="fileupload" name="myfile" type="file" /> <input type="submit" value="submit" id="submit" /> </form> you need form type , php process file :) you should check out uploadify if want customisable out of box.

PDF to Image convertor -

i'm taking recommendations either library in python or ruby or free web service take pdf , pair of image dimensions , spit out image each page (jpg or png). nothing complicated! must have point-for-point accuracy original pdf. all. imagemagick uses ghostscript pdf files. skip imagemagick , use ghostscript directly. imho.

javascript - Reading Dynamic JSON Array -

i trying build javascript function grab json encoded array , return value based on requested key. use jquery $.parsejson() method take json string , convert javascript object. here watered down example: function getvalue(dynamicarraykey) { var thearray = $.parsejson(/* json source using jquery */); alert('here value: ' + thearray.dynamicarraykey); } so key want given function, , should return resulting value. thinking javascript eval() method should used in there somewhere, i'm not sure. appreciated. there's no need eval(), use alert('here value: ' + thearray[dynamicarraykey]);

sql - Android client/server application? -

i supervising project done 2 students involves retrieving information server , displaying on android phone. students have never learnt networking, sql or java before (although know how program) , learning how setup socketed connections between phone , sample server app gave them. they need setup simple sql database on server on campus network , able communicate , pull information database , display on phone. my current plan receive xml objects generated on server side sent stream through socket connection. able generate dom using javax.xml classes , display see fit on phone itself. is valid method? kind of problems can expect experience following technique? there another/better/correct way ( without using php or webservices )? system multiple users there significant performance issue proposed method? note 1: phone never sends request other single multicharacter identifier. server interprets identifier , returns information preprogrammed queries , places xml format. ...

iphone - iPad 3.2 & [MPMoviePlayerController setFullScreen:] not showing up -

i have universal application plays movies internet. has support 3.1.x 4.x. in order work, have branch in code detects pre-3.2 devices , utilizes mpmovieplayercontroller supposed work there. this how prepare player play remote movie: - (void)registerformovienotifications { //for 3.2 devices , above if ([movieplayer respondstoselector:@selector(loadstate)]) { log(@"movieplayer responds loadstate, 3.2+ device"); //register notification movie ready play [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplayerloadstatechanged:) name:mpmovieplayerloadstatedidchangenotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(didexitfullscreen:) ...

c# - why is XLinq reformatting my XML? -

i using xlinq (xml linq) parse xml document , 1 part of document deals representing rich-text , uses xml:space="preserve" attribute preserve whitespace within rich-text element. the issue i'm experiencing when have element inside rich-text contains sub-element no text, xlinq reformats xml , puts element on own line. this, of course, causes additional white space created changes original content. example: <rich-text xml:space="preserve"> <text-run><br/></text-run> </rich-text> results in: <rich-text xml:space="preserve"> <text-run> <br/> </text-run> </rich-text> if add space or other text before <br/> in original xml so <rich-text xml:space="preserve"> <text-run> <br/></text-run> </rich-text> the parser doesn't reformat xml <rich-text xml:space="preserve"> <text-run> <b...

ipad - multiple page turn effect like flipboard -

i want make multiple page turn effect flipboard. please give me suggestion how implement effect. thanks have @ github.com/raweng/flipview , tried replicate flipboard app ipad !! implemented of features multiple flip (just click on last pagination if u r @ first or second multi-flip). views arrangement if orientation changed flipboard selection of random layout hope helps u :)

c# - Why ASP.NET Session is automatically lost? -

i hosted asp.net web app. iis6. when run web app., w3wp.exe process terminate , sessions lost. use traditional in-process session state. page have many process calculate. but in machine running web in iis6, can run , have no problem. problem occurs in machine. my machine core2duo cpu running on windows server 2003 4gb of ram i try configure iis6 disable events of worker process recycle, still cannot work. what should do? thanks

actionscript 3 - How to get swf's url on swc library -

i'am beginner of actionscript3 i wanna swf's url. but develop swc lib. swf(main) develop other developer. i have main loaderinfo, / f fixed. do have idea? public function dosomething( arg1:string,arg2:string ):string { /* thing */ return result; } get other developer pass in main class or stage (in fact displayobject) , return loaderinfo.loaderurl that. like: public function getswfurl( dobj:sprite ):string { return dobj.root.loaderinfo.loaderurl; } the .root return root displayobject , displayobject that's attached stage return this.

c - lib dependencies and their order -

at times if don't list libs in order inside makefile, fails. the reason being - definition should come before use. how determine correct order? actually, when linking libraries, use should come before definition. unresolved symbols need known before library file providing definitions processed. what comes order, i'm afraid have manually. if liba depends on libb (i.e. liba uses symbols libb), have link in order: -la -lb . this matter of documentation. well-documented library states other libraries depends on, can figure out correct linking order. if don't want read documentation or there no documentation available, trial , error option :)

android - how to change my grid view in horizontal view? -

hi create thumbnails images.....but wish create images in horizontal view.. how change grid view in horizontal..... you can use , horizontalscrollview parent layout , inside use , imagviews. or can use galleryview.

resource for practical javascript exercise -

i beginner webprogramming & javascript. have went through few tutorials , learned basics. suggest me best resource practical exercise solutions. i found "pagetutor.com" has practical javascript exercises, it's paid! please suggest paid sites worth practical learning. eloquent javascript "interactive tutorial" embeds editor directly pages, enabling test , experiment many examples. learning advanced javascript provides series of examples intended enable learner understand prototype.js's .bind method. examples can edited allow reader experiment them. admittedly, neither of these options provide answer question, not "exercises" interactive tutorials. may of value nonetheless.

ios - Is there any FaceTime API for iPhone developers? -

i developing application having facetime feature. how know when both connected/disconnected using facetime? need restrict call duration , don't want show others facetime id when getting connected because of security reasons. there delegate know details? give idea it? there no facetime api in offical api. you can use the facetime url scheme: facetime://

c# - Customizing the Login Control in ASP.NET -

i'm making library management system using asp.net using c#. have problem creating custom login page in website. i've tried using asp.net web configuration boss doesnt allow me install aspnet_regsql.exe in main database. i have 2 tables, 1 table username , password , other 1 username status (in case username deleted or not used anymore). there alternatives or workaround? you use separate database aspnet login part. way boss doesn't have worry .net adding procedures , tables existing database. wouldn't recommend writing own scratch there danger of creating security vulnerabilities hackers later exploit.

Preloading a UIImageView animation using objective c for the iphone -

i have animated image works great. consists of 180 high quality images , plays fine , loops continuously. problem first time load view containing these images takes long time load. every subsequent time after loads assuming images have been cached or preloaded!!! come flash background , sure aware preloaders common muck don't feel should difficult find after countless googling cannot find examples on preloading or articles on why there delay , it. so question(s) this: is there checkbox in info.plist preload images @ start of app? how can preload images , there simple example projects at? is best way implement video has been output png sequence? is there method viewdidload not work expect do. traces "finished loading images" (see code below) view not show second or 2 after images have been loaded if view not show until images have loaded neither uiactivityindicatorview in same view. how do event listening in objective c? below code in viewdidload believe st...

Limited icon in gridview in android -

how can design gridview in android shows icon limited on first time , clicking particular button remaining icons on screen? for example i have total 30 40 icon display,on first screen want show half of total icons , icon clicking particular action clicking button. is possible design view?if possible plz send me hint. thnx.

python - Problems in scraping and saving file by eventlet -

i can use evenlet scrap img website failed save them domestic directory. following code. 1 familiar i/o operation in tasklets model? thanks import pyquery import eventlet eventlet.green import urllib2 #fetch img urls............ works fine print "loading page..." html=urllib2.urlopen("http://www.meinv86.com/meinv/yuanchuangmeinvzipai/").read() print "parsing urls..." d=pyquery.pyquery(html) count=0 urls=[] url='' in d('img'): count=count+1 print i.attrib["src"] urls.append(i.attrib["src"]) def fetch(url): try: print "start feteching %s" %(url) urlfile = urllib2.urlopen(url) size=int(urlfile.headers['content-length']) print 'downloading %s, total file size: %d' %(url,size) data = urlfile.read() print 'download complete - %s' %(url) ########################################## #file save won't work f=open("/head2/"+url+".jpg","wb...

database - Complex data-driven web application in Java - Decision on technologies -

dear stack overflow community, i java programmer in front of task of building complex, data-driven, web application (saas) , i'm searching technologies use. have made decisions , believe i'm proficient enough build appliaction using technologies have decided (i'm not saying perfect, working). however, i'd make task easier , that's why need help. brief description of project back-end the application heavily data-driven , meaning stored in self-descripting database. means database entirely described metadata , application not know data reads , writes. there won't regular entities (in terms of jpa @entity) because application won't know structure of data; obtain metadata. metadata have pre-determined structure. put simply, metadata alpha-omega of application because tell application when , display , how display it. the application utilize stored procedures perform low-level tasks on data, such automatical auditing, logging , translating user's...

javascript - Subscribing multiple handlers to DOM Events with jQuery -

i attempting subscribe events css class. have 2 handlers, defined follows: $(document).ready(function() { $('.refresh-cart').click( function(e) { alert('refreshing'); }); $('form.ajax').submit( function(e) { e.preventdefault(); $.post( this.action, $(this).serialize(), function(data, textstatus, jqxhr) { alert('post'); }, 'text'); } ); }); when these handlers overlap, not getting expected functionality. this code works correctly, alerting 'post' , submitting ajax request. <form action="page.html" method="post" class="ajax"> <input type="text" name="sample" value="samplevalue" /> <input type="submit" /> </form> this code works correctly, alerting 'refreshing' <di...

mechanize - first python script, scraper, recommendations welcome -

i have finished first python script, scraper election data philipines. not have programming background, have used stata statistical analysis , dabbled bit in r lately want switch @ point. want learn python extract data websites , other sources. far have browsed through python tutorial, "learning python" o'reilly waiting on shelf. wrote following script taking inspiration other peoples' scripts , browsing included packages documentation. what looking general advice. script work, there superfluous parts? should structure differently? there typical (or plain dumb) beginners mistakes? i have compiled few questions myself have listed after script. import mechanize import lxml.html import csv site = "http://www.comelec.gov.ph/results/2004natl/2004electionresults_local.aspx" br = mechanize.browser() response = br.open(site) output = csv.writer(file(r'output.csv','wb')) br.select_form(name="ctl00") provinces = br.possible_ite...

c# - Loading the WCF configuration from different files on the client side -

a common problem in wcf many people face impossibility of loading client configuration different configuration files. this common scenario when developer wants deploy binaries along independent configuration file (which may in resource file or configuration file) avoid modifying main configuration file. i have found 2 references: http://weblogs.asp.net/cibrax/archive/2007/10/19/loading-the-wcf-configuration-from-different-files-on-the-client-side.aspx http://social.msdn.microsoft.com/forums/en-us/wcf/thread/f33e620a-e332-4fd4-ae21-88c750437355/ which best solution ?? any suggestions best solution ? use vs 2008 , .net 3.5. the first link (blog post) more relevant situation. other option use wcf discovery discover endpoint , configuration @ runtime, approach more work , can complicated in managed mode.

installation - Install Shiled 2008 - how to add a MSU (MSI?) as a prerequisite and install by condition -

i have install shield 2008 express edition , setup project create's exe , and msi installer. our application uses hlp files system , hlp files not supported natively on windows vista , newer need add setup prerequsite installation of viewer windows vista, 7, 2008 can downloaded here: http://www.microsoft.com/downloads/en/details.aspx?familyid=258aa5ec-e3d9-4228-8844-008e02b32a2c### , in msu (microsoft update format) also need make conditionall install means need detect if setup running on vista, 7 2008 , detect if 32-bit or 64-bit , install correct msu. possible , if yes how in installshield 2008 express? i see in redistributables section predefined prerequisites. how can add own, custom? the express sku of installshield doesn't provide means creating custom prereq (.prq ) files. files simple xml documents though , trial version of installshield pro/prem. author 1 , drop in directory express consume. checkout blog article describing how author prereq. de...

SMTPRecipientsRefused in django -

when trying send mails through django getting above error . can please tell cause of error , how avoid it? the cause smtp server refusing of recipients you're sending email to. fix either not send email recipients, reconfigure smtp server accept them, or find different smtp server use.

image - File Transfer via Internet ( using java) -

i've java(swing) application running on server , client(or assume 2 different computers),these 2 connected through internet not lan or wan..the client has send some data (around 200 kb) server.which method preferable transferring data..i used tcp through lan,but it's working slow through internet..so can use udp internet ? if yes, don't know how divide data chunks , send & again re-assemble data @ server. i thankful if source code provided udp transfer(bulk data in java). thanks in advance.. use tcp , want in way better can hope implement on own. if have low bandwidth, transfer in background or wait - there nothing can that. read data in byte arrays , write them whole - see datainputstream.readfully(). flush output @ end of writing. edit: if want send multiple images, 1 after other, can video compression - designed efficient @ that.

math - Quadratic Bézier Curve: Calculate Points -

Image
i'd calculate point on quadratic curve. use canvas element of html5. when use quadraticcurveto() function in javascript, have source point, target point , control point. how can calculate point on created quadratic curve @ let's t=0.5 "only" knowing 3 points? use quadratic bézier formula, found, instance, on wikipedia page bézier curves : in pseudo-code, that's t = 0.5; // given example value x = (1 - t) * (1 - t) * p[0].x + 2 * (1 - t) * t * p[1].x + t * t * p[2].x; y = (1 - t) * (1 - t) * p[0].y + 2 * (1 - t) * t * p[1].y + t * t * p[2].y; p[0] start point, p[1] control point, , p[2] end point. t parameter, goes 0 1.

multi query - NHibernate Multiquery for eager loading without joins -

is possible use multiquery , have 2 hql queries returning 2 different sets of entities 1 of sets used in other , session "fixes" via first level cache? e.g. scenario (a dumb 1 , solved joins) public class room { ... public virtual iset<bookings> bookings {get;set;} public virtual bool isavailible {get;set;} ... } public class booking { ... } after executing multicriteria 2 hql's: returning rooms isavailible = true returning bookings having room has room isavailible when accessing room result , bookings want them resolved second resultset via firstlevel cache of session , there avoiding n+1. generally speaking, nhibernate can use cache "combine" results queries executed through multiquery. however, should noted applies cases lazy collections loaded no restrictions whatsoever. examples: invoice ialias = null; invoicedetails idalias = null; // base-query: invoices condition var invoices = session.queryover<invoice...

optimization - Erlang: optimize complex qlc -

i have qlc refsblocked = qlc:e(qlc:q([ ref1 || {{ref1, {pattern, {_status1, _pattern1, limit1}}}, count} <- dict:to_list( qlc:fold( fun({key, _ref2}, acc) -> dict:update_counter(key, 1, acc) end, dict:new(), qlc:q([ {{ref1, {pattern, {status1, pattern1, limit1}}}, ref2} || {ref2, {status, status2}} <- ets:table(tmp), {ref3, {tag, tag3}} <- ets:table(tmp), ref2 =:= ref3, {ref1, {pattern, {status1, pattern1, limit1}}} <- ets:table(tmp), ref =:= ref1, status1 =:= status2, pattern1 =:= tag3 ]) ) ), count >= limit1 ], unique)) where tmp ets of type bag , ref particular identifier need test. ets contains from hundreds thousands of entries {ref1, {definition, {tuple1}}} {ref1, {status, scheduled}} {ref1, {status, blocked}} {ref1, ...

Java basics: a static function without a name, or return type -

public class main { public static final logger logger = logger.getlogger(main.class.getname()); static { try { logger.addhandler(new filehandler("errors.log",true)); } catch(ioexception ex) { logger.log(level.warning,ex.tostring(),ex); } } ... i'm wondering nameless static function about. i never saw in java (which i'm learning). what ? when typically used ? when gonna executed in program ? that called static block , executed once during initialization. also, if there more 1 static initialization blocks, run time guarantees called in order appear in source code. here pretty explanation example code @ bottom of page. http://isagoksu.com/2009/development/java/understanding-static-blocks/

.net - Send custom header for all WCF REST OPTION calls -

i'm trying implement standalone wcf rest service. 1 problem have have send custom objects, webget can't handle. i'm trying send them post instead of get. now of course can't make jsonp request post data. work around this, have send allow-origin header calls made "options" http-method. there a way apply header each option call? a way intercept , allow option-calls without setting [webrequest(method = "*")] (instead of [webrequest(method = "post")] a way add headers , return request without calling wcf method? or alternatively, how can override parameter-serialization method of webget? i tried solve custom endpoints , messagedispatchers, doesn't seem work. i figured out how overwrite parameter serialization of webget. this question pointed me in right direction. i had overwrite httpbehavior , add own querystringconverter, uses newtonsoft json serializer. public class customquerystringconverter :system.se...

jquery - back button browser causes go to home page -

i understand more how capture if user click on button of browser, , basic tecniques handle it. as example of know how redirect (for instance) user home page if button pressed? you can't , shouldn't. users expect button work in way, changing breaks behaviour. bad, bad.

iphone - MPMoviePlayerController delay when there should be virtually none -

each time app changes displayed animation, looping movie, takes pause till start movie. movieplayerconntroller created way self.movieplayer = [mpmovieplayercontroller alloc]; [movieplayer initwithcontenturl:[nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"newchar" oftype:@"m4v"]] ]; // remove playerview our view (no prob isnt attached any) [movieplayer.view removefromsuperview]; // tell our playerview size has use movieplayer.view.frame = cgrectmake(0, 0, 320, 430); // , add hin superview behind else [self.view insertsubview:movieplayer.view atindex:0]; // no moviecontrolls movieplayer.controlstyle = mpmoviecontrolstylenone; // looping forever movieplayer.repeatmode= mpmovierepeatmodeone; // let him use own audio session old devices movieplayer.useapplicationaudiosession= no; // fix silly black background on ios 4.3 movieplayer.view.backgroundcolor = [uicolor clearcolor]; the actu...

javascript - Know when position collision has fired in jQuery UI -

i trying extend jquery ui dialog() use arrow pointers point clicked. issue i've run knowing when collision method runs can change pointers left side right side. is possible know when position.collision method triggered? $('#myelem').dialog({ position:{ collision:'flip' } }); solution: as turns out can pass more in documentation. here ended using solved problem: position: { my: 'left top', at: 'right center', of: $trigger, offset: '20 -55', collision: 'flip', using: function(obj) { var $modal = $(this), trigger_l = $trigger.position().left, modal_l = obj.left, top; // check ie's top position top = ( isie ) ? obj.top - 48 : top = obj.top; $(this).css({ left: obj.left + 'px', top: top + 'px' }); } } i used using method inside position object majority of w...

java - How do I send data from Struts action to javascript? -

i'm trying create webb application using struts 2 , javascript , i'm having trouble passing data action javascript. list i'm trying send/access: list<markerclass> markers; markerclass defined acoprding belove: final class markerclass { public integer objectid; public string street; public string streetnumber; public string zip; public string city; public integer statusid; public float lattitude; public float longitude; } the action includes getter markers: public list<markerclass> getmarkers() { return markers; } in jsp-file have tried doing this: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!doctype html> <html> <head> <script type="text/javascript"> function initialize() { var titel ...

scrollto - Jquery SlideToggle AND scroll -

i'm having problem slidetoggle link appears @ bottom of page. want user click show/hide hidden div (which works fine) the problem page doesn't scroll down show now, not hidden div as jquery novice, there way toggle div , center on page? or @ least scroll down, without things getting complicated? thanks to perform function, i'd recommend using callback slidetoggle call set document scroll using scrolltop function. you'll able determine value scrolltop setter using offset top position of toggled container relative page. i'd suggest restricting scroll behavior fire when element shown, not hidden. in general, directly setting page scroll can jarring ux. reason i'm going give code animates scrolltop rather straight sets using scrolltop function, approach not necessary direct call scrolltop equally position page. think user i'd rather see gradual scroll rather sudden positional change. the code, instance, take form: $(".myshowhidel...

iphone - Question concerning File Handling -

i got following problem : trying create file following code : nsstring *homedirectory = nshomedirectory(); nsstring *documentdirectory = [homedirectory stringbyappendingpathcomponent:@"documents"]; nsstring *filepath = [documentdirectory stringbyappendingpathcomponent:@"test.txt"]; nsfilehandle *savedfile = nil; savedfile = [[nsfilehandle filehandleforwritingatpath:filepath]retain]; nsstring *data = @"testmessage"; [savedfile writedata:[string datausingencoding:nsutf8stringencoding]]; [savedfile synchronizefile]; [savedfile closefile]; my question following. running on mac not give me errors whatsoever. file seems nonexistant or @ least not locateable. need find , access file , have able export mac using mobile ios device thanks in advance :) h4wkeye you need check savedfile not nil (see the docs here). nsstring *homedirectory = nshomedirectory(); nsstring *documentdirectory = [homedirectory stringbyappendingpathcomponent:@"...