Posts

Showing posts from July, 2011

How should you go about learning ASP.NET after life as a ColdFusion developer? -

as has spent around 10 years programming web applications adobe's coldfusion, have decided add asp.net string bow. for has spent long cf , underlying java, asp.net seems little alien me. how should go getting speed asp.net can dangerous it? need know c# @ great amount of detail? i want in position can build basic web apps can learn more doing tricky stuff. i'm maybe 6 months down same path, here thoughts experience far: the c# language shouldn't give problem if have experience java @ (or cfscript). reference, though, when starting, found csharp-station primer language basics. won't far asp.net side goes; syntax. more you'll familiarizing .net libraries. ide can enormous here. here 3 biggest differences found making transition: asp.net server controls - in coldfusion, have pretty direct control on html; work closely page. isn't case in asp.net. server controls meant relieve of lot of tedium, @ cost of maybe direct control. cf pr...

ide - How to "Add Existing Item" an entire directory structure in Visual Studio? -

i feel ridiculous asking because seems should simple, have been unable discover answer question. i have free standing set of files not affiliated c# project @ reside in complicated nested directory structure. want add them in format different directory in asp.net web application working on; while retaining same structure. so, copied folder target location of project , tried “add existing item” lose previous folder hierarchy. have re-created directories hand, copied across on one-to-one basis, , added existing items. there many directories/items in case. so how add existing directories , files in visual studio 2008? drag files / folders windows explorer solution explorer. add them all. note doesn't work if visual studio in administrator mode, because windows explorer user mode process.

Design by coding, its wrong but easier to visualize -

i'm sure others agree, when code hits pavement easier think of elements go application. meaning, once going, think of what's next because have reached point have design table or class. the drawbacks of approach obvious , don't need go it. the question is, of can't conceptualize design without "seeing it", how go design @ seat of our pants more structured methodology? the solution can think of detailed specifications, forces 1 think of how things going work. is case of how people think differently, or there else ignoring? well, don't know if quite asking, reading question reminded me of tdd (test driven development). the goal of tdd produce clean, testable code along suite of automated regression tests. it amazing me how clean code can end when go @ tdd... think problems, write tests it, implement make tests pass, refactor ensure code clean , readable. i don't think need lot of front design tdd, may help... i'm kind of ...

database - Data Encryption -

a database stores lot of credit card information inevitable part of system have completed. want though ultimate security of card numbers whereby setup mechanism encrypt , decrypt of ourselves cannot decrypt given number. what after way secure information down @ database level no 1 can go in , produce file of card numbers. how have others overcome issue? 'standard' approach this? as usage of data links private , secure , no transmission of card number performed except when record created , encrypted not worried front end end. well database oracle have pl/sql , java play with. there's no shortage of processors willing store cc info , exchange token can bill against stored number. gets out of pci compliance, still allows on demand billing. depending on why need store cc, may better alternative. most companies refer "customer profile management", , pretty reasonable on fees. a few providers know of (in no particular order): authorize.net c...

ruby on rails - How can I display simple tooltips on icons in html? -

i using activescaffold in ruby on rails app, , save space in table have replaced default "actions" text in table (ie. "edit", "delete", "show") icons using css. have added couple of custom actions action_link.add ("move" , "copy"). for clarity, i have tooltip pop related action (ie. "edit", "copy") when hover mouse on icon. i thought adding simple "alt" definition tag, doesn't appear work. can point me in right direction? the alt attribute used alternative image, in case of image missing, or in text browser. ie got wrong, when made alt appear tooltip. never meant that. the correct attribute title , of course doesn't tooltip in ie. so, have tooltip show in both ie, , firefox/safari/chrome/opera, use both alt attribute , title attribute.

.net - Select rows in dataset table based on other dataset table -

i have dataset has 2 tables in it. want following (or it) possible , how have correct? dstabdata.tables("filingtabs").select("fs_id not in (select fsp_fsid parenttabs)") how reference data other table in same dataset? ok ok before y'all flame me! ;) i did more looking around online , found looks stuff need, off read more here: navigating relationship between tables

Python/Sqlite3 - is there a way to programmatically set .nullvalue? -

currently, python storing string "none" nulls returned sqlite3. read can change default value nulls in sqlite3 @ command line, can set within python code? i'd of blank results same without having loop through , check each value. want nulls returned sqlite3 empty string ("") instead of "none". uses sql-function coalesce each column of left join. select a.id, a.value, coalesce(b.id, ''), coalesce(b.value, '') left outer join b on b.a_id = a.id

javascript - How can I suppress keyboard popup on an iPad HTML5 app? -

i’ve written html5 application ipad. has 1 input field. every time user comes page, popup keyboard appears. how can suppress default behavior within html5/js context? in app, if type in login & password, shows screen (without page reload). keyboard still exists, , have manually hide it. i’m not sure understand description of problem, seems incomplete. try re-stating it, see if understand correctly? the user opens safari on ipad the user types address of html5 app safari’s address bar, , taps “go” button the user taken app’s login page. tap username field, , popup keyboard appears. they type in username, switch password field, type in password, , tap “go” button. your app loads different content on screen via javascript. popup keyboard still present. if that’s problem you’re having, might worth calling blur function on username , password fields before load content of new page. might make keyboard go away. if html these fields looked this: <input t...

winforms - How to run executable at end of Setup Project? -

i have visual studio setup project use install simple winforms application. @ end of install have custom user interface page shows single check box asks user if want run application. i've seen other installers quite often. cannot find way setup project run executable after install finishes. ideas? note: cannot use custom actions because these used part of install process, want run installed application once user presses 'close' button @ end of install. i believe 1 of real limitations of visual studio installation project. need able modify last page of installation ui vs.net not give way this. modify tables in .msi after has been built vs.net overwrite these changes each time built. may able override last page using merge module include in installation project. either way need become familiar how ui dialogs authored in .msi , not trivial. you may want consider switching free script based installer or buy commercial setup authoring application (just don't...

How to extract a value from a string using regex and a shell? -

i in shell , have string: 12 bbq ,45 rofl, 89 lol using regexp: \d+ (?=rofl) , want 45 result. is correct use regex extract data string? best have done highlight value in of online regex editor. of time remove value string. i investigating expr , syntax errors. how can manage extract 45 in shell script? you can gnu grep's perl mode: echo "12 bbq ,45 rofl, 89 lol"|grep -p '\d+ (?=rofl)' -o -p means perl-style, , -o means match only.

c# - Where can I find a FTP Server with an API? -

i looking ftp server has decent api. great if code use .net framework. using secure ftp globalscape have had less plesant experiences working it. have had @ iis7 ? if server fits needs (it has improved feature set since v6) api using microsoft.web.administration usable. it's not comfortable administering websites (there typed classes in microsoft.web.administration that), there examples here, can check if api enough you: http://forums.iis.net/p/1150298/1873516.aspx

vb.net - DataGridView cell search using a LINQ query -

i'm still relatively new linq, , have done more stumbling around anything, have liked have seen far. in mind, have vb.net search routine, part of provided, below, checks text cells in datagridview given string (inclusive), using basic set of nested loops perform search: ' search first occurrence of given string each row datagridviewrow in dgvmembers.rows ' skip new row if row.isnewrow exit ' loop through cells in current row each cell datagridviewcell in row.cells ' skip non-text cells if cell.gettype isnot gettype(datagridviewtextboxcell) continue ' search our matching text if cell.value.tostring.toupper.contains(searchtext) ' select cell if have match dgvmembers.currentcell = cell writemessage("string '{0}' found.", searchtext) exit sub end if next next ' if point, didn't find writemessage("string '{0}...

licensing - Legal issues when forking Lua? -

i've been developing highly modified version of lua (including rewrite of sources keep better maintainability). right i'm @ point consider forking lua, , possibly re-release under different name (so people don't mistake original lua interpreter). of course resulting interpreter , compiler opensource (mit license, lua5.0). wonder if fine lua license? can use lua sources continue own work? have keep copyright notes? my first suggestion send email lua folks. i'm 99,9% sure won't have problem. now think it, guy create language called "idle" which, if remember well, heavily based on lua. as long show due credits , represent differences lua, i'm sure you'll fine.

C# and Google Checkout - getting the reply back from the server? -

are there tutorials out there on how responses google checkout transaction when using c# , gcheckout api. of examples find previous versions of api , not current 1 (2.5). more specifically, i'd see example reply of google post me without , https connection. know it's minimal data, i'd still see example of , see how others parsing it. google sends notification internally create notification page this: <%@ import namespace="system.io" %> <%@ import namespace="gcheckout" %> <%@ import namespace="gcheckout.autogen" %> <%@ import namespace="gcheckout.util" %> <%@ import namespace="system.data.sqlclient" %> <%@ import namespace="system.text" %> <script runat="server" language="c#"> string serialnum = string.empty; void page_load(object sender, eventargs e) { // extract xml request. stream requeststream = request.inputstream; stre...

c++ - Windows API Dialogs without using resource files -

i'm trying create dialog box using c++ , windows api, don't want dialog defined in resource file. can't find on over web, none of examples i've read seem define dialog programmatically. anyone know how this? simple example fine, i'm not doing complicated yet. i think raymond chen has pretty example here: http://blogs.msdn.com/oldnewthing/archive/2005/04/29/412577.aspx

java - Is it okay to throw NullPointerException programmatically? -

when there post-condition, return value of method must not null, can done? i do assert returnvalue != null : "not acceptable null value"; but assertions turned off! so okay do if(returnvalue==null) { throw new nullpointerexception("return value null @ method aaa"); } ? or better use user-defined exception (like nullreturnvalueexception ) such condition? i see no problem throwing npe possible before jvm - in particular null arguments. there seems debate this, there many examples in java se libraries this. cannot see why npe should holy in aspect not able throw yourself. however, digress. question different. talking post-condition stating return value mustn't null. surely null in case mean have bug inside method ? how document this? "this method throws nullpointerexception if return value unexpectedly null"? without explaining how happen? no, use assertion here. exceptions should used errors can conce...

html - Are liquid layouts still relevant? -

now of major browsers support full page zoom (at present, notable exception being google chrome), liquid or elastic layouts no longer needed? relative pain of building liquid/elastic layouts worth effort? there situations liquid layout still of benefit? full page zoom real solution @ first appears be? yes, because there vast variety of screens out there commonly ranging 15" 32". there variation in people consider "comfortable" font size. of adds quite range of sizes content need fit into. if anything, liquid layout becoming more necessary scale huge monitors, , down cellphone devices.

c# - What are the technologies that i should use for developing SaaS. Software as a service -

guys know tools , technologies needed start software service business. requirements needed ? kind of silly question? need web application provides service. can use language or hardware want. you'll need web server or cloud. you'll need profitable idea, money, , programmers worth crap. need way convince them work you, involves money or pizza. you'll need not run out of money before have useful in world wants pay for. need way them pay you. luck. edit: far technologies, programmer can write in 5 different languages similar result. let them decide use , focus on defining requirements, scalability, performance, business logic requirements and you'll need common sense. if you're developing yourself, stick you're familiar unless there's business requirement can't meet. should concerned fastest way money in bank , profitable, may force use particular technology depending on requirements. seems know python, pretty web stuff after al...

exception - Powershell exit does not work -

i writing script checks registry value , and exits if 0. (it proceed if value 1.) if ((get-itemproperty -path hklm:\software\ict\loginscript).proceed -eq 0) { $form.close() exit } when run script reg value @ 0, fails exit , throws exception instead: system.management.automation.exitexception: system error. @ system.management.automation.flowcontrolnode.execute(array input, pipe outputpipe, executioncontext context) @ system.management.automation.parsetreenode.execute(array input, pipe outputpipe, arraylist& resultlist, executioncontext context) @ system.management.automation.statementlistnode.executestatement(parsetreenode statement, array input, pipe outputpipe, arraylist& resultlist, executioncontext context) @ system.management.automation.statementlistnode.execute(array input, pipe outputpipe, arraylist& resultlist, executioncontext context) ... the script using windows forms - not sure if relevant? ed...

objective c - record live streaming audio -

i'm making app has play , record streaming audio internet on ipad. streaming of audio done, have come recording part , don't have idea on how proceed. could give me hint??? idea? have play while simultaneously recording aac or mp3. thanks. you'll need use lower-level audioqueue api, , use audiosession api set audio session. then you'll need fill out audiostreambasicdescription struct , create new input queue audioqueuenewinput() , include callback function handling input buffers. and you'll need create 3 buffers using audioqueueallocatebuffer() , audioqueueenqueuebuffer() . , ready call audioqueuestart() . should handle audio session interruptions, , handle stopping audio queue. that stream of buffers containing uncompressed 16-bit integer pcm audio data. still need compress data, can of worms involves using audioconverter api, haven't done on iphone os don't know work there.

vba - equivalent vb code for a java code -

can tell me java code do? securerandom random = securerandom.getinstance("sha1prng"); byte[] bytes = new byte[20]; synchronized (random) { random.nextbytes(bytes); } return base64.encode(bytes); step step explanation useful can recreate code in vb. thanks using code snippets can this dim randomnumgen randomnumbergenerator = rngcryptoserviceprovider.create() dim randombytes(20) byte randomnumgen.getbytes(randombytes) return convert.tobase64string(randombytes)

jquery - How do I make custom scrollbars with jScrollPane to be always visible? -

i have scrollbars using jscrollpane plug-in jquery. the scrollbar works, content ajax, every 'page' load, add re-initialization of scrollbars. when content shorter page, scrollbars not visible. this results in 10px space content, , annoying items using 100% of available space. anyone idea how make scrollbars visible when content not available? or alternative css way reserve space fine. if nobody finds better solution, i can modified jscrollpane plugin, show "track" bar, , if going hide scrollbar (because content smaller view) not append 'drag' bar. though not clean option. it should taken further, , disable / re-enable down buttons, adding css functionality not hover/active state's when disabled... better usability. still looking forward possible better solution, though feel have come possible solution there none out of box

java - Synchronized block equivalent to static synchronized method? -

when have method such following: public synchronized void addone() { a++; } it equivalent following: (correct me if i'm wrong) public void addone() { synchronized(this) { a++; } } but equivalent following method?: public static synchronized void addone() { a++; // (in case 'a' must static) } what synchronized block acts same static synchronized method? understand static synchronized method synchronized on class , not instance (since there no instance), syntax that? it equivalent locking on class object. can reference class object writing class name followed .class . so, like: synchronized(yourclass.class) { } see java language specification, section 8.4.3.6 synchronized methods : a synchronized method acquires lock (§17.1) before executes. class (static) method, lock associated class object method's class used. instance method, lock associated (the object method invoked) used.

How do I check whether a file exists using Python? -

how check whether file exists, without using try statement? if reason you're checking can if file_exists: open_it() , it's safer use try around attempt open it. checking , opening risks file being deleted or moved or between when check , when try open it. if you're not planning open file immediately, can use os.path.isfile return true if path existing regular file. follows symbolic links, both islink() , isfile() can true same path. import os.path os.path.isfile(fname) if need sure it's file. starting python 3.4, pathlib module offers object-oriented approach (backported pathlib2 in python 2.7): from pathlib import path my_file = path("/path/to/file") if my_file.is_file(): # file exists to check directory, do: if my_file.is_dir(): # directory exists to check whether path object exists independently of whether file or directory, use exists() : if my_file.exists(): # path exists you can use resolve() ...

optimization - How do I tell how much memory / resources is my php script using up? -

hi guys i'm debugging application here , in nutshell - application dying out on online server or maybe server dying out. have checked application 3 different servers , exhibited similar results, application run while of sudden once i'd opening more , more requests i'd network error or site fail load. i'm suspecting code here need find out how can make less resource intensive infact don't know why doing in first place. runs ok on localhost machine though. or because i'm hosting on technically shared host? should specialised hosting hosting application? there lot of complex database queries , ajax requests in application here. as far checking how memory script using can periodically call memory_get_usage(true) @ points in code identify parts of script using memory. memory_get_peak_usage(true) returns max amount of memory used. you application runs ok while. single script running time, or many different page requests / visitors? there max_execu...

opengl - UV mapping for a dome? -

i trying understand how can change uv mapping of dome, need different texture map projection 1 coded below: protected final void createdome(final float radius) { int lats=16; int longs=16; gl11.glenable(gl11.gl_texture_2d); gl11.glbindtexture(gl11.gl_texture_2d, textures2x4[0].gettextureid()); int i, j; int halflats = lats / 2; for(i = 0; <= halflats; i++) { double lat0 = mathutils.pi * (-0.5 + (double) (i - 1) / lats); double z0 = math.sin(lat0)* radius; double zr0 = math.cos(lat0)* radius; double lat1 = mathutils.pi * (-0.5 + (double) / lats); double z1 = math.sin(lat1)* radius; double zr1 = math.cos(lat1)* radius; gl11.glbegin(gl11.gl_quad_strip); for(j = 0; j <= longs; j++) { double lng = 2 * mathutils.pi * (double) (j - 1) / longs; double x = math.cos(lng); double y = math.sin(lng); ...

security - What techniques do you use when writing your own cryptography methods? -

for years, maybe 10, i've been fascinated cryptography. read book xor bit-based encryption, , have been hooked ever since thing. i guess it's more fair i'm fascinated can break various encryption methods, digress. to point -- methods use when writing cryptography? obfuscation in cryptography? i use 2 key-based xor encryption, various hashing techniques (sha1) on keys, , simple things such reversing strings here , there, etc. i'm interested see others think of , try when writing not-so-out-of-the-box encryption method. -- info on how pros go "breaking" various cryptography techniques interesting well. to clarify -- have no desire use in production code, or code of mine matter. i'm interesting in learning how works through toying around, not reinventing wheel. :) ian to contradict else has said far, go it! yeah, code might have buffer overflow vulnerabilities in it, , may slow, buggy, etc, you're doing fun ! understand recreat...

evc - Fix for fatal error C1083 -

we have set of nightly builds build of full suite of software using embedded visual c++ batch files. there total of 30 builds done. every night @ least 1 or 2 builds fail following error: c:\lc\trunk\server\can\svcangettracedrivelength.cpp(11) : fatal error c1083: cannot open precompiled header file: 'sh4rel/canwce.pch': permission denied it never same file or precompile header fails , same executable. far know nothing else happening on build machine. does have fix make our nightly builds run more reliably? try running in visual ide; easier catch way. you sure don't have multiple compiler instances working on several builds @ once? 1 building project/lib/whatever while trying access it?

design - What are some great online database modeling tools? -

what's favorite open source database design/modeling tool? i'm looking 1 supports several databases, firebird sql can't find 1 on google. i've used dbdesigner before. open source tool. might check out. not sure if fits needs. best of luck!

optimization - Does an index < or > MySQL queries? -

if have query like, delete table datetime_field < '2008-01-01 00:00:00' does having datetime_field column indexed help? i.e. index useful when using equality (or inequality) testing, or useful when doing ordered comparison well? (suggestions better executing query, without recreating table, ok!) maybe. in general, if there such index, use range scan on index if there no "better" index on query. however, if optimiser decides range end being big (i.e. include more than, 1/3 of rows), won't use index @ all, table scan faster. use explain (on select; can't explain delete) determine decision in specific case. depend upon how many rows there in table what range you're specifying what else specified in clause. won't use range scan of 1 index if there index "looks better".

Java creating max 3 objects of a class -

when want create 1 object of class, use singleton design pattern. want create maximum 3 or 5 objects of class. there way restrict maximum number of object creation in java? of course implement singleton-like feature rather easily, you're apparently looking object pool . there many implementations of such pools, notable 1 apache commons/pool

Ruby Split By Part of a Regex -

i have write argument parser, passed in string ala {a, b, c} delimiter comma space after it, can escaped pipe "|" before it. thinking of writing regex /[^\|], / split by, , removing escape characters afterwards. when using split character before delimiter well. how should go accomplishing i'm looking for? if you're on version 1.9 of ruby, can split on /(?<!\|),/ . (?<!\|) negative lookbehind assertion meaning "ensure previous character not | ".

python - How to overload __init__ method based on argument type? -

let's have class has member called data list. i want able initialize class with, example, filename (which contains data initialize list) or actual list. what's technique doing this? do check type looking @ __class__ ? is there trick might missing? i'm used c++ overloading argument type easy. a neater way 'alternate constructors' use classmethods. instance: >>> class mydata: ... def __init__(self, data): ... "initialize mydata sequence" ... self.data = data ... ... @classmethod ... def fromfilename(cls, filename): ... "initialize mydata file" ... data = open(filename).readlines() ... return cls(data) ... ... @classmethod ... def fromdict(cls, datadict): ... "initialize mydata dict's items" ... return cls(datadict.items()) ... >>> mydata([1, 2, 3]).data [1, 2, 3] >>> mydata.fromfilename("/tmp...

html - middle click (new tabs) and javascript links -

i in charge of website @ work , have added ajaxy requests make faster , more responsive. has raised issue. on pages, there index table on left, menu. once have clicked on it, makes request fills rest of page. @ anytime can click on item of index load different page. before adding javascript, possible middle click (open new tabs) each item of index, allowed have other pages loading while dealing 1 of them. since have changed links ajax requests, execute javascript instead of being real links. opening empty tabs when middle click on them. is there way combine both functionalities: links firing javascript when left clicked or new tabs when middle clicked? have ugly javascript catches every clicks , deal them accordingly? thanks. yes. instead of: <a href="javascript:code">...</a> do this: <a href="/non/ajax/display/page" id="thislink">...</a> and in js, hook link via it's id ajax call. remember need stop...

java - Should I return null from or apply the "null object" pattern to a function returning a Date? -

let's have function returns date: date myfunc(parama, paramb){ //conditionally return date? } is appropriate return null function? seems ugly because forces clients check null . the "null object" pattern implementation pattern addresses concern. i'm not huge fan of null object pattern, yes, makes sense return list, if empty, rather return null . however, in java, null date 1 cleared , has year 1970. what best implementation pattern here? the null object pattern not trying do. pattern creating object no functionality in it's implementation can pass given function requires object not being null. example nullprogressmonitor in eclipse, empty implementation of iprogressmonitor . if return "null" date, 1970, clients still need check if it's "null" seeing if it's 1970. , if don't, misbehaviour happen. however, if return null, code fail fast, , they'll know should check null. also, 1970 could valid date....

MsBuild: Read part of the file using ReadLinesFromFile -

i need read xml file. use following code: <itemgroup> <sourcexsltfile include="sourcefile.xml" /> </itemgroup> <readlinesfromfile file="@(sourcexsltfile)"> <output taskparameter="lines" itemname="filecontents" /> </readlinesfromfile> but need part of file's content copied resides inside <xsl> tag. any ideas? http://msbuildtasks.tigris.org/ - use regexmatch task - <xsl\b[^>]*>(.*?)</xsl> (not sure exact correctness though). write own custom task

visual studio - How do you manage .vcproj files in source control which are changed by multiple developers? -

we use subversion our source control system , store visualstudio project files (vcproj) in source control system normal think. subversion don't use form of file locking, if 2 developers working on same project @ same time , both add files project, or change settings, second 1 commit has merge changes. how merge these changes? the vcproj files text files possible edit them hand not amenable hand editing, junior developers. the ways can think of are get latest version svn , re-add local changes manually edit file hand resolve conflicts automatic merge implement form of locking scheme prevent simultaneous changes have agreement between developers not make simultaneous changes currently using first option of re-adding changes manually time consuming , wondering if there better way. with source files automatic merge feature works of time , don't many conflicts. i've found option 2 (edit files hand) works well, long you're using diff tool (i use...

database - SQL Server 2005 Performance: Distinct or full table in WHERE IN statement -

we have 2 tables: document: id, title, document_type_id, showon_id documenttype: id, name relationship: documenttype hasmany documents. (document.document_type_id = documenttype.id) we wish retrieve list of document types 1 given showon_id. we see 2 possiblities: select documenttype.* documenttype documenttype.id in ( select distinct document.document_type_id document showon_id = 42 ); select documenttype.* documenttype documenttype.id in ( select document.document_type_id document showon_id = 42 ); our question is: when , if better use distinct smaller record set versus retrieving whole table , in statement walking table first match. (we guess that's ;-)) is different different databases, there common answer? or there better way of doing it? (we in .net land) from point of view should not make difference inside sql server (but knows how implemented). think of way: return resultset server needs go document table , retrieve document_type_id ...

kernighan and ritchie - How should I learn C? -

i'm interested in learning c. have read k & r , , have done simple c extension work in r , python. what's worthwhile project idea doing more substantial c? online resources, similar dive python ? in particular, resources focused on programmers know newer languages trying learn c (that mention things "asking array length nonsense in c, lazy pythonista"). my background: math/stats, day day programming in python, r, around natural-language-processing, algorithms, , like. have @ after k&r book use learn programming in plain c?

.net - SQL Server SMO take back up locally from remote server -

my question straight forward, how can program sql smo take local backup, connecting remote server. want save bak file local machine connecting remote server. want users privilege able save backups locally. you cannot - period. backups of sql server can only saved local disk - local sql server itself. you cannot tricks or tools backup remote sql server local harddisk. can't it.

How do I log an exception at warning- or info-level with traceback using the python logging framework? -

using this: try: # something... except exception excep: logger = logging.getlogger("component") logger.warning("something raised exception: " + excep) logger.info("something raised exception: " + excep) i rather not have on error-level cause in special case not error. from logging documentation : there 3 keyword arguments in kwargs inspected: exc_info , stack_info , , extra . if exc_info not evaluate false, causes exception information added logging message. if exception tuple (in format returned sys.exc_info() ) or exception instance provided, used; otherwise, sys.exc_info() called exception information. so do: logger.warning("something raised exception:", exc_info=true)

compatibility - can i use bdb(berkeley db) file created by c implementation (python bsddb) by oracle berkeley db java edition? -

i have berkeley db file (*.bdb) created c implementation(python bsddb module). possible read file pure java implementation of berkeley db? tried read using berkeley db java edition (je) not. je throws out exception saying not detect berkeley database. berkeley db files not inter operable across different implementations? if so, why? no. according berkeley db java edition faq , berkeley db , berkeley db java edition not compatible 1 because have different file layout structure.

Scope issue - Controlling a movieclip inside a button with actionscript -

i'm trying show/hide movieclip (or graphic) symbol on layer of button symbol using actionscript 2. here's tried in actions button: on (release) { this.button_name.movieclip_name._alpha = 0; trace(this.button_name.movieclip_name); } and trace returns undefined ... think i've got problem understanding how address child element. not flash programmer... hacking on @ moment side project, don't understand how works. thanks, jim :) for as2, it's not idea put movieclips inside buttons. easiest , direct approach restructure things button , movieclip had inside @ same level, perhaps within new mc created contain them. should think of button symbol thing provides clickable hit state, not container other things. as followup, yep, can indeed use movieclips buttons. if give mc functions handle button-like events (onpress, onrelease, onreleaseoutside , on), functions called on button. can control finer details - see docs on movieclip.hitarea , movieclip.us...

ClickOnce: getting MSVCRT C++ DLLs on user's machine -

i've been trying desperately application (15 c# dlls , 1 c++/cli dll c++ runtime dll dependencies) deploy clickonce. got work just copying release folder , clickonce refuses copy files (msvcm80.dll, msvcp80.dll , msvcr80.dll) , deploy them in folder. i did nutty workaround (supply msvcm80.dll, msvcp80.dll , msvcr80.dll content/copy if newer , @ startup, create microsoft.vc80.crt folder, copy dlls, , create microsoft.vc80.crt.manifest) seems work, feels wrong me. am missing something? i'm stupid: found this: on publish tab of properties page of startup project: click prerequisites... button > check visual c++ runtime libraries, radio button setting: download prerequisites component vendor's web site. it seems work way 1 might expect!

grails - I'm getting a NullPointerException when accessing static constraints -

the code ${personrequest.constraints.requeststatus.inlist} in gsp file throws nullpointerexception , new personrequest().constraints.. works. why? isn't constraints static? copied here (grails-user mailing list) but why accesing static fields doesnt work? because "constraints" static field closure property. has no sub-properties relating constraints. grails evaluates closure using constraint builder monitors "calls" methods don't exist, i.e. property names use: type( inlist: [xxxxx]) ...causes method call "type" map parameter containing "inlist" ==> value. from info, grails builds list of constraints available , binds them future instances of domain class. so, when access user.constraints statically, getting a closure. we -could- @ replacing value of static constraints property @ runtime after evaluating closure initialized wi...

c# - What's the hardest or most misunderstood aspect of LINQ? -

background: on next month, i'll giving 3 talks or @ least including linq in context of c# . i'd know topics worth giving fair amount of attention to, based on people may find hard understand, or may have mistaken impression of. won't talking linq sql or entity framework except examples of how queries can executed remotely using expression trees (and iqueryable ). so, have found hard linq ? have seen in terms of misunderstandings? examples might of following, please don't limit yourself! how c# compiler treats query expressions lambda expressions expression trees extension methods anonymous types iqueryable deferred vs immediate execution streaming vs buffered execution (e.g. orderby deferred buffered) implicitly typed local variables reading complex generic signatures (e.g. enumerable.join ) delayed execution

w3c - What is the state of native SVG support in the most popular browsers? -

what state of native svg support in popular browsers in latest releases? internet explorer firefox opera safari chrome konqueror camino ie has svg support in ie9 not in ie8 , below. alternative vml mozilla claims support on latest version opera claims support since v8.0 safari has experimental support (probably incomplete) chrome seems have same level of svg support safari konqueror uses same svg engine safari , chrome - ksvg claims in beta. fact have todo list implies it's not ready production camino apparently supports svg well

eclipse - Blackberry extrenal library problem (module not found) -

i using eclipse. when add external jar (import it.sauronsoftware.ftp4j.*;) seems ok, reference external jar right clicking project , properties. when instantiate ftpclient opbject , run in simulator "module not found". somebody on different forum suggested creating new library , adding jar it, reference library dependency in main bb project. downside library must installed along compiled bb app , dont want this. there way import third party libs eclipse blackberry plugin make work? thanks my solution (for eclipse plugin): generate/get *.jar file. preverify *.jar file using preverify tool (it's in jde_dir\components\bin): preverify -classpath {jde.home}\lib\net_rim_api.jar {output.file} -d {output.dir} above command produce preverified *.jar in: {output.dir}\output\ in eclipse: add preverified *.jar build path: (right click on project -> libraries -> add jars) export *.jar: (right click on project -> libraries ->order , export -...

multithreading - Please can someone give me a simple example of how to use System.Monitor in C#? -

i find system.monitor confusing, although understand threading, locks, deadlocks, race conditions, dining philosophers , jazz. use manualresetevent() inter-thread co-ordination, know that's heavyweight kernel object, , system.monitor (enter/pulse, etc.) more efficient. i've googled , googled cannot find sensible example. i grateful if crew explain potentially wonderful construct me :-) here's simple example; call wait releases lock (allowing worker obtain it) , adds main thread lock-object's pending queue. worker obtains lock, , calls pulse : moves main thread lock-object's ready queue. when worker releases lock, main can resume work. note lock(obj) {...} compiler-candy monitor.enter / monitor.exit in try/finally block. [edit: changed sample move lock(sync) earlier, avoid (unlikely) risk of missed pulse] static void main() { object sync = new object(); lock (sync) { threadpool.queueuserwor...

Installing a rails plugin from a Git repository -

i've been trying install shoulda script/plugin install git://github.com/thoughtbot/shoulda.git but is: removing: c:/documents , settings/danny/my documents/projects/ruby on rails/_projectname_/vendor/plugins/shoulda/.git > and vender/plugins directory empty. have rails 2.1.1 installed gem , have verified 2.1.1 loaded (using puts inserted config/boot.rb). ideas what's going on? (this on windows box) do have git installed? if don't, not work. rails assumes git installed , can found in path. you can git windows here .

My script works fine on static content, but breaks when the content is changed via AJAX - jQuery -

i writing custom calendar, consists of 2 parts, 1 div showing month grid, , second div showing events selected date. current month's calendar grid loads automatically, , display of daily events works correctly. however, when user clicks button view next or previous month, clicking on dates no longer works. also, changing month no longer works on dynamically-loaded calendar. this jquery code using: <script type="text/javascript"> $(document).ready( function() { $('div.calendar_events').text('to view events on of highlighted dates, click date.'); $('div.number').click( function(e) { e.preventdefault(); var thedate = $(this).attr('id').split('-'); $('div.calendar_events').load('ajax/calendar_events.php?month=' + thedate[1] + '&day=' + thedate[2] + '&year=' + thedate[3]); }); $('a.changemonth...

javascript - Iterating through a Dictionary to add to another -

i trying loop through each value in dictionary , go out , dictionary based on 1 of objects in first dictionary through each loop iteration: var dalbumphotos = {}; // holds list of photo objects var dalbumsandphotos = {}; // hold album | dalbumphotos each album for(var in dalbums) { dalbumphotos = getphotosforalbum(userid, accesstoken, a.id); dalbumsandphotos(a) = dalbumphotos; } i'm not quite sure how without index. need increment through dalbumphotos , append final dictionary album , it's dalbumphotos it looks you're using associative array in javascript should able change last bit of code be: for(var in dalbums) { dalbumphotos = getphotosforalbum(userid, accesstoken, dalbums[a].id); dalbumsandphotos[a] = dalbumphotos; }

user interface - Which language for a quick GUI app + sqlite database CRUD (2-4 tables) -

which language quick gui app + sqlite database crud (2-4 tables). java, python? (please no jokes vbasic), reference, source code on? added: first idea: 1 database sqlite (win) + client gui app (win) clients table + orders table + others import, export database add, del, edit, etc. entries second idea: 1 hosted database (postgresql ,mysql) + web app client clients table + orders table + others import, export database add, del, edit, etc. entries thinking django, ror or local java(netbeans), python(wxpython+orm). ??? ruby on rails simple crud operations very - although doing more can little more complex (would require reading ror's way of doing things). latest version of rails automatically uses sqlite databases, , in fact whole database, , crud gui code can created 1 command ( scaffold ). if deployed can bit more difficult (although hear capistrano good) - local or intranet use that's i'd do.

documentation - Doxygen and Assembly Language -

i'd use doxygen document legacy code that's mix of c , x86 assembly language. assembly language not inline, in separate assembly-only files. recommended way deal assembly language portion? see question 12 of doxygen faq . dealing pure assembly files, or inline assembly inside c sources? assuming former, you'll have either write input filter transform assembly code c-like (easier), or write new parser (much harder).

javascript - Permission denied to get property HTMLDocument.body -

i doing hidden http post in 1 page of application login application via iframe. in iframe able access functions of application encounter javascript permission denied property htmldocument.body in application when try save , update contents. any reasons weird behaviour , how resolve issue? yes referencing domain. there anyway work around issue? does iframe reference domain? if does, you're hitting browser's cross-site scripting defence.

c# - Update database n:n -

i have 2 classes: public class richman { public string id {get;set;} list<car> _cars=new list<car>(); { public list<car> cars { { return this._cars; } set { this._cars = value; notifychanged("email"); } } } and public class car { public string id {get;set;} } and 3 tables: richman id int cars: id int , carsofrichmen idcar int (fk) idrichman (fk) if collection of cars of richamn change how on database ? delete records carsofrichmen idrichman id of richam, , in foreach add realtions carsofrichmen ? is practice ? no, it's not practice. cars can have other linked information; changes in cars can trigger other actions. you must add/delete/update relevant cars [edit] and/or carsofrichmen...

.net - Using events declared in Visual Basic 6.0 in a dotnet application -

we writing tests com library written in vb 6.0.the problem facing that, unable access events declared in vb( withevents). exception, "object not support set of events". how can overcome problem? your mocking framework problem here. mock object returned call: repository.dynamicmock<personlib.databasecommand>(); implements databasecommand class's interface, not mock events. therefore, when pass instance of mock object vb6 code, expects receive databasecommand object can raise events, won't work. when pass mock object personclass.init method, here simplified version of happening: the code gets line in personclass.init : set dbcommand = vdbcommand vb6 asks object on right-hand side of set statement if supports same events databasecommand class (vb6 because declared dbcommand withevents keyword, try set event sink receive events dbcommand object). the object passed in, however, being mock object , not real databasecommand object, doe...

asp.net - In linq how to work on Storprocedure -

i work on northwind database.server ms2008.in linq active sp show me bellow error: syntax : <dxwgv:aspxgridview id="aspxgridview1" runat="server" autogeneratecolumns="false" datasourceid="linqservermodedatasource1" keyfieldname="categoryid"> <columns> <dxwgv:gridviewcommandcolumn visibleindex="0"> <editbutton visible="true"> </editbutton> <newbutton visible="true"> </newbutton> <deletebutton visible="true"> </deletebutton> </dxwgv:gridviewcommandcolumn> <dxwgv:gridviewdatatextcolumn caption="categoryid" fieldname="categoryid" visibleindex="1"> </dxwgv:gr...

project management - How to prioritize future features (enterprise web development) -

suppose you're product manager internal enterprise web application has 2000 users , 7 developers. have list of 350 future features, each ranging 5 150 developer days of work. how choose features work on, , how run release process? here's i'm thinking: (skip if boring) release process. work on several features @ once, release each individually when it's ready. other option (what we've been doing point) pick out set of features, designate them "a release", , release them @ once (announcing via mass email). the advantage of shorter release process can release features finish development. advantage of bigger process it's easier organize. feature prioritization. put future features in spreadsheet columns feature, description, comments, estimate, benefit, (your) estimate, (your) benefit. give copies 2 senior engineers, other senior project manager , yourself. the engineers estimate features (how precisely? consulting each other?). determine...

pointers - Updating 1object appears to also update another. VB.Net -

i having problem in website have 2 objects held in session, both object structured differently , not have links each other (not intentionally). both objects however, have collection of "travellers". trying modify 1 collection adding or removing "travellers", when finish button clicked, modified collection saved other object. the problem reason when modify 1 collection in 1 object, modifications made collection in other object. here's rough example: dim bookingcontext bookingcontext = session("bookingcontext") dim personsearchcontext personsearchcontext = session("personsearchcontext") dim personid integer = request.form("personid") dim mode string = request.form("mode") select case mode case "add" each traveller personprofile in personsearchcontext.travellers if traveller.personid = personid personsearchcontext.selectedtravellers.add(traveller) ex...

python - Getting user input -

i running this: import csv import sys reader = csv.reader(open(sys.argv[0], "rb")) row in reader: print row and in response: ['import csv'] ['import sys'] ['reader = csv.reader(open(sys.argv[0]', ' "rb"))'] ['for row in reader:'] [' print row'] >>> for sys.argv[0] prompt me enter filename. how prompt me enter filename? in python 3.x, use input() instead of raw_input()

c++ - Most elegant looping construct? -

sorry newb question. i'm still learning programming. i'm using c++, , need this: int n; { n = get_data(); if(n != -1) send(n); } while(n != -1); this sketch. anyway doesn't feel real elegant. have have test twice. test once , set flag, doesn't feel real elegant either since have check flag twice. seems there should way more easily, since it's easy want do. int n; while (-1 != (n = get_data())) { send(n); } // while

html - Disc to left of list item is displayed at bottom -

Image
screenshot of happening: it list item within underordered list, happening in ie7 , else. <ul> <li>filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text. filler text.</li> </ul> .fancybox-entry.computer-policy li { float:none; width:100%; list-style-type:disc; margin-bottom:10px; } .fancybox-entry.computer-policy ul + p { margin-bottom:20px; } .fancybox-entry.computer-policy ul { margin:5px 0 10px 25px; } any why doing , fix appreciated. it appears width css property triggers haslayout li element in ie7. first try removing width:100%; declaration make sure bullet appears in correct place. if can't without width property, can use position: relative; , vertical-align: t...

java - convert the output of PinField.getPassword() to string -

if ("submit".equals(cmd)) { //process password. string usernameinput=username.gettext(); ///////////////////////////////error pin when printed shows error///////////////////////////// char[] pininput = pinfield.getpassword(); string pininput=pininput.tostring(); //for debugging , print pininput , prints garbage system.out.println("pin entered "+pininput); //pininput has garabage instead of pin entered //so function ispasswordcorrect fails verify username & pin if (ispasswordcorrect(usernameinput,pininput)) { //some tasks } } boolean ispasswordcorrect(string username,string pin) { //verify username & pin } i need convert pininput character array string, can use function ispasswordcorrect() . when use tostring() method , produces garbage value , should convert value of pininput string...

iis - ASP.NET URL validation -

we have custom rest handler on asp.net configured handle incoming requests: <add path="*" verb="*" type="rest.restprotocolhandler"/> however, passing pipe character, encoded or not @ all, triggers validation error seems come inside asp.net. accessing http://localhost:8080/%7c or http://localhost:8080/| yields error: [argumentexception: illegal characters in path.] system.io.path.checkinvalidpathchars(string path) +7489125 system.io.path.combine(string path1, string path2) +40 system.web.configuration.usermappath.getphysicalpathforpath(string path, virtualdirectorymapping mapping) +114 system.web.configuration.usermappath.getpathconfigfilename(string siteid, virtualpath path, string& directory, string& basename) +72 system.web.configuration.usermappath.mappath(string siteid, virtualpath path) +30 system.web.configuration.usermappath.mappath(string siteid, string path) +31 system.web.hosting.hos...

git - Is there an "impact graph" tool for non-GitHub projects? -

are there tools build impact graph of github's, can run on repos aren't on github? maybe spits out nice png or <canvas> -based html file? raphaƫl.js javascript library manipulationg interactive svg. have demo impact graph : http://raphaeljs.com/github/impact.html

How to paste tabular data into an HTML table -

i have html table on webpage , can edit contents manually. however, make life easier if can copy data file clipboard , paste in onto form. can bhos in ie this? pointers helpful. i have superset of data in file , don't want type webpage. if file can saved csv (using excel or other program), can use tool such 1 here (or write own) convert html.

double click - Cannot get itemDoubleClick event to work in Flex (even with doubleClickEnabled=true) -

i trying simple datagrid in flex doubleclick event, cannot itemdoubleclick fire: <mx:datagrid id="gridreportconversions" height="100%" width="100%" mouseenabled="true" doubleclickenabled="true" itemdoubleclick="refererrowdoubleclicked(event)"> <mx:columns> <mx:datagridcolumn width="75" datafield="qty" headertext="qty" /> <mx:datagridcolumn datafield="referer" headertext="url" /> </mx:columns> </mx:datagrid> if use itemclicked event event raised fine. when search problem find many people saying 'you need set doubleclickenabled=true , i've done , still doesn't work. this control nested within quite few levels of vbox , other containers. surely dont need set doubleclickenabled on each of containers i? just clarify ho...