Posts

Showing posts from September, 2014

jquery - setting loses caret position on <pre> element on pressing TAB key -

i have pre contenteditable="true" on webpage , trying make append "\t" when press <tab> . found other plugins working on <textarea> . so, problem when append text <pre> through jquery, loses caret position. sure losing focus it's not. $("pre").focus() , nothing. i tried blur first not practical cause caret return on different position depending on browser. please... :p, my code here: http://jsfiddle.net/parisk/kprpj/ try using document.execcommand instead. here’s demo . in short: $("pre").keydown(function(e){ if (e.keycode==9) { e.preventdefault(); document.execcommand('inserthtml', false, '\t'); } });

windows - How to scan network for shares with permissions granted to users which have been deleted (and then delete them) -

i'm looking clean permissions user accounts have been deleted. i able scan top-level shares in domain , remove permissions. i've taken @ share enum doesn't seem set type of activity. the non-existance of user can determined successful failed lookup. means need able query ad successfully, , ad needs respond user doesn't exist. need sure able query whole distribution of ad-structure. i'm not sure way go. you can use command cacls or icacls list permissions , take action. consider highly dangerous route go. network error causes failure in lookup result in loss of unwanted files. instead should consider moving users quarantine ou , disabling them. list of ou members , process cacls output. set objgroup = getobject ("ldap://cn=deletedusers, dc=your,dc=domain") each objmember in objgroup.members wscript.echo objmember.name next

mysql - How to get unique number of rows from the secondary table -

create table pro_category (id primary key, product_id int, category_id int) insert pro_category (1, 1, 1) insert pro_category (1, 1, 2) insert pro_category (1, 2, 1) insert pro_category (1, 2, 1) how unique number of rows secondary table (e.g. in above case there 2 product id's involved answer of 2). using count(distinct) select count(distinct product_id) pro_category

facebook - Get application liker via graph api -

how can facebook user id application via graph api. please give suggestion. like facebook fan page showing application liker randomly. want access application liker list , want save in database. please tell me if possibility? need suggestion... thanks sorry, don't think that's possible privacy reasons facebook doesn't allow it. need people application install , authenticate before can find out more them. however, remember managing scrape fans of page before maybe that's possible applications well...

asp.net - How to get Tab Index of active/focused control on page using javascript -

i have controls on page, there way can tabindex of active control or focused control? thanx i'm assuming you've got jquery, since question tagged asp.net. in case: var tabindex = $(':focus').attr('tabindex'); should it. if element not have explicitly declared tabindex attribute, tabindex var undefined .

CMake: reuse object files built for a lib into another lib target -

i'm trying move project cmake, , @ same time have optimization on compilation process. here's deal: i have several subdirs (have be) each compiled static library (this works). i want gather object files each subdir bigger, complete, static library. it looks this: . libbig.a # made object subdir1 , subdir2 subdir1/ src/ libsubdir1.a subdir2/ src/ libsubdir2.a today, managed use global variable in every subdir cmakelists.txt append own source files. use variable "source" input in big library: # big library depends on source files # ${all_src} automatically filled each subdir's cpp file get_property( biglib_src global property all_src) add_library( big static ${biglib_src}) # recompiles sources now, works, not bad, thing is, all source files compiled twice : once subdir library, , once big library. cmake seems forget has built them. i have keep subdir libraries , ar can't merge 2 static libraries. do know how that?

.net - OrderBy, GetNewBindingList and Linq to SQL -

i have background worker performs loading of data database temporary structure. data d = new data(); d.listgroup = context.groups.getnewbindinglist(); d.tbuser = context.users.orderby(x => x.name); d.listpricelevel = context.pricelevels.getnewbindinglist(); e.result = d; the problem 3rd line (d.tbuser = ... ) being lazy-loaded. sure, can do: context.users.orderby( x => x.name ).tolist(); but again, not bindable list, changes made won't propagate db. so think need like: d.tbuser = context.users.orderby( x => x.name ).getnewbindinglist(); but doesn't work. goal is: retrieve list of users, ordered name bind-able list. ideas? thanks time! adding orderby (like of other query functions) turns query iqueryable<tentity> . fortunately, linq-to-sql's internal query type ( dataquery<tentity> ) provides bindinglist<tentity> via implementation of ilistsource . to bindinglist given query, can this: var bindinglist = (

php - Need to see if a range of dates overlaps another range of dates in sql -

i have table stores bookings of rooms, schema is: id | room_id | check_in_date | check_out_date | user_id i need run search query rooms available/unavailable between set range of dates. also keep in mind there exists table holds dates when room prebooked , in format: room_id | date so need run query looks rooms available within set range, how formulate query? i'm using mysql here. ---edit--- theres rooms table of schema: id | room details etc the unavailability/prebooked dates table holds sporadic single dates, each date in unavailability table refers date when room reason cannot booked eg: maintenance etc select room_id rooms r left join bookings b on ( r.room_id = b.room_id , b.check_in_date > '$max_date' , b.check_out_date < '$min_date' ) i'm not sure how pre-booked rooms factors in there no date range. pre-booked rooms entry on bookings or not?

Preventing eclipse from deleting files in web folders deployed under tomcat when sync -

we using eclipse develop web projects. have tomcat server defined in servers pane. inside there 2 web modules deployed: tomcat: * module1 * module2 after initial sync place files inside module folders manually. example: c:\tomcat\webapps\module1\main.swf it seems when making changes , eclipse resyncs main.swf deleted folder. is there way prevent this?

custom module of Joomla -

i want access configuration.php file custom front-end module. want set "var $offline" o or 1 module(through radio) , refresh page. want module show when site off line. you not want access configuration.php directly. instead, use functions joomla provides change website maintenance (/offline) mode. maintenance not allow specify displayed modules. need change joomla include or custom code in maintenance mode.

iphone - Utilize the Facebook SDK Login (iOs/Android) for being logged into Facebook @ Web? -

straight forward: user logs iphone/android app facebook sdk [so got id , authtoken user] ... functionality using fb sdk , more ... i open webview inside pp , load facebook profile of other user, in webview im not logged in. is there possibility, utilize login (id/authtoken) sdk user automatically logged in inside webview? tia on ios can use single sign on, see https://github.com/facebook/facebook-ios-sdk , scroll down 'single sign on' section it's description. this not direct solution perhaps help.

iphone - Image with gestures - phonegap -

i'm making application needs display map, contained in large image file (png). user must able zoom in/out image , drag in order scroll image touch gestures. i'm not sure it, want display single image displayed "photos" iphone application. i hints best way gesture , navigation header in order leave image view. thanks in advance if can give me issue because did not find clue on phonegap doc. /ouss why don't use built inn components this? sounds need wrap imageview inside scrollview , horizontalscrollview, rescale image handling ontouch-events.

java - Is it possible to open a log file programmatically if it's continously being written to? -

or generate error? wanted know if possible before put forth effort implement behavior application. sorry naivety... note: i'm using log4j logging, , 'opening log file programmatically', mean through gui component, such button. i never used log4j used log4net lot (its .net counterpart). can set log's lockingmodel minimal-lock have log file locked when logger writing it. @ point can read without preventing logger writing if make sure application doesn't obtain exclusive lock on file.

.NET DateTime serialised to JSON for use in ExtJs JsonStore(event store for ExtJs Calendar)? -

i'm trying set json store extjs calendar. store uses http proxy retrieve it's data. stores fields include startdate , enddate objects of type date. i'm serializing data in c# code json requested http proxy. wondering should serialize start , endates string or c# datetime type. @ moment serialising them datetime types. the json response looks this: {"data": "items":[{ "cid":"0", "end":"\/date(1275260400000+0100)\/", "notes":"4:00", "start":"\/date(1275260400000+0100)\/", "title":"basic""}] the start , end properties sort of date reference. have tried serialising startdate , enddate's strings rather datetime types. returns following jsonresponse: {"data": "items":[{ "cid":"0", "end":"03/06/10", "notes":"4:00", "st

jquery - Is this a javascript array with objects in it? -

square brackets array, , curly brackets objects correct? what data structure: some.thing = [ { "swatch_src" : "/images/91388044000.jpg", "color" : "black multi", "inventory" : { "f" : [ 797113, 797114 ], "x" : [ 797111, 797112 ] }, "images" : [ { "postfix" : "jpg?53_1291146215000", "prefix" : "/images/share/uploads/0000/0000/5244/52445892" }, { "postfix" : "jpg?53_1291146217000", "prefix" : "/images/share/uploads/0000/0000/5244/52445904" }, { "postfix" : "jpg?53_1291146218000", "prefix" : "/images/share/uploads/0000/0000/5244/52445909" } ], "skus" : [ { "sale_price" : 199, "sku_id" : 797111, "msrp_price" : 428, "size" : "s" }, { "sale_price"

How to tag code in C# XML documentation -

i have function: public static string join(this ienumerable<string> strings, string separator) { return string.join(separator, strings.toarray()); } which want document. want <return> tag string.join(separator, strings.toarray()) since able read c# code says more thousand words. however, when use <return>string.join(separator, strings.toarray())</return> then string.join(separator, strings.toarray()) formatted plain text, makes unreadable. tried <return><code>string.join(separator, strings.toarray())</code></return> but creates new paragraph... so here's question: there way format piece of text appears if code? i'd satisfied fixed-width font. the <c> tag sounds it's you're looking for. check out msdn's tag reference more details. that said, sure want documentation refer directly actions performed function? if decide change implementation later? know pretty trivial example,

javascript - print DIV not page -

possible duplicate: print <div id=printarea></div> only? hi all, we know window.print() . let assume have div content in it. how can print it? take here: http://www.isolutionteam.co.uk/printing-contents-of-a-div-using-javascript/

photoshop - problem with the font resolution -

Image
when try create button in fireworks resolution sucks .. thought fonts vector graphics .. can think ? convert text curves before scale it.

Jquery :getting Object Expected Error when using the onchange() for textfield -

i have textfield <input type = "text" name ="text1" id ="text1" onchange="displayresult()"> function displayresult(){ alert("testing") } it giving object expected error in ie6.o . when debug in mozilla pointing function name in way `function onchange(event) { displayresult(); //the cursor pointed on here }` how can correct going description , example, think displayresult() function declaration below 'onchange' input text usage. solution below uses document.ready() event, , uses id selector , .change() register 'onchange' needs. can remove onchange="displayresult();" in html if use code below <script> function displayresult(){ alert("testing"); } $(document).ready( function(event){ $("#text1").change(function(event){ displayresult(); }); }); </script>

javascript - immutable chrome sqlite return objects -

i using sqlite db storage system webapp. been using objects returned queries directly in application. example: function get_book_by_id(id,successcallback,errorcallback) { function _successcallback(transaction, results) { if(results.rows.length==0) {successcallback(null);} else { book=results.rows.item(0); successcallback(book); } } db.transaction( function (transaction) { transaction.executesql("select id,title,content,last_read books id=?;",[id], _successcallback, errorcallback); }); } this returns me object given id, columns provided properties. nice. problem figured out properties of result set object immutable. example if want change property 'title' takes no effect, in opinion makes no sense. example: get_book_by_id(1,handle,error); function handle(book) { //this doesn't work, book.title still was. book.title=book.title+"more text"; } i of

c# - Executing a method from a non-reference dll based on its attributes -

i have visual studio 2008 c# .net 3.5 project accept non-reference dll plugin. plugin implements arbitrary number of classes derived known interface. each class implements set of known functions interface, may implement unknown functions have known attribute. [attributeusage(attributetargets.method, allowmultiple = false)] public class someattribute : attribute { public someattribute(string description) { /*...*/ } } public class pluginclassa : iplugininterface { public pluginclassa(int some_val) : base(some_val) { } public override void begin() { /*do interesting things...*/ } public override void end() { /*do interesting things...*/ } [someattribute("attribute title")] public void someunknownfunction() { /*do interesting things...*/ } [someattribute("attribute title")] public void someotherfunction() { /*do interesting things...*/ } } i'd able load plugin dll , execute functions in order: begin() each fun

PyThon How do I pass a object to another class? -

i want access some_object within class hello: def get() from wsgiref.simple_server import make_server import web urls = ( '/(.*)', 'hello' ) class hello: def get(self, name): return some_object if __name__ == '__main__': data = [] some_object = parentobj.func(data) app = web.application(urls, globals()) app.run() you make some_object member of class itself. under '__main__' section, set some_object class member of hello class, so: hello.some_object = some_object then change hello.get return member of class: class hello: def get(self, name): return self.some_object

debugging - How to trace PHP errors? -

i following error: [23-feb-2011 19:51:29] php fatal error: allowed memory size of 134217728 bytes exhausted (tried allocate 512 bytes) in /obj/class.db.php on line 60 my problem don't know error happens. line 60 of class.db.php 1 of used functions in application (database read() function). how can trace error originates from? you can try using http://www.xdebug.org/

ios - Core Data modeling issues (how to update attribute based on a relation's relation?) -

i have entity (order) has to-many relationship entity item, has to-many relationship entity note. if price changes note, or note added, 'price' attribute associated order must update. right now, solution have order objects sign nsmanagedobjectcontextdidchange notifications, , check inserted/changed objects see if of objects 1 of order's item's notes. however, inefficient , hacky, , leading few more performance issues can optimized away, i'm starting realize solution what's faulty, not issues. so, what's best way this? edit: answer questions brought rog: i'm looking propagate changes model data, observed view controllers via kvo. problem i'm noticing is, if price of note related item adjusted, there's no facility account in core data. if use keypathsforaffectingprice on item, , return "notes", accounts if notes inserted/deleted, not if note price adjusted. if wasn't core data, i'd write own accessor note price [self.i

python - Jython and the xml.sax parser - strange error -

i getting started python/jython , sax parser ( xml.sax ). wrote simple content handler test. from __future__ import with_statement xml.sax import make_parser, handler xml.sax.handler import contenthandler class countinghandler(contenthandler): def __init__(self): self.counter = 0 def startelement(self, name, attrs): self.counter += 1 def main(argv=sys.argv): parser = make_parser() h = countinghandler() parser.setcontenthandler(h) open(argv[1], "r") input: parser.parse(input) when run on documents (not all), error: traceback (most recent call last): file "src/sciencenetworks/xmltools.py", line 93, in <module> sys.exit(main()) file "src/sciencenetworks/xmltools.py", line 88, in main parser.parse(input) file "/amd.home/home/staudt/workspace/jython/lib/xml/sax/drivers2/drv_javasax.py", line 141, in parse self._parser.parse(jyinputsourcewrapper(source)) file &quo

executable jar - running a .jar file from the start=>run box in Windows 7 -

i've written code , made .jar file out of it, , want able run code start=>run box in start menu. after lot of trial , error, made sure construct .jar file right way, , set proper .jar file type association computer recognizes run .jar file using java.exe. doing enabled me run .jar command window, typing "java -jar myjar.jar", won't run start=>run box (even when add in .jar's filepath). should do? also, i'm not sure if run .jar run box takes arguments - possible that? you'll need tell java class main class. if intend distribute application should make manifest file main-class attribute. see: http://download.oracle.com/javase/1.4.2/docs/guide/jar/jar.html#jar%20manifest if want damn thing running, command should work... java -jar myjar.jar myclass ... analogous how you'd write... java myclass ... @ command line. btw, might worth mentioning javaw command, which works java launches graphical application without showing c

nant directory::exists returns false even though directory exists -

i'm trying check if directory exists part of nant script , getting false negative. here script fragment: <echo message="${backup.dir} --> ${directory::exists('${backup.dir}')}"/> here output: [echo] d:\d\rtc\backup\20110223 --> false except directory exists. as side note if run.. <echo message="${backup.dir} --> ${directory::get-creation-time('${backup.dir}')}"/> i following error: expression: ${backup.dir} --> ${directory::get-creation-time('${backup.dir}')} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not find part of path "d:\d\rtc\${backup.dir}". and if run.. <echo message="directory name --> ${path::get-directory-name('${backup.dir}')}"/> i get [echo] directory name --> all in i'm confused right now.. thoughts? you must not use ${} in nested way: <echo message="${backup.dir} -->

ruby on rails 3 - RubyOnRails 3 on WHM (centOS) -

i have server (centos 5.5) , whm installed. installed manually ruby 1.9.2, rails 3.0.4, passenger 3.0.0.pre4 , passenger apache module, because mongrel doesn't work whm (cpanel) , rails 3. i have problem passenger setup, because, must add 3 lines of code , vhost definition in httpd.conf file, bud whm auto-generate file , doesn't work. did have experience passenger , whm? need make work :| i solve problem tutorial: http://jetpackweb.com/blog/2009/07/21/install-phusion-passenger-a-k-a-mod_rails-on-cpanel-server/

jQuery Page Background Fading -

i have 2 background images (on body of page), both same except 1 brighter (higher opacity). i'm trying figure out how can make 2 fade between each other consistently looks it's getting brighter , darker. 1 fades in other fades out , repeats itself. any idea? thanks! there many fade-in, fade-out plugins jquery. here 1 list. example, fadetransition plugin lot of way there - set 2 images want in div z-index make them background of page , keep fading each other.

Rails 3. Scraping Google Trends for links -

i links page (google trend). how can rails 3? http://www.google.com/trends/hottrends/atom/hourly i quite lost. hey, can should mechanize , nokogiri. there super screencasts on how use them on www.railscasts.com. in case don't know railscasts yet, recommend going there.

uniqueidentifier - Creating a unique filename from a list of alphanumeric strings -

i apologize creating similar thread many out there now, wanted insight on methods. i have list of strings (could 1 or on 1000) format = xxx-xxxxx-xx each 1 alphanumeric i trying generate unique string (currently 18 in length longer ensuring not maximize file length or path length) reproduce if have same list. order doesn't matter; although may interested if easier restrict order well. my current java code follows (which failed today, hence why here): public string createoutputfilename(arraylist alinput, enumfpfunction efpf, boolean pheaders) { /* create file name based on input list */ string sfilename = ""; long partnum = 0; (string sgpn : alinput) { sgpn = sgpn.replaceall("-", ""); //remove dashes partnum += long.parselong(sgpn, 36); //(base 36) } sfilename = long.tostring(partnum); if (sfilename.length() > 19) { sfilename.substring(0, 18); //max length of 19 } return al

php - session_start() Error -

i have problems session_start(); i know nothing should outputted before session_start(); statement but can't find problem in script index.php: <?php session_start(); include('functions.php'); if(!is_logged_in(session_id())){ include('form.php'); }else{ ?> <html> <head> <title></title> </head> <body> </body> </html> <?php } ?> but geh following error: warning: session_start() [function.session-start]: cannot send session cookie - headers sent (output started @ c:\xampp\htdocs\fertige_scan\index.php:1) in c:\xampp\htdocs\fertige_scan\index.php on line 1 i hope can me :) make sure file saved ansi format not utf-8 format.

c# - Change Entity Framework provider in configuration -

i hoping able switch data providers to/from sql server , sql server compact edition via configuration change. doesnt work , looking @ edmx file think can see why: <edmx:storagemodels> <schema ... provider="system.data.sqlclient" ... is there way specify provider in app.config or @ runtime? the storage-model tied specific provider, cause entity framework reject dbconnection implementations not compatible specified provider. if @ entity framework connection-string, can see storageschema, modelschema , mapping specified in 3 different files (which generated .edmx , embedded in assembly). take .edmx apart , embed .ssdl, .csdl , .msl , create .ssdl sql server ce. copy & paste , replacing provider , column-types. i wrote here: comparison entity framework

c# - Cannot use SHA-512 in Silverlight? -

pdf: web client integration via url says: ascertaining sha-512 hash passphrase (result 512 bits). can implemented in .net using sha512managed-class problem project in silverlight , sha512managed not available silverlight nor implementation available silverlight right now. so blocked @ sha512 step: var passphrase = "mypassphrase"; byte[] bytevalue = (new sha512managed()).computehash(system.text.encoding.utf8.getbytes(passphrase)); byte[] key = new byte[32]; byte[] iv = new byte[16]; array.copy(bytevalue, key, 32); array.copy(bytevalue, 32, iv, 0, 16); // declare stream used encrypt in memory // array of bytes. memorystream msencrypt = null; // create rijndaelmanaged object // specified key , iv. aesalg = new aesmanaged(); aesalg.key = key; aesalg.iv = iv; can please let me know if there other way encode url ? mono has implementation use, provided happy os license. https://github.com/mono/mono/blob/master/mcs/class/corlib/system.security.cryptography/s

winapi - setting baud rate on dial-up connection win32 -

i creating dial-up connection in code in windows xp , windows 7 (rassetentryproperties). entries come default baud rate of 19200. using win32 how change baud rate in both windows xp , windows 7? setcommstate. call getcommstate first can preserve other existing settings don't want change.

What's the best practice when it comes to aligning images horizontally in html/css? -

this how typically causes issues. i'll float images content below gets screwed because don't float. suggestions? <p>this content</p> <img src="" /> <img src="" /> <p>this more content</p> you can use display: inline-block .

javascript - Trouble with google maps api v3 polyline and markers -

well im making gps tracking app , gps sending data database need fetch data , use api, app suposed draw route of 1 given car id. code for($i=0;$i<sizeof($losdatos);$i++) { if($losdatos[$i+1]['latitud']<>$losdatos[$i]['latitud'] || $losdatos[$i+1]['longitud']<>$losdatos[$i]['longitud']) { $script.="latarray.push(".$losdatos[$i]['latitud'].");"; $script.="lngarray.push(".$losdatos[$i]['longitud'].");"; $script.="codigos.push(".$losdatos[$i]['codigo'].");"; $script.="fechas.push('".$losdatos[$i]['fecha']."');"; $script.="velocidades.push(".$losdatos[$i]['velocidad'].");"; } } once ive filled array call function of mine called route. parameters in function arrays route(latarray,lngarray,codigos,fechas,velocidades); function route(lats,lngs,codigos,fechas,vs,weight) { var pointsarray=[]

c# - 'Malformed Reference Element' when adding a reference based on an Id attribute with SignedXml class -

unable sign element id attribute when there's namespace prefix: void main() { var doc = new xmldocument(); doc.loadxml("<root xmlns:u=\"myuri\"><test u:id=\"_0\">zebra</test></root>"); signedxml signedxml = new signedxml(doc); signedxml.signingkey = new rsacryptoserviceprovider(); reference reference = new reference("#_0"); signedxml.addreference(reference); signedxml.computesignature(); } computesignature() fail here 'malformed reference element' how should done? the approach used subclass system.security.cryptography.xml.signedxml class... public class signedxmlwithid : signedxml { public signedxmlwithid(xmldocument xml) : base(xml) { } public signedxmlwithid(xmlelement xmlelement) : base(xmlelement) { } public override xmlelement getidelement(xmldocument doc, string id) { // check see if it's sta

php - Phpunit skeleton generator cannot find extends class -

i have application based on zend framework trying use phpunit generate skeletons test cases. phpunit can't seem find parent classes of classes trying generate for: phpunit --skeleton-test default_model_person ../application/models/person.php phpunit 3.5.11 sebastian bergmann. php fatal error: class 'x1_db_table_auditable' not found in /path/to/application/models/person.php on line 3 fatal error: class 'x1_db_table_auditable' not found in /path/to/application/models/person.php on line 3 so have example application/models/person.php <?php class default_model_person extends x1_db_table_auditable { in library/x1/db/table/auditable.php is <?php class x1_db_table_auditable extends x1_db_table { ... i have other test cases written hand phpunit can run on application without problem. have tried specifying bootstrap file --bootstrap , config --configuration make sure path library should found, can't seem work (the result same above)

osx - Fast way to check if file is open on OS X -

is there fast way check if file handle closed command line on os x? lsof works, of course, super slow. you´ll want check out dtrace family man dtrace . if you´re interested on pure "file actions" should have @ opensnoop , builds on dtrace , has been included since mac os x 10.6. can show file in use process (by -p pid or -n name) , watch files -f /path/to/file .

c# - "An operations error occurred" from DirectoryServices -

i'm trying use system.directoryservices query active directory server, using ldap. code can (apparently) connect , authenticate, when first directorysearcher findall() method called, get: [directoryservicescomexception (0x80072020): operations error occurred.] picking apart exception in debugger has been remarkably unproductive. seems have pretty no other information associated it. online docs aren't helping me, either. i'm sure it's i'm doing wrong, what? there way tell kind of problem is?

computer vision - Finding the disparity to depth matrix using Matlab -

i have rotation matrix , translation vector between 2 cameras .is there way find out 4 x 4 disparity-to-depth mapping matrix using matlab ? used this link finding r , t parameter values between 2 cameras. you can compile opencv , use in matlab external dll.

Scan single character C -

/* program calculate trip , plan flights */ #define trip 6 #define dest 1 #include <stdio.h> int error_dest(int type_num, int cont_num, int dest_code, int check); int main(void) { int check, type_num, cont_num, index, i, dest_code, trip_num, row, col; int travelint[trip][dest], travelarea[trip]; char area_code, s, m, l, n, p, k, r, c, u, w, o; trip_num = 7; while (trip_num > trip) { printf("please enter number of trips:"); scanf("%d", &trip_num); if ( trip_num < trip) { printf("valid trip number. please proceed enter destination code.\n"); } else { printf("invalid trips. please enter no more 6 trips.\n"); } } /*********************************************************************************/ (i=0; < trip_num ; i++) /*destination code input*/ { printf("please enter destination code:"); scanf("%d", &dest_code);

visual studio 2010 - .NET Framework 4 KB2162169 documentation -

does knows newly released ".net framework 4 kb2162169" contain? links helpful. (also, knows if update available through windows update?) thanks. datte i apologize if not looking for. http://support.microsoft.com/kb/2162169 were looking different? again, apologies if isn't wanted.

error in launching the emulator and android device -

hi new app developer, when trying run app following occured... [2011-02-24 09:33:35 - firstimage] android launch! [2011-02-24 09:33:35 - firstimage] connection adb down, , severe error has occured. [2011-02-24 09:33:35 - firstimage] must restart adb , eclipse. [2011-02-24 09:33:35 - firstimage] please ensure adb correctly located @ 'c:\android-sdk-windows\tools\adb.exe' , can executed. the adb located in " c:\android-sdk-windows\tools\ " i tried "adb start-server" in run command no use, there way solve issue. try killing android debug bridge (adb) running command adb kill-server , adb start-server on command prompt. also ensure if have updated sdk path of adb may android-sdk-windows\platform-tools in new sdk. try copying file in android-sdk-windows\tools directory.

ios - How do I get started creating Mac applications? -

i iphone application developer. iphone developer, figured create , sell mac applications there mac application store. i have learned apple - similar required iphone - need join mac developer program $99 in order submit applications mac application store. my question multi-part: how similar developing mac developing iphone? what resources available learning how create mac applications? in basic terms mac programming can though of "superset" of iphone programming. note not strictly true, provides rough idea of things. there things such garbage collection, foundation classes, cocoa bindings, carbon, etc. have no presence on ios. so answer first question, noit's not same similar. there great answers similar question here: from iphone mac programming in general resources want start apple's own, provided on mac dec center website. http://developer.apple.com/devcenter/mac/index.action

design - dreamweaver vs alternative systems eg notepad++, flux, coda -

my main question whether beneficial hand code or use dreamweaver or other wysiwyg editors. i'd find out peoples views on whether dreamweaver way go when coding websites today. my current background , situation using coda in combination textexpander , developing on macintosh system. my boss has requested move dreamweaver in attempt make designing sites quicker through use of wysiwyg. would making move dreamweaver beneficial or using current system more beneficial in long run assuming more understanding of hand coding , gain experience through time. i leaning towards writing report stating moving dreamweaver without trainer isn't idea. i've developed 2 webpages http://digitalgenesis.com.au (personal site) http://www.aicm.org.au (work site) so far have fair bit of understanding css, html, li, links, etc. my current weaknesses not understand how page layouts work still rusty on floats despite reading few articles on subject. hinders ext

c# - I need to change Multiview or place holder whenever I select different values in dropdown list -

i creating online booking page. i got example page can see in link http://www.parkercorporate.co.uk/webbookercc/oneform.asp i need same behaviour in site whenever user selects value in pickup dropdown list in right side need change text values or view. to behaviour how should write code in asp.net , c#. thanks ranam first, use updatepanel don't see visual postback. second, set autopostback property on dropdownlist true. third, handle dropdownlist's selectedindexchanged event. fire after every change in dropdownlist, because enabled autopostback. in event handler, can change activeviewindex of multiview, or show/hide controls, change textboxes, etc.

iphone - Access parent view from custom cell -

how can access uiview in have uitableview, custom cells inside table. cant find method that. thanks you can add instance variable points uitableview , set when creating/configuring cell (e.g. in tableview:cellforrowatindexpath:). make sure cell not retain tableview though. knowing cell’s tableview, call [parenttableview superview] access uitableview’s parent view: @interface propertylistingcell : uitableviewcell { __weak id parenttableview; } - (void) setparenttableview:(uitableview*)tv; // parenttableview = tv; in uitableviewcontroller implementation: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { //dequeue/create , configure custom cell here [cell setparenttableview:tableview]; return cell; } update: if you're using recent xcode (at least 4.3) can add @property (weak) uitableview *parenttableview; // use unsafe_unretained instead of weak if you're targeting ios 4.x to

python - Convert a tuple into a dictionary -

i've looked on internet , consulted few books can't seem find example illustrates trying do. loathe ask on because feels basic question i've been banging head against wall last few hours here goes: how turn this: item = ((100,may),(160,june),(300,july),(140,august)) into this: { item:[ { value:100, label:'may' }, { value:160, label:'june' }, { value:300, label:'july' }, { value:140, label:'august' } ] } {'item': [dict(value=value, label=label) value, label in item]}

what is the problem with android while downloading? can any one figure out? -

the following link downloads file site.it works fine in desktop browser. not working in android default browser , in webview code(i used download listener not working). i believe android default browser can't download .zip files default (you should "this content not supported" error). if want download files through own application though, can try this solution .

ios - How can i create a activity indicator in middle of view programmatically? -

i working app parses feed online. when click refresh button takes time re parse file , show data. want activity indicator in middle of view when click refresh button. , when parsing done indicator should hide. using code not working. - (ibaction)refreshfeed:(id)sender { uiactivityindicatorview *spinner = [[uiactivityindicatorview alloc] initwithactivityindicatorstyle:uiactivityindicatorviewstylewhitelarge]; [self.view addsubview:spinner]; [spinner startanimating]; // parsing code code [spinner release]; } a uiactivityindicator needs placed separate thread long process (parsing feed) in order appear. if want keep in same thread, need give indicator time appear. this stackoverflow question addresses placing delay in code. edit: 2 years later, think time using delay make happen doing wrong. here how task now: - (ibaction)refreshfeed:(id)sender { //main thread uiactivityindicatorview *spinner = [[uiactivityindicatorview alloc] initwithactivi

c# - problem in drawing a line in a pdf file using itextsharp -

Image
i generating pdf file in asp.net c# using itextsharp. not able draw horizontal line/verticle line/dotted line. i tried draw line using following code,i getting no errors line not getting displayed in pdf file pdfcontentbyte cb = wri.directcontent; cb.setlinewidth(2.0f); // make bit thicker 1.0 default cb.moveto(20, pdfdocument.top - 40f); cb.lineto(400, pdfdocument.top - 40f); cb.stroke(); what problem in code.is because of position of x y co-ordinates? had used rough points know approximate position in pdf,but line never apears in pdf file. the output looking out shown in image below. you should make sure set color operation you're performing, otherwise won't know you'll (it whatever previous operation performed). try doing cb.setstrokecolor(255, 0, 0) (pure red) until line want it.

ipad - mobile safari: device rotation causes bad scaling of website -

i have mobile website iphone , ipad disable user zooming <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> this works fine long site in landscape mode. width of website width of screen. if rotate device portrait mode gets scaled down fits new (shorter) width. ok. but if rotate landscape mode scaled 125% means horizontal scrolling possible , zooming not possible since disabled. how can make @ 100% zoom when rotated landscape? thanks! try experimenting maximum-scale , minimum-scale so <meta name="viewport" content="width=device-width, maximum-scale=1.0, minimum-scale=1.0" /> and see if can achieve looking for..

c# - Loading SQL tables using Entity Framework -

i want use entity framework load number of sql tables memory c# app before performing work on them , sending changes database. want hit database once when load data , once more when update changes. should load tables dataset or there better way achieve this? in such case can't use entity framework. entity framework hit database once loading each table (unless there relations can load tables in single query @jakub suggested) , hit database each performed change. ef doesn't have command batching , each modified, inserted or deleted entity cause separate roundtrip db.

c - Python ctypes: passing to function with 'const char ** ' argument -

i want pass python list of strings c function expecting const char **. saw question , solution here not seem work me. following sample code: arglist = ['abc','def'] options = (ctypes.c_char_p * len(arglist))() options[:] = arglist gives following error: traceback (most recent call last): file "<interactive input>", line 1, in <module> typeerror: string or integer address expected instead of str instance what doing wrong? addendum: there seems consensus, code should work. here how reproduce problem. the following 4 lines typed in python command-line illustrate problem. python 3.2 (r32:88445, feb 20 2011, 21:29:02) [msc v.1500 32 bit (intel)] on win 32 type "help", "copyright", "credits" or "license" more information. >>> ctypes import * >>> arglist = ['abc', 'def'] >>> options = (c_char_p * len(arglist))() >>> options[:] = arglist tra

css absolute position an inner div to the top of the page ignoring parents relative position -

is there way absolute position inner div top of page ignoring parents relative position? nope, unless re-locate in dom. ( using position:fixed might alternative if want window related instead of document related )

database - What is the difference between Max Cardinality and Min Cardinality? -

i having hard time understanding difference between max , min cardinalities when trying design database. remember cardinality relationship thing. max cardinality(cardinality) 1 or many. class has relationship package b cardinality of one, means @ there can 1 occurance of class in package. opposite package has max cardnality of n, mean there can n number of classes min cardinality(optionality) means "required." 0 or 1. 0 mean 0 or more, 1 ore more there tons of articles out there explain this, including explain how property "diagram" . thing can search cardinality/optionality (omg terms) explains same thing, optionality "min" cardinality "max", from http://www.databasecentral.info/faq.htm q: can see how maximum cardinality used when creating relationships between data tables. however, don't see how minimal cardinality applies database design. missing? a: correct in noticing maximum cardinality more impo

linux - Compiling GMP for cross compiler problem -

i'm compiling gnu gmp mac/linux cross compiler i'm getting error: in file included ../gmp-impl.h:102, fib_table.c:4: ../fib_table.h:4: warning: data definition has no type or storage class ../fib_table.h:4: warning: type defaults ‘int’ in declaration of ‘error’ ../fib_table.h:4: warning: type defaults ‘int’ in declaration of ‘error’ ../fib_table.h:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘data’ fib_table.c:7: warning: data definition has no type or storage class fib_table.c:7: warning: type defaults ‘int’ in declaration of ‘error’ fib_table.c:7: warning: type defaults ‘int’ in declaration of ‘error’ fib_table.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘data’ fib_table.c:107: warning: iso c not allow ‘;’ outside of function make[2]: *** [fib_table.lo] error 1 make[1]: *** [all-recursive] error 1 make: *** [all] error 2 when running "make" my configure command "./configure --prefix=/users/

php - Retrieve autoincrement ID through ODBC -

i'm adding new features legacy application written in php uses oracle 9i database through odbc functions . i've created table has sequence , trigger generate auto-incrementing ids. now, i'm struggling find way make insert , obtain generated id afterwards: the odbc library not appear have dedicated lastinsertid method. running query returning clause triggers: ora-00439: feature not enabled: returning clause client type . i'm able run returning clause if enclose in begin...end block it's of little help: out parameters apparently not supported unified odbc driver php uses . do need hard-code sequence name , use seq_name.currval in rest of transaction? need ensure right value if there're concurrent accesses? update: added third point failed attemps best bet might code insert pl/sql api on database side return id use. e.g.) create function insert_yourtable(p_f1 number, p_f2 varchar2, ... p_fn varchar2) return number idval number; b

java - Spring security 3 : Save informations about authentification in database -

i need save informations user when authentificated ip adress , authentification date , other stuff database. in other words want keep connections history. using custom authentification provider, implementation of userdetailsservice dont know put code of saving these informations. any suggestions? since abstractauthenticationprocessingfilter implements applicationeventpublisheraware , fires event interactiveauthenticationsuccessevent on successful authentication, need listen event , update database. keep database code clean , decoupled security code.

php - javascript sum returning NaN error -

i have javascript shopping basket, in sum returning nan error,almost every time. in code have $('#add-to-basket select').selectbox(); $('#contents select').selectbox().change(function (e) { var product = $(this).parents('.product'); var ppu = product.find('.ppu').val(); product.find('.price .wrapper .value').text($(this).val() * ppu); var total = 0; $('.product .price .value').each(function (index, value) { total += new number($(value)); }); var form = $(this).parents('form'); form.ajaxsubmit(function () { }); $('#total .value').text(total); }); i tried using parsefloatm still dosn't work... $(value) gives jquery-wrapped element, not actual value. you want $(value).val() instead if elements form inputs, or $(value).text() if not. also, instead of new number(...) should use number(..

cocoa - NSApplicationDelegate prevent window if command line present -

i have simple single window app, drop target on files. works fine. however, want when started command line, processes files instead, rather showing window. is there delegate method in nsapplicationdelegate can prevent window showing, process files , quit application in? you can set window not show when loaded nib file . there's setting in inspector in interface builder. then can show window if necessary, using methods described in this documentation . but still show icon in dock while app processing file.

javascript - js: accessing scope of parent class -

i have jquery class within normal class in javascript. possible access variables in scope of parent class callback function in jquery class? a simple example of mean shown below var simpleclass = function () { this.status = "pending"; this.target = jqueryobject; this.updatestatus = function() { this.target.fadeout("fast",function () { this.status = "complete"; //this needs update parent class }); }; }; now in above example, callback function tries access scope of jquery object. there way access status variable in parent class? you set "this" variable in parent function , use in inner function. var simpleclass = function () { this.status = "pending"; this.target = jqueryobject; var parent = this; this.updatestatus = function() { this.jqueryobject.fadeout("fast",function () {

Javascript storing variable -

i want store variable client side, currently, have few selection (javascript variable, cookie, session), because want reduce workload server, incoming parameter not check on server side. for example, client side <div id="showmoney"></div> <script> var money=10000; $('#showmoney').html(money); function changemoney() { { pass variable 'money' ajax php...} } </script> php side <? $money = $_post['money']; $sql = "update user_details set money = ".$money." uid = 123"; { query...} ?> are there method make more secure, because afraid can modify javascript variable tools(firebug? if yes, how?) thanks lot~:) every variable not want user change (such price tag) has stored on server , not on client. there lot of ways change client sends you, , firebug simplest tool. more sophisticated tools allow intercept , edit every http request..

Passing Variables To onChange Event with jQuery .change() -

i'm writing simple web application , have hit stumbling block of sorts - i've found workaround, i'd understand i'm doing wrong having scoured jquery documentation. i have function, when called page, inserts table row: var rowcount = 0; function addrow(tbody){ $("#"+tbody).append( $('<tr>').attr('id','row_'+rowcount).append( $('<td>').append('content'), $('<td>').append($('<input>').addclass('text').attr('readonly','readonly')), $('<td>').append($('<input>').addclass('text').attr('readonly','readonly')), $('<td>').attr('id','barcode_cell'+rowcount), $('<td>').append($('<input>').addclass('text').addclass('quantity').attr('maxlength',3)),

ubuntu - Meta-x doesn't work in Emacs -

problem: how make meta-x work in emacs? hi newcomer linux using ubuntu 10.04lts , emacs23.1.1. used alt key meta, stopped working when upgraded ubuntu. changed meta right ctrl (using ubuntu keyboybard preference). right controll works fine in accesing third level characters in emacs when using norwegian layout. typing meta-x result in message "mismatched parantheses" in emacs , character '»' in buffer. switching layout nothing happens when typing meta-x. i want meta-x work can insert commands again in emacs. remedies have tried: changing meta key ubuntu keyboard preference -> doesn't work i looked file file .xdefaults locate. since didn't exist created in home\"username". , wrote line "xterm*metasendescape: true" in file. (i not sure does. maybe fix ment problem, found @ http://www.emacswiki.org/emacs/emacschannelfaq#toc17 ) -> doesn't work normally use esc-key m-. m-x esc-x

objective c - How to create a spinnable image for iPhone/iPad? -

i @ loss starting project. have object want user able flick finger , spin on iphone/ipad app creating, don't know how it. example of talking about, elements app allows "spin" element. thoughts? the elements uses opengl present 3d model. suggest opengl if want similar effect. http://maniacdev.com/2009/04/8-great-resources-for-learning-iphone-opengl-es/ in case of elements, it's not image you're spinning, it's 3d model.

Cakephp Helpers in Views and $this -

i'm trying determine best standard using helpers in views whether should be echo $form->input(); or echo $this->form->input(); in cakephp manual ver 1.2 helper class accessed helper object directly, whereas in 1.3 book helper object accessed through view. does matter? leo it matters because of possibility of having collision "wipe out" access helper. had model named form , decided in view after getting many records. foreach ($forms $form) { echo $form['form']['name'] . '<br/>'; } see happened there? accidentally overwrote $form variable, losing formhelper . the standard access helpers via $this in view.

spring - OC4J 10.1.3.5 / Spring3 Issue -

i'm using oc4j 10.1.3.5.0, , have issue xml namespaces in spring xml files supplied in war/ear. according oracle documentation, there known issue in parsing spring 3 xsd files within oc4j, embeds oracle xmlparserv2 jar , uses xml parsing (which has issues xsd tricks used in spring 3 apparently). i've folowed oracle work-around, defining own xml parser shared libraries on oc4j instance, , (in orion-application.xml), defining shared library use. created shared library,'apache.xml', xercesimpl (v 2.9.1), xml-apis (v 1.3.04), , xml-resolver (v 1.2). tried defining ear use new library <imported-shared-libraries> <imported-shared-library name="apache.xml"/> </imported-shared-libraries> i receive following error 14:50:31 error (userid:) [dispatcherservlet] context initialization failed org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 10 in xml document servletcontext resource [/web-inf/sprin

Get rid of busy waiting during asynchronous cuda stream executions -

i looking way how rid of busy waiting in host thread in fallowing code (do not copy code, shows idea of problem, has many basic bugs): cudastream_t steams[s_n]; (int = 0; < s_n; i++) { cudastreamcreate(streams[i]); } int sid = 0; (int d = 0; d < data_size; d+=data_step) { while (true) { if (cudastreamquery(streams[sid])) == cudasuccess) { //busy waiting !!!! cudamemcpyassync(d_data, h_data + d, data_step, cudamemcpyhosttodevice, streams[sid]); kernel<<<griddim, blockdim, smsize streams[sid]>>>(d_data, data_step); break; } sid = ++sid % s_n; } } is there way idle host thread , wait somehow stream finish, , prepare , run stream? edit: added while(true) code, emphasize busy waiting. execute streams, , check of them finished run new one. cudastreamsynchronize waits particular stream finish, want wait of streams first finished job. edit2: got rid of busy-waiting in fallowin

java - Issue with proxy while running Ant script -

i'm developing ant script project purposes , figured out proxy causes problem me. here simplest example apache documentation of 'copy' task: =================== build.xml ===================== <project default="simplestcopy"> <property name="test.dir" value="${basedir}/test/" /> <target name="simplestcopy"> <mkdir dir="${test.dir}" /> <copy todir="${test.dir}" flatten="true"> <resources> <url url="http://ant.apache.org/index.html"/> </resources> </copy> </target> </project> i've got next error: d:\temp>ant buildfile: d:\temp\build.xml simplestcopy: java.net.connectexception: connection refused: connect build failed d:\temp\build.xml:7: warning: not find resource url "http://ant.apache.org/index.html" copy. i've tried set

listbox - GWT ValueListBox: can it support more than a single selection? -

can gwt's valuelistbox support multiple selections? also, there way display more single value @ time (like listbox.setvisibleitemcount()) ? it seems you'd need @ underlying listbox (or somehow provide custom one) in order make happen. of course getlistbox() private, that's out. no. valuelistbox intended operate on single value. that's why can used editor (from editor framework) wrapped type. multiple selection can use listbox, afaik there's no straightforward way use editor (you have write own custom editor based on listbox).

delphi - Connect 4: Check for winner -

in delphi, have connect 4 board representation (7 columns x 6 lines) in form of array: tboard = array[1..7, 1..6] of smallint; board: tboard; // instance ob tboard each element can have 3 different states: 1 = player 1's pieces 0 = empty -1 = player 2's pieces now need function checks if there's winner or draw: function checkforwinner(): smallint; ... 1 player 1's win, 0 draw, -1 player 2's win , "nil" game has not ended yet. my draft follows - split 2 single functions: function checkforwinner(): smallint; var playertocheck: shortint; s, z: byte; draw: boolean; begin draw := true; s := 1 7 begin z := 1 6 begin if board[s, z] = 0 draw := false; // if there empty fields no draw end; end; if draw begin result := 0; end else begin playertocheck := board[lastpiecex, lastpiecey]; // last-moving player if searchrow(playertocheck, +1, 0, lastpiecex, lastpiecey) // search right/left result

pagerank - Website to check page rank based on keyword -

i'm wondering there way check google page rank of page of website/blog based on search keyword? and not page rank, position/page. for example, if have blog "lady gaga album review", if search google keyword "lady gaga album review", wanna know actual position of blog (for example, rank #43, page 4, or that) here page free google tools can use seo: http://www.seoptimise.com/blog/2009/12/10-free-google-seo-tools-everybody-should-use.html