Posts

Showing posts from April, 2012

cakephp - need to login to wordpress when someone logs into my site -

i have site thats made in cakephp , have wordpress blog thats in subdirectory /news. when registers site automatically creates account same login credential wordpress site aswell. there way when logs site logs them wordpress site aswell? i think wordpress uses cookies or session authentication set necessary session or cookie variables up? , if did? thanks solved it! did download ajax login plugin wordpress , looked @ ajax call made when used using firebug net tab. had replicate ajax call when logs site!

jQuery Ajax is not triggered in IE 6, 7, 8 -

my jquery ajax call working fine in chrome , firefox , when test in ie 6, 7, 8 not working (the ajax call not triggered, no request send server ). here code: $.ajax({ url: myurl, type: 'get', async: false, cache: false, contenttype: 'application/text', //i tried use json datatype: 'text', //i tried use json data: {car_id: car_id, customer_id: customer_id}, success: function(data) { //some code here deal 'data' }, error: function(xhr, status, error) { //some code here } }); i have tried both ' text ' , ' json ' data type, code not working in ie, no request send server... how rid of ie problem?? ---------------------edit---------------------------- myurl='/cars/reserved_cars/' i developing rails 3 app

C# : Fastest way for specific columns in CSV Files -

i have large csv file (millions of records) have developed smart search algorithm locate specific line ranges in file avoid parsing whole file. now facing trickier issue : interested in content of specific column. there smart way avoid looping line line through 200mb files , retrieve content of specific column? unless all csv fields have fixed width (and if empty there's still n bytes of blank space between separators surrounding it), no. if yes then each row, in turn, has fixed length , therefore can skip straight first value column and, once you've read it, advance next row's value same field, without having read intermediate values. i think pretty simple - i'm on roll @ moment (and @ lunch), i'm going finish anyway :) to this, first want know how long each row in characters (adjust bytes according unicode, utf8 etc): row_len = sum(widths[0..n-1]) + n-1 + row_sep_length where n total number of columns on each row - constant whole f

mysql - how do i get greek characters in my database using jsp -

i'm trying insert greek names in database using jsp programme. however, result in database "????" instead of greek characters. if try insert greek name using phpmyadmin or command line, there no problem. guess there trouble in jsp code. here simple part of code: try { statement stmt; resultset rs; class.forname("com.mysql.jdbc.driver"); string url ="jdbc:mysql://localhost:3306/test?useencoding=true&characterencoding=utf-8&autoreconnect=true"; connection con =(connection) drivermanager.getconnection(url,"root", ""); con.setcharacterencoding("utf-8"); stmt = (statement) con.createstatement(); stmt.executequery("set names 'utf8'"); stmt.executequery("set character set 'utf8'"); string greekname = "κωνσταντίνα"; stmt.executeupdate("insert users(name,age) values ('" + greekname + "'

c++ - how application handle exception in try catch in disassembly -

hi debugging such program call win32 api raiseexception(). want know how can handle manually not debugger. tanx try reading on structured exception handling . check out matt pietrek's article: a crash course on depths of win32™ structured exception handling .

java - how to trim "enter key" in a string -

string strfckeditor1 = request.getparameter("fckeditor1"); string strfckeditor1 = request.getparameter("fckeditor1").replaceall("\\r|\\n", ""); you need replace \r and/or \n\r (hence regex), not \n stated in other answer, since don't know whether user using windows / mac osx / linux.

collation - Japanese character are saved as question mark in SQL Server -

i'm working on sql server 2005, in have database. when use japanese characters in application, stored question marks in databse. collations should use save japanese characters properly. note: additional info(if helps) in mysql, have used utf8 default character set in startup variable , works file. thank you, pavan japanese_90 appears new collation name. http://msdn.microsoft.com/en-us/library/bb330962%28v=sql.90%29.aspx#intlftrql2005_topic24 note, might want consider _ks suffix if want consider hirigana/katakana whilst sorting. marc_s says, want ensure column datatype nvarchar

PHP's imagecreatefromstring function not working on Amazon Linux Server -

Image
i have created script in have create image @ runtime using 64bitencoded string .i m using imagecreatefromstring function of php works in windows xampp based php , not on cloud side applications deployed on amazon cloud running suse version of linux. can u give me suggestion overcome problem. or there other function capable create image encoded string passed it. thanks in adv i using following code <?php require ('../dbconfig/dbconfig.php'); $gameid = $_post["gameid"]; $username = $_post['email']; $imagedata = $_post['imagedata']; $uploaddir = './../blogdata/i/'; $countsql = mysql_query("select max(_id) filename blog_data "); while($rowcommentdata = mysql_fetch_assoc($countsql)) { $num = $rowcommentdata["filename"]; $file = ++$num.".png"; $filedb = $uploaddir .$file; } /* $imagedata= 'ivborw0kggoaaaansuheugaaabwaaaascam

windows phone 7 - WP7 application how to post a local picture with facebook C# SDK? -

i developing wp7 application , want post picture wall. find need uri picture if want post local picture mobile, should specify here or how can uri local picture? lot! the last time looked @ working facebook sdk wasn't possible post local photo user's wall; had have photo hosted online somewhere already. can post user's photos section. there forum post on app hub gives code doing this. think facebook c# sdk supports wp7, i'm not sure if simplify process further.

sql server - SQL: Persisted computed field in table sometimes not used during query execution -

possible duplicate: why execution plan include user-defined function call computed column persisted? in sql server 2008 i'm running sql profiler on long running query , can see persisted computed column being repeatedly recalculated. i've noticed before , anecdotally i'd seems occur on more complex queries and/or tables @ least few thousand rows. this recalculation cause of long execution speeds dramatically if comment out 1 column returned results (the field computed running xpath against xml field). edit: offending sql has following structure: declare @orderby nvarchar(50); select a.[id], case when @orderby = 'col1' a.[computedcol1] when @orderby = 'col2' c.[computedcol2] else c.[computedcol3] end [order] [stuff] inner join [stuffcode] sc on a.[code] = sc.[code] all columns nvarchar(50) except computedcol3 nvarchar(250). the query optimizer tries pick cheapest pla

c# - ADO.net SqlTransaction improves performance -

i'm doing work involves inserting batch of records sql database. size of batch vary arguments sake can 5000 records every 5 secs. less though. multiple processes writing table, nothing reading it. what have noticed during quick test using sqltransaction around whole batch insert seems improve performance. e.g. sqltransaction trans = connection.begintransaction() mystoredproc.transaction = trans; sampledata.foreach(executenonqueryagainstdb); transaction.commit(); i'm not interested in having ability rollback changes wouldn't have considered using transaction except seems improve performance. if remove transaction code inserts go taking 300ms around 800ms! what logic this? because understanding transaction still writes data db locks records until committed. have expected have overhead... what looking fastest way insert. if looking fast wqay insert/load data have @ sqlbulkcopy class

c++ - relative path problem for a deployed win32 application -

i have written c++ program , deployed in c:\my_app, , executable's path c:\my_app\my_app.exe. say, my_app needs many files such the_file.txt, located in c:\my_app\the_file.txt. in executable, open txt file as, xx.open("the_file.txt"); moreover, have associated program let's .myp extension. when i'm on desktop, , want open file named example.myp, program can not see the_file.txt. because, (somehow) assumes it's working on desktop. is there easy way handle problem changing shell command open in hkey_classes_root? naive solution change file open operations "%my_app_location/the_file.txt". don't want that. thanks help. always use full path name open file. in other words, don't open "foo.txt", open "c:\bar\foo.txt". find install directory of exe use getmodulefilename(), passing null module handle.

database - Test scenarios to demonstrate SQL tuning strategies -

is there place can find test cases illustrate different sql tuning strategies? example if clustering factor on table bad , oracle performs table scan instead of index access have test scenario required data demonstrate bad clustering. scenarios illustrate wrong join order, partitioning , other tuning topics helpful. the closest thing you'll find numerous tests jonathan lewis has written these topics. i'd go visit , search blog: http://jonathanlewis.wordpress.com/ and/or buy book: http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html for example first question clustering factor covered in chapter 5 of book, of can see preview here regards, rob.

image processing - Validation Error with Multiple File Uploads in Django via Ajax -

i have view trying submit multiple ajax uploads via raw post data (e.g. via octet-stream). these requests submitted 1 after other process in parallel. problem django thinks last request valid. example, if submit 5 files, first 4 give: upload valid image. file uploaded either not image or corrupted image. i'm guessing occurs because somehow requests overlap? , image isn't loaded before form attempts validate it? and last 1 works fine. my upload view: def upload(request): form = uploadimageform(request.post, request.files) print form if form.is_valid(): # ..process image.. and upload image form: class uploadimageform(forms.form): upload = forms.imagefield() to submit requests i'm using html5uploader js pretty right out of box. on different not, have tried https://github.com/blueimp/jquery-file-upload/ - pretty non-flash based file uploader progress bar.

java - how to fire an event for different fields inside list-field item in blackberry -

i developing application need use list-field. inside each list-field item, there 3 fields: image text image if click on list-field item menu displayed. don't want whole list field item row selected when user clicks row. want part of list-field item highlighted -- if click first image 1 action should performed, , if click last image after text action should performed. wherever click on list-field item same action being performed. don't want it. want separate actions different fields inside each list-field item. if api not support it, api not support it. common j2me problem. consider creating own customitem.

php - Enforce Method Call Required by Object -

i created ssh2 wrapper. have read constructor should not fail, ssh2 connection not done in wrapper, method connect() . question is: how make sure connect() called? need called once. class uploader { private $user; private $pass; private $host; private $ssh = null; private $sftp = null; public function __construct($host, $user, $pass) { $this->host = $host; $this->user = $user; $this->pass = $pass; } public function connect() { if ($this->ssh === null) { $this->ssh = ssh2_connect($this->host); ssh2_auth_password($this->ssh, $this->user, $this->pass); $this->sftp = ssh2_sftp($this->ssh); } } } what best way ensure connect() called? should application call it? $ssh = new uploader('host', 'user', 'pass'); $ssh->connect(); or in class methods? ... public function upload($source, $dest, $filename) { $this->connect(); ... } public function del

How to remove default CSS from TextField in flex? -

i'm in serious fight it. need set defaulttextformat of textfield component own values. can't since component not use defaulttextformat if has using format css stylesheet said here http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/text/textfield.html#defaulttextformat : note: can't set property if style sheet applied text field. my question is: there way remove css propertis of text field? how "override" style sheet ?? i want able without overwrite css file or write own. if give own css properties component, default properties automatically overridden. thanks

Import list template STP file to Visual Studio 2010 -

i have exported sharepoint 2010 list list template (.stp file) via ui. is there way import list template visual studio 2010 or chance extract .cab file , go through manifest.xml manually? moontear! yesterday gave thoughts same matter. unfortunately, couldn't find solution import list template vs 2010. seems, microsoft deprecated .stp files in sp 2010 , replaced them .wsp one. therefore, found 2 solutions: first: working .cab files, said. second: make template of whole site , copy list project in vs 2010.

vb6 - from access+VB 6 to COBOL -

does know way export data access db cobol code? thanks fixed format way go, cobol can read fixed format file. a simple way create fixed format file in sql dialect (oracle, db2, h2 etc) use sql string functions create single field , export/write query file ms access example query: select left(str([tblid])+space(8),8) + left(str([tblkey])+space(20),20) + left([details]+space(30),30) + "<" exportstring tbl_ti_inttbls; for cobol best right justify 0 fill , align decimal points of numeric fields. also if once off can run query in access copy / paste output text editor. ms access allows define fixed formats , use these input ( export ?) long time since used them (i using them import fixed width data). leave discussion of access expert. you @ recordeditor (http://record-editor.sourceforge.net/record11.htm) / jrecord (http://jrecord.sourceforge.net/) because both let view / edit file using cobol copybooks - useful checking ex

ajaxcontroltoolkit - asp.net ajax hovermenuextender on modalpopupextender z-index problem -

i have asp.net ajax hovermenuextender on modalpopup panel display tip on hover. the problem (tip) panel hovermenuextender appears below modalpopupextender in ie8 this z-index issue, there place in page can set z-index hovermenu appears on modalpopup, learnt change made in popupbehavior.js file here: http://ajaxcontroltoolkit.codeplex.com/workitem/26107 but using ajaxcontroltoolkit.dll in project , not possible modify ajax javascript source files. thanks in advance. i have running version ajax 3.0 , adjusting z-index did trick. thank you! make sure popupmenu container has higher z-index modal popup control. if use firefox firebug plugin can find when page gets rendered. right click on modal popup background -> inspect element firebug -> on right side swap "computed" tab , find current z-index in object properties.

sql server - is insert-select statement massive? -

when multiple inserts used select statement in transaction, how database keep track of changes during transaction? can there problems resources (such memory or hard disk space) if transaction held open long? you can have many problems large transaction. first, in databases not want run row-by-row because million records take hours. insert million records in 1 complex statement can cause locking on tables involved , harm performance else. , rollback if kill transaction can take while too. best alternative loop in batches. test 50,000 @ time , raise or lower set depending on how long takes. i've had databases no more 1000 in 1 set-based operation. if possible large inserts or updates should scheduled off-peak hours database operates. if large (and one-time - large data migration) might want close database maintenance, put in single user mode , drop indexes, insert , reindex.

java - Best way to parse large XML document in Jython -

i need parse large (>800mb) xml file jython. xml not nested, containing million relevant elements. need convert these elements real objects. i've used nu.xom.* before, i've switched java jython, library fails following message: the parser has encountered more "64,000" entity expansions in document; limit imposed application. i have not found way fix this, have xml library. either java or jython-compatible python , should efficient. pythonic great, nu.xom.* simple not pythonic. have suggestions? sax best way parse large documents. sounds you're hitting default expansion limit. see note: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4843787 you need set system property "entityexpansionlimit" change default. (added) see answer question.

Can someone provide a regex for validating and parsing a csv of integers and reals -

i new regex , struggling create expression parse csv containing 1 n values. values can integers or real numbers. sample inputs be: 1 1,2,3,4,5 1,2.456, 3.08, 0.5, 7 this used in c#. thanks, jerry use csv parser instead of regex. there several options - see this questions , answers , this 1 different options (built bcl , third party libraries). the bcl provides textfieldparser (within visualbasic namespace, don't let put off it). a third party library liked many filehelpers .

c# - how to programatically mouse move,click,right click and keypress, etc. in winform and wpf? -

how programatically mouse move,click,right click , keypress etc in winform , wpf. please me code snippet if possible. if understand question correctly want simulate input. in case sendinput way go. this link pinvoke sendinput – official way simulate input. pushes input through of expected code paths, , indistinguishable real input. an easy way use inputsimulator @ codeplex. adding reference inputsimulator.dll can simulate keystrokes like // tab inputsimulator.simulatekeydown(virtualkeycode.tab); // shift+tab inputsimulator.simulatemodifiedkeystroke(virtualkeycode.shift, virtualkeycode.tab); // etc. however, inputsimulator doesn't support mouse yet here starter mousesimulator . leftclick , rightclick far of following 2 links extent mousemove etc. pinvoke.net: sendinput (user32) how can emulate mouse events in application? mousesimulator public class mousesimulator { [dllimport("user32.dll", setlasterror = true)]

debugging - How do I Debug Memory Leaks, Infinite Loops, and Executing Javascript in the Browser? -

what recommended ways check infinite loops in javascript in browser? open chrome , crashes, there way breakpoint or somehow pinpoint occurred? then i'm wondering, how see running list of executing scripts in browser (say timer lost track of running , it's slowing things down)? preferably in chrome/safari, firefox work too. i use element inspector/console time, haven't figured out ways debug these 3 things. thanks! for script crashes browser, can insert breakpoint anywhere in code before crashes. manually step through code until crashes. if unable insert breakpoint before browser crashes, can add "debugger;" statement somewhere in code. inserts breakpoint @ point in code. one way see what's being run js profile it. dev tools come profiler. profile code few seconds after page loads, , give glimpse of what's still running. if using library such jquery, see lot of internal jquery functions , of own. @ function takes running time (per cal

java - Range in DCT coefficents MATLAB -

i trying find range on coefficients of 8 x 8 block varies various block of image. need generate histogram values of there function in matlab? for pixel values between 0 , 255, coefficients of 8x8 block 2d dct can take value ±16320

Can I "splice" in the contents of an iterator into my own iterator in Python? -

suppose have iterator, , want add elements before or after it. way can think of use explicit loop: def myiter(other_iter): yield "first element" item in other_iter: yield item yield "last element" is there better or more efficient way this? there function name yield_items_from can used this? def myiter(other_iter): yield "first element" yield_items_from(other_iter) yield "last element" edit: ok, oversimplified example. here's better one: suppose have iterator other_iter returns ascending sequence of nonnegative integers. want return iterator counts zero, returning 1 numbers returned other_iter , 0 otherwise. example, if other_iter yields [1,4,5,7], want yield [0,1,0,0,1,1,0,1]. there efficient , readable way this? no, there nothing yield_items_from , although there draft proposal adding 1 python 3.x in pep 380 . for current python, explicit loop way yield sub-iterator. however, it

html - i can't figure out why this css is not working -

thirtydot edit: (there's no doctype) here code in pastebin: http://pastebin.com/zwptd8dd <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>my layout</title> <style type="text/css"> #wholepage{ background: #fff; width: 960px; margin: 0 auto; } #header{ width: 960px; margin: auto 0; } #header ul{ border:1px solid #bbbbbb; width:100%; height:45px; -moz-border-radius:8px; -webkit-border-radius: 4px; list-style: none; } #header ul li{ float: left; margin: 3px; } #login-form{ position: relative; margin-left: 750px; margin-right: -20px; border: 1px solid #4e4e4e; } #frontpage-content{ position: relative; margin-right: 210px; border: 1px solid #bbbbbb; } </style> </head> <body> <div id="wholepage"> <div

windows - Iterating over WDM device stack -

as understand, 1 can iterate device stack of wdm devices bottoms up, because device_object has attacheddevice member (but not lowerdevice member). luckily, adddevice callback receives physicaldeviceobject can iterate on entire stack. from within filter driver i'm trying determine whether i'm filtering device object. (let's have legit reason this. bear me.) idea go on every device_object in stack , compare driverobject member mine. judging existence of iogetattacheddevicereference, assume accessing attacheddevice isn't safe thing do, risk of device going away. however, iogetattacheddevicereference brings me straight top of stack, no me. so, there safe way iterate on device stack? correct, can't safely walk attacheddevice chain unless can somehow guarantee stack not torn down (e.g. if have active file object referencing stack). on win2k pretty option. on xp , later, preferred method walk top of stack down. can calling iogetattacheddevicereference

c++ - Recursive backtracking -

i having problem backtracking function loops data can't write here whole program code can put here function. bool sharemoney(int quantity, int *values, int index, int moneya, int half, bool *ifchosen) { if(moneya == half) return true; else if(index >= quantity) return false; moneya += values[index]; if(sharemoney(quantity, values,index+1, moneya, half, ifchosen)) { ifchosen[index] = true; return true; }; moneya -= values[index]; if(sharemoney(quantity, values,index+1, moneya, half, ifchosen)) { ifchosen[index] = false; return true; }; return false; } now here explanation: quantity - number of elements in values array values - array of numbers index - variable control recursion moneya - variable stores sum of element array values half - number moneya should reach after recursion done ifchosen - array of boolean elements refers array values the function gets quanti

iphone - NSXMLParser Memory Leak from Second Parse Call -

update: while leaks instrument points first call [parser parse]; , have identified leak occurs when make call second time. don't see in nsxmlparser class reference or documentation indicates 1 can't re-parse. missing something? should create new nsxmlparser each time wish parse document? i trying track down leak in xml parsing code iphone app. i've searched through other posts on leaks nsxmlparser, haven't found answers use, appreciate help. the instruments leaks tool detecting leak in following code: nsdata* data = [nsdata datawithcontentsoffile: [[nsbundle mainbundle] pathforresource: @"collisiongraph" oftype: @"graphml"]]; nsxmlparser* parser = [[[nsxmlparser alloc] initwithdata: data] autorelease]; [parser setdelegate:self]; [parser parse]; <<<<< leak here according leaks self.currentpass++; ... [parser parse]; self.currentpass++; i removed of code delegate callback methods, didn't stop leak. -(void)pars

java - Add JButtons to JTable cell + DB -

Image
i have jtable, want populate jtable database. first mission done. the second mission how add jbutton in jtable, have acolumn must put buuton in, number of buttons change number of rows. how can do?? this example in image: thanks in advance. best regards. ali table button column should out.

distributed - Consistent Hashing: what about rehashing? -

as may know, consistent hashing great idea when dealing dht. main idea not suffer when new node added or deleted. from original paper: when machine added or removed set of caches, expected fraction of objects must moved new cache minimum needed maintain balanced load across caches. the solution great, there phenomenon of bad distribution of keys. solve that, replicas of original nodes distributed randombly. solution works quite well. @ chart if want sure. ok, seems work well. but, there i've been thinking nobody mention. what happens when 1 node added (or removed)? well, every key, "before" node placed needs rehashed. seems good, becouse keys not "all" keys. but, if decide place replicas, 20, then, 20 nodes feel pain of rehashing. less replicas means worse distribution, more replicas means more pain when rehashing needed. what solution know suit in situation? missing something? yeah, think you're looking @ wrong way.

php - How do I require_once() this file? -

Image
i want require_once() dbconnect.php in register.php . how do that? tried require_once('../dbconnect.php') not work (though work @ register level. require_once("../../dbconnect.php");

iphone - Setting a navigationbar to be like the photo app -

i trying set navigation bar see through photos app. what property used achieve this? have tried available properties navigationbar cant work. is possible do? i want view behind navigationbar seen when bar on it. if using .nib can select navigation bar , set navigation bar style "black translucent" in navigation bar attributes (in inspector). if adding navigation bar programmatically can set style in viewdidload: self.navigationcontroller.navigationbar.barstyle = uibarstyleblacktranslucent;

jQuery Change Input text upon selection of radio button -

trying value="" of <input class="box" type="text" value="??" name="searchquery" change upon selection of radio button. if user presses 'first name' radio button example, changes value of .box input value such "enter first name" , have other radio buttons well. can help? jquery novice here :) <!doctype html> <html> <head> <link rel="stylesheet" href="global.css" media="screen" /> <link rel="stylesheet" href="design.css" media="screen" /> <style type="text/css"> .hidden { display: none; } </style> <script type="text/javascript" src="inc/jquery.js"> </script> <script type="text/javascript">$(function() {$('input[type=text]').focus(function() {$(this).val('')});});</script> <!-- // --&

javascript - Encode a string for sending with HTTP request? -

i on javascript/node.js , when i'm making http request query parameter: ?key="https://me.yahoo.com/a/xt4hq7qyssa8hymjkv8mevqqkghq_1jwvas-#a6e6f" i error because shops of after: ?key="https://me.yahoo.com/a/xt4hq7qyssa8hymjkv8mevqqkghq_1jwvas- i wonder how can encode string doesn't chop off? i'm assuming hash (#) @ end of url part of query argument. problem node.js treating hash of overall url, plays no role in http requests. thus, you'll need encode query string. a structured api function querystring.stringify best. var query = querystring.stringify({ key: '"https://me.yahoo.com/a/xt4hq7qyssa8hymjkv8mevqqkghq_1jwvas-#a6e6f"' });

.net - How do I find the amount of memory allocated by a method? -

i'd know total amount of memory allocated while method runs. far have: gc.collect() gc.waitforpendingfinalizers() memstart = gc.gettotalmemory(false) f() memend = gc.gettotalmemory(false) print (memend - memstart) this seems work enough simple functions when f allocates forces collection result excludes collected objects. not that, there no way of telling "overflow" happened. is there easy way this? without buying/installing/configuring memory profiler? stopwatch allocator/collector ideal. do: sw = new gcstopwatch() sw.start() f() sw.stop() print sw.totalbytesallocated print sw.numberofcollections // etc i want can find out how pressure method putting on garbage collector. code reading numbers fixed length string using lots of calls along lines of int32.parse(s.substring(4,6)) , considered doing parsing in-place introducing parseint(string s, int startindex, int length) avoid allocating tens of thousands of substrings. nice tool have in other scenarios to

Scheme pattern matching -

i have written following syntax rule: (define-syntax match-rewriter (syntax-rules () ((_ (patt body) ...) (λ (x) (match x (patt body) ... (_ x)))))) which match-lambda except returns argument if no match found rather throwing exception. now want write function, let_as_lambda , take strings of source code input , rewrite let statements new let_as_lambda function. have: (define let_as_lambda (match-rewriter (`(let((,<var> ,<val>)) ... ,<expressions>) `((lambda (,<var> ...) ,<expressions>) ,<val> ...)))) it wrong as: (let_as_lambda '(let((x 3)) (+ x 2))) returns: '((λ ((x) ...) (+ x 2)) (3) ...) still showing ellipses , "3" in parentheses. believe problem don't understand proper usage of symbols ` , . , , , in pattern matching. if show me correct way appreciated. thanks. you're confused because use 2 different pattern matching tools. first syntax-rule

ruby - Grid with Rails? -

grid supports sorting data. search select all/none any grids available rails ? have fruitful information grid in rail. refer link. http://www.2dconcept.com/jquery-grid-rails-plugin

.net - work with data grid view in C# windows forms -

dear sir, m developing 1 application on c# windows forms using oledb connection.on 1 form placed 1 datagridview , bind 1 table.that table contains fields....., here problem want edit table on runtime.on table need 2 links edit,unmask.in runtime data in datagridview seems plain text on paper.if click edit row changed text boxes , combo boxes.sometext boxes contain passwords also.those in ** formate.while picking unmask button passwords changed actual text.while picking edit button exploted update, cancel.then change data , pick update data stored database table.(i need datagridview gridview in asp.net).is there properties datagridview gridview(asp).could please suggest me how resolve prob. in advance. can you, @ time of hang, hit pause in visual studio see code hangs?

operating system - Change Android Source Code -

i have downloaded froyo os , have modify it. possible? i havent before. download it.. if have done before, please tell me entry point. start , do? i want change home screen of android os. want icons see on home screen. thanks in advance

php - Is it possible to collect from data in excel or CSV file using HTML5 Local database only, without using Mysql? -

Image
it's example: i have html form on webpage i want collect data of form ( data, user submit) in excel or csv sheet.? is possible html 5 only? or required mysql, php, apache etc? browser use : google chrome , no other browser need consider application run on local pc. if it's not possible html5 local database, install portable xampp. any demo , example appreciated? localstorage key/value store, , there's not way change way chrome decides save data in order write csv file instead.

ActionView::TemplateError (Missing template) In ruby on rails -

i running ror application (rails 2.3.8, ruby 1.8.7), application runs fine on local machine. on production logs show following error: actionview::templateerror (missing template folder/_file_name.erb in view path app/views) on line #19 of app/views/layouts/main.rhtml: 19: <%= render :partial => "folder/file_name" -%> the file name exists folder/_file_name.html.erb , tried reproduce problem on production environment didnt have luck, reason rails application asks folder/_file_name.erb @ times while other times searches right file folder/_file_name.html.erb . could explain me going on? the same occurs .rhtml files, rails application requests .erb @ times while others right .rhtml file update: <%= render :partial => "shared/meta_tags" -%> <%= render :partial => "shared/common_resources" -%> <%= render :partial => 'shared/ads/oas' -%> any pointers on issue helpful, in advance whats form

Content type that are supported by Internet Explorer -

i need map various video , audio file types can upload application. in following microsoft's documentation publish supported mime types ie. but think list partial. example couldn't find there content type ' video/quicktime ' generated ie8 first question - can find list of ie/windows supported mime types. my second question - there difference between mime-type , content-type. because example in this file type list mime type of .avi file video/x-msvideo while checked content type of video/avi why there difference between mime , content type? internet explorer can support infinite list of mime types depending on applications installed on client. see http://blogs.msdn.com/b/ieinternals/archive/2009/07/01/ie-and-the-accept-header.aspx explanation of accept header , information changes have been made ie9. mime type , content-type used interchangeably. content-type header contains mime type , [optionally] character set information. in case of avi, ther

html - Jquery not working in IE9 RC -

i have upgraded ie9 rc (which must add isnt bad attempt microsoft, far, still have time mess up! please dont comment below on how wonderful/rubbish think is, dont want browser war! ) in order test websites. now understand release candidate, , still being developed, reason none of jquery on site not being rendered (i not rendering properly, mean not working fullstop). the way work use ie9 browser mode , ie8 standards. using ie9 broswer mode , ie9 standards stops jquery working. i understand im going have wait until either ugrade ie or jquery api know why or possibly have fix? cheers guys! update ok guys can either go jquery v1.4 or use release candidate of jquery v1.5 - http://code.jquery.com/jquery-1.5.1rc1.js http://code.jquery.com/jquery-1.5.1rc1.js that should ;)

tortoisesvn - Selective SVN checkout based on pattern -

i'm trying partially checkout large svn repository contain lots of files don't need: object files, .class files, sound , other data files. these files may occur in directory. i'm tired of going through subdirs in repo browser see whether need check them out recursively or sparsely. svn offer way checkout files match or don't match (regex, glob or other) pattern? not directly in svn, no. see ( can partial checkout subversion? ). you'd have checkout @ empty depth, in own script, update files match pattern

iphone - Is there a way to show UIStatusBar, but still hide the green "Touch to return to call" button? -

because it's seemingly impossible find apple-authorized way access carrier signal strength, i'm considering leaving uistatusbarhidden set false signal bars still show. problem becomes ugly green "touch return call" button pops in call. i'd rather keep status bar without green bar. know of way this? in apple authorized way? no.

autocomplete - How to use more than one jQuery AutoSuggest on a single page? -

i can use autosuggest jquery plugin on page... how create more 1 of them on single page? don't understand syntax on this site example: $(function(){ $("div.someclass input").autosuggest(data); $("#someid input").autosuggest(other_data); }); what mean? it hard say, beacuse not clear not understand. anyway, select inputs via css-like selector $('css selector here') and call method autosuggest on it, like $('css selector here').autosuggest(); if want more 1 field, repeat. $('css selector here').autosuggest(); $('another css selector here').autosuggest(); you can pass object storing options parameter autosuggest .

string - c# Split sentence -

is possible split combined words two? ex: "firstname" "first" "name" i have bunch of properties eg firstname,lastname etc. , need display on page. thats why need separate property name display more appropriate way. unless have dictionary of 'single' words solution can think of split on upper letters: firstname -> first name the problem still exist uifilter -> ui filter.

php - How can i merge array in ezpublish template? -

if 1 me add arrays in ez publish. i have arrays link {def $a = array(a,b,c)} {def $b = array(d,e)} i want output in array like $c = array(a,b,c,d,e); this surely work: {def $c = merge($a,$b)} output: array(a,b,c,d,e)

cakephp - Create aro/aco having an aro and an aco -

i'm trying implement pdf functionality application. so, added new actions in controllers (like 'viewpdf'). after this, rebuild acl tree build_acl action (from mark story tutorial automated tool creating acos ). so, can see mysql new node created. until this, fine. try test viewpdf button, , 'you not authorized access location.' error (even being admin). check error.log file , see warning: > aco: controllers/specializations/viewpdf in [/usr/share/php/cake/libs/controller/components/acl.php, line 273] 2011-02-24 11:40:34 warning: warning (512): dbacl::check() - failed aro/aco node lookup in permissions check. node references: aro: array ( [user] => array ( [id] => 1 [email] => admin@gmail.com [group_id] => 1 ) ) aco: controllers/specializations/viewpdf in [/usr/share/php/cake/libs/controller/components/acl.php, line 273] then check aros_acos table in database , see there's no 'v

How do I select random rows in MySQL? -

mytable pid name field === ==== ===== 1 a1 0 2 a2 1 3 a3 1 4 a4 0 5 a5 0 this table structure. here want select randomly 4 rows use rand() mysql function in query questions how pair rows. mean, wanna select pid 2 , 3 1 ofter another. need in bellow order. i don't want break pair a2 a3 a1 a2 a3 a4 or a2 a3 a4 a1 or a2 a3 a4 a5 or a4 a5 a2 a3 , etc i used query below it's not working me select * mytable order rand() asc limit 0,4 turbod close answer, ordering randomly, when seems wanted order pid, after getting random rows wanted in conjunction ones concerning a2 , a3: ( select * `mytable` name ='a2' or name ='a3' limit 2 ) union ( select distinct * `mytable` name !='a2' or name !='a3' order rand( ) limit 2 ) order `pid`

C# Sharing file handles across threads -

i have piece of code executed n threads. code contains, for(;;)//repeat 10,000 times { lock(padlock) { file.appendalltext(filename, text); } } basically, threads write same set of 10,000 files , hence files shared resource. issue 10,000 open,write,close performed each thread slowing down program considerably. if share file handlers across threads, i'd able keep them open , write different threads. can throw light on how can proceed? let threads write syncronised list. let 1 thread 'eat' items on list , write them single filewriter file. presto problem solved in exchange memory usage.

php - Case sensitive , add strtolower -

possible duplicate: users register lower case letters hi, have register page , , have script register lower case letters : pretty not want register : pretty , pretty , pretty ... here code , need add ? public function addfield($field_name){ if (!array_key_exists($field_name, $this->fields)) { if ($field_name=='username') { $field = new field_join_username(); parent::registerfield($field); } if ($field_name=='email') { $field = new field_join_email(); parent::registerfield($field); } } parent::addfield($field_name); } where's code taken from? trying change existing code? as far can see, adds fields not values of fields strtolower should applied, applying strtolower field_name won't trick ... it's hard guess place strtolower without seeing correct code snippet.

Separator missing out between list items in Android -

Image
i have used custom array adapter populate list view.the problem face separator missing out in between fourth , fifth list item. here's code: public class clubs extends listactivity{ private static class efficientadapter extends baseadapter { private layoutinflater minflater; private bitmap micon1; private bitmap micon2; public efficientadapter(context context) { // cache layoutinflate avoid asking new 1 each time. minflater = layoutinflater.from(context); // icons bound rows. micon1 = bitmapfactory.decoderesource(context.getresources(), r.drawable.yellow_offline); micon2 = bitmapfactory.decoderesource(context.getresources(), r.drawable.green_online); } /** * number of items in list determined number of speeches * in our array. * * @see android.widget.listadapter#getcount() */ public int getcount() {

Touch Event in android App development -

as new android development. in app table rows there touch row want give color particular row selected. rest of element should have original color it. i have used ontouchlisterner it's nt working expected. thnx help............. just create rowbackground.xml in drawable having 2 state background image (normal , clicked state). for follow link http://www.gersic.com/blog.php?id=56 then give background resource rows creating. also can have onclick listener rows ,just give tag or id unique 1 each row. that it.. done...let me know wt happen? thanks .

javascript - no css effect when printing! -

i made page contains specific control, , used css , works okay , applied on page, when print control contains data , no effect css on paper . problem ? control exists in div. background colors , images won't printed default browsers. ie reference: http://support.microsoft.com/kb/296326 firefox reference: how make firefox print background-color style? easy enough find other browser if want.

How do I send a C# file in Visual Studio C# 2008 express edition along with the database in one zip file? -

i have used ms-access(2000-2003) file format , visual studio c# express 2008 edition create winforms application. need satisfy following condition: all code , referenced assemblies must submitted in 1 zip file. need able unzip , run vs solution without changing settings, adding references or creating databases. you want mdb go executable, so: place access mdb file solution right clicking on project , using add existing item . once have added mdb file project, find in solution explorer , right click on , goto properties . once there change build action content , , set copy output directory copy if newer . change references mdb file relative--i.e. @"mydata.mdb" --as copied alongside exe @ compile time. now database follow executable @ compile , run whether you're in debug or release. doesn't fix situation target machine doesn't support access, not problem can solve through project file.

Add data to ListView Items WPF -

how add data wpf listview items windows forms? using databinding can bind itemssource observable collection have items added that. this approach makes easy manipulate data once used databinding long have inotifypropertychanged implemented listview update when call onpropertychanged().

sql server 2008 - For a multiline intersecting several polygons, get the respective lengths -

i have 1 table containing polygons , containing multilines. given multiline, can intersecting polygons, so: select p.geo, p.id polygons p, lines l p.geo.stintersects(l.geo) = 1 , l.id = @lineid to line itself, add: union select l.geo, l.id lines l l.id = @lineid how, though, respective length of portion of line intersects given polygon, third column? as simple should be, really. select p.geo, p.id, p.geo.stintersection(l.geo).stlength() polygons p, lines l p.geo.stintersects(l.geo) = 1 , l.id = @lineid

html - Javascript click event in outlook 2007 -

we have toggele image (plus-minus) on div. plus should expand div , minus should collepse div. work when send html email outlook having div , toggle javascript function called image click? thanks javascript not supported e-mail clients.

Get JSON from subdomains with jQuery -

i have user1.mydomain.com , user2.mydomain.com domains. use api.mydomain.com deal web app on ajax/json. so, want make post request user1.mydomain.com api.mydomain.com/projects using jquery this: {'action':'getactiveprojects'} list of active projects user1 in json result. found $.getjson method seems there no option sending data server, method. other problem face same origin policy. so, how can post json server on subdomain , json response result? using $.ajax , json-p specifying datatype: "jsonp" . details in linked docs. server have respond json-p rather json, that's pretty easy if control server. alternately, if need support recent browsers (and not ie), can set server support cors . that's supported in recent browsers, , although ie8 supports it, doesn't support transparently through usual xmlhttprequest object, instead requires different transport object ( xdomainrequest ), jquery doesn't handle automatically (yet).

iphone sdk 3.0 - What is the alternative of [NSBundle mainBundle] URLForResource:withExtension: in iOS 3 SDK -

i developing ios app using ios 4.2 sdk, want app run on older devices iphone 2g ios 3.1.3. don't know alternative code: nsurl *modelurl = [[nsbundle mainbundle] urlforresource:@"coredataapp" withextension:@"momd"]; it crashes on device, because urlforresource:withextension: method ios 4+. please help. thanks. its - nsurl *afileurl = [nsurl fileurlwithpath: [[nsbundle mainbundle] pathforresource:path oftype:@"aif"]];

What are the available string matching algorithms besides Knuth-Morris-Pratt, Rabin-Karp and likes of it? -

what available string matching algorithms besides knuth-morris-pratt, rabin-karp , likes of it? a cited compendium of these algorithms can found in: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.133.4896&rep=rep1&type=pdf included following algorithms: karp-rabin shift or morris-pratt knuth-morris-pratt simon colussi galil-giancarlo apostolico-crochemore not naive forward dawg matching boyer-moore turbo-bm apostolico-giancarlo reverse colussi horspool quick search tuned boyer-moore zhu-takaoka berry-ravindran smith raita reverse factor turbo reverse factor backward oracle matching plus 15 others. btw, might want clarify if interested in string similarity algorithms (e.g., levenshtein distance, etc), closely related, if indeed interested in that.

c - Error: Address already in use while binding socket with address but the port number is shown free by `netstat` -

i tried bind socket(server socket) @ port number 8000 . worked , did job me. @ end of code close socket well. next instant run code again , shows me address in use. have printed meaning of error values strerror(errno); see if code working @ each point. check if port free checked using netstat shows port number 8000 free. has happened me lot of times. every time wait few more secs , starts working again. using c language. reason behavior os. after few more secs run code , works. anirudh@anirudh-aspire-5920:~/desktop/testing$ sudo ./a.out socket creation: success file open: success socket bind: address in use socket listen: address in use ^c anirudh@anirudh-aspire-5920:~/desktop/testing$ sudo netstat -lntp active internet connections (only servers) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 0.0.0.0:80 0.0.0.0:* listen 1348/lighttpd tcp 0 0 0.0.0.0:22

performance - Is Parallel code good for web based applications? -

possible duplicate: using parallel extensions in web applications since cpus aren't getting faster getting more cores, parallel way go better performance on desktop applications, not sure if same true web based applications. web servers have spin lots of threads handle of web requests, coding application in parallel fashion (say sorting, searching, etc algorithms) performance or hurt it? i'm particularly using asp.net think question valid platform. i going make assumption operation considering parallelizing needs completed synchronously(sorting, searching) : in case not sure mean better performance degrade performance. below reasoning why. take example environment app running on server hosts 20+ other web applications. if in 1 thread server process @ 1 go , return results. if split in parallel threads of threads might finish others potentially stuck behind threads other applications. total response time slower though number of cpu cycles close same