Posts

Showing posts from September, 2013

vnc - Restrict keyboard short-cuts in x11vnc -

how can restrict keyboard shortcut options in x11vnc? example, want restrict alt+f4, alt+x, ctrl+q, etc. is -skip_keycodes option of here? you can configure such shortcuts in window manager. way, such shortcuts won't passed application, , should able handle them. but, since seem want application running time (you want prevent users closing it), might idea write simple script this: while true; run_your_application ; done that way, if application crashes or closed, restarted. (be careful applications fork or detach terminal!) on other hand, if want browser, can try using kiosk mode opera browser . see kiosk software @ wikipedia . update: using gnome... don't use gnome, quick search @ superuser gave me answer: https://superuser.com/questions/132666/how-to-disable-control-alt-arrow-gnome-window-manager-control-for-redhat-linux […] keyboard shortcuts gnome uses under system, preferences, keyboard shortcuts. but... sure want gnome environme

iframe - Facebook Application Requests: How to determine who's invited whom? -

we're build facebook application run inside xfbml iframe. found tutorial (kudos author). right now, there's 1 more issue need deal with. basically, wanted know how determine uid of person invited friend join application. example, user invites user b join cool-app. user b sees application request, , responded accepting invitation. question is, how going know user b referred user a? help please. well, luckily found closest possible answer. fbml has fb:req-choice tag use inside fb:request-form. can embedded in content attribute of latter. it looks this: <fb:req-choice url="url_here" label="button_text_here"/> ..where url_here application-base-url plus relative path somewhere so: http://apps.facebook.com/my_cool_app/path/to/somewhere e.g: http://apps.facebook.com/my_cool_app/users/invite/referred-by/1234567890 this button user "accepts" or "confirms". when triggered, fb redirects link provided. that&

c# - How can I safely exit a DBMS when records are locked? -

i'm hobbyist programmer have been doing while. i'm writing small document management application use @ work (in c#). when user opens record, update indicate it's locked editing. what i'm not sure how ensure database gets updated when application exits unsafely (eg. computer shuts down unexpectedly)? also, how should update when application exits via computer being shut down user? want make sure don't end records being marked locked when nobody viewing them. here's how done sql server. developer-issued "record locks" not relevant client-server architecture. confusing shared-file architecture client-server architecture. make sure table has timestamp column (which automatically updated database engine). read in row want edit. put timestamp row in variable. update statement looks this: update mytable set col = {some value} id = {your id} , timestampcolumn = {the timestamp row had when read in} if has changed row since read in, have

c++ - Do I put 'const' in my UML diagram? -

i'm making uml diagram using dia . need put const in diagram when function const ? if so, where? chapter 11.8.2 ("operation") in latest uml specification lists isquery 1 of operation's attributes: isquery : boolean - specifies whether execution of operation leaves state of system unchanged (isquery=true) or whether side effects may occur (isquery=false). default value false. if operation not change system's state shown in diagram, property {query} should added after function's return type. dia supports isquery attribute class' operations: open class' properties window , in operations tab tick query checkbox method not change class' state , const appear after method's return type in diagram.

java - Is JMS the answer to the need for a persistent blocking queue? -

i'm creating library consists of log4j appender asynchronously sends events remote server. when log statement made, appender asynchronously record event local queue pool of consumers retrieve , send remote. the in-memory solution create blockingqueue handle concurrency issue. however, i'd queue persisted if remote server not available don't grow queue unbounded or start discard messages in case of bounded queue. i thinking of using embedded h2 database store events locally , use polling mechanism retrieve events , send remote. rather use blockingqueue poll database table. is jms answer? edit: if jms answer, , seems going way, have recommendations on lightweight, embeddable jms solution can configured accept messages in-process? in other words, not want to, , possibly not allowed to, open tcp socket on listen. edit: i've got activemq embedded , seems working. all. you use jms asynchronously send messages remote machine (assuming can receive t

recursion - Android refer to custom views in a loop? -

i need recursively move through bunch of custom views of mine extend view class. e.g. viewone.java viewtwo.java viewthree.java i have created instances of each view in mainclass.java viewone vone; viewtwo vtwo; viewthree vthree; these views implement function called start() . and want able loop through them somehow: for(int i=0; i<= 2:i++) { views[i].start(); } how go doing this? the above example. real reason need able move through them numerically , programatically because want able add , remove views layout in numeric order button (previous , next) clicked. (i don't want them added layout @ start because heavily resource intensive views). so required such: click next -> add next view -> remove current view. click previous -> add previous view -> remove current view. e.g. currview = 1 current view currview (1) click next add view currview+1 (2) layout switch view currview+1 (2) remove view currview (1) or currview = 2 current vie

javascript - multiple file upload using ajax -

i trying achieve multiple file upload using ajax, or @ least should ajax (without page reload). below code... i able using simple submit. in above code can list of files, reomove files , upload rest server. want ajax, progressbar. can not use file api python on server side not file object then. appreciated. <!doctype html> uploader <script type="text/javascript"> var file_array = []; var file_name_cell,relation_cell, option_cell, sr_no_cell; var rowid = 0; var filecount = 1; var new_file_id = ''; var array_last_index = 0; /* ----------- add file name in hidden field start ----------- */ function addfilename(fileid){ var file = document.getelementbyid(fileid); for(var i=0; i<file.files.length; i++){ file_array.push(file.files.item(i).filename); } $('#file_n

boost and gcc&make - compiler and version agnostic linking -

boost jam creates fancy static library names such boost_system-mgw45-mt-d-1_44 , contain compiler , library version. let's assume want distribute application in sources buildable standard makefile, , user should install boost library himself. there known ways determine installed compiler , library versions compose static library names? you use autoconf , use various ax_boost_ macros, if check autoconf-archive. (the archive available package manager, know debian , macports have it). if use automake , setting --install in aclocal_amflags copy macro definitions project.

How to set an SQLite database as datasource in Dashcode? -

is possible set sqlite database datasource in dashcode? , how? i'm referring "mobile safari web application tutorial" ( http://developer.apple.com/library/mac/#documentation/appleapplications/conceptual/dashcode_userguide/contents/resources/en.lproj/makingawebapp/makingawebapp.html#//apple_ref/doc/uid/tp40004692-ch18-sw1 ). i'd replace static json in tutorial sql query result. thank you! r0byn

Listbox binding in Silverlight -

i have listbox on silverlight page, datacontext of page set instance -- testquestions , please see code below. listbox uses datatemplate , itemsource ' answers ' property of page's datacontext, works fine until try bind ' showanswer ', property on page's datacontext within datatemplate. no matter tried won't pick property's value. thank help. xaml: <listbox itemssource="{binding path=answers, mode=twoway}"> <listbox.itemtemplate> <datatemplate> <radiobutton ischecked="{binding path=correct, mode=twoway}" > <grid> <stackpanel visibility="{binding path=showanswer}"> <rectangle fill="blue" visibility="{binding path=correct}" /> </stackpanel> <textblock text="{binding path=answertext, mode=twoway}" textwrapping="wrap" /> &l

flash - JSFL: Suppressing/auto clicking on Dialog boxes -

var tmpdoc = fl.createdocument(); /*..some logic...*/ tmpdoc.additem({x:0,y:0},item); my jsfl has above code. , on 3rd line, dialog box : has title : "resolve library conflict" 2 radio button options : "replace","dont replace" 2 buttons : "ok","cancel" due dialog box, have manually monitor script execution , click on button. i want either : 1. suppress these kind of dialog boxex altogether. 2. or programatically provide default option these kind of dialogs. how do jsfl? you can try check if item exists before adding library using library's itemexists() function: var doc = fl.getdocumentdom(); var lib = doc.library; //check if item exists first, if so, keep count of symbols same name, append random, etc. if(!lib.itemexists('item')) lib.addnewitem('movie clip','item'); else lib.addnewitem('movie clip','item'+math.random()); hth

Java try-finally return design question -

in java, try { ... } { ... } executed unintuitively me. illustrated in question, does execute in java? , if have return statement in try block, ignored if block defined. example, function boolean test () { try { return true; } { return false; } } will return false. question: why this? there particular philosophy behind design decision made java? appreciate insight, thank you. edit: i'm particularly interested 'why' java thinks it's ok violate semantics define. if 'return' in try block, method should return right , there. jvm decides ignore instruction , return subroutine hasn't yet been reached. technically speaking, return in try block won't ignored if finally block defined , if block includes return . it's dubious design decision probably mistake in retrospect (much references being nullable/mutable default, and, according some, checked exceptions). in many ways behaviour consistent colloqui

webforms - Forms Authentication and Web Form -

i have directory , want allow users logged into. there web page in root directory has several data , visitors can see them. web.config file: <system.web> <compilation debug="true"/> <customerrors mode="off"/> <authentication mode="forms"> <forms name=".artucltd" loginurl="loginpage.aspx" protection="all" path="the_path" timeout="30" cookieless="usedeviceprofile" /> </authentication> <authorization> <deny users ="?" /> <allow users="*"/> </authorization> </system.web> this custom login controls username , password mssql 2008 database. works fine have problem is: when want open default web page (http://localhost/test), system automatically redirect loginpage.aspx (not default.aspx). want see default.aspx , navigate other pages. loginpage.aspx in root folder not

core audio - Output sound in iPhone "call" speaker -

i simulate call in iphone app. possible play sound in speaker put ear ? ok, found it. looks should use kaudiosessioncategory_playandrecord play iphone audio in ear speker

No git color schemes under rxvt/cygwin -

after getting tired of default cygwin terminal, decide try rxvt . seems fine except 1 thing: color schemes git repositories stop working. btw other color schemes vim editor works fine under rxvt . ran script ensure 256 colors enabled. my ~/.gitconfig looks this: [user] name = xyz email = xyz@abc.com [color] diff = auto status = auto branch = auto [core] autocrlf = false if change settings in ~/.gitconfig color section "auto" "always", msysgit coloring work in rxvt/mintty [color] ui = status = branch = diff = interactive =

javascript - toggle/visible check wrong behavior or a bug in the library -

i have section on call toggle() callback format. have noticed if visible check on child element of toggled section, opposite. instead of visible false. i have following code fragments: $('.section_advanced').toggle('fast',resizesection()); function resizesection() { console.log($('#responsibilitylevel').is(':visible')); if ($('#responsibilitylevel').is(':visible')) { } else { } } where responsibilitylevel child of of .section_advanced section. you need pass resizesection function instead of calling it. this: $('.section_advanced').toggle('fast',resizesection()); should be: $('.section_advanced').toggle('fast',resizesection);

osx - In Mac OS X Terminal, what are the best colors, fonts, etc. to use? -

what good/best terminal setting? had terminal (mac osx) set on homebrew it's kind of boring! setting guys use out there? there can import? recommend? love know colors, fonts, font size use out there easy on eyes? thanks in advance ;-) i use pro settings minimal changes, , visor because having instant access terminal without alt-tabbing.

c# - nicely exception handling -

in our app, use components developed other teams. question how can define nicely way of exception handling this try { somecomponent.dostuff(); } catch (exception ex) { textlabel= ex.message; } the component has no custom exception type, maybe nicely way define component specific exception type , wrap somehow? know question basic, interested more in let's how it. if call component no custom defined exception types, how handle potential exceptions in elegant way? when catch error able repackage , throw error, @ basic level may adding more data - but, you've suggested, replace generic error custom error that, whilst won't overcome limitations of response you've got component, give code further call stack opportunity respond more appropriately. so in terms of adding information in basic manner - throwing new exception additional text whilst still passing original exception: catch (exception ex) { throw new exception("

gedit automatic session saving or default session? -

i'm used eclipse's , notepad++'s behavior of automatically opening files , tabs present on last exit. know if there way enable in gedit? session management plugin i'm using seems require explicit menu selection of load , save in order retrieve session. know if there's way automatically restore last session or choose default session? thanks. there session saver plugin available in gedit-plugins package. @ http://live.gnome.org/geditplugins

c# - In the GDI + error general form -

i have directory, in directory image background.jpg in work load image in background imagebrush imgbrush = new imagebrush(); imgbrush.imagesource = new bitmapimage(new uri("images/background.jpg", urikind.relative)); border.background = imgbrush; after pattern during, need change image. shake server, try write in images/background.jpg , exception "in gdi + error general form" - translate russian. get image server , save computer httpwebrequest lohttp = (httpwebrequest)webrequest.create(request); lohttp.method = "get"; lohttp.protocolversion = httpversion.version11; httpwebresponse lowebresponse = (httpwebresponse)lohttp.getresponse(); streamreader loresponsestream = new streamreader(lowebresponse.getresponsestream()); system.drawing.image webimage = system.drawing.image.fromstream(lowebresponse.getresponsestream()); try { webimage.save("images/background.jpg");//this exception imagebrush imgbrush = new imagebrush();

flex - Deployed SWF not accessible in Firefox -

i'm using swfobject.js deploy load flex applet. unfortunately, while i'm able run/debug in firefox via flash builder, cannot access deployed applet via url -- applet doesn't load/start. can access deployed applet via url both ie 8 , chrome 7. causing issue in firefox? below swfobject code , produced object tag: <script type="text/javascript"> window.onload = function() { <!-- version detection, set min. required flash player version, or 0 (or 0.0.0), no version detection. --> var swfversionstr = "10.0.0"; <!-- use express install, set playerproductinstall.swf, otherwise empty string. --> var xiswfurlstr = "playerproductinstall.swf"; var flashvars = {}; var params = {}; params.quality = "high"; params.bgcolor = "white"; params.allowscriptaccess = "samedomain"; params.allowfullscreen = "true";

How join tables in multiple folders with Advantage Database Server -

using advantage database server sql, need able join free tables in separate folders. there way this? with free tables can specify relative paths tables in clause. select * "..\directory1\table1.adt" a, "directory2\table2.adt" b a.id = b.id; this entry in files describes basics of it.

spring security - Grails Acegi Url mapping weirdness -

this grails 1.2.0 , acegi 0.5.2. part of security config (the requestmapstring): requestmapstring = """\ convert_url_to_lowercase_before_comparison pattern_type_apache_ant /login/auth=is_authenticated_anonymously /logout/**=is_authenticated_anonymously /role/**=is_authenticated_anonymously /js/**=is_authenticated_anonymously /css/**=is_authenticated_anonymously /images/**=is_authenticated_anonymously /plugins/**=is_authenticated_anonymously /captcha/**=is_authenticated_anonymously /register/**=is_authenticated_anonymously /help/**=is_authenticated_anonymously /=is_authenticated_fully /**=is_authenticated_fully """ i had '/' rule @ top, did not make difference. in logs, see lines 2010-11-15 14:08:02,937 debug filterchainproxy - converted url lowercase, from: '/images/nav_bg_ribbon_hover.png'; to: '/images/n

php - upload only txt files -

how check .txt files uploaded server , not other files in php. you can test filetype: if ($_files['file']['type'] == 'text/plain') // file txt also, can verify mime-type of file using function mime_content_type .

c# - Wake up a thread when event occurs -

i achieve following communication between 2 threads: thread alpha something, , suspends itself. next second thread(beta) raises , event resumes alpha thread. cycle goes on... i did below not sure if proper design. i've notice thread.suspend() , thread.resume() deprecated. i'm looking forward hearing advice implementation , preferred replace deprecated methods. namespace threadtester { delegate void actionhandler(); class alpha { internal thread alphathread; internal void start() { while (true) { this.alphathread.suspend(); console.writeline("alpha"); } } internal void resume() { while (this.alphathread.threadstate == threadstate.suspended) this.alphathread.resume(); } } class beta { internal event actionhandler onevent; internal void start() { (int =

mysql - SQL Timestamp Where clause 30 mins ago -

how can see if time stamp >= 30 mins ago? sorry if not descriptive enough idk else say. now()-1800<=$the_time_stamp the above wrong, should be unix_timestamp()-1800<=$the_time_stamp

wpf - list box selected index won't update -

i have strange problem came out of no where... when attempt update list box selected index in code update if following lstbox.selectedindex = 4 or other number in range. if lstbox.selectedindex++ or lstbox.selectedindex += 1 or lstbox.selectedindex = var; not update index selected index not update. i using c# , wpf any great! interesting. tested , appear selectedindex property updates, controls appearance not update until has gained focus first time (calling invalidatevisual() , updatelayout() not update control ui, calling focus() or selecting item before setting selectedindex will). edit: ignore that, updating selected item contrast between window background , unfocused highlight slight on screen didn't notice it, fool feel :p

c# - ASP.NET MVC2 Login form in master page -

i'm trying find elegant way of having login form in master page. means unless user logs in, login form should appear on every page. (this common these days) taking example comes mvc2 application in visual studio have created this: public class masterviewmodel { public string user { get; set; } // omitted validation attributes public string pass{ get; set; } public bool rememberme { get; set; } } every view model inherits masterviewmodel public class registerviewmodel : masterviewmodel { public string username { get; set; } public string email { get; set; } public string password { get; set; } public string confirmpassword { get; set; } } my master page renders partial view <%@ master language="c#" inherits="system.web.mvc.viewmasterpage<mylogon.viewmodels.masterviewmodel>" %> ..... <div id="logindisplay"> <% html.renderpartial("logon"); %>

user interface - Entirely custom UI for an Android device -

my goal create custom rom commodity android tablet hardware. won't use normal android ui widgets, simple launcher offers custom email app, news app, , maybe handful of other things. each icon won't small, in normal android launcher, rather full half or quarter of screen. what best way go this? create custom rom nothing start , launch stripped-down browser process loads web pages local drive? option? i'm considering development machine. g1s plentiful , well-supported, m001s. if had custom rom worked on test machine, kind of work needed working on different hardware platform? i appreciate input can offer. some thoughts: look @ asop , devices supports , device test machine. you need customize 1 main default android app give launch screen want...the homescreen application..sample in examples of sdk..

visual studio - C# - overloaded extension methods -

in pretty basic studying exercise using linkedlist , when needed return last element mistakingly used method last() instead of property last , started wonder. this method extension method of ienumerable, if it's not overloaded (visual studio + resharper displaying me basic ienumerable extension method signature method), inefficient. the linkedlist msdn page specifies of extension methods "overloaded." i'm not sure means(clicking method link displays basic method's explanation) , why doesn't visual studio + resharper show me. thanks. an easy mistake make confuse over loading over riding . when msdn page saying methods overloaded, means there multiple versions of methods different parameters. you cannot override extension methods since static.

http status code 404 - Zend Framework: How to intentionally throw a 404 error? -

i intentionally cause 404 error within 1 of controllers in zend framework application. how can this? a redirect 404 be: throw new zend_controller_action_exception('your message here', 404); or without exception: $this->_response->clearbody(); $this->_response->clearheaders(); $this->_response->sethttpresponsecode(404);

NServiceBus: GridInterceptingMessageHandler -

what "gridinterceptingmessagehandler"? did search , can find no mention of on nservicebus.com. also, see samples have line: .loadmessagehandlers(first<gridinterceptingmessagehandler>.then<sagamessagehandler>()) what exactly? if @ source , documentation you'll see following: intercepts messages, not allowing through if endpoint has had number of worker threads reduced zero. gridinterceptingmessagehandler

ssh - How to run a CPU Hogging Program on Remote Server? -

i run machine learning program might take day or 2 complete; not want run on laptop, on remote server. thinking if ssh machine , run program there, , close ssh session, how know next time ssh machine if program still running or completed? use screen instead. assuming have installed, run screen ssh session. given new shell. once start program can detach session terminal typing ^a d (ctrl+a followed d). later, when ssh in, run screen -r reattach session current terminal. (note plain killing off ssh session in fact detach screen session, not kill it.) man screen further reading. screen very powerful, , learning ^a action sequences worth time. use screen daily , love it.

visual studio 2010 - Error Code -1073741515 When Using EDITBIN -

i'm using editbin increase stack size of application i'm writing. have in post-build event command line visual studio: "c:\program files (x86)\microsoft visual studio 10.0\vc\bin\editbin.exe" /stack:268435456 "$(targetpath)" when build project, error: error 470 command ""c:\program files (x86)\microsoft visual studio 10.0\vc\bin\editbin.exe" /stack:268435456 "[target executable]"" exited code -1073741515. i have both of following in path environment variable: c:\program files (x86)\microsoft visual studio 10.0\common7\ide c:\program files (x86)\microsoft visual studio 10.0\vc\bin the command works when run manually cmd.exe. know problem here? i had same issue, how resolved it: ran msbuild.exe <my.sln> /t:<mytargetproject> vs2010 command prompt, <my.sln> solution name , <mytargetproject> project trying build. e.g. msbuild.exe helloworld.sln /t:mainproj .

DLL missing when COM+ application client proxy is exported on Windows 2003 Server and Windows 7 -

on windows 2003 server , windows 7 when com+ application client proxy exported, dll proxied not included in msi file created. msi install, since dll not included, remote application cannot instantiated. the same com+ application exported windows 2000 server includes dll, installer won't run on windows 7 machine. why dll missing com+ application exported on windows 2003 server or greater? can no longer install com+ dlls system32 folder on server. in windows 2003 server , beyond (including windows 7) when exporting com+ package dlls registered in windows\system32 (or folders below that) not exported. according microsoft support, design. (this information has not been published publicly microsoft, had open ticket them discover issue.) the symptoms exported msi files not contain com+ dlls if:   1. com+ dll registered in system32 and   2. com+ package exported on windows 2003 or later. msi created , install, applications not able instantiate objects because dll

iPhone OpenGL : Data Type Question -

i want store array of floats that's array. so want store array of float[3] (this contains x,y,sizex,sizey) use opengl what's best way of doing using standard objectivec arrays feels slow solution. i going through array on every draw call check collision objects. i use array of glfloats in standard c, best bet performance wise.

c# - Impact of Recycling Worker Process on WCF Service -

i want know impact (in performance, availabillity, etc) recycling worker process (iis v 6.0) has on wcf service hosted in iis, know if there's best practice on how configure recycling time or # of requests. i know if worker process being recycled has service it's instantiation configuration set single, has instantiate again after every worker process recycling? thanks! http://msdn.microsoft.com/en-us/library/ms525803(vs.90).aspx notes: considerations when recycling applications when applications recycled, possible session state lost. during overlapped recycle, occurrence of multi-instancing possibility. loss of session state: many iis applications depend on ability store state. iis 6.0 can cause state lost if automatically shuts down worker process has timed out due idle processing, or if restarts worker process during recycling. occurrence of multi-instancing: in multi-instancing, 2 or more instances of process run simultaneously. depending on how app

android - onItemClickListener (ListActivity) vs onItemClick (ListView): which one should I use? -

when comes using listview inside of listactivity , there difference between applying onitemclicklistener associated listview , overriding onlistitemclick method in listactivity? there doesn't appear difference except class handles event. is there 1 preferable other, whether efficiency reasons, code maintainability, or android best-practices? override onlistitemclick if you're using listactivity. that's it's there for.

jquery question, how can i make it calc. multi. form with different form IDs? -

jq question again, i've 4 form in 1 page , script calc. total, how can calc different total amount < form id="#" > things ? thanks <script type="text/javascript"> $(document).ready(function() { var total = 0; function calctotal() { $("input:checked").each(function() { var value = $(this).attr("value"); total += parseint(value); }); } //this happens when page loads calctotal(); $("h2").after('<p class="total">total: <strong>¥' + total + '</strong></p>'); $("input:checkbox, input:radio").click(function() { total = 0; calctotal(); $("p.total").hide().html("total: <strong>¥" + total + "</strong>").fadein('slow'); }); }); </script> give each form different id (e.g.

vba - Pulling Column Names into Excel from SQL query -

i'm using excel pull data sql db. used code question , works fine. want pull in column names table in addition actual table. figured out names using each fld loop. there's still issue of populating them horizontally in row in excel number of columns might change - i'm thinking need each loop or similar. sub getdatafromado() 'declare variables' set objmyconn = new adodb.connection set objmycmd = new adodb.command set objmyrecordset = new adodb.recordset 'open connection' objmyconn.connectionstring = "provider=sqloledb;data source=localhost;user id=abc;password=abc;" objmyconn.open 'set , excecute sql command' set objmycmd.activeconnection = objmyconn objmycmd.commandtext = "select * mytable" objmycmd.commandtype = adcmdtext objmycmd.execute 'loop names' ' here????' 'open recordset' set objmyrecordset.activeconnection = objmyconn objmyrecordset.open o

install - Error: component "zip" not found -

i'm trying install zip library. wonko:desktop andrew$ alisp international allegro cl free express edition 8.2 [mac os x (intel)] (jan 25, 2010 14:49) copyright (c) 1985-2010, franz inc., oakland, ca, usa. rights reserved. development copy of allegro cl licensed to: allegro cl 8.2 express user ;; optimization settings: safety 1, space 1, speed 1, debug 2. ;; complete description of compiler switches given ;; current optimization settings evaluate (explain-compiler-settings). cl-user(1): (asdf:oos 'asdf:load-op :zip) ; autoloading package "asdf": ; fast loading /applications/allegrocl/code/asdf.fasl ; autoloading package "excl.osi": ; fast loading /applications/allegrocl/code/osi.fasl ; fast loading bundle code/fileutil.fasl. ; autoloading package "regexp": ; fast loading bundle code/regexp2-s.fasl. ; autoloading regexp::make-vm-closure: ; fast loading /applications/allegrocl/code/regexp2.fasl ; fast

C# Check if string contains any matches in a string array -

what fastest way check if string contains matches in string array in c#? can using loop, think slow. you combine strings regex or statements, , "do in 1 pass," technically regex still performing loop internally. ultimately, looping necessary.

android - Store object into SQLite database best practices -

i store object sqllite database. looking how best in order ensure if need updata/change object in future users of new , old object layout minimally impacted. in other words want ensure making changes object have minimum affect on clients not update software on old database format. want ensure easy update old record style new format. i thinking add element in sql row identify object type unique name, , identify object version number. way read row , use object number control deserializer use correct version of class. i appreciate best practices on subject. the info start here . basically need create subclass of sqliteopenhelper . doing way useful callbacks create/update db schema or change data. the sqliteopenhelper.onupgrade(sqlitedatabase db, int oldversion, int newversion) callback called os automatically , accepts version params able detect whether there upgrade or downgrade , undertake needed db changes. way you'll able arrange sort of db migrations (in way

use html code in iphone -

please tell me how put html code in iphone app i have show hyperlinks on app (please don't suggest me use uibutton) please provide or sample code if possible please check here

c++ - Calculating AABB (axis aligned bounding box) collision -

i'm supposed check aabb collision between 2 pyramids. looked aabb, simple enough check. given vertices both pyramids, 4 world positions. supposed calculate aabb collision box, i've done, , see if pyramids collide or not. part i'm confused on world coords for? there 4 per pyramid, aren't vertices.. can figure out whether or not collide based on vertices, world positions for? surely world positions represent vector transforms indicate centre of pyramids in world?

ios - iphone - Mail app - text kind of control -

i'm trying create view similar iphone's mail application. in mail app, in compose mode, after entering to, cc , subject, started entering text. number of lines increases, view scroll (still keeping keyboard) , user pointed last line of text. how can achieve such view. how can done. you potentially use uitextviewdelegate , implement (void)textviewdidchange:(uitextview *)textview then in implementation call [textview bounds] , obtain height... shift view accordingly. seems there should better way though... hope gives start least

How to process a file in PowerShell line-by-line as a stream -

i'm working multi-gigabyte text files , want stream processing on them using powershell. it's simple stuff, parsing each line , pulling out data, storing in database. unfortunately, get-content | %{ whatever($_) } appears keep entire set of lines @ stage of pipe in memory. it's surprisingly slow, taking long time read in. so question 2 parts: how can make process stream line line , not keep entire thing buffered in memory? avoid using several gigs of ram purpose. how can make run faster? powershell iterating on get-content appears 100x slower c# script. i'm hoping there's dumb i'm doing here, missing -linebuffersize parameter or something... if work on multi-gigabyte text files not use powershell. if find way read faster processing of huge amount of lines slow in powershell anyway , cannot avoid this. simple loops expensive, 10 million iterations (quite real in case) have: # "empty" loop: takes 10 seconds measure-command {

Python app to django web app -

i've written python code accomplish task. currently, there 4-5 classes i'm storing in separate files. i'd change whole thing database-backed web app. i've been reading tutorials on django, , far impression i'll need manually specify fields , types every "model" use. little surprising me, since expecting kind of orm capability take existing classes i've defined, , map them onto database somehow, in manner abstracted away me. is not case? missing something? looks need specify fields , types in file 'models.py'. okay, beyond specifics, have general tips on best way migrate object-oriented desktop application web application? thanks! that is django's orm: maps classes tables. else did expect? there needs way of specifying fields are, though, before can use them, , that's managed through models.model class , various models.field subclasses. can use classes mixins in order use existing business logic on top of field defi

.htaccess - Apache directory listing restriction per IP bases -

i need limit directory listing users except ip's. idea how that? the option should be: options -indexes and let's directory need restrict /restricted/ <directory /restricted> options -indexes </directory> but how place ip restriction but, instance, 127.0.0.1 any appreciated options -indexes <files *> deny allow 213.106.26.195 allow 213.106.15.132 options +indexes </files> i used directive because tried in .htaccess, in server profile can use directive well, of course.

ruby - Get node name with REXML -

i have xml, can like <?xml version="1.0" encoding="utf-8"?> <testnode type="1">123</testnode> or like <?xml version="1.0" encoding="utf-8"?> <othernode attrib="true">other value</othernode> or root node can unexpected. (theoretically anything.) i'm using rexml parse it. how can find out xml node root element? xml = rexml::document.new "<?xml version" #etc (or load file) root_node = xml.elements[1] root_node_name = root_node.name

uicolor - How to Get Android System Colors -

i've seen references on how set system colours, need find out how them - how find out are? on samsung galaxy s example, tab views, listview highlights when select item, , summary text line on preference screen blue. there many apps immitate style , want same. cannot hard code , set colour blue, other handsets use different colours. the question is, there way programmatically find out colour preference screen summary line, tabs, or listview selections are, can set against textview elsewhere in app? how android system colours? there answer question, not 1 wanted hear. there no way reliably this. "selection color" part of nine-patch image, provided on platform specific basis. use standard orange color, (sense) uses green, , others use red. exhaustive list of these might able create mapping hardware color, not effective because new hardware comes out time, , of these phones allow sense uninstalled. the real thing can make buttons consistent within

c# - Serializing a HashSet -

i'm trying serialize hashset i'm having no luck. whenever try open serialized data, empty hashset. however, list works fine. example code: [serializable()] public class myclass : iserializable { public myclass(serializationinfo info, streamingcontext ctxt) { hashset<string> hashset = (hashset<string>)info.getvalue("hashset", typeof(hashset<string>)); list<string> list = (list<string>)info.getvalue("list", typeof(list<string>)); console.writeline("printing hashset:"); foreach (string line in hashset) { console.writeline(line); } console.writeline("printing list:"); foreach (string line in list) { console.writeline(line); } } public void getobjectdata(serializationinfo info, streamingcontext ctxt) { hashset<string> hashset = new hashset<string>(); h

c# - LINQ to map a datatable into a list<MyObject> -

i discover linq comprehensive me please! :-) so! have data-tier provide me datatables , want convert them lists of objects. these objects defined in spécific layer dto (data transfer objects). how can map every rows of datatable objects , put objects list? (today make "manually" field after field) possible linq? i've heard linq2entities? right? thanks beginner understand... if objects not complex can use this: public static class datatableextensions { public static ilist<t> tolist<t>(this datatable table) t : new() { ilist<propertyinfo> properties = typeof(t).getproperties().tolist(); ilist<t> result = new list<t>(); foreach (var row in table.rows) { var item = createitemfromrow<t>((datarow)row, properties); result.add(item); } return result; } private static t createitemfromrow<t>(datarow row, ilist<propertyinfo> properties) t : new()

c# - Strongly signed assemblies -

i not .net developer, there might basic things don't know. i have experience coding in c#, have question. 1 of projects (a) references ptoject (b), "local copy" set. when b.dll in same location a.exe works. when b.dll put in common directory path doesn't work. one of coworkers said thought should make b signed. correct? why 1 sign assembly? i read bit in in internet saw security... if so, how 1 sign assembly , consequences have? please note using vs2003 .net 1.1. edit: thank answers, links provided refer later versions of vs , .net have sort of signing tab in project properties. know (or give link )how name assembly in vs2003 .net1.1? i think co-worker might referring "strong naming" assembly. strong naming enables deploy assembly gac. once in gac, application using assembly can locate it. path's irrelevant , preferred way have shared assemblies deployed. to strong name assembly, can use sn.exe tool comes visual studio genera

email - Get password from android account -

i noticed android api, have method getpassword(account account) . accountmanager = accountmanager.get(this); account[] allgoogleaccounts = accountmanager.getaccountsbytype("com.google"); (account account : allgoogleaccounts) { system.out.println(accountmanager.getpassword(account)); } but have error: 11-16 10:49:08.986: warn/system.err(5732): java.lang.securityexception: caller uid 10039 different authenticator's uid 11-16 10:49:09.038: warn/system.err(5732): @ android.os.parcel.readexception(parcel.java:1247) 11-16 10:49:09.038: warn/system.err(5732): @ android.os.parcel.readexception(parcel.java:1235) 11-16 10:49:09.045: warn/system.err(5732): @ android.accounts.iaccountmanager$stub$proxy.getpassword(iaccountmanager.java:415) 11-16 10:49:09.087: warn/system.err(5732): @ android.accounts.accountmanager.getpassword(accountmanager.java:277) 11-16 10:49:09.087: warn/system.err(5732): @ com.test.account.oncreate(account.java:30) 11-16 10:4

c# - Accessing data from an Adorner -

i'm writing 2d graphics tool in c# , wpf, , i'm using adorners on shapes drawn canvas . i'd adorners highlight when shape considered "selected", i'm doing using mousedown , mouseup events. however, user can select multiple shapes, not of shapes receive both of mouse events. i have class manages drawing, holds list of selected shapes. best way give adorners access data, can see if adorned element selected? some thing's i've considered: making list global - bad idea sub-classing each shape add "selected" property - require changing references shapes in class you can make attached dependencyproperty set on shape - can set property when select one. adorner can have visibility binding property on shape visibility set automatic. you can use tag property on shape store values - old way of doing :)

java - opening a mapview on a button click from another class -

i dont understand seems problem here...my app crashes. , followin logcat error: error/dalvikvm(1270): not find class 'intenttest.xyz.com.second', referenced method intenttest.xyz.com.intenttest$1.onclick 1.intenttest.java: package intenttest.xyz.com; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; public class intenttest extends activity { button b; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); b = (button) findviewbyid(r.id.b); b.setonclicklistener( new view.onclicklistener() { public void onclick(view view) { intent intent = new intent(intenttest.this,second.class ); startactivity(intent); } }); } } 2.main.xml: <?xml version="1.0" encoding=&quo

c++ - What to do with students after templates were explained? -

i'm having c++ seminar in 30 minutes :-) because incorporated of examples on seminar lecture don't have students. gave them broad overview of templates (from basics advanced topics). any tips do? it can explain (step-by-step), or have code. replicate containers - list or vector.