Posts

Showing posts from May, 2013

javascript - Can you use HTML5 local storage to store a file? If not, how? -

how 1 go caching / managing many large files (videos) on user's computer via browser mechanisms (plugins acceptable solutions). can tell, local storage database type data, not files. the filesystem api[1,2] going best bet going forward, @ 1 point bleeding edge. has been been abandoned w3c. own documentation: work on document has been discontinued , should not referenced or used basis implementation. http://dev.w3.org/2009/dap/file-system/pub/filesystem/ http://www.html5rocks.com/tutorials/file/filesystem/

iPhone/Xcode: UIImage and UIImageView won't get with the program -

i attempting save , load uiimage , iphone documents directory after image picked iphone photo library. able so, reason, when load image, rotates 90 degrees counterclockwise. here saveimage , loadimage methods: save image: - (void)saveimage: (uiimage*)image{ if (image != nil) { nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring* path = [documentsdirectory stringbyappendingpathcomponent: [nsstring stringwithstring: @"lephoto.png"] ]; //nsdata* data = uiimagepngrepresentation(image); //[data writetofile:path atomically:yes]; [uiimagepngrepresentation(image) writetofile:path atomically:yes]; } } load image: - (nsdata*)loadimage{ nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory,

iphone - how to place previously selected value at UIPickerview bar -

i displaying array objects in pickerview. my array contains {one,two,three,four,five} when select value in picker view, getting value using - (void)pickerview:(uipickerview *)thepickerview didselectrow:(nsinteger)row incomponent:(nsinteger)component { if select two, exit picker view , next time display 1 in picker view bar. but need display selected value. i think understandable otherwise let me add comment. - (void) viewdidappear:(bool)animated { [pickerview selectrow:selecteditem incomponent:0 animated:yes]; }

How to limit the number of taxonomy values in a Wordpress post? -

i have defined series of custom post types (namely "portfoliopage" , "portfoliogallery"). each of them uses custom taxonomy called "artist". is there way limit end-user enter @ 1 artist per portfoliopage / portfoliogallery post? you cause custom taxonomy use radio buttons rather checkboxes, have here: https://wordpress.stackexchange.com/questions/7456/altering-the-appearance-of-custom-taxonomy-inputs

iphone - MapView snaps back to original location - help! -

i have mapview custom annotations , ran problem on beta tester's iphone. mapview won't let user move location.. try move, snaps right original coordinates. any idea why? doesn't happen in simulator, , notice little bit on own device... consistent problem on device. thanks much! static bool havealreadyreceivedcoordinates = no; - (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation { if(havealreadyreceivedcoordinates) { return; } havealreadyreceivedcoordinates = yes; cllocationcoordinate2d loc = [newlocation coordinate]; [mapview setcentercoordinate:loc]; } icky put on right track. shouldn't resetting map's center whatever location manager. location manager send sorts of updates. you may wish use update once , ignore future updates (by setting kind of flag), or may wish center map on user's location when user presses button. in latter

ruby on rails 3 - MongoDB : Mongoid and I18n translations -

i going start new project based on top of mongodb. my application need handle fields translations. i discovered plugin named : mongoid_i18n is 1 plugin interesting ? or other plugins available ? mongoid >= 2.4 includes facility natively. see: http://two.mongoid.org/docs/documents/localized.html

associations - right database/approach to do keyphrase queries with many possible "keys words" matching each record -

my rails 3 application hosted @ heroku using postgres ordinary database stuff keeping track of messages , users. 100% of experience normal relational dbases , sql. however i'm adding single new method "lookup_product_by_keyword" accesses dataset unrelated rest of app , therefore implemented in framework or database. , i'm wondering if mongodb or other type of database might way implement 1 capability. our goal find 1 of 5000 product type ("screwdriver" "bottle opener" etc etc) best matches list of perhaps 50,0000 keywords , phrases. example, there might 10-20 words or phrases match , return "screwdriver" ("philips screwdriver" "flathead screwdriver" etc). i suspect there type of clever design, perhaps built around specialized database different form mysql, postgres, etc. optimized thsi sort of "assocative" rather relational information structure. any pointers appreciated... what looking @

rubygems - undefined class/module YAML::PrivateType -

i have uploaded new version of gem server, successfully. if install gem local, installed. but i'm getting following error while installing same gem remote server. error: while executing gem ... (argumenterror) undefined class/module yaml::privatetype note: i have included method outside of class/module. there issue that? run these commands: gem install rubygems-update update_rubygems

.net - WCF logging: Why isn't Close being called for TraceListener? -

i'm trying log messages wcf service @ transport level. i've followed instructions found on net successfully, want implement own trace listener supports our in-house logging solution. i've implemented trace listener , configure using app.config of windows service hosting wcf service. following xml use configure logging. <system.diagnostics> <sources> <source name="system.servicemodel.messagelogging"> <listeners> <add name="messages" type="my.namespace.advancedlogtracelistener, tools.logging, version=2.0.3.1, culture=neutral" initializedata="c:\logs" /> </listeners> </source> </sources> </system.diagnostics> ... <diagnostics> <messagelogging logentiremessage="true" logmalformedmessages="false" logmessagesatservicelevel="false" logmessagesattransportlevel="true"> </messagelogging>

Eclipse Java - Use output of one project as lib in other -

i have 2 projects, "foo engine" , "foo webapp". obviously, run webapp, can package foo jar, , link jar. time consuming when making changes foo well. there way tell eclipse continually update jar in same way in-editor instant-compile system (is possible?), , specify path jar (so it's in lib folder of webapp). thanks! edit: advice! i've realised webapp project isn't being compiled eclipse, webapp framework (play) - reference projects option isn't available. i'll see if can refer project in play, if not i'll go jar packaging... wtf? i'm not allowed vote answers... sorry guys from eclipse user guide : open java build path dialog (project > properties > java build path) , go projects tab. in required projects on build path list , can add project dependencies selecting other workbench projects add build path new project. adding required project indirectly adds classpath entries marked 'expo

c# - Search in BindingList<T> with Linq -

why warning? bindinglist<classname> lst = list.select(obj => obj.number == "nn").tolist<classname>(); ................................................. list: bindinglist<classname> list = new bindinglist<classname>(); erro: system.collections.generic.ienumerable' not contain definition 'tolist' , best extension method overload 'system.linq.enumerable.tolist(system.collections.generic.ienumerable)' has invalid arguments do mean where instead of select ? list.select(obj => obj.number == "nn") is projection each item in list returns string "nn" - have sequence of n-times- "nn" ; try force list of classname . further attempt cast list<classname> bindinglist<classname> , there no relationship between them other ilist<t> i expect mean: bindinglist<classname> lst = new bindinglist<classname>( list.where(obj => obj.number == &qu

sharepoint2010 : javascript in Sharepoint 2010 using visual studio 2010 -

can use javascript in sharepoint 2010 web part using visual studio 2010? yes, see creating web part client-side script http://msdn.microsoft.com/en-us/library/dd584169(v=office.11).aspx

mysql - PHP Zend framework - Many layer menu -

in application, want make dynamic multi layer menu this toy1 ==>sub toy1-a ==>sub toy1-b toy2 ==>sub toy2-a ==>sub toy2-b toy3 ==sub toy3-a i have created 2 table in database called parent-menu contain toy1,toy2,toy3 , sub-menu contain sub toy1-a, sub toy1-b , father belongs. don't know how retrieve database or algorithm make this. have solution ? i can recommend use 1 table, make program eaisy. take 3 field *menu_id* , *menu_text* , *parent_id* top menu take parent id 1. following work, retrieve data table. and use recursive function place menu.

c# - Threading Basics -

using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.threading; namespace testthreads { public partial class form1 : form { public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { } public void counttolots() { (int = 0; < 10000000; i++) { textbox1.text = "counting 10000000, value " + + environment.newline; } } public void counttozero() { (int = 10000000; > 0; i--) { textbox2.text = "counting 0, value " + + environment.newline; } } private void button1_click(object sender, eventargs e) { thread countup = new thread(new thread

java - Android -- Open multiple Sockets (Input and Output Streams) for one connection -

i can connect through bluetooth nexus 1 android phone bluetooth android phone. can use input , output streams connection , write requests , read responses . application uses real time data processing. wondering there way open 2 input/output streams on different sockets (sort of dedicated sockets) communication? , if yes how accomplish ? pointers helpful ... mmsocket.connect(); public void connect () since: api level 5 attempt connect remote device. this method block until connection made or connection fails. if method returns without exception socket connected. creating new connections remote bluetooth devices should not attempted while device discovery in progress. device discovery heavyweight procedure on bluetooth adapter , slow device connection. use canceldiscovery() cancel ongoing discovery. discovery not managed activity, run system service, application should call canceldiscovery() if did not directly request discovery, sure. now question : how can connect u

BlackBerry wifi implementation failure -

i have problems wifi connection in application. worked fine ";deviceside=true" using ";interface=wifi" caused problems, , gives me "tunnel failed" exception, wrong? (tested in bold 9000 real device) hard without seeing code, try using versatile monkey's network helper class connections, supports wi-fi , other blackberry connection permutations quite seamlessly.

.net - how to create a authentication rule if i use seperate login for two folders say admin folder and vendor folder -

Image
i have following directory structure in asp.net webdirectory ! i want when body access anypage inside admin folder auto redirect login page of admin folder until login ... using login page ... add in configureation section of web.config <location path="admin"> <system.web> <authorization> <deny users="?"/> <allow roles="super admin"/>//you can allow specific roles access folder </authorization> </system.web> </location> <authentication mode="forms"> <forms name="signin" loginurl="~/login.aspx" defaulturl="~/default.aspx"/> </authentication>

CMS - Alfresco, Magnolia, Drupal and Joomla Comparison -

i comparing alfresco, magnolia & joomla specific following features: a. ease of integration of user created templates. b. jcr (jsr-170?) or cmis compliance. c. scalability in architecture. d. mobile site deployment. i used cmsmatrix.org compare features not of specific information related above mentioned points. any insights based on experience on working 1 or more of above cms products helpful. thanks, krish. while these 4 products branded cms don't think comparable. drupal and, know, joomla web publishing cms (or wcms ), designed create web sites , manage content. not designed generic cms, dms or ecm . alfresco, , magnolia, ecm/dms designed manage enterprise contents. for instance, while manageable in drupal (given enough effort , custom php code), complex multi-states multi-actor workflow multilingual documents (pdf, office, etc.) easier manage alfresco. , alfresco not suitable manage web content lightweight publishing workflow , u

PHP foreach loop to access twitter followers not working -

as question states, trying avatars of each of followers, getting json twitter, , once i've decoded it, try loop through of users profile images url, right getting image tags no url's, so, <img /> "1" or <img /> "2" . here php code: $followers = json_decode(file_get_contents("http://api.twitter.com/1/statuses/followers.json?screen_name=usersscreenname"), true); $i = -1; foreach($followers $value){ $i++; echo "<img src='".$value[$i]['profile_image_url']."' />"; } here when print_r($followers) , array ( [0] => array ( [contributors_enabled] => [following] => [verified] => [url] => [is_translator] => [time_zone] => timezone [profile_text_color] => 739e9f [profile_image_url] => http://a3.twimg.com/profile_images/000000000/normal

c++ - Partial specialization of double-templated method fails -

there template class list. template <typename point> class list { public: template <const unsigned short n> void load ( const char *file); ... }; template <typename point> template <const unsigned short n> void list <point>::load ( const char *file) } how specialize method load n=2? code not valid... template <typename point> void list <point> <2>::load ( const char *file) { } and code not work. template <typename point> void list <point> ::load <2> ( const char *file ) { } error 3 error c2768: 'list<point>::load' : illegal use of explicit template arguments 66. error 5 error c2244: 'list<point>::load' : unable match function definition existing declaration 66 compiler g++: template <typename point> template <> void list <point> ::load <2> ( const char *file ) { } error: explicit specialization in non-namespace

.net - Cannot set authorization rules in web.config for WCF Service -

i read on post can use asp.net authorization in web config control access wcf web service replace following attribute: [principalpermission(securityaction.demand, role="administrators")] to test have been using "administrators" valid role should allow me access , "test" isnt. works fine when using above attribute when comment out , use in web.config file: <authentication mode="windows" /> <authorization> <allow roles=".\test"/> <deny roles="*"/> </authorization> it still allows me access. so wondering if have got wrong in web.config or whether read wrong saying use that. just reference post looked at: using windows role authentication in app.config wcf and following web.config: <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetframework="4.0" /> <authentication mode="

deployment - Deploying Custom Features to Live SharePoint 2010 Environment -

i have been working on customisation sharepoint 2010 using visual studio. visual studio project contains custom web parts , pages. have been deploying , testing customisations within sharepoint development environment without issues. i need deploy these changes live sharepoint environment has load balanced front end web servers. will need install visual studio on both load balanced servers , there pre deployment procedures need carry out? many thanks. in development environment, visual studio 2010 automatically packaging , deploying you. to migrate these packages production environment, go /bin directory of project, , there should wsp in there. copy server. then use either stsadm or powershell install/deploy them. pushed out wfe in farm. no dont need install visual studio on live servers it idea scheduled window deploying, release reset application pool, or may need reset iis/server (depending on setup/configuration)

utf 8 - MySQL search with uft8_general_ci is case sensitive for FULLTEXT? -

i set myisam table fulltext searching. do not want searches case-sensitive. my searches along lines of: select * search match (keywords) against ('+diversity +kitten' in boolean mode); let's keywords field i'm looking has value "my diversity kitten". i noticed searches case-sensitive. double-checked collation on search table, set utf8_bin . d'oh! changed utf8_general_ci . but query still case-sensitive! why? is there server setting need change, too? is there need besides change collation? i did "repair table search quick" rebuild fulltext index, didn't either... my searches still case-sensitive. =( aha, figured out reals time. i believe issue using navicat update collation. have older version of navicat, maybe bug or something. doing: alter table search convert character set utf8 collate utf8_general_ci; fixed correctly. always use command line, kids! =)

java - SurfaceView without camera : preview after start rotated on 90 degree -

my problem. create app preview camera on android. preview while im not press on button - used camera , camera.open. when app started - orientation of screen normal.. when try record video - closed camera preview , used surfaceview recorder.setvideosource(mediarecorder.videosource.default); it's showing me preview camera without class camera. becouse it's fixed me bug greenish screen after recorded. so... preview(which without camera) after start rotated on 90 degree ( in mode landscape) im try use setrequestedorientation(activityinfo.screen_orientation_landscape ); and setrequestedorientation(activityinfo.screen_orientation_portrait ); but not fixed problem. so, can 1 tell me how rotate preview(without camera) in mode screen_orientation_portrait ?? pls tell me how fix problem.. can't fix 2-3 days :( regards, peter p.s. sorry bad english, hope u understand me. it's code used preview when recorded video/audio preview = new surfaceview(withprevie

Filtering arguments in windows batch file -

is possible filter list of arguments in windows batch file? assuming called like: file.cmd arg1 --unwanted arg3 it should call other executable (hardcoded) without argument string --unwanted : some.exe arg1 arg3 i know name of argument, can passed argument in list. may not exist on argument list, , arguments should passed unmodified. number of arguments may vary. more examples (what's called -> should called in result) file.cmd arg1 arg2 -> some.exe arg1 arg2 file.cmd --unwanted -> some.exe file.cmd --unwanted arg2 -> some.exe arg2 file.cmd arg1 --unwanted -> some.exe arg1 moving unix shell scripting windows batch files black magic me :) @echo off setlocal enableextensions if "%1"=="sotest" ( rem tests... call file.cmd arg1 --unwanted arg3 call file.cmd arg1 arg2 call file.cmd --unwanted call file.cmd --unwanted arg2 call file.cmd arg1 --unwanted goto :eof ) set params= :nextparam if "

datagrid - How to change the background color of a Silverlight DataGridRow? -

Image
i have silverlight datagrid bound collection of myobjects . myobject has boolean field called ishighlighted . change row's background color when value true. , have changed if becomes false. i tried using loading_row event ( as explained here ), didn't work me, event called once, , objetcs have boolean value set false @ time (it becomes truc when component selectes; works, checked values). anybody has clue ? in advance ! update : made test application illustrate, reproduces problem. <navigation:page x:class="aviews.tests" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"

javascript - Why does this ExtJS code get the error "this.el is null"? -

i want able click button , execute extjs code testing, extjs code gives me error this.el null . what have code work? main.js: ext.onready(function() { var button = new ext.button('button-div', { text: 'hello', handler: function() { alert('pressed'); } }); viewport = new ext.viewport({ layout: 'border', items: [ button ] }); viewport.dolayout(); }); html: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"> </script> <script type="text/javascript" src="ext/ext-all-debug.js"> </script> <script type="text/javascript" src="js/main.js"></script> </he

asp.net mvc - SetLastModified ignored when using an OutputCacheAttribute -

i've got asp.net mvc method (v3.0 on .net 4.0) set following: [outputcache(duration = 31536000, location = outputcachelocation.any)] public virtual actionresult item() { this.response.cache.setlastmodified(new datetime(2011, 01, 01)); return this.content("hello world", "text/plain"); } i'd expect come last-modified header set mon, 07 feb 2011 00:00:00 gmt specified, coming date output first cached in output cache (i.e. first time method called since iis reset). if comment out [outputcache] attribute no output caching done last-modified header comes expected, appears it's in output caching infrastructure that's choosing ignore specified value this. any idea why might doing so? , there way make use specified value last-modified date? well, never did work out reason occurs, looks bug somewhere in asp.net page caching infrastructure [outputcache] attribute uses. i ended writing custom [httpcache] attribute same publi

php - Find the highest set bit -

i have 5 different values saved bits 10010. value int database (cannot change that) 24 means 11000 know can biggest bit here using if ((decbin($d) & 16) == 16) but if first 0 have check next bit, , if 0 have ... so after have block of ifs , if there more bits block bigger. there simple way "id" (or value, not matter) of highest bit 1? yes. compute base 2 logarithm of number , floor it: $highbit = floor(log($d, 2)); if $highbit , instance, 5, means 5th bit highest bit set 1.

java - No image occure from JSON -

i have webservice returns json object decodes image link json: json object my java code in handler: handler handler = new handler(){ @override public void handlemessage(message msg) { pd.cancel(); if (msg.obj.tostring()!= null) { jsonparse json = null; try { log.e("xxx",msg.obj.tostring()); json = new jsonparse(msg.obj.tostring()); string im = json.getchannelimage(); im = im.split("\r")[0]; if (!im.equals(null)) { byte[] decodedstring = base64coder.decode(im); log.e("byte", decodedstring.tostring()); bitmap bitmap = bitmapfactory.decodebytearray(decodedstring, 0, decodedstring.length); iv

svn - How to perform a diff between each pair of files of a directory (and it's sub-directories)? -

i have 2 versions of project in 2 folders. i'd make diff of every pair of identical file in each directory. want (tortoise) svn between working copy , repository, locally. is possible use svn diff between local folders ? thanks. so maybe recursive ordinary diff on 2 directories?

css - Page in Explorer < 8 doesn't get styled for some reason -

i setting page partly in html5 styling in combination ie7.js script (which enables html5 styling support). worked before flawlessly , i'm using same setup, website comes in ie6/7 unstyled. i've been busy days , cannot find out why. able find out what's wrong? this head: <!--[if lt ie 9]><script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/ie9.js"></script><![endif]--> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="stylesheet" type="text/css" media="all" href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/style.css" /> <link rel="shortcut icon" type="image/x-icon" href="http://zzappservices.nl/wordpress/wp-content/themes/zzapp/favicon.ico" /> <!-- scripts, css , settings specific targeted internet explorer --> <!--[if lt ie 9]><link rel="stylesheet" href=&quo

c# - Problem with threads in WPF -

i'm writing application in wpf. have 1 main thread , 1 - calculate something. in main thread need 1 operation after additional thread finished. can't use join additional thread, because don't want block main thread. how can wait finishing second thread , @ same time don't block main thread? the eaisest way use backgroundworker , handle runworkercompleted event. i invite take part 3 of joseph albahari's threading in c# pdf

javascript - Up and bottom keys block -

i have 1 jscript uses , down keys when user click or down page scrolling how block scroll when user click or down? use return false; at end of event handler. see this quirksmode.org article more information.

comparison - What is wrong in the following conditional expression in bash? -

what wrong in following conditional expression in bash? if [[ -z $x -o $x -ge 100 -o $x -le -100 ]]; echo $x "\t" $i fi i following error syntax error in conditional expression syntax error near -o thanks. just use || this: if [[ -z $x || $x -ge 100 || $x -le -100 ]]; the [ synonym test -- in fact, in systems, /bin/[ points /bin/test: $ [ /usr/local/bin/[ the -o flag test or the -o flag [[ (the bash builtin) checks if shell option set [e.g. -o vi vi editing]

need help with jquery ui accordion -

i have created accordion menu. here js code: var menu = $('ul.menu', '#sidebar'); menu.accordion({ header: '.parent > a', collapsible: true }); here recreation of have: http://jsfiddle.net/chmpt/ here's delima: want menu collapsed default , can't change html structure because menu produced joomla. i tried using create method close active menu upon creation of accordion doesn't work right. , here's code: var menu = $('ul.menu', '#sidebar'); menu.accordion({ create: function(event, ui) { menu.accordion("activate" , false); }, header: '.parent > a', collapsible: true }); any suggestions? its simple as menu.accordion({ header:'.parent > a', collapsible: true, active:false }); edit: link jquery ui doc regarding active option

overloading - php overload equals-operator -

in php program have array of custom objects, , want find if array contains object. of course can use array_search, checks if objects same object, not if has same variables. want able create own compare function objects, can use array_search method (or similar). want able this: class foo { public $_a,$_b; function __construct($a,$b) { $this->_a = $a; $this->_b = $b; } function __equals($object) { return $this->_a == $object->_a; } } $f1 = new foo(5,4); $f2 = new foo(4,6); $f3 = new foo(4,5); $array = array($f1,$f2); $idx = array_search($f3,$array); // return 0 is possible? know can create own array_search method uses method class, i'd have use 2 different search functions, 1 classes have own compare function, , 1 haven't. here's neat little trick found out: class foo { public $a; public $b; public function __tostring() { return (string)$this->a; } public func

c# - Silverlight DataGrid duplicate error messages for objects using both DataAnnotations and INotifyDataErrorInfo -

my entity objects use dataannotations attributes validation, validation work silverlight controls , not datagrid, implemented inotifydataerrorinfo. produces duplicate validation errors text in datagrid (it shows error both dataannotations , inotifydataerrorinfo). how can fix this? my modelbase class: http://pastebin.com/sewggvuc here a link blog post can you. author describes how combine inotifydataerrorinfo , dataannotations @ end of post. if nothing changes - add code of entity class question.

c++ - ATL & COM - Multiple servers, one binary? -

i have 2 com dlls. both of implement atl::catldllmodulet<>. understanding, class dirty work of registering , unregistering com objects. there way merge these 2 one? class cfoo : public atl::catldllmodulet< cfoo > { public : declare_libid(libid_foolib) declare_registry_appid_resourceid(idr_foointerface, "{4e6823f7-230b-4d6c-9195-571b94b32859}") }; the 2 projects have, 1 dll , other lib (which gets linked in). see object_entry_auto macro creates link between clsid , implementation object provide support registration, initialisation, , creation of class. use macro each clsid want exe/dll.

linux - Calling elinks from shell script sometimes double fires -

we have migrated hpux 11 rhel 6 , in process our sysadmin group informed lynx no longer available , we'd have use elinks instead. make servlet calls nightly batch processing scripts , never had problem lynx. elinks half time double fires , calls servlet twice (as 2 minutes between firings no other activity on system). being servlets each independent , unaware of other instances , we're having lot of cleanup following day , @ times results in large financial transactions going screwy. the sysadmins know nothing elinks , have left us, none of whom linux expert, figure out why elinks double fires when called shell script , other times doesn't. else experience or have sort of starting point? i've of course been through documentation , elinks website. why don't install lynx rpm ?

http - How to make a XMPP client in a container like tomcat? -

i need login, receive , send messages on xmmp servlet loaded on tomcat container. i know if there implementation of situation ? thx ur time :) i've found smack best available java library xmpp. however, far perfect server side development. in particular need think clustering smack connections hold alot of state. the api nice however, it's pretty trivial connect , send messages , documentation decent. check out http://www.igniterealtime.org/projects/smack/

c++ - Forward stdout to file in Qt Application -

i have qt application starts several qprocess children , calls qprocess::setchannelmode(qprocess::forwardedchannels) . forward stdout of application (now containing stdout of children) log file, location of determined application, means can't modify logging write specified file, because won't work children, , can't run app | tee logfile , because don't know tee to. i prefer - if exists (and haven't been able find if does) - method via qt, other solutions acceptable. isn't qprocess::setstandardoutputfile() ? sorry never done myself

mysql - Query to show all tables and their collation -

is there query can run in mysql shows tables , default collation? better if there on show collations on columns of tables. select table_catalog, table_schema, table_name, column_name, collation_name information_schema.columns

java - Google Guice: Provider with parameters -

i have constructor depends on classes , b. defined this: @inject testclass(a a, b b) is there way in guice have 1 of constructor parameters injected manually? problem is, object of class a cannot built depends on user input. wondering if guice supports provider accepts argument. example, object can created provider.get() , guice has 1 support provider.get(a) ? i think need assisted inject .

msbuild - How to HeatDirectory 2 or more times against directories with the same files? -

i've been using heatdirectory task in our wix installer project in beforebuild target harvest files of web application deploy on clients network. been working great. i want deploy second set of files, happens documentation, , contains files of same name exist in previous heatdirectory output. i following error: lght0293: multiple files id 'web.config' exist. i understand why getting error, i'm wondering how best resolve it. option a : copy files directory , run heat on them in 1 massive pass. i because easy implement using stock msbuild tasks. dislike because create 1 massive componentgroup , if ever decided make optional features (like not install something), can't. option b : iterate on output file of heatdirectory task , append suffix on component id , file id's. example - web.config become web.config_documenationfiles i because it's clean; i.e. can delete later or add project that's having issue , not add projects don't

asp.net - Changing passwordFormat from Encrypted to Hashed -

i'm finding surprisingly little information on converting existing database encrypted passwords hashed passwords. (i able find bit more information on converting other way, wasn't of help.) as people know, changing passwordformat setting in web.config affects new users. have database couple of hundred users , i'd convert them use hashed passwords without changing existing passwords. is else familiar how 1 might approach this? tips. this approach i'd start see how far got: create 2 membershipproviders in web.config, 1 encrypted passwords , 1 hashed. loop through users using encrypted password provider. ( sqlmembershipprovider.getallusers ) get user's password using encrypted password provider. ( membershipuser.getpassword ) change user's password same password using hashed password provider. ( membershipuser.changepassword ) so it'd this: <membership defaultprovider="hashedprovider"> <providers>

Perl Regex to Process Text Input -

i have perl script imports html , converts plain text. using html::tagfilter remove html tags , working except we've run 1 issue. when html contains non-stand html tags such "caption" in example input below tags aren't being removed: lorem ipsum dolor sit amet, consectetur adipiscing elit. etiam pulvinar, odio ut gravida fringilla, tellus mi ultrices felis, quis porta lacus sem ut lacus. vestibulum massa justo, tristique id aliquet in, dapibus eu leo. nam sapien risus, dictum et porttitor quis, egestas quis dui. ut nec nisl felis. class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. [caption id="sample-id" align="sample-align" width="225" caption="sample caption"]<a href="http://www.domain.com/image.jpg"><img class="sample-image-class" title="sample title" src="http://www.domain.com/image.jpg" alt="sample alt" width="225

machine learning - Dalvik format failed: Failed to convert dex. PermGen space- Android -

i need use classifier j48 in android. running heapspace problems. there way fix same? error states. dalvik format failed: failed convert dex. permgen space. so have memory problem using j48 in weka on android. try diagnose in following order: how memory program consume? see here , here weka memory consumption. add more memory jvm (also in earlier links). try running on more affluent jvm - can run on desktop? or problem unrelated os resources? tune algorithm - build smaller tree or prune more heavily. prune dataset - remove unnecessary attributes. prune dataset - use fewer instances. use different algorithm. if else fails - implement decision tree using different library (scipy/orange/knime/rapid miner), or roll own.

php - sql join problem -

i want select posts contain specific tag. i'm trying query: select group_concat(t.tag_name) taglist posts p join posts_tags pt on p.post_id = pt.post_id join tags t on t.tag_id = pt.tag_id (p.post_private = 0) , t.tag_name = 'php' group p.post_id problem is, query above, selects posts contain php tag, doesn't select of other tags post may contain. without and t.tag_name = 'php' part, select every tag post has, want able filter tag... any ideas how this? i've tried many things, can't figure out... sample data without and statement: || *taglist* || || php,echo || || c++, cout || sample data and statement: || *taglist* || || php || what want: || *taglist* || || php,echo || (the posts contain php tag only) select p.post_id, group_concat(t.tag_name) taglist posts p /* these 2 joins list of tags */ inner join posts_tags pt on p.post_id = pt.post_id inner join tags t

codeigniter - nginx + fastCGI stops servering php after a couple of refreshes -

i setup new centos server nginx , fastcgi. followed linode article installed , configured http://library.linode.com/lemp-guides/centos-5/ . seems work fine, until refresh page couple times. after 2 refresh nginx stops serving php , gives me error. if load php page in different browser, work again, until fresh. there kind of arbitrary limit on number of requests session can make? i'm new nginx. i'm more comfortable apache configs. i'm sure it's in nginx.conf. other pointing locations directory php is, didn't change of default configs in /etc/nginx.conf. i don't think matters, it's running codeigniter application. thanks.

Class static instance initializers (i.e. factory methods) in Ruby -

i have class want put factory methods on spit out new instance based on 1 of 2 construction methods: either can constructed data in memory, or data stored in file. what encapsulate logic of how construction performed inside class, have static class methods set this: class myappmodel def initialize #absolutely nothing here - instances not constructed externally myappmodel.new end def self.construct_from_some_other_object otherobject inst = myappmodel.new inst.instance_variable_set("@some_non_published_var", otherobject.foo) return inst end def self.construct_from_file file inst = myappmodel.new inst.instance_variable_set("@some_non_published_var", get_it_from_file(file)) return inst end end is there no way set @some_private_var on instance of class class without resorting metaprogramming (instance_variable_set)? seems pattern not esoteric require meta-poking variables instance

Third Party WordPress ad placement plugin / utility for Yahoo APT -

is there third-party ad placement plugin or utility wordpress works yahoo apt, or have roll own? looks there lot of options adsense, can't seem find apt. use adrotate . not specific adsense, let define blocks can insert in template. in blocks, can show adsense/yahoo/png/flash advertising want. manage rotation automatically. if there mora ads in block, display @ random! stats included

properties - How to test property existence and type based on NSString typed key? -

in quest update core data model within ios project, i'm querying server json objects correspond - extent - managed entities of model. end result i'm striving reliable update solution json output. for examples in question, i'll name core data managed object existingobj , incoming json deserialized dictionary updatedict . tricky part dealing these facts: not properties of existingobj present in updatedict not properties of updatedict available in extistingobj . not types of existingobj 's properties match json deserialized properties. (some strings may need custom objective-c wrapper). updatedict may contain values keys uninitialized ( nil ) in existingobj . this means while iterating through updated dictionaries, there has testing of properties , forth. first have test whether properties of updatedict exist in existingobj , set value using kvc, so: // key nsstring, e.g. @"displayname" if ([existingobj respondstoselector:nsselectorfromstrin

Hiding certain SELECT dropdown in JQuery -

i have page approx 10 select dropdowns. 3 of these dropdowns hidden default onload, depending on users status. now, if user specific, these 7 dropdowns hidden , depending on users input, these dropdown visible. i show , hide these dropdowns using jquery. jquery("select").hide() jquery("select").show() currently, when select dropdowns shown, selects visibile. have run code hide 3 default ones. what jquery hide visible select dropdowns (the 7 visible ones) , show these 7 ones (leaving 3 defaulted hidden 1 hidden). is possible using jquery, shows , hides select dropdowns style visibility visible?not sure? many thanks solution assign these selects special class , use class show , hide: $(".myspecialselectclass").hide(); $(".myspecialselectclass").show(); you need make sure class assigned selects.

Microsoft SQL Server: How to improve the performance of a dumb query? -

i have been asked performance issue of sql server installation. not sql server expert, decided take look. using closed source application appears work ok. after sql server upgrade 2000 2005, application performance has reportedly suffered considerably. ran sql profiler , caught following query (field names changed protect innocent) taking 30 seconds run. first thought should optimize query. not possible, given application closed source , vendor not helpful. left, trying figure out how make query run fast without changing it. not clear me how query ran faster on older sql server 2000 product. perhaps there sort of performance tuning applied on instance did not carry on or not work on new sql server. dbcc pintable comes mind. anyway, here offending query: select min(row_id) table1 calendar_id = 'test1' , exists (select id table1 calendar_id = 'test1' , datediff(day, '12/30/2010 09:21', start_datetime) = 0 ) , exists (sel

mysql - Use of date function in PHP to output a user-friendly date -

i have mysql database column named dateadded. i'd echo readable date/time. here simplified version of code have: $result = mysql_query(" select listitem, dateadded lists userid = '" . $currentid . "' "); while($row = mysql_fetch_array($result)) { // make date nicer $dateadded = date('d-m-y',$row['dateadded']); echo $row['listitem'] . ","; echo $dateadded; echo "<br />"; } is use of date function best way output user-friendly date? thanks taking look, if don't plan on outputting dates beyond 2038, fine using date() . otherwise, use php's datetime doesn't have limitation, or mysql's date formatting functions format date directly in database. however, seem storing timestamp in database. have considered switching datetime field?

hash - Is there a secure way to guarantee credit card uniqueness? -

so, reasonably competent web development shop, wear cotton gloves when touch credit cards, , use braintree securevault store them clear of pci compliance issues. however want offer free trial our service, pretty relies on being able guarantee given credit card used once free trial. ideally able hash credit card number guarantee uniqueness. problem there set of valid credit card numbers small, it's going easy brute force credit card numbers. salting tactics useless far can see, because if has access database of hashes, have code well, , salting algorithm. the best 2 ideas far are: a) keeping hashes isolated in set, no relation billing information. therefore if hashes brute-forced, have list of credit card numbers used @ point in time, no personal information or knowledge of whether it's still valid. main weakness here have record of last-4 potentially used match them extent. b) hash without full number , deal false positives , negatives. hashing on name, last-4