Posts

Showing posts from March, 2012

c# - Creating an installer with WPF forms, packaged files and custom setup actions -

i'm trying create way of deploying set of tools (which add-ins 3rd party software) users. i following: user enters serial dlls in directory structure extracted program files a file copied location in programdata (this registers add-ins 3rd party application) online activation software performed can point me right direction this? had @ deployment projects in visual studio i'm not sure if i'm after. main problem ugly, have nice wpf installer, , have more custom experience. guess can traded off if going make things easier. i thinking, make own c# project extracts files, have no idea how package them , extract them part of 1 download (like msi files deployment projects create). can point me in right direction? the thing having wpf installer users need appropriate version of .net installed install application. may fine if using .net 3.0 , software requires windows vista or greater. if use .net 3.5 or 4.0 stating .net requirement may not enough. do if u...

Xcode warning: "Multiple build commands for output file" -

i getting error this: [warn]warning: multiple build commands output file /developer/b/be/build/release-iphonesimulator/bb.app/no.png [warn]warning: multiple build commands output file /developer/b/be/build/release-iphonesimulator/bb.app/d.png [warn]warning: multiple build commands output file /developer/b/be/build/release-iphonesimulator/bb.app/n.png but have checked xcode , don't see duplicates of such files @ all. this post in apple mailing lists say, there no duplicates. in project navigator, select xcode project file. show project settings targets in project. in "copy bundle resources" build phase. should find offending files in list twice. delete duplicate reference. xcode complaining trying bundle same file application 2 times.

algorithm - Smallest circle which covers given points on 2D plane -

problem: what smallest possible diameter of circle covers given n points on 2d plane? what efficient algorithm solve problem , how work? this smallest circle problem . see references links suggested algorithms. e.welzl, smallest enclosing disks (balls , ellipsoids), in h. maurer (ed.), new results , new trends in computer science, lecture notes in computer science, vol. 555, springer-verlag, 359–37 (1991) is reference "fastest" algorithm.

java - Android - Remove data from SDCard -

my application use sdcard store data (about 100 mb of stuff). delete these file when application deleted through application manager , offer way clear data there (like google apps does). ideas ? quote http://developer.android.com/guide/topics/data/data-storage.html accessing files on external storage if you're using api level 8 or greater, use getexternalfilesdir() open file represents external storage directory should save files. ... if user uninstalls application, directory , contents deleted. from understanding create file on sd card has scope (like directory of applications package namespace) , phone delete directory when uninstall app. assume how google apps achieves function.

php curl reset or modify cookies -

php-curl: how hell can modify or delete cookies after calling curl_exec in existing curl object? 1) "cookiejar" file not saved on disk until curl_close()! 2) curlopt_cookie - can't help, adding cookie same name, not removing/editing older one. 3) curlopt_httpheader - setting "cookie: " - can't too! i need edit or totally remove cookies without closing - re-creating curl object =( i think had similar problem. solution cloning curl object curl_copy_handle() , closing 1 of them (either original or clone). i'm not sure if useful problem.

How to set global variables in jQuery/JavaScript? -

i have ajax function: $.ajax({ url: 'http://localhost/process.php', type: 'post', data: '', success: function(output) { var animal = output } }); i var animal set globally can call anywhere on page outside ajax function's success callback. how this? declare outside of function or jquery construct var animal = null; $(function(){ $.ajax({ url: 'http://localhost/process.php', type: 'post', data: '', success: function(output) { animal = output } }); });

java - What does this symbol mean in IntelliJ? (red circle on bottom-left corner of file name, with 'J' in it) -

under target folder in intellij java project created, have few java source files in package. beside each file 'j' icon has red circle line through it. what mean? how fix it? you need specify source dir file> project structure > modules click directory , click sources button it's weird because it's done automatically. maybe it's better if recreate project again.

testing - What's the difference between unit, functional, acceptance, and integration tests? -

what difference between unit, functional, acceptance, , integration testing (and other types of tests failed mention)? depending on look, you'll different answers. i've read subject lot, , here's distillation; again, these wooly , others may disagree. unit tests tests smallest unit of functionality, typically method/function (e.g. given class particular state, calling x method on class should cause y happen). unit tests should focussed on 1 particular feature (e.g., calling pop method when stack empty should throw invalidoperationexception ). touches should done in memory; means test code and code under test shouldn't: call out (non-trivial) collaborators access network hit database use file system spin thread etc. any kind of dependency slow / hard understand / initialise / manipulate should stubbed/mocked/whatevered using appropriate techniques can focus on unit of code doing, not dependencies do. in short, unit tests simple possible...

python - Break nested loop in Django views.py with a function -

i have nested loop break out of. after searching site seems best practice put nested loop function , use return break out of it. acceptable have functions inside views.py file not view? best practice location of function? here's example code inside views.py @login_required def save_bookmark(request): if request.method == 'post': form = bookmarksaveform(request.post) if form.is_valid(): bookmark_list = bookmark.objects.all() bookmark in bookmark_list: link in bookmark.link_set.all(): if link.url == form.cleaned_data['url']: # something. break else: # else. else: form = bookmarksaveform() return render_to_response('save_bookmark_form.html', {'form': form}) you shouldn't think of django views being in way special. it's python . such, ...

php - problem in showing an img open from zip archive -

iam img date zip archive getfromindex() , date (this first line of text appearing) ‰png ��� ihdr���@���@���ªi know how can makke appear iam used $im = imagecreatefromstring($data); if ($im !== false) { header('content-type: image/png'); imagepng($im); imagedestroy($im); } but did not worked , used header('content-type: image/png'); imagepng($data); imagedestroy($im); but did not worked , giving me warning: imagepng(): supplied argument not valid image resource now asked me date format assume output is $date = file_get_contents('http://sstatic.net/so/img/logo.png'); the text appear same format must use $date because must contents first i suspect image data not output of script, right? must be.

fork - How can I redirect the output of Perl's system() to a filehandle? -

with open command in perl, can use filehandle. have trouble getting exit code open command in perl. with system command in perl, can exit code of program i'm running. want redirect stdout filehandle (no stderr). my stdout going line-by-line output of key-value pairs want insert mao in perl. why want redirect stdout java program in perl. possible? note: if errors, errors printed stderr. 1 possibility check if gets printed stderr can quite perl script. you may want check out ipc::system::simple -- gives many options executing external commands, capturing output , return value, , optionally dying if bad result returned.

Quick way to create JSF custom component -

i know of 2 ways of creating custom jsf components: 1. native jsf way: creating jsf component class, tag, etc. 2. facelets way: defining component in xhtml file , creating appropriate decrption in facelets taglib. currently work on project in introducing facelets unfortunately out of question. on other hand, creating custom components standard jsf way seems pain in ass. is there maybe third party library allows creating custom components in way similar facelets doesn't entail need of using non-standard renderer? you can limited amount of templating using (for example) jsp:include , f:subview . alternatively, can extend uicomponent overriding selected methods , provide via existing tag , managed bean using binding attribute. still requires reasonably detailed understanding of component development (and consequences of choice), cut down number of files/volume of code significantly. this approach bit of hack, might ok short-term stuff. wouldn't component li...

Is it possible to call WSDL method just by calling some url from browser? -

is possible call wsdl (bacikhttpbinding) method calling url browser? according this: http://www.devdaily.com/blog/post/java/how-to-call-web-service-from-browser you can calling replacing ../someservice?wsdl with ../someservice/methodname?paramname=value however doesn't work xfire, website states so. (website uses axis2)

java - ANDROID: How to gain root access in an Android application? -

i'm developing first android application, , i'm curious if there "standard" ways executing privileged shell commands. i've been able find 1 way it, executing su , , appending commands stdin of su process. dataoutputstream pout = new dataoutputstream(p.getoutputstream()); datainputstream pin = new datainputstream(p.getinputstream()); string rv = ""; // su must exit before output can read pout.writebytes(cmd + "\nexit\n"); pout.flush(); p.waitfor(); while (pin.available() > 0) rv += pin.readline() + "\n"; i've read wrapping privileged ( superuser ) calls in jni : possible? if so, how 1 go accomplishing it? other that, there other ways of calling privileged instructions java ? as far know, can run command-line commands using root privileges. can use generic class made wraps root access in code: http://muzikant-android.blogspot.com/2011/02/how-to-get-root-access-and-execute.html all need extend class ...

asp.net - C#: Object reference not set to an instance of an object -

i following error: object reference not set instance of object this c sharp code: datatable tableacces = dsacces.tables["dsprinteracces"]; datatable tablemdf = dsacces.tables["dsprintermdf"]; datarow newrow = null; foreach(datarow dr in tableacces.rows) { newrow = tablemdf.newrow(); newrow["printer_id"] = dr["printer_id"]; newrow["merk"] = dr["merk"]; newrow["model"] = dr["model"]; newrow["lokaal_id"] = dr["lokaal_id"]; tablemdf.rows.add(newrow); } damdf.update(dsmdf, "dsprintermdf"); lblsucces.text = "gelukt. de tabel printers overgezet."; } in line, throws error: newrow = tablemdf.newrow(); thanks lot, vincent tablemdf null then. need find out why dsacces.tables["dsprintermdf"] returning null @ top.

html - GET variable for css files? -

i've noticed sites when link css pass appears variable in addition link, example http://html5boilerplate.com html template, ?v=2 <link rel="stylesheet" href="css/style.css?v=2"> is flag server rewrite or more? some sites may use route specific css files, however, without knowing specific site referring to: in event css file changes, provides easy way reset browser cache on clients computers. changing v=2 v=3 .

osx - Advice for supporting both Mac and Windows Desktops -

what best practices building gui desktop app support both windows , os x? let's it's budgeting software, there bit of math , big data structures. user data saved in xml files; there no separate database or networking. at 1 extreme, build windows version in c# , mac version in objective c. there better approach, can more keep 2 versions in sync , write less duplicate code? write math , data structures , "business logic" in c++, pre-processor directives simple system calls io, , separate gui layer written once windows , once os x? c/c++ choice cross-platform end, assuming want native code? there way write gui part single time? (i expect not.) please note i'm not asking how use cross-compiler. i'm interested in how you'd structure overall project least hassle. it's have different view on issue, given strong feelings platform native user interfaces , controls/widgets, tend prefer second approach. i'm not masochistic enough go through h...

parsing - How exactly is a PHP script executed? -

i thinking myself "how php script executed?" thought parsed first syntax errors etc, , interpreted , executed. however, don't know why believe correct. i'm wrong. so, how php file interpreted , executed? stages involve? how included files fit parsing of script? this me head around it. i'm interested , can not find answer google. basically, each time php script loaded, goes 2 steps : the php source code parsed, , converted what's called opcodes kind of equivalent of java's bytecode if want see like, can use vld extension then, opcode executed these slides sebastian bergmann, on slideshare, might understand process bit better : php compiler internals

sql server 2008 - how to write T-SQL to compare and copy data? -

i have 2 sql server 2008 enterprise databases (on 2 machines), , 1 of databases master database , database slave database. i want transfer update table in source database table in destination database (two tables of same schema, both of them using single column unique primary key). transfer rule (in short, rule keeping destination database same source database because of update of source database), if there new row in source database not in destination database, insert row in destination database; if row not exists in source database exists in destination database, delete row in destination database; if row's content (i.e. columns other primary key columns) changes in source database, update new content destination database. thanks in advance, george you can use sql server project wizard visual studio (vsts) [check out tutorial learn more], in can select master database, select other configuration in wizard. finally fetch data/schema master database can c...

Rails HTML/TEXT UserMailer Templates -

currently rails 3 mailer templates, need create html , text version in views/user_mailer directory. why necessary? why can't rails @ html version , automatically format text/plain version? this not required. can provide 1 of templates. instance, if don't need html, can create text file only. likewise, can provide html template only. readers attempts extract information. however, if use html, should provide alternative text version make sure readers won't mess content of email. by way, rails doesn't force provide both templates.

javascript - How to get the dimensions of the scroll bars? -

possible duplicate: javascript : browser's scrollbar sizes i have html table contains lots of rows , columns. therefore, has vertical , horizontal scroll bars. how can dimensions in pixels of these scroll bars in javascript/jquerys ? ben alman has nice scrollbarwidth plugin works nicely. var content = $('#content').css( 'width', 'auto' ), container = content.parent(); if ( content.height() > container.height() ) { content.width( content.width() - $.scrollbarwidth() ); }

postgresql - How do i find out a value between two parameters in postgres sql? -

for example: name | startyear | endyear jon 2003 2005 jake 1999 2002 blake 1997 1998 jake 1995 1996 jason 1993 1994 is there way return blake? i want know treasurer between 2 terms of jake. you use between , like: select yt.name yourtable yt theyear between yt.startyear , yt.endyear between inclusive, return blake theyear = 97 , 98.

jquery - Select Options from JSON -

i newb when comes json , wanting try write json select option autofiller, not know start. the way script works using php , mysql fill first set of select options distinct list db table , upon user selection next set of select options autofilled options linked first set. there anyway in json? sure. lets have simple json: { "options": [ { "text":"mytext","value":"myvalue"}, { "text":"mytext2","value":"myvalue2"} ] } then, evaluate javascript: var options = eval('(' + myjson + ')'); // myjson data variable then, create each option in dom (i'll use jquery brevity sake) var length = options.length; for(var j = 0; j < length; j++) { var newoption = $('<option/>'); newoption.attr('text', options[j].text); newoption.attr('value', options[j].value); // fixed typo $('#myselect').append(newoption...

include or extends (UML java) -

can tell me if have use include dependency or extends one? use_case : select , load file use_case b : show waveform whenever user selects , loads audio file, waveform displayed. i think use_case , use_case b should connected extends .... right? thank you i'd include not extend . reason: purpose user's point of view display waveform . selecting , loading file means towards end, not end in itself. it's difficult see select , load file ever having use on it's own: doesn't represent valuable end-user functionality. ever exist uc if common step in more 1 'real' ucs. hth.

.net - How do I transfer configuration data into injected objects? -

i used use spring.net , want switch ninject 1.5 (i have use .net2, since unlucky guy me still needs consider users working win 2k). used have done in xml , invoke container during startup. in way, limited codes depending on container. have scenarios , wonder how same in ninject. i have external config file, items end users can change basing on environment/preferences. , of objects depends on values initialize. primary values, times can list/dictionaries/etc. got fixed myself. follow link: http://java2cs2.blogspot.com/2010/04/passing-external-configuration-data-to.html

push back - Vector does reallocation on every push_back -

ide - visual studio 2008, visual c++ i have custom class class1 copy constructor it. i have vector data inserted using following code class1* objclass1; vector<class1> vclass1; for(int i=0;i<1000;i++) { objclass1 = new class1(); vclass1.push_back(*objclass1); delete objclass1; } now on every insert, vector gets re-allocated , existing contents copied new locations. example, if vector has 5 elements , if insert 6th one, previous 5 elements along new 1 gets copied new location (i figured out adding log statements in copy constructors.) on using reserve() , not happen expected! have following questions is mandatory use reserve statement? does vector reallocation every time push_back ; or happen because debugging ? find out putting copy constructor test non debug code, , let know platform! imo vector shouldn't reallocate on every pushback. there smarter ways manage memory, , i'd bet money implementers didn't tha...

erd - Other use for a Hibernate Mapping file -

i trying define db dependency web based application, , thinking perhaps hibernate mappings used in application might importable sort of tool produce visual erd diagram. has tried this? the hibernate tools plugin eclipse allows visualize data model "mapping diagram": alt text http://relation.to/service/file/2987

recursion in JavaScript graph exploring algorithm -

i trying explore graph here not sure wrong explore function. recursion doesn't seem working correctly; while exploring neighbours of node 0 explored 0, 1, 2 , never returns explore 3, 4, 5; why so? explored=[] //class definition function graph(){ this.graph=new array(); .graph[0] = [1,0,1,1,0,1] .graph[1] = [0,1,1,1,0,0] .graph[2] = [1,1,1,1,0,0] .graph[3] = [1,1,1,1,1,0] .graph[4] = [0,0,0,1,1,0] .graph[5] = [1,0,0,0,0,0] this.explore = explore } function explore(node,depth){ explored[node]=1 document.write('<br>') for(x=0;x<depth;x++) document.write('-') document.write(node+'<br>') neighbours=this.graph[node] document.write('exploring '+node +' neighbours' + neighbours +'explored = '+explored) ( i=0;i<neighbours.length;i++){ document.write('checking'+i+' node ='+node ) if(neighbours[i] ==1 && ...

python - Actionscript Three Asymetric Encryption -

i cant seem find reliable asymetric encryption solution secure data between python based server application , client on open data channel. need way client prevent man in middle attack on open data channel, current exchange has me sending clients token use verify talking server application checking token valid php script on site. far ideal , compromised waiting sent token , passing off user. have tried as3crypto's rsa encryption old implementation not supported many libraries having known vulnerability. solution lets me hard code public/private keys both client , server prevent happening. since decompiling swf content not major problem experienced hackers, advise against hardcoding keys. have thought using ssl @ all?

c++ - Conditions for automatic generation of default/copy/move ctor and copy/move assignment operator? -

i want refresh memory on conditions under compiler typically auto generates default constructor, copy constructor , assignment operator. i seem recollect there rules, don't remeber, , can't find reputable resource online. can help? in following, "auto-generated" means "implicitly declared defaulted, not defined deleted". there situations special member functions declared, defined deleted. the default constructor auto-generated if there no user-declared constructor (§12.1/5). the copy constructor auto-generated if there no user-declared move constructor or move assignment operator (because there no move constructors or move assignment operators in c++03, simplifies "always" in c++03) (§12.8/8). the copy assignment operator auto-generated if there no user-declared move constructor or move assignment operator (§12.8/19). the destructor auto-generated if there no user-declared destructor (§12.4/4). c++11 , later only: the mov...

java - Resolving Webpage expired in IE8 -

whenever click on file->new window or press ctrl+n in ie8, new window page displayed browsers cachec , request not go server side. i solved above issue adding following lines in each page, response.setheader("cache-control","no-cache"); response.setheader("pragma","no-cache"); response.setdateheader ("expires", 0); response.setheader("cache-control","no-store"); now when click on file->new window or press ctrl+n in ie8, msg "webpage has been expired.........local copy............." in new window. instead of displaying above msg need display own msg/page . have tried different values in response header cache-control, expire etc. thing want achieve that, if there no page in cache request must go server processing i.e. whenever user clicks on file->new window or ctrl+n in ie8 request should go server. i'm sure way achieve if user disables own cache, eve...

winforms - C# Synchronisation with screen updates -

i have following problem: application screen-update , should make screenshot of new view after that. code follows: public viewmodelbase screen { { if (_screen == null) { screen = new datasourcechooserscreenviewmodel(this); history.changehistory(add_item); } return _screen; } set { _screen = value; onpropertychanged("screen"); system.windows.forms.application.doevents(); } } the screen update done in "onpropertychanged("screen")" , screenshot taken in "history.changehistory(add_item)". methods calling setter "screen" follow same scheme: //do screen = otherscreen; history.changehistory(add_item); //do else and here's problem: screenshot made before screen has been updated although execution order says else. to solve problem myself tried several things: busy waiting in add_i...

makefile - Error log of make command in Linux -

i compiling kernel module , has many compilation errors in it. after running "make", errors thrown out many fit in screen. scrolling doesn't reach first error. tried capturing errors doing make &2 > log didn't work (log file empty , error messages still dumped on screen). can please tell me how go logging messages generated during compilation/make logfile? try doing: make >&log the & after > tells shell dump both stdout , stderr log . can used pipes.

osx - How can I put 0x08 ascii character using MacBook? -

i'm writing question because 1 little invisible problem has taken me hours , hours of dummy searchings, , time has been wasted (here question: css: there difference between these 2 parts? ) does know how character 0x08 ("backspace" in ascii) can written text using macbook , simple ide (i use "coda")? there no ability press alt + 08 on macbook (there no digital keys part on macbook's keyboard). how can happen? did copy & paste anywhere? because way know - apart scfrench suggested - enable in terminal typing: stty erase space ctrl + v ctrl + h return

debugging - C# - foreach showing strange behavior / for working with no problem -

today coded function uses 2 nested foreach loops. after seeing, did not work expected, debugged it. dont see error, , dont think simple error can cause behavior have noticed. the part looks this: foreach(myclass citem in checkedlistboxitemlist.items) { foreach(myclass cactiveitem in activeitemlist) { if (cactiveitem.id == citem.id) /*...check checkbox item...*/; } } lets say, checkedlistboxitemlist.items holds 4 items of type myclass, , activeitemlist list< myclass > 2 items. the debugger jumps outer foreach, reaches inner foreach, executes if 2 times (once per cactiveitem) , reaches end of outer foreach.now, debugger jumps head of outer foreach should. instead of starting second round of outer foreach, debugger jumps myclass.tostring() method. can step through method 4 times (number of items in checkedlistboxitemlist.items) , ... nothing. visual studio shows me windows form, , foreach not continued. when changing code to int listcount = checkedlist...

"Cannot create an instance of the abstract class or interface" C# error message -

i changed base class abstract project , i'm receiving following error: cannot create instance of abstract class or interface am receiving error because naming new instance of abstract class not allowed? newplane = new airplane_abstract(name, position); you can't create instance of abstract class. think of interface may contain implementation logic well. expect happen if called abstract instance method no definition?

git rebase branch with all subbranches -

is possible rebase branch it's subbranches in git? i use branches quick/mutable tags mark commits. * master * * featurea-finished * * origin/master now want rebase -i master onto origin/master , change/reword commit featurea-finished^ after git rebase -i --onto origin/master origin/master master , want history be: * master * * featurea-finished * (changed/reworded) * origin/master but is: * master * * (same changeset featurea-finished) * (changed/reworded) | * featurea-finished |.* (original commit wanted edit) * origin/master is there way around it, or stuck recreating branches on new rebased commits? according git's object model if change meta-data of commit (i.e. commit message) not underlying data ("tree(s)") contained within it's tree hash remain unchanged. aside editing commit message, performing rebase, change tree hashes of each commit in history, because changes pulled origin/master affect files in re-written history: me...

Blogger Facebook 'Like' Not in Feed -

i've tried adding facebook button blogger site using javascript sdk/xfbml , iframe methods. the button show , work, notification never shows in facebook news feed -- in individual profile. it doesn't seem matter method use, i've been fiddling iframe. tried this, still, same problem -- notification doesn't show in news feed: <iframe allowtransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.url + &quot;&amp;layout=standard&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:40px;'/> anyone out there have suggestions? the facebook button intended show person's friends have 'liked' site. endorsement of reputation site. when person facebook friend of 'liked' site visits,the...

windows - Is It possible to set environment variable and echo it in a single line batch script? -

set a=2 && echo %a% this not echo 2 in windows. there way it? a=2 ; echo $a works in bash. want similar behavior on windows i'm sure there many ways this, here 2 of them: setlocal enabledelayedexpansion&set "foo=bar baz"&echo.!foo!&endlocal set "foo=bar baz"&for /f "tokens=1,* delims==" %%a in ('set foo') if "%%~a"=="foo" echo.%%b edit: added check "filter" set results 2nd solution, johannes rössel

broadcastreceiver - Unregistering Android Broadcast Receiver in onReceive throws "Receiver not registered" -

i have broadcastreceiver 1 time use. i'm registering in activity. can't put unregisterreceiver() in onpause because has stay running when activity paused or destroyed. i want broadcastreceiver unregister when done, this: public class smsreceiver extends broadcastreceiver { public void onreceive(context context, intent intent) { // code.. context.unregisterreceiver(this) } } but causes exception: receiver not registered. a broadcastreceiver exists during execution of onreceive() method. so, this evaluates throw-away instance every time broadcast fired/received. see broadcast receiver lifecycle . dynamically registering/unregistering of broadcastreceiver s, have remember instance of receiver in onpause() register again during onresume() .

sorting - Bogosort optimization, probability related -

i'm coding question on online judge practice . question regarding optimizing bogosort , involves not shuffling entire number range every time. if after last shuffle several first elements end in right places fix them , don't shuffle elements furthermore. same last elements if in right places. example, if initial sequence (3, 5, 1, 6, 4, 2) , after 1 shuffle johnny gets (1, 2, 5, 4, 3, 6) fix 1, 2 , 6 , proceed sorting (5, 4, 3) using same algorithm. each test case output expected amount of shuffles needed improved algorithm sort sequence of first n natural numbers in form of irreducible fractions. a sample input/output says n=6, answer 1826/189. i don't quite understand how answer arrived at. this looks similar 2011 google code jam, preliminary round, problem 4, answer n, don't know how 1826/189.

Looking for a jQuery plugin : sort of bar rating -

i own website users can vote/rate things , want improve poor inputbox (from 1 10) improve visual rendering. i thinking of bar, have 10 ' | ' can move cursor 1 ten (it doesn't have ajax because rating added @ end of form) i'm sure seend king of thing can't find plugin of it. any ideas please ? ps: don't want standars stars rating, using it, ;) i don't "why didn't google that?", there tones of out there... http://www.google.pl/search?hl=pl&q=jquery+rating+plugin&btng=szukaj+w+google&lr= just raplace star icons bar icons. edit (according comment) i didn't question. think jquery ui slider you're looking for.

iphone - TTURLRequest and sending POST data -

i'm three20 first time on ios app, , i'm stuck on can find more information. i'm trying send post data local server, everytime got response : error. if try parameters have no problem. the code i'm using : tturlrequest *request = [tturlrequest requestwithurl:@"http://127.0.0.1:8000/api/login" delegate:self]; request.cachepolicy = cachepolicy; request.response = [[[tturldataresponse alloc] init] autorelease]; request.httpmethod = @"post"; nsstring *myrequeststring = @"username=######@gmail.com&password=66ed############fxij"; nsdata *myrequestdata = [ nsdata datawithbytes: [ myrequeststring utf8string ] length: [ myrequeststring length ] ]; request.contenttype=@"application/x-www-form-urlencoded"; [request.parameters addobject:@"username" forkey:@"######@gmail.com"]; [request.parameters addobject:@"password" forkey:@"6ed############fxij"]; ...

.htaccess - Drupal Login goes to wrong URL :: Problem started after site migration -

i migrated drupal 6 site ('normal-live') host mamp (mac (l)amp stack). needed client can have 'offline' access site in remote areas. i used backup/migrate module on live site export of db. on mamp setup did fresh install of drupal. copied modules, files, themes, etc. new install. after that, using phpmyadmin, imported exported (from live site) sql file new install on mamp. @ point appears fine at...first glance, can nav different pages anonymous user, etc. my problem if try login takes me old url (instead of going http://localhost:8888/drupal-6.20/ ??? goes 'https://originaldomain.com/???'). if change $base_url in settings.php wants reinstall site (drupal installer runs), using .htaccess file got installed w/ fresh drupal (not 1 live site). i baffled... since you're getting redirected url starting http url starting https, check see if have secure pages module installed , set redirect users.

preload - Is there a built-in way to determine the size of a WCF response? -

before client gets full payload of web request, we'd first send measurement of size of response get. if response large, client present message user giving them option abort operation. we can write custom code preload response on server, determine size, , pass on client, we'd rather not if there's way it. does know if wcf has tricky way this? or there free third party tools out there accomplish this? thanks. i don't think there's "tricky" in wcf or .net framework this, really. passing client? instance of class? what run query or fetch response, , serialize memory stream , see how big gets. won't totally accurate size - soap messages has overhead it, soap envelope , headers , stuff - can give ballpark figure of whether you're return few hundred bytes, or couple megabytes. trouble is: might take while on server assemble / query, , "measure", too. plus you'd have have 2 calls - 1 "measureresult" retur...

android - Portion of google map being cut in Motorola Milestone? -

when create google map in our application , load in motorola milestone, left side square portion being cut off. can may reason? same code wont show issues in other sets.. i think google maps glitch on motorola phones and known bug in of motorola phones

javascript - How do I add confirmation to YesNoCheckboxCellEditor in slickgrid? -

i have checkbox field in slickgrid uses yesnocheckboxcelleditor , wants user confirm change. have tried adding vildator:mymethod no success. my guess have modify function this.applyvalue = function (item, state) { item[args.column.field] = state; }; in editor. put whatever conditional logic need , apply value if needed. this.applyvalue = function (item, state) { var applyvalue = (...<your logic goes here>...); if (!!applyvalue){ item[args.column.field] = state; } };

retrieve facebook page posts from everyone -

i want retrieve posts on facebook page, using graph api, can retrieve posted owner of page. i use following http://graph.facebook.com/nilecatacombs/posts which gives me posts written owner. on page http://www.facebook.com/nilecatacombs , if click nile + others, returning results need. try fql: php code: $sql = 'select post_id, actor_id, message, created_time, attachment, comments, likes, permalink stream source_id = ' . $page_id . ' limit 50'; it worked me.

linq - Using Reactives to Merge Chunked Messages -

so i'm attempting use reactives recompose chunked messages identified id , having problem terminating final observable. have message class consists of id, total size, payload, chunk number , type , have following client-side code: i need calculate number of messages take @ runtime (from messages in (from messageargs in receive select serializer.deserialize<message>(new memorystream(encoding.utf8.getbytes(messageargs.message)))) group messages messages.id grouped select grouped) .subscribe(g => { var cache = new list<message>(); g.takewhile((int) math.ceiling(maxpayload/g.first().size) < cache.count) .subscribe(cache.add, _ => { /* rebuild message parts cache */ }); }); first create grouped observable filtering messages unique id , trying cache messages in each group until have collected them all, sort them , put them together. above seems block on g.first(). i need way calculate number take first (or any) of messages come thro...

maven repository mirrors -

normally, have following mirror configured in maven settings.xml <mirror> <id>internal-repository</id> <url>http://build.idaho.local/wtp_repository</url> <mirrorof>*</mirrorof> </mirror> my understanding mirror prevents maven downloading dependencies internet, i.e. them in internal repository. however, whenever want add dependency isn't in internal repository, have comment out text above , add following project's pom.xml <repository> <id>internal-repository</id> <url>http://build.idaho.local/wtp_repository</url> </repository> when make these changes maven check dependencies in local repo, , if not found, download them internet local repo. once have dependencies need, change configuration back. is there way behaviour want - check internal repo, public (internet) repos - without having add <repository> every project's pom.xml ? ideally specify repository once...

c++ - Get date/time of last reboot programmatically -

i find time of last reboot programmatically in linux. using c , c++ in module. is there api? there's no direct api, can read /proc/uptime "file" learn how many seconds system have been running, subtract current time - , assume that's when machine rebooted. /proc/uptime file contains 2 numbers: uptime of system (seconds), , amount of time spent in idle process (seconds).

c# - Twitter API - OOB Flow -

i'm developing mobile application needs access twitter. there's ton of documentation relating using twitter api web apps, i'm having hard time finding correct flow or examples using out-of-band/pin code mode desktop & mobile applications. can point me link or code examples (preferebly in c#) can show me how use twitter api desktop or mobile application? thanks. there description of oob flow in glossary section @ bottom of http://dev.twitter.com/pages/auth out of band mode - instead of providing url-based callback when acquiring request token, "oob" supplied. once user has given twitter account credentials, presented screen containing pin code , asked enter code application. application sends pin oauth_verifier access token step complete exchange. what means in practice, compared normal web flow: in step (a) app starts flow opening browser window oauth flow, sends request param of oauth_callback=oob rather callback url step (c) en...

c# - what is means of this problem when sending email through web-application -

i have error when sending email through our web application " mailbox unavailable. server response was: requested action not taken: mailbox unavailable or not local" this detail of error system.net.mail.smtpfailedrecipientexception caught message=mailbox unavailable. server response was: requested action not taken: mailbox unavailable or not local source=system failedrecipient=<email@email.com> stacktrace: @ system.net.mail.smtptransport.sendmail(mailaddress sender, mailaddresscollection recipients, string deliverynotify, smtpfailedrecipientexception& exception) @ system.net.mail.smtpclient.send(mailmessage message) @ email.globals.sendmail(string emailid, string subject, string message, string sendermail) in c:location innerexception: i assume sender credentials not in order - if recipient's mailbox unavailable, e-mail saying actual sending process should work out (if it's not local recipient). if had gues...

architecture - Top-down or bottom-up design? -

there 2 approaches designing system. advantages , disadvantages? when should use which? should combine approaches? how? roughly speaking, top-down comes decomposition of problem space sub-problems, while bottom-up comes organizing parts of solution space larger chunks. to able use top-down, need solid understanding of problem, i.e. have solid requirements in hand. bottom-up effective, need solving 'standard' problem pieces well-known, exact assembly might need experimentation before right. you should read parnas' brilliant paper a rational design process , how fake it more on issue. answer is: use both, appropriate. when you're done, make (in specifications, design documentation , user documentation) if had done top-down.

c# - How to travel into an ArrayOfXelement? -

i arrayofxelement result webservice. wish bind data chart in silverlight need create datatable. my question how travel arrayofxelement ? ideas ? linq xml ? regards. narglix are looking foreach loop?

Is it possible to use the terminal malloc_history when debugging on a iPhone device? -

i've found malloc_history useful when testing on ios simulator, possible configure physical device (iphone 4). on console similar messages this warning: unable read symbols /developer/platforms/iphoneos.platform/devicesupport/4.2.1 (8c148)/symbols/developer/usr/lib/libxcodedebuggersupport.dylib (file not found). do need setup file somewhere? on terminal this malloc_history cannot examine process xxxx because process not exist. any direct advice / pointers documentation appreciated. thanks try fire instruments , use "allocations".

Calling a Jquery function after the pages is loaded -

i have got link click event in jquery, below: $('#toploginlink').click(function() { //here want current page should reloaded "https" , after page loaded automatically call function mydialogpopup(). below: var mycurrentpage = window.location.href.replace('#',''); var reloadurl; if (https!=' ') { reloadurl = mycurrentpage.replace('#','').replace("http",https); window.location.href = reloadurl; mydialogpopup(); } }); the above code reloading page perfectly, problem function called immediatley, want function should called when page loaded "https" completely. please suggest! how can achieve this you should define flag. example put in cookies or append url. then, in javascript define ready handler called when page loaded: $(document).ready(function() { if (check...

css - How to make GWT RichTextArea transparent under Internet Explorer? -

by default gwt richtextarea transparent against body background etc, true firefox, chrome , safari. internet explorer, not. changing css background-color etc doesn't seems help, still giving me white background within richtextarea. need assistance, in advance :) check if richtextarea component uses iframe element - it's body should have style background-color set "transparent". iframe element should have allowtransparency attribute set "true".

c++ inline functions -

i'm confused how inline functions in c++.... lets function. how turned inline function int maximum( int x, int y, int z ) { int max = x; if ( y > max ) max = y; if ( z > max ) max = z; return max; } as others have said, can use inline keyword tell compiler want function inlined. inline keyword compiler hint . compiler can , chose ignore request if wants or needs to. an alternative make function function template, blown out inline: template<class val> val maximum( val x, val y, val z ) { val max = x; if ( y > max ) max = y; if ( z > max ) max = z; return max; }

image processing - Working with decision trees -

i know tl;dr; i'll try explain problem without bothering ton's of crappy code. i'm working on school assignment. have pictures of smurfs , have find them foreground background analysis. have decision tree in java has data (hsv histograms) 1 one single node. tries find best attribute (from histogram data) split tree on. executes split , creates left , right sub tree data split on both node-trees. data still kept in main tree able calculate gini index. so after 26 minutes of analysing smurfs pc has giant tree splits , other data. question is, can give me global idea of how analyse new picture , determine pixels "smurf pixels". know have generate new array of data points hsv histograms of new smurf , need use generated tree determine pixels belong smurf. can give me pointer on how this? some additional information. every decision tree object has split object has best attribute split on, value split on , gini index. if need provide additional information...

Ajax, content-type header and python -

when using python web opposed php, have manually write header: content-type:text/html . if want change inner html of element ajax, should python script (requested ajax) output above header or plain html response? every http response must include content-type header. php happens insert 1 default. whatever python library using apparently doesn't. therefore need provide 1 explicitly. this leaves question "should fragment of html served text/html?" the rfc says: the text/html media type defined w3c recommendations; latest published version [html401]. in addition, [xhtml1] defines profile of use of xhtml compatible html 4.01 , may labeled text/html. these specifications not define html fragments, should use like: content-type: x-text/html-fragment

Using Google Visualization in GWT 2.0 -

i'm working on learning gwt (total newb) , have question regarding visualiztion api provided google. page: http://code.google.com/p/gwt-google-apis/wiki/visualizationgettingstarted describes getting started pie chart (which need). i'm trying in composite ui using uibinder. end don't know how handle callback correctly shown: public class simpleviz implements entrypoint { public void onmoduleload() { // create callback called when visualization api // has been loaded. runnable onloadcallback = new runnable() { public void run() { panel panel = rootpanel.get(); // create pie chart visualization. piechart pie = new piechart(createtable(), createoptions()); pie.addselecthandler(createselecthandler(pie)); panel.add(pie); } }; // load visualization api, passing onloadcallback called // when loading done. visualizationutils.loadvisualizationapi(onloadcallback, piechart.package); } my...

Drupal 6: set pager_query() to display last page of query? -

does here know how set pager_query() automatically go last page of query when page displayed? i'm using theme_pager() format page. drupal_goto: http://site.com/views_page_link?page=lastpagenum determine lastpagenum via quering count of result divided counts of elements show.

In Excel, how to download documents from embedded links and save them all locally -

i have excel spread sheet containing links various ms word , pdf documents held on our sharepoint site. these links in 1 column. extracting data sharepoint burn dvd. what easiest way of downloading each document locally, collecting them , changing link in excel point @ local file? changed excel sheet , folder of documents burned dvd. excel sheet becoming , index documents. the hardest part of macro download file sharepoint. depending on moss architecture , version, should react differently. thus, may try described here : http://forums.devx.com/showthread.php?threadid=163915 then, have create hyperlinks path of file have downloaded, described here : http://www.ozgrid.com/vba/hyperlink-list.htm please feel free post first part of work or further questions on macro. hope these first hints help, regards, max

how to replace the backslash in php to xml? -

i'm trying create xml file php.... not work properly... when eentered \notepad\text ,it creates in xml file otepad ext.... what's solution problem? can use function this? when write way: echo "\notepad\text"; \n interpreted newline , \t tab. try single quotes: echo '\notepad\text'; or escape backslash characters: echo "\\notepad\\text";

email - Reasoning behing 76 being the line length limit for MIME sections, as defined by RFC 2045? -

rfc 2045 defines maxmimum line length encoded data 76 - cannot find explanation why 76. number entirely arbitrary, or there reasoning behind it? rfc2822 legacy standard of email. in section 2.1.1 of rfc2822, can find reason below: affects mime. there 2 limits standard places on number of characters in line. each line of characters must no more 998 characters, , should no more 78 characters, excluding crlf. the 998 character limit due limitations in many implementations send, receive, or store internet message format messages cannot handle more 998 characters on line. receiving implementations handle arbitrarily large number of characters in line robustness sake. however, there many implementations (in compliance transport requirements of [rfc2821]) not accept messages containing more 1000 character including cr , lf per line, important implementations not create such messages. the more conservative 78 character recommendation accommod...

MySQL log files deletion -

i have master , slave database running on different nodes. master db subjected huge no. of inserts/updates. master db size close 6 gb, while log files occupying space of more 120 gb. running out of disk space , need rid of log files. will deleting log files in anyway affect slave db ? presently, slave couple of seconds behind master. is there someplace can see steps need follow delete files eg. 1)shut down slave 2)shut down master 3)delete log files 4)start master 5)start slave do need inform slave log files have been deleted ?? if yes, way ? any appreciated. thanks yes, can delete old bin_log files. make sure they're super old. also, mysql flush_logs you should set config file expire log files after x days.

Visual Studio 2010: Location drop down when creating a new project -

vs2008 has nice feature when creating new project, shows folder structure: alt text http://img130.imageshack.us/img130/7057/2008v.png however either turned off default in vs2010 or missing: alt text http://img219.imageshack.us/img219/9686/2010q.png if feature exists, know how turn on?

windows - Changing checksum of a binary -

how modify checksum of binary? specifically, want edit embedded checksum in dll/exe. there tools available? windows requires checksum != 0 kernel modules, don't need set usermode modules. if want set checksum, run editbin /release yourapp.exe, or call checksummappedfile() . see this article analysis of checksum algorithm.

How to use Watir with Javascript triggered elements -

can tell me how click watir on element triggered javascript events. for instance, on http://www.kissmetrics.com/ , on homepage, if click on 'learn more' button on example image, bring lightbox. can click n 'get started' button move on the registration page. how can simulate thing in watir? ie. how can click on first on 'learn more', on 'get started' button? thanks help. well there javascript events fired when click, may not ones particular element looking for. , element has first put state can click on via mouseover. so trick figure out events need fired (see zeljko's answer) , use .fireevent method fire events against elements need see them, in order required. a lot of times pretty have reverse engineer developers doing looking see elements in html looking events. in specific case, if intent click blue learn more button seems on top of kind of screen shot, examining html or dom shows has convenient id value used. can see ...

c# - Lazy-loaded NHibernate properties in Equals and GetHashCode -

how can following problem dealt with? we're using lazy loaded nhibernate properties , whenever we're calling equals() or gethashcode() properties used, lazy-loaded, potentially causing cascade of lazy-loading operations. eager-loading used alternative, think in specific cases , not general solution. a typical scenario this: public class abstractsaveableobject { [id(0, name = "id", unsavedvalue = null)] [generator(1, class = "native")] public virtual long? id { get; set; } } [class(nametype = typeof(classa))] public class classa : abstractsavableobject { [bag(0, inverse = true, cascade = "none")] [key(1, column = "classa")] [onetomany(2, classtype = typeof(classb))] public virtual icollection<classb> classbs { get; set; } } [class(nametype = typeof(classb))] public class classb : abstractsavableobject { [manytoone(column = "classa")] public virtual classa classa { get; set...

openid - VerificationException from DotNetOpenAuth RP -

i'm trying integrate open id site, have problem due open ticket: " http://dotnetopenauth.net:8000/ticket/163 " can give me workaround, please? maybe indicate older version? thank much well, forcing stateless rp (dumb mode) workaround issue. or wait until tomorrow's build of dotnetopenauth comes out (v3.4.4.10121) have "fix". at root it's clr bug, "fix", mean workaround built library catch error , swallow them.

google app engine - Grails constraints GORM-JPA always sorting alphabeticaly -

in grails app, in use gorm-jpa, cannot define order of elements of class using constraints. if autogenerate views, sorted alphabetically, instead of defined order. here's source class: package kbdw import javax.persistence.*; // import com.google.appengine.api.datastore.key; @entity class organisatie implements serializable { @id @generatedvalue(strategy = generationtype.identity) long id @basic string naam @basic string telefoonnummer @basic string email @basic organisatietype type @basic string adreslijneen @basic string adreslijntwee @basic string gemeente @basic string postcode @basic string faxnummer static constraints = { id visible:false naam size: 3..75 telefoonnummer size: 4..18 email email:true type blank:false adreslijneen size:5..250 adreslijntwee blank:true gemeente size: 2..100 postcode s...

.net - Difference between Visual studio 2008 and 2010 -

possible duplicates: what's compelling reason upgrade visual studio 2010 vs2008? difference between visual studio 208 , visual studio 2010 difference between visual studio 2008 , 2010

actionscript - Combining flash files -

so, i'm naturally php coder, have use flash part of project. i wondering if have files such mainsite.swf , page1content.swf, there way include page1content.swf file predefined area on mainsite.swf file (as in php's include)? also, possible use flash "include" embed external swf's? finally, ideally i'd able merge these files together, i've read, it's tricky business, filenames, referencing etc, optional. thanks help. ps: i'll using actionscript 2. it's possible load external swf movie clip on stage. have @ - http://kb2.adobe.com/cps/141/tn_14190.html#main_using_the_actionscript_2_0_loadmovie_command i'm not sure mean merging movies, need them do?

Why we haven't boolean datatype in Firebird? -

unless i'm totally wrong, have no boolean datatype (1 bit) in firebird, sql server. why? think boolean usefull in various situations... , low space consuption... firebird has booleans, in form of bit data type. http://www.firebirdsql.org/manual/migration-mssql-data-types.html fta: converting bit data type the bit data type used hold single boolean value, 0 or 1. ms sql not support assigning null fields. interbase can emulate integer or char(1) data type. the acceptable values can restricted using domains. more information on firebird domains, see data definition documentation.