text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
What is reflection, and why is it useful? I'm particularly interested in Java, but I assume the principles are the same in any language. The name reflection is used to describe code which is able to inspect other code in the same system (or itself). For example, say you have an object of an unknown type in Java, and you would like to call a 'doSomething' method on it if one exists. Java's static typing system isn't really designed to support this unless the object conforms to a known interface, but using reflection, your code can look at the object and find out
[ 0.5497502684593201, 0.044309478253126144, -0.28117015957832336, 0.12011632323265076, -0.5074552297592163, -0.2580319046974182, 0.3048868775367737, -0.18157625198364258, 0.011029992252588272, -0.4840736985206604, 0.45703744888305664, 0.4897489547729492, -0.30047255754470825, -0.008113149553...
if it has a method called 'doSomething' and then call it if you want to. So, to give you a code example of this in Java (imagine the object in question is foo) : ``` Method method = foo.getClass().getMethod("doSomething", null); method.invoke(foo, null); ``` One very common use case in Java is the usage with annotations. JUnit 4, for example, will use reflection to look through your classes for methods tagged with the @Test annotation, and will then call them when running the unit test. There are some good reflection examples to get you started at <http://docs.oracle.com/javase/tutorial/reflect/index.html> And finally, yes, the concepts are pretty much similar in other statically
[ 0.3947080671787262, -0.15725351870059967, -0.2065654993057251, -0.03896408900618553, -0.4593070149421692, -0.2247162014245987, 0.2484983503818512, -0.4492744207382202, 0.13913331925868988, -0.5794327259063721, 0.2526693344116211, 0.8142974972724915, -0.19198310375213623, -0.160154744982719...
typed languages which support reflection (like C#). In dynamically typed languages, the use case described above is less necessary (since the compiler will allow any method to be called on any object, failing at runtime if it does not exist), but the second case of looking for methods which are marked or work in a certain way is still common. **Update from a comment:** > The ability to inspect the code in the system and see object types is > not reflection, but rather Type Introspection. Reflection is then the > ability to make modifications at runtime by making use of >
[ 0.08966364711523056, -0.04173107445240021, -0.0468582846224308, 0.2928951680660248, -0.5226852893829346, -0.11277076601982117, 0.34186071157455444, -0.1936783790588379, 0.005748338997364044, -0.49138522148132324, 0.020588649436831474, 0.554253339767456, -0.46826961636543274, -0.36741682887...
introspection. The distinction is necessary here as some languages > support introspection, but do not support reflection. One such example > is C++
[ 0.0902976468205452, 0.12369921803474426, -0.1705799698829651, 0.2893946170806885, -0.14082318544387817, -0.012974414974451065, 0.20086227357387543, 0.1849995255470276, 0.053345710039138794, -0.4427376687526703, -0.03945215046405792, 0.48937323689460754, -0.42303961515426636, -0.24391189217...
When **Eclipse** creates a new file (**.c** or **.h** file) in a C project the editor always auto creates a `#define` at the top of the file like this: If the file is named 'myCFile.c' there will be a `#define` at the start of the file like this ``` #ifndef MYCFILE_C_ #define MYCFILE_C_ ``` I have seen other editors do this as well (Codewright and SlikEdit I think). The `#defines` don't seem to do anything for the editor as I can just delete them without any problem, and I can't think of a reason why *I* would want to use them. Does anyone know why
[ 0.4696519374847412, 0.161026269197464, -0.028696997091174126, 0.03305194526910782, -0.24941660463809967, -0.3828919231891632, -0.09037325531244278, 0.2915244996547699, -0.17269302904605865, -0.6098867654800415, -0.06294554471969604, 0.4209055006504059, -0.09862713515758514, 0.0842354744672...
they are there? It's to guard against [multiple definitions](http://www.fredosaurus.com/notes-cpp/preprocessor/ifdef.html).
[ 0.5302028059959412, 0.3160158395767212, -0.061041269451379776, 0.32523226737976074, -0.035142432898283005, -0.09664996713399887, 0.28605759143829346, 0.31983670592308044, -0.4887177646160126, -0.08386742323637009, 0.03518272936344147, 0.1375981867313385, -0.08124158531427383, 0.19103692471...
I am using the function below to match URLs inside a given text and replace them for HTML links. The regular expression is working great, but currently I am only replacing the first match. How I can replace all the URL? I guess I should be using the *exec* command, but I did not really figure how to do it. ``` function replaceURLWithHTMLLinks(text) { var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i; return text.replace(exp,"<a href='$1'>$1</a>"); } ``` First off, rolling your own regexp to parse URLs is a *terrible idea*. You must imagine this is a common enough problem that someone has written,
[ 0.21970659494400024, 0.14087402820587158, 0.90447598695755, -0.1890614926815033, 0.10645689070224762, -0.12870314717292786, 0.3836109936237335, -0.023048030212521553, -0.28564852476119995, -0.5549284815788269, -0.05166325345635414, 0.8573744297027588, -0.5666466355323792, 0.116607598960399...
debugged and [tested](http://benalman.com/code/test/js-linkify/) a library for it, according to [the RFCs](https://metacpan.org/pod/Regexp::Common::URI#REFERENCES). **URIs are complex** - check out the [code for URL parsing in Node.js](https://github.com/joyent/node/blob/master/lib/url.js) and the Wikipedia page on [URI schemes](http://en.wikipedia.org/wiki/URI_scheme). There are a ton of edge cases when it comes to parsing URLs: [international domain names](http://en.wikipedia.org/wiki/Top-level_domain#IDN_test_domains), actual (`.museum`) vs. nonexistent (`.etc`) TLDs, weird punctuation including [parentheses](http://www.codinghorror.com/blog/2008/10/the-problem-with-urls.html), punctuation at the end of the URL, IPV6 hostnames etc. I've looked at [a ton](https://github.com/search?l=JavaScript&q=linkify&ref=cmdform&search_target=global&type=Repositories) of [libraries](https://github.com/search?l=JavaScript&q=autolink&ref=cmdform&search_target=global&type=Repositories), and there are a few worth using despite some downsides: * Soapbox's [linkify](http://soapbox.github.io/jQuery-linkify/) has seen some serious effort put into it, and [a major refactor in June 2015](https://github.com/SoapBox/jQuery-linkify/pull/51) [removed
[ 0.295066773891449, -0.042155977338552475, 0.1638687551021576, 0.21328143775463104, -0.3133719563484192, -0.1357773393392563, 0.19969439506530762, -0.13744336366653442, -0.5046790838241577, -0.21705076098442078, -0.32559487223625183, 0.07120612263679504, -0.4322982430458069, 0.5326176285743...
the jQuery dependency](https://github.com/SoapBox/jQuery-linkify/issues/56). It still has [issues with IDNs](https://github.com/SoapBox/linkifyjs/issues/92). * [AnchorMe](http://alexcorvi.github.io/anchorme.js/) is a newcomer that [claims to be faster](https://github.com/ali-saleem/anchorme.js/issues/2) and leaner. Some [IDN issues](https://github.com/ali-saleem/anchorme.js/issues/1) as well. * [Autolinker.js](https://github.com/gregjacobs/Autolinker.js) lists features very specifically (e.g. *"Will properly handle HTML input. The utility will not change the `href` attribute inside anchor () tags"*). I'll thrown some tests at it when a [demo becomes available](https://github.com/gregjacobs/Autolinker.js/issues/138). Libraries that I've disqualified quickly for this task: * Django's urlize [didn't handle certain TLDs properly](https://github.com/ljosa/urlize.js/pull/18) (here is the official [list of valid TLDs](http://data.iana.org/TLD/tlds-alpha-by-domain.txt). [No demo](https://github.com/ljosa/urlize.js/issues/21). * [autolink-js](https://github.com/bryanwoods/autolink-js/issues/12) wouldn't detect "www.google.com" without http://, so it's not quite suitable for autolinking "casual URLs" (without a
[ -0.10320095717906952, 0.11949345469474792, 0.49363386631011963, -0.015159386210143566, -0.27476996183395386, -0.1484384685754776, 0.16649092733860016, -0.06543856114149094, -0.2146620899438858, -0.4076063930988312, -0.10723432153463364, 0.49643105268478394, -0.24841773509979248, -0.1046448...
scheme/protocol) found in plain text. * [Ben Alman's linkify](https://github.com/cowboy/javascript-linkify) hasn't been maintained since 2009. If you insist on a regular expression, the most comprehensive is the [URL regexp from Component](https://github.com/component/regexps/blob/master/index.js#L3), though it will falsely detect some non-existent two-letter TLDs by looking at it.
[ 0.4653058648109436, -0.13188926875591278, 0.6258343458175659, -0.34571799635887146, -0.19529245793819427, -0.45450833439826965, 0.49183955788612366, -0.04920307546854019, -0.5059546828269958, -0.3504214584827423, -0.19401927292346954, 0.19292041659355164, -0.37804919481277466, 0.0886829867...
Sorry for this not being a "real" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it. Does anybody know about that article? I believe that was on [thedailywtf.com](http://thedailywtf.com/Articles/Random-Stupidity.aspx) - ie. not something that you want to do. It is not possible to get a truly random number from pseudorandom numbers, no matter how many times you call randomize(). You *can* get "true" random numbers from special [hardware](http://en.wikipedia.org/wiki/Hardware_random_number_generator). You could also collect entropy from mouse movements and things like that.
[ 0.6903914213180542, 0.024630863219499588, -0.09415235370397568, 0.29567751288414, -0.1620696783065796, -0.33447930216789246, 0.227186381816864, 0.18396241962909698, -0.5802608132362366, -0.5517730116844177, 0.28089842200279236, 0.417482852935791, 0.1444692462682724, 0.16847188770771027, ...
I have the following code in a web.config file of the default IIS site. ``` <httpModules> <add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/> </httpModules> ``` Then when I setup and browse to a virtual directory I get this error Could not load file or assembly 'Charts' or one of its dependencies. The system cannot find the file specified. The virtual directory is inheriting the modules from the default web.config. How do you stop this inheritance? I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false. ``` <location path="." inheritInChildApplications="false"> <system.web> <httpModules> <add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/>
[ 0.3046819567680359, 0.20534759759902954, 0.30513450503349304, 0.028920229524374008, 0.11227430403232574, -0.1428339034318924, 0.3338080644607544, -0.4850332736968994, -0.09979891777038574, -0.9963974952697754, 0.18573875725269318, 0.2973036766052246, -0.14848589897155762, 0.306124418973922...
</httpModules> </system.web> </location> ``` Now any virtual directories will not inherit the settings in this location section. @GateKiller This isn't another website, its a virtual directory so inheritance does occur. @petrich I've had hit and miss results using `<remove />`. I have to remember to add it to every virtual directory which is a pain.
[ 0.2574117183685303, 0.20585909485816956, 0.334791362285614, -0.0590028390288353, -0.06994244456291199, -0.3362915515899658, 0.40298712253570557, 0.019091734662652016, -0.06602161377668381, -0.7352449297904968, -0.023758916184306145, 0.34385502338409424, -0.10840348899364471, 0.346044629812...
I'd like to be able to view the event `log` for a series of `asp.net` websites running on IIS. Can I do this externally, for example, through a web interface? No, but there are two solutions I would recommend: * Adiscon [EventLogger](http://www.eventreporter.com/en/) is a third-party product that will send your Windows EventLog to a SQL database. You can either send all events or create filters. Of course, once the events are in a SQL database, you can use any of the usual tools to create a web interface. * You can use ASP.NET's [HealthMonitoring](http://msdn.microsoft.com/en-us/library/ms998306.aspx) configuration section to configure .NET to send all ASP.NET-related
[ 0.36739739775657654, -0.3439009189605713, 0.14886529743671417, 0.15935948491096497, -0.09954956918954849, -0.340377539396286, 0.16173218190670013, 0.16727431118488312, -0.2410525530576706, -0.761837363243103, 0.21127259731292725, 0.4184361696243286, -0.13929378986358643, -0.012444765307009...
events directly to a SQL database. This covers exceptions, heartbeats, and a host of other event types. The [SqlWebEventProvider](http://msdn.microsoft.com/en-us/library/system.web.management.sqlwebeventprovider.aspx) is a cinch to setup.
[ 0.22707507014274597, -0.28108513355255127, 0.16234520077705383, 0.361211895942688, 0.14773768186569214, -0.3090359568595886, 0.03763691708445549, 0.0763321965932846, -0.3346019983291626, -0.39351436495780945, -0.33208709955215454, 0.31817400455474854, -0.29182225465774536, 0.07389096915721...
Can you please point to alternative data storage tools and give good reasons to use them instead of good-old relational databases? In my opinion, most applications rarely use the full power of SQL--it would be interesting to see how to build an SQL-free application. Plain text files in a filesystem * Very simple to create and edit * Easy for users to manipulate with simple tools (i.e. text editors, grep etc) * Efficient storage of binary documents --- XML or JSON files on disk * As above, but with a bit more ability to validate the structure. --- Spreadsheet / CSV file * Very easy model for business users to
[ 0.11660534143447876, 0.13538658618927002, -0.12616832554340363, 0.4627755582332611, 0.014187196269631386, -0.32859721779823303, -0.11900881677865982, 0.04330574721097946, -0.35599657893180847, -0.7308405041694641, -0.21447844803333282, 0.5370121598243713, -0.08097709715366364, -0.091439753...
understand --- Subversion (or similar disk based version control system) * Very good support for versioning of data --- [Berkeley DB](http://www.oracle.com/technology/products/berkeley-db/index.html) (Basically, a disk based hashtable) * Very simple conceptually (just un-typed key/value) * Quite fast * No administration overhead * Supports transactions I believe --- [Amazon's Simple DB](http://www.amazon.com/SimpleDB-AWS-Service-Pricing/b/ref=sc_fe_l_2?ie=UTF8&node=342335011&no=3435361&me=A36L942TSJ2AJA) * Much like Berkeley DB I believe, but hosted --- [Google's App Engine Datastore](http://code.google.com/appengine/docs/datastore/) * Hosted and highly scalable * Per document key-value storage (i.e. flexible data model) --- [CouchDB](http://incubator.apache.org/couchdb/) * Document focus * Simple storage of semi-structured / document based data --- Native language collections (stored in memory or serialised on disk) * Very tight language integration --- Custom (hand-written) storage engine * Potentially very high performance in required uses cases --- I can't claim to know anything
[ 0.14907337725162506, 0.09737814962863922, 0.23921261727809906, 0.05213942006230354, -0.19530794024467468, -0.24228456616401672, 0.3467971980571747, -0.20965124666690826, 0.12391342967748642, -0.7514779567718506, -0.0040350244380533695, 0.6496980786323547, -0.4571115970611572, -0.1214660704...
much about them, but you might also like to look into [object database systems](http://en.wikipedia.org/wiki/Object_database).
[ 0.4719063341617584, 0.011582110077142715, -0.19190828502178192, 0.18643827736377716, -0.04721435159444809, -0.28961890935897827, 0.2952533960342407, 0.5793615579605103, -0.6170805096626282, -0.47737208008766174, -0.10964371263980865, 0.3768732249736786, 0.3761391043663025, 0.24414096772670...
I want to show a chromeless modal window with a close button in the upper right corner. Is this possible? You'll pretty much have to roll your own Close button, but you can hide the window chrome completely using the WindowStyle attribute, like this: ``` <Window WindowStyle="None"> ``` That will still have a resize border. If you want to make the window non-resizable then add ResizeMode="NoResize" to the declaration.
[ 0.13989196717739105, 0.16555333137512207, 0.6701948642730713, -0.22765573859214783, 0.06646315008401871, -0.2399797886610031, 0.18980565667152405, -0.06915619969367981, -0.08290643990039825, -0.6545329689979553, -0.15518927574157715, 0.7512562870979309, -0.1658000499010086, 0.2337455153465...
I have seen lots of questions recently about WPF... * What is it? * What does it stand for? * How can I begin programming WPF? WPF is a new technology that will supersede Windows Forms. WPF stands for Windows Presentation Foundation Here are some useful topics on SO: 1. [What WPF books would you recommend](https://stackoverflow.com/questions/9591/what-wpf-books-would-you-recommend) 2. [What real world WPF applications are out there](https://stackoverflow.com/questions/7837/what-real-world-wpf-applications-are-out-there) From my practice I can say that WPF is a truly amazing technology however it takes some time to get used to because it's totally different from the WinForms. I would recommend you to take a look at this [demo](http://perseus.franklins.net/dnrtvplayer/player.aspx?ShowNum=0115).
[ 0.569688618183136, -0.21821880340576172, 0.22023820877075195, 0.19044987857341766, -0.052056316286325455, -0.5466870069503784, -0.015888987109065056, -0.2811867594718933, -0.22963611781597137, -0.6727598905563354, 0.041627053171396255, 0.4801354706287384, 0.05001545324921608, 0.00206582108...
I'm looking for some software that allows me to control a server based application, that is, there are bunch of interdependent processes that I'd like to be able to start up, shut down and monitor in a controller manner. I've come across programs like Autosys, but that's expensive and very much over the top for what I want. I've also seen [AppCtl](http://appctl.sourceforge.net/), but that seems not to handle dependencies. Maybe it would be possible to repurpose the init scripts? Oh, and as an added complication it should be able to run on a Solaris 10 or Linux box without installing any new
[ 0.26455581188201904, -0.07592758536338806, 0.24971388280391693, 0.255497545003891, -0.04872987046837807, -0.07552720606327057, 0.036867134273052216, 0.2879977524280548, -0.24000094830989838, -0.762277364730835, 0.02169746533036232, 0.671870231628418, -0.5254762172698975, -0.019028514623641...
binaries. On the boxes I've seen recently, that means shell scripts and Perl but not Python. Do any such programs exist or do I need to dust off my copy of Programming Perl? Try Supervise, which is what qmail uses to keep track of it's services/startup applications: <http://cr.yp.to/daemontools/supervise.html>
[ 0.7515203952789307, 0.03744800388813019, -0.1953456997871399, 0.20602595806121826, -0.20937494933605194, -0.07836814224720001, 0.22480738162994385, 0.36807534098625183, -0.46899116039276123, -0.5468270182609558, 0.006740553770214319, 0.10011851042509079, -0.6183177828788757, 0.009681724011...
When designing LINQ classes using the LINQ to SQL designer I've sometimes needed to reorder the classes for the purposes of having the resultant columns in a DataGridView appear in a different order. Unfortunately this seems to be exceedingly difficult; you need to cut and paste properties about, or delete them and re-insert them manually. I *know* you can reorder columns fairly easily in a DataGridView, however that would result in a lot of hardcoding and I want the designer to match up to the grid. Does anyone know of any easier way of achieving this or is cutting/pasting the only available
[ 0.43329933285713196, 0.3461205065250397, 0.20878846943378448, 0.14491882920265198, -0.12050217390060425, -0.023293286561965942, 0.07425771653652191, -0.029175234958529472, -0.14523537456989288, -0.6536481976509094, 0.28110361099243164, 0.5246093273162842, -0.32382750511169434, 0.2727563381...
method? I tried manually editing the .designer.cs file, but reordering properties there doesn't appear to do anything! **Edit:** Just to make it clear - I want to reorder what's in the LINQ to SQL designer, not what's in the table. I haven't made an error in ordering requiring a reversion to the original table layout; rather I have a table which I want to possess a different ordering in Visual Studio than in SQL Server. Using Linq-to-Sql, you can have columns in the DataGridView appear different than in the original table by: 1. In your Linq query, extract the columns that you want, in
[ 0.06066131219267845, 0.10955145955085754, 0.401662677526474, 0.03962749242782593, -0.14257089793682098, -0.0031305456068366766, 0.04192039743065834, -0.5680735111236572, -0.3381288945674896, -0.5792525410652161, 0.17592963576316833, 0.5442826747894287, -0.3704489767551422, -0.0385719202458...
the order than you want, and store them in a var. Then the autogenerate columns should show them in that order in the DataGridView 2. Use Template columns in your DataGridView 3. Do not use drag-and-drop on the Linq-to-Sql design surface to create your entities. Rather, create them by hand and associate them with the database table using table and column properties As far as I know, there is no drag-and-drop column reorder in the designer itself
[ 0.42294928431510925, -0.1253749579191208, 0.6140909790992737, 0.14864778518676758, -0.09501010179519653, -0.019809113815426826, 0.004816094879060984, -0.3705712556838989, -0.2516828179359436, -0.7593759298324585, 0.15468578040599823, 0.5918480157852173, -0.3192561864852905, 0.0321958139538...
I am reviewing a big java application to see if there are any performance bottlenecks. The real problem is that I cannot pinpoint the performance issues to any single module. The whole application is slow as such. Is there some tool/technique I can use to help me out in this? Try using a profiler on your running code. It should help you identify the bottlenecks. Try [jprofiler](http://www.ej-technologies.com/products/jprofiler/overview.html) or [Netbeans profiler](http://www.netbeans.org/features/java/profiler.html)
[ 0.1755392700433731, -0.029259003698825836, -0.10742954164743423, -0.028501683846116066, -0.032805707305669785, -0.11249666661024094, 0.10536052286624908, -0.19096970558166504, -0.18347269296646118, -0.8286940455436707, -0.051037807017564774, 0.5837258100509644, -0.08392442762851715, -0.128...
I would like to open a small video file and map every frames in memory (to apply some custom filter). I don't want to handle the video codec, I would rather let the library handle that for me. I've tried to use Direct Show with the SampleGrabber filter (using this sample <http://msdn.microsoft.com/en-us/library/ms787867(VS.85).aspx>), but I only managed to grab some frames (not every frames!). I'm quite new in video software programming, maybe I'm not using the best library, or I'm doing it wrong. I've pasted a part of my code (mainly a modified copy/paste from the msdn example), unfortunately it doesn't grabb
[ 0.40256786346435547, -0.0026688275393098593, 0.3214243948459625, 0.11075028777122498, -0.12527789175510406, -0.2543686628341675, 0.05025891587138176, -0.10428892821073532, -0.17947475612163544, -0.659075140953064, 0.19107802212238312, 0.3889726400375366, -0.23304857313632965, 0.34626665711...
the 25 first frames as expected... ``` [...] hr = pGrabber->SetOneShot(TRUE); hr = pGrabber->SetBufferSamples(TRUE); pControl->Run(); // Run the graph. pEvent->WaitForCompletion(INFINITE, &evCode); // Wait till it's done. // Find the required buffer size. long cbBuffer = 0; hr = pGrabber->GetCurrentBuffer(&cbBuffer, NULL); for( int i = 0 ; i < 25 ; ++i ) { pControl->Run(); // Run the graph. pEvent->WaitForCompletion(INFINITE, &evCode); // Wait till it's done. char *pBuffer = new char[cbBuffer]; hr = pGrabber->GetCurrentBuffer(&cbBuffer, (long*)pBuffer); AM_MEDIA_TYPE mt; hr = pGrabber->GetConnectedMediaType(&mt); VIDEOINFOHEADER *pVih; pVih = (VIDEOINFOHEADER*)mt.pbFormat;
[ 0.12761078774929047, -0.24877731502056122, 0.9013848304748535, -0.004432653076946735, -0.1382788121700287, 0.4372049570083618, 0.40439245104789734, -0.7030611634254456, -0.5915810465812683, -0.5341379046440125, -0.30438998341560364, 0.3611825406551361, -0.37308886647224426, -0.044243007898...
[...] } [...] ``` Is there somebody, with video software experience, who can advise me about code or other simpler library? Thanks Edit: Msdn links seems not to work ([see the bug](http://stackoverflow.uservoice.com/pages/general/suggestions/19963)) Currently these are the most popular video frameworks available on Win32 platforms: 1. Video for Windows: old windows framework coming from the age of Win95 but still widely used because it is very simple to use. Unfortunately it supports only AVI files for which the proper VFW codec has been installed. 2. DirectShow: standard WinXP framework, it can basically load all formats you can play with Windows Media Player. Rather difficult to use. 3. [Ffmpeg](http://ffmpeg.mplayerhq.hu/): more precisely libavcodec and
[ 0.459652304649353, -0.04860033094882965, 0.675279974937439, 0.14822344481945038, -0.47598615288734436, -0.49842414259910583, -0.036154162138700485, -0.12769463658332825, -0.3934004008769989, -0.6129590272903442, 0.03897655010223389, 0.7153716683387756, -0.38627174496650696, 0.3986797034740...
libavformat that comes with Ffmpeg open- source multimedia utility. It is extremely powerful and can read a lot of formats (almost everything you can play with [VLC](http://www.videolan.org/vlc/)) even if you don't have the codec installed on the system. It's quite complicated to use but you can always get inspired by the code of ffplay that comes shipped with it or by other implementations in open-source software. Anyway I think it's still much easier to use than DS (and much faster). It needs to be comipled by MinGW on Windows, but all the steps are explained very well [here](http://arrozcru.no-ip.org/ffmpeg/) (in this
[ 0.23440413177013397, -0.2836545705795288, 0.7082414031028748, -0.04534730687737465, -0.3407784402370453, -0.29935649037361145, -0.1351032853126526, -0.21254058182239532, -0.09609048813581467, -0.7755921483039856, 0.14131715893745422, 0.9146602749824524, -0.4478430151939392, 0.0041333213448...
moment the link is down, hope not dead). 4. [QuickTime](http://developer.apple.com/quicktime/download/): the Apple framework is not the best solution for Windows platform, since it needs QuickTime app to be installed and also the proper QuickTime codec for every format; it does not support many formats, but its quite common in professional field (so some codec are actually only for QuickTime). Shouldn't be too difficult to implement. 5. [Gstreamer](http://www.gstreamer.net/): latest open source framework. I don't know much about it, I guess it wraps over some of the other systems (but I'm not sure). All of this frameworks have been implemented as backend in OpenCv Highgui,
[ 0.051699262112379074, -0.10231182724237442, 0.5009433031082153, 0.34876927733421326, 0.10179601609706879, -0.1917979121208191, 0.17391614615917206, -0.07410355657339096, -0.2896982431411743, -0.8446052074432373, -0.3602290451526642, 0.6125917434692383, -0.2349020093679428, -0.2632965445518...
except for DirectShow. The default framework for Win32 OpenCV is using VFW (and thus able only to open some AVI files), if you want to use the others you must download the CVS instead of the official release and still do some hacking on the code and it's anyway not too complete, for example FFMPEG backend doesn't allow to seek in the stream. If you want to use QuickTime with OpenCV [this](http://path.berkeley.edu/~zuwhan/QTforOpenCVWin/) can help you.
[ 0.31719309091567993, 0.10574764013290405, 0.3418807089328766, 0.1301315575838089, -0.2288305014371872, -0.621243953704834, 0.26510441303253174, 0.12345221638679504, -0.14673186838626862, -0.44980373978614807, -0.03509058058261871, 0.7163724303245544, -0.5127549767494202, -0.004327751230448...
By default IntelliJ IDEA 7.0.4 seems to use 4 spaces for indentation in XML files. The project I'm working on uses 2 spaces as indentation in all it's XML. Is there a way to configure the indentation in IntelliJ's editor? Sure there is. This is all you need to do: * Go to ``` File -> Settings -> Global Code Style -> General ``` * Disable the checkbox next to 'Use same settings for all file types' * The 'XML' tab should become enabled. Click it and set the 'tab' (and probably 'indent') size to 2.
[ -0.0492488257586956, -0.10101494193077087, 0.44142743945121765, 0.03869938477873802, 0.14083880186080933, -0.1220688447356224, 0.12317875772714615, 0.019245844334363937, -0.06606889516115189, -0.8746424317359924, -0.2303360551595688, 0.5608516931533813, -0.22928203642368317, -0.22569210827...
I'm trying to make the case for click-once and smart client development but my network support team wants to keep with web development for everything. What is the best way to convince them that click-once and smart client development have a place in the business? We use ClickOnce where I work; in terms of comparison to a web release I would base the case around the need for providing users with a rich client app, otherwise it might well actually be better to use web applications. In terms of releasing a rich client app ClickOnce is fantastic; you can set it up to
[ 0.6849244236946106, 0.11865860968828201, 0.11303649842739105, -0.003406986128538847, 0.26254308223724365, -0.0870981216430664, -0.22161847352981567, 0.4838812053203583, -0.34074312448501587, -0.741071343421936, 0.27840033173561096, 0.7680065035820007, 0.05557248741388321, 0.064121879637241...
enforce updates on startup thus enforcing a version throughout the network. You can make the case that ClickOnce gives you the same benefit of having a single deployment point that web deployment possesses. Personally I've found ClickOnce to be unbelievably useful. If you're developing rich client .net apps (in Windows, though let's face it the vast majority of real .net development *is* in Windows) and want to deploy it across a network nothing else compares.
[ 0.5500338077545166, -0.07808179408311844, 0.21005457639694214, 0.09387938678264618, -0.2742604911327362, -0.6005251407623291, 0.48320528864860535, 0.3953493535518646, -0.3182566463947296, -0.7331618666648865, -0.0712740421295166, 0.7455348968505859, -0.41772469878196716, -0.149669662117958...
How can I find the origins of conflicting DNS records? You'll want the SOA (Start of Authority) record for a given domain name, and this is how you accomplish it using the universally available **nslookup** command line tool: ``` command line> nslookup > set querytype=soa > stackoverflow.com Server: 217.30.180.230 Address: 217.30.180.230#53 Non-authoritative answer: stackoverflow.com origin = ns51.domaincontrol.com # ("primary name server" on Windows) mail addr = dns.jomax.net # ("responsible mail addr" on Windows)
[ 0.2008654773235321, -0.19355261325836182, 0.3788939416408539, 0.33279091119766235, 0.10452171415090561, -0.23759789764881134, 0.1861727386713028, -0.22876809537410736, -0.1521814614534378, -0.3487718999385834, -0.09536245465278625, 0.11580005288124084, -0.10166669636964798, 0.3850193619728...
serial = 2008041300 refresh = 28800 retry = 7200 expire = 604800 minimum = 86400 Authoritative answers can be found from: stackoverflow.com nameserver = ns52.domaincontrol.com. stackoverflow.com nameserver = ns51.domaincontrol.com. ``` The **origin** (or **primary name server** on Windows) line tells you that **ns51.domaincontrol** is the main name server for **stackoverflow.com**. At the end of output all authoritative servers, including backup
[ 0.0641765147447586, 0.21926845610141754, 0.5916339755058289, 0.2956697344779968, 0.2415389120578766, -0.18310871720314026, 0.22898022830486298, 0.030810724943876266, -0.3928678631782532, -0.22700460255146027, -0.46998146176338196, 0.3960188031196594, -0.03290325030684471, 0.445392638444900...
servers for the given domain, are listed.
[ 0.03497137874364853, 0.1541038602590561, 0.2107541412115097, 0.3094032108783722, 0.0756278857588768, -0.01251711044460535, 0.06584180146455765, 0.42042383551597595, -0.3731025755405426, -0.35342568159103394, -0.488115131855011, -0.015093762427568436, -0.1000378355383873, 0.5181768536567688...
Both are mathematical values, however the float does have more precision. Is that the only reason for the error - the difference in precision? Or is there another potential (and more serious) problem? It's because the set of integer values does not equal the set of float values for the 'int' and 'float' types. For example, the float value 0.5 has no equal in the integer set and the integer value 4519245367 might not exist in the set of values a float can store. So, the checker flags this as an issue to be checked by the programmer.
[ 0.054572511464357376, 0.1241956353187561, 0.13049285113811493, 0.25591740012168884, 0.00796507392078638, -0.061351228505373, -0.06688172370195389, -0.29236409068107605, -0.061643220484256744, -0.1748504787683487, 0.2261926680803299, 0.5898460745811462, 0.015952659770846367, 0.0273454431444...
How do I find the start of the week (both Sunday and Monday) knowing just the current time in C#? Something like: ``` DateTime.Now.StartWeek(Monday); ``` Use an extension method: ``` public static class DateTimeExtensions { public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startOfWeek) { int diff = (7 + (dt.DayOfWeek - startOfWeek)) % 7; return dt.AddDays(-1 * diff).Date; } } ``` Which can be used as follows: ``` DateTime dt = DateTime.Now.StartOfWeek(DayOfWeek.Monday); DateTime dt = DateTime.Now.StartOfWeek(DayOfWeek.Sunday); ```
[ 0.13523726165294647, -0.28940874338150024, 0.8273382186889648, -0.2920646667480469, 0.2798958420753479, -0.00972604751586914, 0.12727400660514832, 0.0775010734796524, -0.16402572393417358, -0.45631033182144165, -0.22576700150966644, 0.8313275575637817, -0.08206698298454285, 0.3541553020477...
The only *nice* way I've found is: ``` import sys import os try: os.kill(int(sys.argv[1]), 0) print "Running" except: print "Not running" ``` ([Source](http://www.unix.com/unix-advanced-expert-users/79267-trick-bash-scripters-check-if-process-running.html)) But is this reliable? Does it work with every process and every distribution? Mark's answer is the way to go, after all, that's why the /proc file system is there. For something a little more copy/pasteable: ``` >>> import os.path >>> os.path.exists("/proc/0") False >>> os.path.exists("/proc/12") True ```
[ 0.3329986333847046, 0.039648253470659256, 0.5581074953079224, 0.0061668590642511845, 0.20488108694553375, -0.08502084761857986, 0.5233415365219116, -0.05636616796255112, -0.07667222619056702, -0.5082363486289978, 0.13678689301013947, 0.7367547750473022, -0.05152516812086105, -0.07562246918...
I am considering log-shipping of [Write Ahead Logs (WAL)](http://www.postgresql.org/docs/8.2/static/runtime-config-wal.html) in PostgreSQL to create a warm-standby database. However I have one table in the database that receives a huge amount of INSERT/DELETEs each day, but which I don't care about protecting the data in it. To reduce the amount of WALs produced I was wondering, **is there a way to prevent any activity on one table from being recorded in the WALs?** Unfortunately, I don't believe there is. The WAL logging operates on the page level, which is much lower than the table level and doesn't even know which page holds data
[ 0.4278407096862793, 0.2364070862531662, 0.698544979095459, -0.04717114567756653, 0.03682537004351616, -0.27637794613838196, 0.2954294979572296, 0.037930551916360855, -0.3601318299770355, -0.7769878506660461, 0.1884852945804596, 0.3363548517227173, -0.18678773939609528, 0.3124347925186157, ...
from which table. In fact, the WAL files don't even know which pages belong to which *database*. You might consider moving your high activity table to a completely different instance of PostgreSQL. This seems drastic, but I can't think of another way off the top of my head to avoid having that activity show up in your WAL files.
[ 0.5590700507164001, -0.08716698735952377, 0.3011479079723358, 0.24906709790229797, -0.09992615878582001, -0.3761356472969055, 0.10261354595422745, 0.33405429124832153, -0.1384771764278412, -0.6137742400169373, 0.04821380600333214, 0.1983058750629425, -0.18515382707118988, 0.366166710853576...
`celsius = (5.0/9.0) * (fahr-32.0);` Is it just a development choice that the C developers decided upon or is there a reason to this? I believe a float is smaller than a double, so it might be to prevent overflows caused by not knowing what decimal format to use. Is that the reason, or am I overlooking something? I think the reason is to ensure that any result can be encompassed. so the natural choice is double as it is the largest data type.
[ 0.48196014761924744, 0.20217083394527435, 0.03817972168326378, 0.07850226014852524, -0.05021500587463379, -0.2565803527832031, 0.0011493369238451123, -0.04911121726036072, -0.22288721799850464, -0.09483405947685242, -0.09844740480184555, 0.11426925659179688, -0.38697144389152527, 0.2102911...
I am in a position where I can choose the client browser for my web app. The app is being used internally, and we are installing each client "manually".I would like to find a better solution for the browser,so : What is a good browser that I can use as a client to a web application? General functionalities I would like to have: * opening the browser from a shortcut, directly to the application's URL * ability to restrict navigation to a set of allowed URLs * fullscreen mode, no menu, no address bar * javascript * good CSS support * ability to cancel Back button (or at least
[ 0.40501752495765686, 0.181536465883255, 0.4790055751800537, -0.07563136518001556, -0.023127952590584755, -0.02671724744141102, 0.3623640537261963, 0.271427184343338, -0.1737629473209381, -0.8770608901977539, -0.19385384023189545, 0.6380755305290222, 0.016154972836375237, 0.0800560563802719...
solve the "Webpage has expired" IE problem) IE7 and FireFox are good candidates, but each seem to have it's own problems and issues. [Mozilla Prism](http://developer.mozilla.org/en/Prism) seems ideal for your purposes. It shares code with Firefox but is designed to run web applications without the usual Browser interface to make them appear more like desktop applications. So no back button or address bar to worry about. **Edit:** [Google Chrome](http://www.google.com/chrome) has [Application Shortcuts](http://www.google.com/support/chrome/bin/answer.py?answer=95710&hl=en_GB) so that may now be a better option.
[ -0.04384838044643402, 0.08502532541751862, 0.643587589263916, 0.029222838580608368, 0.05862697586417198, -0.126426100730896, 0.3311963677406311, -0.20935800671577454, -0.20125608146190643, -0.7197594046592712, -0.22563305497169495, 0.3622034788131714, -0.6183247566223145, -0.10450390726327...
I have Carbide.c++ Developer from Nokia and I want to create applications for my S60 phone. I've looked at the samples that goes with the different SDK's for S60 but I haven't found any simple explanation on how strings, called descriptors, are used in Symbian. One of the problems are that I'm visually impaired and therefore it takes quite some time to read through large documents that has page up and page down with lots of unuseful info and I've given up. I'm willing to give it another try. Can anyone help me? Here are a few sites on blogspot that may help. They
[ 0.8935028910636902, 0.44395506381988525, -0.08670201897621155, 0.194548562169075, -0.1882806420326233, 0.23770400881767273, -0.04013330861926079, 0.1644212156534195, -0.052136924117803574, -0.5003125667572021, 0.4382827579975128, 0.5714171528816223, 0.03089434839785099, 0.5230766534805298,...
have RSS feeds that will hopefully be easier to consume than paging through PDFs. * <http://descriptor-tips.blogspot.com/> * <http://descriptors.blogspot.com/>
[ 0.8868442177772522, -0.20335380733013153, 0.5355604290962219, 0.38169002532958984, -0.1309601068496704, -0.4256163537502289, -0.05385337024927139, -0.1179031953215599, -0.4943138360977173, -0.4887779951095581, -0.08698941022157669, 0.42325302958488464, -0.2716895639896393, -0.3446525037288...
It may not be best practice but are there ways of removing unsused classes from a third party's jar files. Something that looks at the way in which my classes are using the library and does some kind of coverage analysis, then spits out another jar with all of the untouched classes removed. Obviously there are issues with this. Specifically, the usage scenario I put it though may not use all classes all the time. But neglecting these problems, can it be done in principle? There is a way. The JarJar project does this AFAIR. The first goal of the JarJar project is to
[ 0.6782346963882446, 0.06568620353937149, -0.18456053733825684, 0.2260897159576416, -0.2899478077888489, -0.49466508626937866, 0.5131984353065491, -0.02421124279499054, -0.08168180286884308, -0.41724416613578796, 0.2732708752155304, 0.48507168889045715, 0.021845119073987007, 0.4403155744075...
allow one to embed third party libraries in your own jar, changing the package structure if necessary. Doing so it can strip out the classes that are not needed. Check it out at <http://code.google.com/p/jarjar/>. Here is a link about shrinking jars: <http://sixlegs.com/blog/java/jarjar-keep.html>
[ 0.6919063329696655, -0.07736529409885406, -0.2962610721588135, -0.15559233725070953, -0.15979129076004028, 0.08022747188806534, 0.5977430939674377, -0.07316884398460388, -0.3333262801170349, -0.3798240125179291, 0.28534916043281555, 0.25000038743019104, -0.2940109968185425, 0.0919084772467...
Because Linux (and its variants) have a completely different set of fonts than Windows and Mac OS X, is there anyone with any experience of creating cross-platform font families - ideally finding equivalents to the common fonts found on the aforementioned operating systems? If so, what is the best route to take? Here are some good up-to-date listings of the most-installed fonts for PC, Mac, and Linux: [Sans serif font sampler and survey results](http://www.codestyle.org/css/font-family/sampler-SansSerif.shtml) [Serif font sampler and survey results](http://www.codestyle.org/css/font-family/sampler-Serif.shtml) Hope this helps your decision!
[ 0.3126658499240875, 0.09586580097675323, 0.19982749223709106, 0.18284669518470764, -0.04747728258371353, -0.05225977674126625, 0.11817493289709091, 0.15930262207984924, -0.2880322337150574, -0.6913145184516907, -0.13006168603897095, 0.4948095381259918, 0.044896844774484634, -0.103392034769...
I'm using jquery ajax to post updates back to my server. I'm concerned about making sure I have put in place appropriate measures so that only my AJAX calls can post data. My stack is PHP on Apache against a MySQL backend. Advice greatly appreciated! Any request that the AJAX calls in your pages can make can also be made by someone outside of the application. If done right, you will not be able to tell if they were made as part of an AJAX call from your webapp or by hand/other means. There are two scenarios I can think of which you might
[ 0.36695337295532227, 0.10049962252378464, 0.25078895688056946, 0.031118132174015045, -0.22920778393745422, -0.16029562056064606, 0.2984321713447571, 0.3075001537799835, -0.27301138639450073, -0.6764258146286011, 0.0472152978181839, 0.48839274048805237, 0.04094814881682396, 0.01020192261785...
be talking about when you say you want to make sure that only your AJAX calls can post data: either you don't want a malicious user to be able to post data that interferes with another user's data or you actually want to restrict the posts to being in the "flow" of a multi-request operation. If you are concerned with the first case (someone posting malicious data to/as another user) the solution is the same whether you are using AJAX or not -- you just have to authenticate the user through whatever means is necessary -- usually via session cookie. If
[ 0.38310539722442627, -0.005577732343226671, 0.0566248819231987, 0.2574089765548706, -0.26977452635765076, -0.4682316780090332, 0.3346630930900574, 0.12967358529567719, -0.3174281716346741, -0.5089765787124634, -0.192818745970726, 0.4739004075527191, -0.24897246062755585, -0.125167623162269...
you are concerned with the second case, then you are going to have to do something like issue a unique token at each step of the process, and store the expected token on the server side. Then when a request is made, check that there is a corresponding entry on the server side for the action that is being taken and that the expected tokens match and that that token has not been used yet. If there is no, you reject the request, if there is, then you mark that token as used and process the request. If what you are
[ 0.2467283308506012, -0.14832106232643127, 0.1085650697350502, 0.26454487442970276, 0.05447963625192642, -0.0950290635228157, 0.010938296094536781, -0.3553742468357086, -0.27729785442352295, -0.6126220226287842, -0.19982782006263733, 0.3459809422492981, -0.07083362340927124, 0.0041522006504...
concerned about is something other than one of these two scenarios then the answer will depend on more specifics than you have provided.
[ 0.4577885568141937, -0.260885089635849, 0.18982143700122833, 0.23631060123443604, -0.04510827362537384, 0.09439140558242798, -0.17636941373348236, -0.16090472042560577, -0.33647871017456055, -0.3192208409309387, 0.2668563723564148, 0.9759883284568787, -0.3314957022666931, -0.00040661473758...
Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a [reactor pattern](http://en.wikipedia.org/wiki/Reactor_pattern "reactor pattern") written in [Boost.Asio](http://www.boost.org/doc/libs/release/libs/asio/index.html "Boost.Asio"). [Edit:] Running a synchronous connector in threads is not an option. I know this is an old question, but consider looking at the new Boost.Mysql library: <https://anarthal.github.io/mysql/index.html>
[ 0.3564043641090393, -0.1885133534669876, 0.11456158757209778, 0.3795927166938782, 0.030388951301574707, -0.001795035321265459, -0.11077665537595749, 0.027131570503115654, -0.21529802680015564, -0.41271528601646423, -0.04686952754855156, 0.3417019844055176, -0.42801526188850403, 0.177772104...
Say you want a simple maze on an N by M grid, with one path through, and a good number of dead ends, but that looks "right" (i.e. like someone made it by hand without too many little tiny dead ends and all that). Is there a known way to do this? From <http://www.astrolog.org/labyrnth/algrithm.htm> > Recursive backtracker: This is somewhat related to the recursive backtracker solving method described below, and requires stack up to the size of the Maze. When carving, be as greedy as possible, and always carve into an unmade section if one is next to the current cell. Each
[ 0.32287365198135376, -0.052292633801698685, 0.2407224178314209, 0.2976413667201996, 0.31876006722450256, 0.2629857659339905, 0.08876528590917587, -0.1682005226612091, -0.3100985288619995, -0.4786031246185303, 0.016736991703510284, 0.3521427512168884, -0.06191524863243103, -0.10827800631523...
time you move to a new cell, push the former cell on the stack. If there are no unmade cells next to the current position, pop the stack to the previous position. The Maze is done when you pop everything off the stack. This algorithm results in Mazes with about as high a "river" factor as possible, with fewer but longer dead ends, and usually a very long and twisty solution. It runs quite fast, although Prim's algorithm is a bit faster. Recursive backtracking doesn't work as a wall adder, because doing so tends to result in a solution path
[ -0.010292436927556992, -0.2084357738494873, 0.26123419404029846, 0.2495788037776947, 0.23443472385406494, -0.12913593649864197, 0.7079006433486938, -0.32380539178848267, -0.7140400409698486, -0.5734726190567017, 0.0756538137793541, -0.08006235212087631, -0.1038302406668663, 0.1122267916798...
that follows the outside edge, where the entire interior of the Maze is attached to the boundary by a single stem. They produce only 10% dead ends ![](https://i.stack.imgur.com/vWo6P.gif) is an example of a maze generated by that method.
[ 0.16192765533924103, -0.13099421560764313, 0.5350558757781982, 0.2152438908815384, 0.1135566383600235, -0.11005866527557373, 0.6488650441169739, -0.4405185282230377, -0.4966913163661957, -0.11359632015228271, -0.07755324244499207, -0.1608971357345581, -0.24481312930583954, 0.24007369577884...
What is the best way to keep a PHP script running as a daemon, and what's the best way to check if needs restarting. I have some scripts that need to run 24/7 and for the most part I can run them using [nohup](http://en.wikipedia.org/wiki/Nohup). But if they go down, what's the best way to monitor it so it can be automatically restarted? If you can't use the (proper) init structure to do this (you're on shared hosting, etc.), use cron to run a script (it can be written in whatever language you like) every few minutes that checks to see if they're
[ 0.4719628393650055, 0.1375456005334854, 0.30660921335220337, 0.18942801654338837, -0.07781969010829926, -0.2609075605869293, 0.4840434193611145, 0.25352588295936584, -0.4510565400123596, -0.6052089333534241, 0.046195536851882935, 0.5180061459541321, -0.14432252943515778, 0.0058861603029072...
running, and restarts them if necessary.
[ 0.37089934945106506, 0.08349699527025223, 0.029988201335072517, 0.15168455243110657, 0.31684496998786926, 0.1468084454536438, 0.4054252803325653, 0.04221067950129509, -0.3220231533050537, -0.3617357313632965, -0.31640002131462097, 0.5450450778007507, -0.1702047884464264, -0.224007144570350...
How are people unit testing their business applications? I've seen a lot of examples of unit testing with "simple to test" examples. Ex. a calculator. How are people unit testing data-heavy applications? How are you putting together your sample data? In many cases, data for one test may not work at all for another test which makes it hard to just have one test database? Testing the data access portion of the code is fairly straightforward. It's testing out all the methods that work against the data that seem to be hard to test. For example, imagine a posting process where
[ 0.7362275123596191, 0.2906922698020935, -0.373243510723114, 0.45057931542396545, -0.03622464835643768, 0.07468634098768234, 0.26145851612091064, -0.2521168887615204, -0.1259453445672989, -0.4191254675388336, 0.34903109073638916, 0.7309123873710632, -0.020304298028349876, -0.083892174065113...
there is heavy data access to determine what is posted, numbers are adjusted, etc. There are a number of interim steps that occur (and need to be tested) along with tests afterwards that ensure the posting was successful. Some of those steps may actually be stored procedures. In the past I've tried inserting the test data in a test database, then running the test, but honestly it's pretty painful to write this kind of code (and error prone). I've also tried just building a test database up front and rolling back the changes. That works OK but in a number of
[ 0.7405585646629333, 0.31344953179359436, 0.020517800003290176, 0.37354663014411926, 0.0991416871547699, -0.23100963234901428, 0.546868085861206, 0.0168031994253397, -0.1477597951889038, -0.6337367296218872, 0.20454394817352295, 0.24661283195018768, -0.04355213791131973, -0.1215595006942749...
places you can't easily do this either (and many people would say that's integration testing; so be it, I still need to be able to test this somehow). If the answer is that there isn't a nice way of handling this and it currently just sort of sucks, that would be useful to know as well. Any thoughts, ideas, suggestions, or tips are appreciated. I have to second the comment by @Phil Bennett as I try to approach these integration tests with a rollback solution. I have a very detailed post about integration testing your data access layer [here](https://stackoverflow.com/questions/12374/has-anyone-had-any-success-in-unit-testing-sql-stored-procedures#25204) I show not only the sample
[ 0.7518523931503296, 0.3249606788158417, -0.20021113753318787, 0.20917411148548126, 0.5423408150672913, -0.38120803236961365, 0.3217203617095947, 0.21117821335792542, -0.19593414664268494, -0.6868864297866821, -0.041380688548088074, 0.1085391640663147, 0.08125501871109009, -0.06414218991994...
data access class, base class, and sample DB transaction fixture class, but a full CRUD integration test w/ sample data shown. With this approach you don't need multiple test databases as you can control the data going in with each test and after the test is complete the transactions are all rolledback so your DB is clean. About unit testing business logic inside your app, I would also second the comments by @Phil and @Mark because if you mock out all the dependencies your business object has, it becomes very simple to test your application logic one entity at a time
[ 0.4041142761707306, 0.068903349339962, 0.11510178446769714, 0.3947250247001648, -0.054689887911081314, -0.0015228374395519495, 0.20310528576374054, -0.42178431153297424, 0.03476599603891373, -0.5542712211608887, 0.09910167753696442, 0.6161434650421143, -0.044185806065797806, 0.076431818306...
;) Edit: So are you looking for one huge integration test that will verify everything from logic pre-data base / stored procedure run w/ logic and finally a verification on the way back? If so you could break this out into 2 steps: * 1 - Unit test the logic that happens before the data is pushed into your data access code. For example, if you have some code that calculates some numbers based on some properties -- write a test that only checks to see if the logic for this 1 function does what you asked it to do. Mock out any dependancy on the data access class so
[ 0.27298539876937866, -0.07313933223485947, -0.1405424028635025, 0.34449833631515503, 0.008849496953189373, -0.033744458109140396, 0.23645392060279846, -0.4195992946624756, 0.024779465049505234, -0.4813498258590698, 0.14100834727287292, 0.5067022442817688, -0.2239905446767807, -0.1662057191...
you can ignore it for this test of the application logic alone. * 2 - Integration test the logic that happens once you take your manipulated data (from the previous method we unit tested) and call the appropriate stored procedure. Do this inside a data specific testing class so you can rollback after it's completed. After your stored procedure has run, do a query against the database to get your object now that we have done some logic against the data and verify it has the values you expected (post-stored procedure logic /etc ) If you need an entry in your database for the
[ 0.30878666043281555, -0.1182311549782753, -0.11469525098800659, 0.33970290422439575, 0.06233176961541176, -0.06776653230190277, 0.1782529652118683, -0.4355255663394928, -0.041638851165771484, -0.4443689286708832, 0.10125108808279037, 0.5464355945587158, -0.11229362338781357, -0.04272227361...
stored procedure to run, simply insert that data before you run the sproc that has your logic inside it. For example, if you have a product that you need to test, it might require a supplier and category entry to insert so before you insert your product do a quick and dirty insert for a supplier and category so your product insert works as planned.
[ 0.47377753257751465, -0.11381195485591888, -0.09310466051101685, 0.1818332076072693, 0.301135390996933, 0.04858796298503876, -0.16151513159275055, -0.1022535189986229, -0.2365611046552658, -0.2108302116394043, 0.08731907606124878, 0.7247000336647034, -0.0285547636449337, 0.0061896890401840...
How can I use the nifty JavaScript date and time widgets that the default admin uses with my custom view? I have looked through [the Django forms documentation](https://docs.djangoproject.com/en/dev/topics/forms/), and it briefly mentions django.contrib.admin.widgets, but I don't know how to use it? Here is my template that I want it applied on. ``` <form action="." method="POST"> <table> {% for f in form %} <tr> <td> {{ f.name }}</td> <td>{{ f }}</td> </tr> {% endfor %}
[ 0.42444342374801636, 0.34283384680747986, 0.4784987270832062, -0.1490863859653473, -0.09977839887142181, -0.19068552553653717, 0.08557773381471634, -0.3877432942390442, 0.07348231971263885, -0.832397997379303, 0.23130343854427338, 0.5961408019065857, -0.22954291105270386, 0.005809577647596...
</table> <input type="submit" name="submit" value="Add Product"> </form> ``` Also, I think it should be noted that I haven't really written a view up myself for this form, I am using a generic view. Here is the entry from the url.py: ``` (r'^admin/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}), ``` And I am relevantly new to the whole Django/MVC/MTV thing, so please go easy... The growing complexity of this answer over time, and the many hacks required, probably ought to caution you against doing this at all. It's relying on undocumented internal implementation details of the admin, is likely to break again in future versions of Django,
[ 0.5400967597961426, 0.4396173655986786, 0.7468166351318359, -0.37591713666915894, -0.2390262931585312, -0.2573511600494385, -0.05111077427864075, 0.1297125220298767, -0.3019234836101532, -0.4190283417701721, 0.20821282267570496, 0.5338515043258667, -0.18175597488880157, 0.14521442353725433...
and is no easier to implement than just finding another JS calendar widget and using that. That said, here's what you have to do if you're determined to make this work: 1. Define your own `ModelForm` subclass for your model (best to put it in forms.py in your app), and tell it to use the `AdminDateWidget` / `AdminTimeWidget` / `AdminSplitDateTime` (replace 'mydate' etc with the proper field names from your model): ``` from django import forms from my_app.models import Product from django.contrib.admin import widgets
[ 0.48355957865715027, 0.048629384487867355, 0.7924712896347046, 0.03220050409436226, 0.023919440805912018, -0.08578725159168243, -0.15947552025318146, -0.2952834963798523, -0.08103683590888977, -0.8946244120597839, -0.09870122373104095, 0.4840632975101471, -0.1988448202610016, -0.2570771872...
class ProductForm(forms.ModelForm): class Meta: model = Product def __init__(self, *args, **kwargs): super(ProductForm, self).__init__(*args, **kwargs) self.fields['mydate'].widget = widgets.AdminDateWidget() self.fields['mytime'].widget = widgets.AdminTimeWidget() self.fields['mydatetime'].widget = widgets.AdminSplitDateTime() ``` 2. Change your URLconf to pass `'form_class': ProductForm` instead of
[ 0.19587042927742004, -0.4035969078540802, 0.6721006035804749, -0.20013998448848724, -0.1736730933189392, 0.31195783615112305, 0.27592623233795166, -0.4057878255844116, -0.07334482669830322, -0.7494997978210449, -0.18602971732616425, 0.46020078659057617, -0.3095855414867401, 0.4746108949184...
`'model': Product` to the generic `create_object` view (that'll mean `from my_app.forms import ProductForm` instead of `from my_app.models import Product`, of course). 3. In the head of your template, include `{{ form.media }}` to output the links to the Javascript files. 4. And the hacky part: the admin date/time widgets presume that the i18n JS stuff has been loaded, and also require core.js, but don't provide either one automatically. So in your template above `{{ form.media }}` you'll need: ``` <script type="text/javascript" src="/my_admin/jsi18n/"></script> <script type="text/javascript" src="/media/admin/js/core.js"></script> ``` You may also wish to use the following admin CSS (thanks [Alex](https://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form/719583#719583) for mentioning this): ``` <link
[ 0.25602394342422485, 0.297848641872406, 0.6722372770309448, -0.06831568479537964, 0.04758608713746071, -0.3318058252334595, 0.03575926274061203, -0.4028533697128296, -0.014908842742443085, -0.5268088579177856, -0.34758877754211426, 0.530559778213501, -0.32678744196891785, -0.05227544531226...
rel="stylesheet" type="text/css" href="/media/admin/css/forms.css"/> <link rel="stylesheet" type="text/css" href="/media/admin/css/base.css"/> <link rel="stylesheet" type="text/css" href="/media/admin/css/global.css"/> <link rel="stylesheet" type="text/css" href="/media/admin/css/widgets.css"/> ``` This implies that Django's admin media (`ADMIN_MEDIA_PREFIX`) is at /media/admin/ - you can change that for your setup. Ideally you'd use a context processor to pass this values to your template instead of hardcoding it, but that's beyond the scope of this question. This also requires that the URL /my\_admin/jsi18n/ be manually wired up to the django.views.i18n.javascript\_catalog view (or null\_javascript\_catalog if you aren't using I18N). You have to do this yourself instead of going through the admin application
[ 0.13943637907505035, 0.28430458903312683, 0.9393999576568604, -0.0006596801104024053, -0.11139678955078125, -0.15896832942962646, -0.05306759849190712, -0.6536306142807007, -0.2263932228088379, -0.4378390312194824, -0.17834194004535675, 0.6967531442642212, -0.14657706022262573, -0.03388234...
so it's accessible regardless of whether you're logged into the admin (thanks [Jeremy](https://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form/408230#408230) for pointing this out). Sample code for your URLconf: ``` (r'^my_admin/jsi18n', 'django.views.i18n.javascript_catalog'), ``` Lastly, if you are using Django 1.2 or later, you need some additional code in your template to help the widgets find their media: ``` {% load adminmedia %} /* At the top of the template. */ /* In the head section of the template. */ <script type="text/javascript"> window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}"; </script> ``` Thanks [lupefiasco](https://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form/2818128#2818128) for this addition.
[ 0.004204532131552696, 0.0768679827451706, 0.5271340608596802, 0.13342973589897156, -0.2536608874797821, -0.24054653942584991, -0.20428316295146942, -0.07222551107406616, -0.24287395179271698, -0.6647324562072754, 0.13726778328418732, 0.531226396560669, -0.14503894746303558, -0.004126260057...
I want to combine two structures with differing fields names. For example, starting with: ``` A.field1 = 1; A.field2 = 'a'; B.field3 = 2; B.field4 = 'b'; ``` I would like to have: ``` C.field1 = 1; C.field2 = 'a'; C.field3 = 2; C.field4 = 'b'; ``` Is there a more efficient way than using "fieldnames" and a for loop? **EDIT:** Let's assume that in the case of field name conflicts we give preference to `A`. Without collisions, you can do ``` M = [fieldnames(A)' fieldnames(B)'; struct2cell(A)' struct2cell(B)']; C=struct(M{:}); ``` And this is reasonably efficient. However, `struct` errors on duplicate fieldnames, and pre-checking for them using `unique` kills performance to the point that a loop is better. But here's what it
[ 0.02242988348007202, 0.16473184525966644, -0.12304956465959549, -0.20854002237319946, -0.003976733423769474, -0.1831761747598648, 0.3147488534450531, -0.49915340542793274, -0.13618960976600647, -0.5671523809432983, -0.08289320766925812, 0.524745523929596, -0.35199251770973206, -0.021818421...
would look like: ``` M = [fieldnames(A)' fieldnames(B)'; struct2cell(A)' struct2cell(B)']; [tmp, rows] = unique(M(1,:), 'last'); M=M(:, rows); C=struct(M{:}); ``` You might be able to make a hybrid solution by assuming no conflicts and using a try/catch around the call to `struct` to gracefully degrade to the conflict handling case.
[ -0.19501931965351105, -0.46121159195899963, 0.1192600280046463, 0.06678307801485062, 0.12197619676589966, 0.02617163211107254, 0.139405757188797, -0.29230746626853943, 0.029398009181022644, -0.4085919260978699, -0.1276950091123581, 0.4019487500190735, -0.4796217679977417, 0.082732684910297...
Is there any way to have a binary compiled from an ActionScript 3 project print stuff to *stdout* when executed? From what I've gathered, people have been going around this limitation by writing hacks that rely on local socket connections and AIR apps that write to files in the local filesystem, but that's pretty much it -- it's obviously not possible with the Flash Player and AIR runtimes from Adobe. Is there any project (e.g. based on the Tamarin code) that is attempting to implement something that would provide this kind of functionality? With AIR on Linux, it is easy to write to
[ 0.5614058971405029, 0.2945706844329834, -0.19156423211097717, 0.2573434114456177, -0.2487628012895584, -0.39340728521347046, 0.23640792071819305, 0.004595501814037561, -0.16273395717144012, -0.5513883233070374, -0.05543723702430725, 0.6546162962913513, -0.4707467257976532, -0.1973783373832...
stdout, since the process can see its own file descriptors as files in /dev. For stdout, open `/dev/fd/1` or `/dev/stdout` as a `FileStream`, then write to that. Example: ``` var stdout : FileStream = new FileStream(); stdout.open(new File("/dev/fd/1"), FileMode.WRITE); stdout.writeUTFBytes("test\n"); stdout.close(); ``` **Note:** See [this answer](https://stackoverflow.com/questions/5552277/when-to-use-writeutf-and-writeutfbytes-in-bytearray-of-as3) for the difference between `writeUTF()` and `writeUTFBytes()` - the latter will avoid garbled output on stdout.
[ 0.06324007362127304, 0.30843761563301086, 0.34175723791122437, -0.4280432462692261, -0.19524486362934113, 0.20435220003128052, 0.3829556703567505, -0.24333803355693817, -0.1347988098859787, -0.7225753664970398, -0.4289953410625458, 0.4471041262149811, -0.29276931285858154, -0.0415285266935...
Is there any way in IIS to map requests to a particular URL with no extension to a given application. For example, in trying to port something from a Java servlet, you might have a URL like this... <http://[server]/MyApp/HomePage?some=parameter> Ideally I'd like to be able to map everything under MyApp to a particular application, but failing that, any suggestions about how to achieve the same effect would be really helpful. With AIR on Linux, it is easy to write to stdout, since the process can see its own file descriptors as files in /dev. For stdout, open `/dev/fd/1` or `/dev/stdout` as a `FileStream`, then write
[ 0.2534693479537964, 0.02771914377808571, 0.38673320412635803, -0.008166552521288395, -0.3519851267337799, -0.17663733661174774, 0.047788333147764206, -0.02090161293745041, -0.061544083058834076, -0.965525209903717, -0.2638344466686249, 0.2163534164428711, -0.40244030952453613, 0.1646038442...
to that. Example: ``` var stdout : FileStream = new FileStream(); stdout.open(new File("/dev/fd/1"), FileMode.WRITE); stdout.writeUTFBytes("test\n"); stdout.close(); ``` **Note:** See [this answer](https://stackoverflow.com/questions/5552277/when-to-use-writeutf-and-writeutfbytes-in-bytearray-of-as3) for the difference between `writeUTF()` and `writeUTFBytes()` - the latter will avoid garbled output on stdout.
[ 0.07856354862451553, 0.2476746141910553, 0.37172019481658936, -0.3539074957370758, -0.059712495654821396, 0.05016690120100975, 0.36838626861572266, -0.24414227902889252, -0.2958700358867645, -0.46217256784439087, -0.45497170090675354, 0.4846840500831604, -0.2084876000881195, 0.003355248831...
I'm not sure I'm using all the correct terminology here so be forgiving. I just put up a site with a contact form that sends an email using the PHP mail() function. Simple enough. However the live site doesn't actually send the email, the test site does. So it's not my code. It's a shared host and we have another site that has the same function that works perfectly, so it's not the server. The only difference between the two is that the site that doesn't work just has the name server pointing to us and so the MX record never
[ 0.8268861174583435, 0.43408703804016113, 0.1426587849855423, 0.2861356735229492, -0.09261060506105423, 0.07210700213909149, 0.3345430791378021, 0.23518654704093933, -0.2099359631538391, -0.479720801115036, 0.4403987228870392, 0.1731094866991043, -0.5349511504173279, 0.14041876792907715, ...
touches our server. So my question is, could some one please confirm that the mail() function wont work if we don't have the MX record pointing to our server. Thanks Hey guys thanks for the answers, it is really appreciated. After ignoring the issue for a few months it has come up again, I did however find the answer to my problems. Firstly, as you answers suggested, PHP and the mail() function were working as expected. The mail was getting sent. The problem lies when the email is sent, it simply presumes that because its being sent from mydomain.com to \*@mydomain.com email that the
[ 0.374531090259552, 0.2876778841018677, 0.7168754935264587, 0.1044493243098259, -0.23118355870246887, -0.05230466648936272, 0.161100372672081, 0.16221514344215393, -0.2949570417404175, -0.7300629615783691, 0.5228253602981567, 0.36294832825660706, -0.10903002321720123, -0.04118987172842026, ...
email itself is hosted on the same server, so it gets sent there instead and ignores the MX record. OK it's a bit more complicated than that, but that is the general jist. Edit: Found a better version of the topic [sendmail and MX records when mail server is not on web host](https://stackoverflow.com/questions/322659/sendmail-and-mx-records-when-mail-server-is-not-on-web-host).
[ 0.256253719329834, 0.30351123213768005, 0.20165719091892242, 0.17504309117794037, -0.12706519663333893, -0.22259929776191711, 0.1489945352077484, 0.11864925175905228, -0.53337562084198, -0.29971444606781006, -0.08095069974660873, 0.2807420790195465, -0.3562593460083008, 0.00187306199222803...
Ok, so, my visual studio is broken. I say this NOT prematurely, as it was my first response to see where I had messed up in my code. When I add controls to the page I can't reference all of them in the code behind. Some of them I can, it seems that the first few I put on a page work, then it just stops. I first thought it may be the type of control as initially I was trying to reference a repeater inside an update panel. I know I am correctly referencing the code behind in my
[ 0.5647704005241394, 0.4945348799228668, 0.2245289534330368, 0.11929582804441452, -0.13593044877052307, -0.08805859833955765, 0.5674073100090027, 0.11995330452919006, -0.28704217076301575, -0.42017194628715515, 0.043149180710315704, 0.5366564393043518, -0.19832080602645874, 0.46076345443725...
aspx page. But just in case it was a screw up on my part I started to recreate the page from scratch and this time got a few more controls down before VS stopped recognizing my controls. After creating my page twice and getting stuck I thought maybe it was still the type of controls. I created a new page and just threw some labels on it. No dice, build fails when referencing the control from the code behind. In a possibly unrelated note when I switch to the dreaded "design" mode of the aspx pages VS 2008 errors out and
[ 0.21510033309459686, 0.10326050221920013, 0.21950659155845642, 0.17703485488891602, -0.23304924368858337, 0.10257253795862198, 0.475053071975708, -0.07768845558166504, -0.291818231344223, -0.6623046398162842, 0.3182445168495178, 0.3882443904876709, -0.2786250114440918, 0.028605356812477112...
restarts. I have already put a trouble ticket in to Microsoft. I uninstalled all add-ins, I reinstalled visual studio. Anyone that wants to see my code just ask, but I am using the straight WYSIWYG visual studio "new aspx page" nothing fancy. I doubt anyone has run into this, but have you? Has anyone had success trouble shooting these things with Microsoft? Any way to expedite this ticket without paying??? I have been talking to a rep from Microsoft for days with no luck yet and I am dead in the water. --- **Jon Limjap:** I edited the title to both make
[ 0.40456992387771606, 0.1092347577214241, 0.26055797934532166, 0.3836912512779236, 0.09223667532205582, -0.25083521008491516, 0.6214206218719482, 0.46214815974235535, -0.2862529158592224, -0.49542495608329773, -0.1233319491147995, 0.8878188729286194, -0.10957945138216019, -0.089152112603187...
it clear and descriptive *and* make sure that nobody sees it as offensive. "Foo-barred" doesn't exactly constitute a proper question title, although your question is clearly a valid one. try clearing your local VS cache. find your project and delete the folder. the folder is created by VS for what reason I honestly don't understand. but I've had several occasions where clearing it and doing a re-build fixes things... hope this is all that you need as well. here ``` %Temp%\VWDWebCache ``` and possibly here ``` %LocalAppData%\Microsoft\WebsiteCache ```
[ 0.4541030824184418, 0.199387788772583, 0.2677379846572876, 0.24279247224330902, -0.16849784553050995, -0.23947183787822723, 0.4150451421737671, 0.046387869864702225, 0.1323838084936142, -0.4425836205482483, -0.09653253853321075, 0.44874441623687744, -0.17799879610538483, -0.007360174786299...
I'm trying to pick up ruby by porting a medium-sized (non-OO) perl program. One of my personal idioms is to set options like this: ``` use Getopt::Std; our $opt_v; # be verbose getopts('v'); # and later ... $opt_v && print "something interesting\n"; ``` In perl, I kind of grit my teeth and let $opt\_v be (effectively) a global. In ruby,the more-or-less exact equivalent would be ``` require 'optparse' opts.on("-v", "--[no-]verbose", TrueClass, "Run verbosely") { |$opt_verbose| } opts.parse! end ``` where $opt\_verbose is a global that classes could access. Having classes know about global flags like
[ -0.12400729954242706, -0.10173080861568451, 0.1446974277496338, -0.11057266592979431, -0.13322125375270844, -0.0357816144824028, 0.25448188185691833, 0.4642797112464905, -0.15591935813426971, -0.6357223987579346, -0.19622430205345154, 0.6335306763648987, -0.489801824092865, -0.067602925002...
that seems ... er ... wrong. What's the OO-idiomatic way of doing this? * Let the main routine take care of all option-related stuff and have the classes just return things to it that it decides how to deal with? * Have classes implement optional behaviour (e.g., know how to be verbose) and set a mode via an attr\_writer sort of thing? *updated:* Thanks for the answers suggesting optparse, but I should have been clearer that it's not *how* to process command-line options I'm asking about, but more the relationship between command-line options that effectively set a global program state and classes that
[ -0.14313305914402008, -0.2966359853744507, 0.05775068700313568, -0.058595504611730576, -0.08283472061157227, 0.05176244676113129, 0.40298572182655334, 0.27900430560112, -0.3165990710258484, -0.5530834794044495, -0.4718877971172333, 0.6751086711883545, -0.2286759912967682, -0.38451921939849...
should ideally be independent of that sort of thing. A while back I ran across [this blog post](http://blog.toddwerth.com/entries/5) (by Todd Werth) which presented a rather lengthy skeleton for command-line scripts in Ruby. His skeleton uses a hybrid approach in which the application code is encapsulated in an application class which is instantiated, then executed by calling a "run" method on the application object. This allowed the options to be stored in a class-wide instance variable so that all methods in the application object can access them without exposing them to any other objects that might be used in the script. I would
[ 0.46224549412727356, 0.1394740641117096, -0.3593268394470215, 0.028689753264188766, -0.14272813498973846, 0.1827651709318161, 0.3845369815826416, -0.0794973373413086, -0.2288757711648941, -0.31856000423431396, 0.06714384257793427, 0.11114631593227386, -0.41897544264793396, -0.0785092711448...
lean toward using this technique, where the options are contained in one object and use either attr\_writers or option parameters on method calls to pass relevant options to any additional objects. This way, any code contained in external classes can be isolated from the options themselves -- no need to worry about the naming of the variables in the main routine from within the `thingy` class if your options are set with a `thingy.verbose=true` attr\_writer or `thingy.process(true)` call.
[ 0.27462029457092285, -0.2292216420173645, -0.11014635860919952, -0.036141641438007355, 0.24109449982643127, -0.0020406015682965517, 0.16955943405628204, -0.13397660851478577, -0.14528237283229828, -0.5315870642662048, -0.26613351702690125, 0.6265625953674316, -0.38590526580810547, -0.36449...
I have a winforms application where users will be creating stock items, and a time of creation there are a number of different things that need to happen. I think the UI for this should probably be a wizard of some kind, but I'm unsure as to the best way to achieve this. I have seen a couple of 3rd party Wizard controls, and I have also seen manual implementations of making panel visible/invisible. What are the best ways that people have used in the past, that are easy to implement, and also make it easy to add "pages" to the wizard
[ 0.5667486786842346, -0.01409166306257248, 0.31266239285469055, 0.2847595810890198, -0.02597995474934578, 0.00125215039588511, -0.1801701933145523, -0.0246836356818676, -0.0031521841883659363, -0.7358081340789795, 0.2663666605949402, 0.5365316867828369, 0.2550261318683624, 0.095939271152019...
later on if needed? Here are a few more resources you should check out: 1. This DevExpress WinForms control: <http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/> 2. A home-grown wizards framework: <http://weblogs.asp.net/justin_rogers/articles/60155.aspx> 3. A wizard framework by Shawn Wildermut part of the Chris Sells's Genghis framework: <http://www.sellsbrothers.com/tools/genghis/>
[ 0.21810410916805267, 0.06691417098045349, -0.10869225114583969, 0.2705222964286804, -0.21896091103553772, -0.24574410915374756, 0.4174971878528595, -0.4543677270412445, 0.2971363961696625, -0.7510656118392944, -0.20366133749485016, 0.10886776447296143, -0.3647124469280243, 0.07457105070352...
An odd issue that I have been trying to address in a project - my calls to WebClient.DownloadFileAsync seem to be getting ignored and no exceptions are being raised. So far I have been able to determine this might be due to destination folder not existing, but from the looks of the MSDN documentation for [Webclient.DownloadFileAsync](http://msdn.microsoft.com/en-us/library/ms144196(VS.80).aspx) this should still cause an exception to be raised. I did find one [MSDN forum thread](http://forums.msdn.microsoft.com/en-US/netfxnetcom/thread/1c046c42-5b45-43d1-9d48-65ffabd6f798/) that seems to imply that this has been known to happen, but there doesn't seem to be any resolution for it. Any ideas what might be going on? Here
[ 0.19501323997974396, -0.016151420772075653, 0.21000541746616364, 0.22881419956684113, 0.018115967512130737, -0.4368115961551666, 0.0715106651186943, 0.358439564704895, -0.6444944143295288, -0.5552597045898438, -0.011133882217109203, 0.37314534187316895, -0.2984049618244171, 0.4576165080070...
are a few more resources you should check out: 1. This DevExpress WinForms control: <http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/> 2. A home-grown wizards framework: <http://weblogs.asp.net/justin_rogers/articles/60155.aspx> 3. A wizard framework by Shawn Wildermut part of the Chris Sells's Genghis framework: <http://www.sellsbrothers.com/tools/genghis/>
[ 0.21797464787960052, 0.11087445169687271, -0.14659468829631805, 0.338705450296402, -0.26264625787734985, -0.25797152519226074, 0.44667819142341614, -0.4855763614177704, 0.24288929998874664, -0.7538506984710693, -0.18781320750713348, 0.1341671347618103, -0.44671353697776794, 0.1703538000583...
[DB\_DataObject](http://pear.php.net/manual/en/package.database.db-dataobject.php) does not appear to be ActiveRecord because you do not necessarily store business logic in the "table" classes. It seems more like Table Data Gateway or Row Data Gateway, but I really cannot tell. What I need is good ORM layer that we can use with DataMapper and a DomainModel. Any ideas? Follow [this link](http://pear.php.net/manual/en/package.database.db-dataobject.intro-purpose.php) to read what DB\_DO is. In a nutshell, it doesn't implement a specific pattern, it just aims to provide a common interface. The idea is to not rebuild the same basic code in each project. As for an ORM, I'd recommend [Doctrine](http://phpdoctrine.org/). It implements ActiveRecord.
[ 0.1629188358783722, 0.1939961165189743, 0.1626218557357788, -0.06267417222261429, -0.34256383776664734, -0.20931820571422577, 0.37408241629600525, -0.15518228709697723, -0.045155543833971024, -0.5073041915893555, -0.05906129628419876, 0.47541144490242004, -0.45501071214675903, 0.0070037818...
I'm thinking of starting a wiki, probably on a low cost LAMP hosting account. I'd like the option of exporting my content later in case I want to run it on `IIS/ASP.NET` down the line. I know in the weblog world, there's an open standard called BlogML which will let you export your blog content to an **XML** based format on one site and import it into another. Is there something similar with wikis? The correct answer is ... "it depends". It depends on which wiki you're using or planning to use. I've used various over the years [MoinMoin](http://moinmo.in/) was ok, used
[ 0.8051170706748962, -0.03759901970624924, 0.3355600833892822, 0.16544054448604584, -0.17512838542461395, -0.4298357367515564, -0.15625016391277313, 0.5168678760528564, -0.34752732515335083, -0.48819243907928467, 0.15942159295082092, 0.42533594369888306, -0.17723660171031952, 0.100747659802...
files rather than database, [Ubuntu](https://help.ubuntu.com/) seem to like it. [MediaWiki](http://www.mediawiki.org/wiki/MediaWiki), everyone knows about and [JAMWiki](http://jamwiki.org) is a java clone(ish) of MediaWiki with the aim to be markup compatible with MediaWiki, both use databases and you can generally connect whichever database you want, JAMWiki is pre-configured to use an internal HSQLDB instance. I recently converted about 80 pages from a MoinMoin wiki into JAMWiki pages and this was probably 90% handled by a tiny perl script I found somewhere (I'll provide a link if I can find it again). The other 10% was unfortunately a by-hand experience (they were of the utmost
[ 0.35637906193733215, 0.09022961556911469, 0.35932403802871704, 0.20241287350654602, -0.1996915638446808, -0.3601849377155304, 0.2936919331550598, 0.19231641292572021, -0.5176814794540405, -0.6743988394737244, -0.2905104160308838, 0.3917511999607086, -0.35087794065475464, 0.3454996049404144...
importance with them being recipies for the missus) ;-) I also recently setup a Mediawiki instance for work and that took all of about 8 minutes to do. So that'd be my choice.
[ 0.19484871625900269, -0.09912283718585968, 0.3464190363883972, 0.4353383779525757, -0.061647363007068634, 0.2358364462852478, 0.35925519466400146, 0.20237956941127777, -0.17368215322494507, -0.7409863471984863, 0.14924298226833344, 0.5446378588676453, 0.17141085863113403, -0.18729589879512...