text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
using (FileStream fOutStream = new FileStream(@"c:\test1.docx",
FileMode.Create, FileAccess.Write)) {
byte[] tempBytes = new byte[4096];
int i;
while ((i = zipStream.Read(tempBytes, 0, tempBytes.Length)) != 0) {
fOutStream.Write(tempBytes, 0, i);
} | [
0.16056208312511444,
-0.2520502805709839,
0.34731391072273254,
-0.0732414498925209,
0.4007425606250763,
0.2891148328781128,
0.25533419847488403,
-0.4645511209964752,
-0.18850299715995789,
-0.47378891706466675,
-0.22553037106990814,
0.519625723361969,
-0.27475935220718384,
-0.05043712258338... | |
}
}
}
```
Taken from a post I wrote last year that shows how to decompress a gzip file using C# and the built-in GZipStream class.
<http://blogs.msdn.com/miah/archive/2007/09/05/zipping-files.aspx>
As for downloading it, you can use the standard [WebRequest](http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx) or [WebClient](http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx) classes in .NET. | [
0.061751145869493484,
-0.020686421543359756,
0.09104023873806,
0.07926853001117706,
0.016028760001063347,
-0.3161506652832031,
0.238091841340065,
0.14110738039016724,
-0.12537415325641632,
-0.5331401228904724,
-0.38206443190574646,
0.335159033536911,
-0.4376105070114136,
0.0575742051005363... | |
> Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are:
>
>
> * Running the tests becomes automate-able and repeatable
> * You can test at a much more granular level than point-and-click testing via a GUI
>
>
> [Rytmis](https://stackoverflow.com/questions/1383/what-is-unit-testing)
My question is, what are the current "best practices" in terms of tools as well as when and where to use unit testing as part of your daily coding?
Lets try to be somewhat language agnostic and cover all the bases.
Ok here's some best practices from some one who | [
0.7019429206848145,
0.17700907588005066,
-0.2691960632801056,
0.11463391780853271,
-0.2811363935470581,
-0.055255237966775894,
0.3896371126174927,
-0.23449310660362244,
0.1629035770893097,
-0.6788786053657532,
0.11292225122451782,
0.6426898241043091,
0.23849506676197052,
-0.087854824960231... | |
doesn't unit test as much as he should...cough.
1. Make sure your tests test [one](http://www.artima.com/weblogs/viewpost.jsp?thread=35578 "one")
thing and one thing only.
2. Write unit tests as you go. Preferably [before](http://en.wikipedia.org/wiki/Test-driven_development "before") you write the code you are testing against.
3. Do not unit test the GUI.
4. [Separate your concerns](http://en.wikipedia.org/wiki/Separation_of_concerns "Separate your concerns").
5. Minimise the dependencies of your tests.
6. Mock behviour with [mocks](http://en.wikipedia.org/wiki/Mock_object "mocks"). | [
0.8563783764839172,
0.1510068029165268,
-0.1339755654335022,
0.2809288501739502,
-0.18588627874851227,
-0.10110175609588623,
0.3970700800418854,
-0.8909491300582886,
0.013809455558657646,
-0.6499719023704529,
0.09326489269733429,
0.7965260744094849,
-0.14713206887245178,
0.182444229722023,... | |
In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions:
* Experienced guys in Delphi and/or COM, do you have any workrounds to work with the buggy TLB interface ?
Some of the bugs are: IDE crashing during edition of a large TLB, lost of methods IDs, TLB corruption, etc.
Here, we haven't found any good solution. Actually we tried do upgrade do the new 2007 | [
0.2473112940788269,
0.2911938726902008,
0.08316142857074738,
0.21217630803585052,
-0.20577305555343628,
-0.22219547629356384,
0.1643313616514206,
-0.1253274530172348,
-0.18828333914279938,
-0.5565487742424011,
0.06445473432540894,
0.797610342502594,
-0.23093371093273163,
-0.094171337783336... | |
version. But the new IDE TLB interface has the same bugs that we found before.
* How do you control TLBs versions ? The TLB file is in a binary format and conflict resolutions are very hard to do. We tried to do it exporting the interfaces descriptions to IDL and commiting into CVS, but we didn't found any good way to generate TLBs from IDL using Delphi. Additionaly, the MIDL tool provided by Microsoft, didn't parse correctly the IDL files that we exported from delphi.
I think you should have a good look at Delphi 2009.
Delphi 2009 has changes to the | [
0.31869420409202576,
-0.09656917303800583,
0.514111340045929,
0.004163096658885479,
-0.4719639718532562,
-0.38129469752311707,
0.37476131319999695,
0.05191304162144661,
-0.332737535238266,
-0.6616793870925903,
0.024706032127141953,
0.6862617135047913,
-0.5856543779373169,
0.138308137655258... | |
COM support, including a text-based replacement for the binary TLB files.
You can read more on [Chris Bensen's blog](http://chrisbensen.blogspot.com/2008/07/tiburn-sneak-peek-com_23.html). | [
0.4534968435764313,
-0.38617265224456787,
-0.06737577170133591,
0.14386938512325287,
0.04054855927824974,
-0.12879429757595062,
0.44312670826911926,
0.42694979906082153,
-0.23329174518585205,
-0.6907862424850464,
0.03356976434588432,
0.7826732993125916,
-0.24357694387435913,
-0.02874711714... | |
I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense.
I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incredible when I finally got it, and it was actually fun to play with, so I'm looking to rediscover the lost art of Haskell.
I'm familiar with Ruby and its functional programming tricks, so I think I'm not completely in the dark. Any links?
Some good places to start are:
* [The Gentle | [
0.29220035672187805,
0.18898658454418182,
-0.05807865038514137,
0.18410764634609222,
-0.10585977882146835,
0.017826607450842857,
0.29833313822746277,
0.42617762088775635,
-0.1526324301958084,
-0.5560557246208191,
-0.07499924302101135,
0.24203304946422577,
-0.0775858536362648,
0.20319350063... | |
Introduction To Haskell](http://www.cs.auckland.ac.nz/references/haskell/haskell-intro-html/intro.html)
* [Problem Solving in Haskell](http://www.cs.kent.ac.uk/people/staff/sjt/Haskell_craft/probSolving.html)
* [Happy Learn Haskell Tutorial](http://www.happylearnhaskelltutorial.com)
Other resources:
* Interesting blog entry on a [Study plan for Haskell](http://web.archive.org/web/20100416040111/http://www.alpheccar.org/en/posts/show/67) via the Wayback Machine
* [HaskellWiki](http://www.haskell.org/)
* [Generic Haskell User Guide (PDF)](http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=F620BE1F358D8EC82AE93B19C543CE3B?doi=10.1.1.13.5249&rep=rep1&type=pdf) | [
-0.1697431206703186,
-0.13045048713684082,
0.1396285891532898,
0.24206998944282532,
-0.2679128348827362,
0.06490173935890198,
0.5528683066368103,
-0.07417303323745728,
-0.19685198366641998,
-0.3831648826599121,
-0.5051474571228027,
0.43905431032180786,
-0.060503557324409485,
-0.39687985181... | |
My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe even with some defaults). Does such a tool exist?
<http://lab.xms.pl/css-generator/> seems to fit the description. | [
0.7529576420783997,
0.32612210512161255,
0.27662816643714905,
-0.06379683315753937,
-0.14812949299812317,
-0.13898614048957825,
0.3979979455471039,
0.001804239465855062,
-0.15249088406562805,
-0.5851682424545288,
0.1875276416540146,
0.2652272582054138,
-0.19627569615840912,
-0.040369622409... | |
I'm trying to compile over 100 java classes from different packages from a clean
directory (no incremental compiles) using the following ant tasks:
```
<target name="-main-src-depend">
<depend srcdir="${src.dir}"
destdir="${bin.dir}"
cache="${cache.dir}"
closure="true"/>
</target>
<target name="compile" depends="-main-src-depend"
description="Compiles the project.">
<echo>Compiling</echo>
<javac target="${javac.target}" | [
0.2387630194425583,
0.04315466806292534,
-0.06072187423706055,
-0.42457813024520874,
-0.08258005976676941,
0.4431529641151428,
0.5633679032325745,
-0.48044729232788086,
0.01694418489933014,
-0.8574719429016113,
0.11171559244394302,
0.2284662425518036,
-0.2895463705062866,
-0.05355230346322... | |
source="${javac.source}"
debug="${javac.debug}"
srcdir="${src.dir}"
destdir="${bin.dir}">
<classpath>
<path refid="runtime.classpath"/>
<path refid="compile.classpath"/>
</classpath>
</javac>
</target>
```
However, the first time I run the compile task I always get a StackOverflowException. If I | [
-0.1248941421508789,
-0.1702011376619339,
0.29797452688217163,
-0.4436713755130768,
0.01689603179693222,
-0.038094643503427505,
0.3946335017681122,
-0.6752457022666931,
-0.31384512782096863,
-0.869736909866333,
-0.011167156510055065,
0.5896407961845398,
-0.35095518827438354,
0.141282722353... | |
run the task again the compiler does an incremental build and everything works fine. This is undesirable since we are using [CruiseControl](http://cruisecontrol.sourceforge.net/) to do an automatic daily build and this is causing false build failures.
As a quick-and-dirty solution I have created 2 separate tasks, compiling portions of the project in each. I really don't think this solution will hold as more classes are added in the future, and I don't want to be adding new compile tasks every time we hit the "compile limit".
> It will be nice to know; what can
> cause or causes a StackOverflowError
> during | [
0.04899050295352936,
-0.378395140171051,
0.406471312046051,
0.24132555723190308,
0.12293307483196259,
-0.1654786765575409,
0.8129027485847473,
-0.015662124380469322,
-0.3705294728279114,
-0.6270509958267212,
0.07614266872406006,
0.9287528395652771,
-0.14000311493873596,
-0.0670912414789199... | |
compilation of Java code?
It is probable that evaluating the long expression in your java file consumes lots of memory and because this is being done in conjunction with the compilation of other classes, the VM just runs out of stack space. Your generated class is perhaps pushing the legal limits for its contents. See chapter [4.10 Limitations of the Java Virtual Machine](http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#88659) in [The Java Virtual Machine Specification, Second Edition](http://java.sun.com/docs/books/jvms/).
**Fix 1: refactor the class**
Since your class is being generated, this might not be an option. Still, it is worth looking at the options your class generation tool offers to see | [
0.33668285608291626,
-0.03553429991006851,
-0.20960478484630585,
-0.03659630939364433,
-0.1126139834523201,
-0.1939786821603775,
0.39886534214019775,
-0.5372925996780396,
-0.45863059163093567,
-0.4337242543697357,
-0.0026473647449165583,
0.5877929925918579,
-0.3970644772052765,
0.017038444... | |
if it can produce something less troublesome.
**Fix 2: increase the stack size**
I think [Kieron](https://stackoverflow.com/questions/16935/ants-javac-tasks-throws-stackoverflowexception#16982) has one solution when he mentions the -Xss argument. [javac](http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html) takes a number of non-standard arguments that will vary between versions and compiler vendors.
My compiler:
```
$ javac -version
javac 1.6.0_05
```
To list all the options for it, I'd use these commands:
```
javac -help
javac -X
javac -J-X
```
I *think* the stack limit for javac is 512Kb by default. You can increase the stack size for this compiler to 10Mb with this command:
```
javac -J-Xss10M Foo.java
```
You might be able to pass this in an Ant file with a *compilerarg* element nested in your *javac* task.
```
<javac | [
-0.34594470262527466,
0.0871090367436409,
0.3982970118522644,
-0.1823912113904953,
0.022823771461844444,
0.09428692609071732,
0.2633068561553955,
-0.23633979260921478,
-0.41747990250587463,
-0.8033416271209717,
-0.14101681113243103,
0.4573235511779785,
-0.5916509628295898,
-0.2108511328697... | |
srcdir="gen" destdir="gen-bin" debug="on" fork="true">
<compilerarg value="-J-Xss10M" />
</javac>
``` | [
-0.45771524310112,
-0.11902854591608047,
0.22959551215171814,
-0.23716884851455688,
-0.07897724211215973,
0.011448749341070652,
0.40495431423187256,
-0.5946038365364075,
-0.079310841858387,
-0.6229996085166931,
-0.24549812078475952,
0.44123244285583496,
-0.22591543197631836,
0.265449345111... | |
I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors.
Is there an advantage to holding the file as a stream, either MemoryStream or FileStream, or should it be converted into a byte[] array?
Keith
A `byte[]` or `MemoryStream` will both require bringing the entire file into memory. A `MemoryStream` is really a wrapper around an underlying byte array. The best approach is to have two `FileStream` (one for input and one for output). | [
0.18695375323295593,
0.023175815120339394,
0.09699945896863937,
0.04516800865530968,
0.25493955612182617,
0.07662184536457062,
-0.00901562999933958,
-0.07127320766448975,
0.03379616513848305,
-0.43623968958854675,
-0.015361261554062366,
0.5418863296508789,
-0.17528213560581207,
-0.06254404... | |
Read from the input stream looking for the pattern used to indicate the file should be separated while writing to the current output file.
You may want to consider wrapping the input and output files in a `BinaryReader` and `BinaryWriter` respectively if they add value to your scenario. | [
0.3892066478729248,
-0.26603060960769653,
-0.11005891859531403,
0.30054762959480286,
0.3041791617870331,
0.11504799127578735,
-0.20539967715740204,
0.1901748776435852,
-0.061323489993810654,
-0.639070451259613,
-0.05382164567708969,
0.6564475893974304,
-0.16638749837875366,
0.0822779238224... | |
I've been using Eclipse with RDT (not RadRails) a lot lately, and I'm quite happy with it, but I'm wondering if you guys know any decent alternatives. I know NetBeans also supports Ruby these days, but I'm not sure what it has to offer over Eclipse.
Please, list any features you think are brilliant or useful when suggesting an IDE, makes it easier to compare.
Also, I said Ruby, not Rails. While Rails support is a plus, I prefer things to be none Rails-centric. It should also be available on Linux and optionally Solaris.
Have you tried [Aptana](http://www.aptana.com/)? It's based on Eclipse and | [
0.5078891515731812,
-0.06469114124774933,
-0.23127689957618713,
-0.12996648252010345,
-0.6437917947769165,
-0.08519070595502853,
0.049390748143196106,
0.22486121952533722,
-0.0849989652633667,
-0.804763674736023,
0.32745906710624695,
0.6919138431549072,
-0.1820654571056366,
-0.021568480879... | |
they have a sweet [Rails](http://www.aptana.com/rails) plugin. | [
0.16729794442653656,
-0.4859536290168762,
0.13686898350715637,
0.18179436028003693,
-0.052969999611377716,
0.4611819386482239,
0.40464600920677185,
0.3295994997024536,
0.08508727699518204,
-0.6265303492546082,
0.20332524180412292,
0.4351821541786194,
0.07254700362682343,
0.0850651487708091... | |
I know what `yield` does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem?
(Ideally some problem that cannot be solved some other way)
I realise this is an old question (pre Jon Skeet?) but I have been considering this question myself just lately. Unfortunately the current answers here (in my opinion) don't mention the most obvious advantage of the yield statement.
The biggest benefit of the yield statement is that it allows you to iterate over very large lists with much more efficient memory usage then using say | [
0.31710726022720337,
0.20614683628082275,
-0.011451954022049904,
-0.032456520944833755,
-0.43318453431129456,
0.04008744657039642,
0.01945539377629757,
0.052766039967536926,
-0.15680968761444092,
-0.5274552702903748,
0.16991987824440002,
0.6180067658424377,
0.20573191344738007,
0.002252037... | |
a standard list.
For example, let's say you have a database query that returns 1 million rows. You could retrieve all rows using a DataReader and store them in a List, therefore requiring list\_size \* row\_size bytes of memory.
Or you could use the yield statement to create an Iterator and only ever store one row in memory at a time. In effect this gives you the ability to provide a "streaming" capability over large sets of data.
Moreover, in the code that uses the Iterator, you use a simple foreach loop and can decide to break out from the loop as | [
0.08953306823968887,
-0.19710983335971832,
0.14022032916545868,
0.39237502217292786,
-0.01663113385438919,
-0.0992390364408493,
0.16974155604839325,
-0.16801998019218445,
-0.4159594476222992,
-0.5944706797599792,
-0.2711178958415985,
0.5242506861686707,
-0.4330470860004425,
0.1326740384101... | |
required. If you do break early, you have not forced the retrieval of the entire set of data when you only needed the first 5 rows (for example).
Regarding:
```
Ideally some problem that cannot be solved some other way
```
The yield statement does not give you anything you could not do using your own custom iterator implementation, but it saves you needing to write the often complex code needed. There are very few problems (if any) that can't solved more than one way.
Here are a couple of more recent questions and answers that provide more detail:
[Yield keyword value added?](https://stackoverflow.com/questions/384392/yield-keyword-value-added)
[Is yield useful outside of | [
-0.009525032714009285,
0.1953068971633911,
0.31290867924690247,
0.11649294942617416,
0.02810491994023323,
-0.23724550008773804,
0.08894092589616776,
-0.5239174962043762,
-0.15876404941082,
-0.49211347103118896,
-0.2967891991138458,
0.8282995820045471,
0.2284182906150818,
-0.165650337934494... | |
LINQ?](https://stackoverflow.com/questions/317619/is-yield-useful-outside-of-linq) | [
-0.10535253584384918,
0.03182648867368698,
0.5969207882881165,
0.12086256593465805,
0.26466819643974304,
-0.2609400749206543,
-0.14650429785251617,
-0.42014551162719727,
-0.05469314381480217,
-0.1022898256778717,
-0.11286355555057526,
0.4569811522960663,
0.22260472178459167,
-0.21369858086... | |
I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?
*(Expanding on Ben's original answer... not sure of the exact etiquette for that but I can't edit yet so I'll re-post)*
No, CodeWarrior uses a different object file format than PRC-Tools. Also, the compiler support libraries are different, so even if the code could be statically linked together, it may use symbols in a different way.
However, if you can wrap the third-party static | [
0.41886383295059204,
0.11324247717857361,
0.2641429305076599,
-0.0991818755865097,
-0.14255300164222717,
-0.059887584298849106,
0.24795162677764893,
0.09187401086091995,
-0.2321256399154663,
-0.3433755040168762,
0.3112449049949646,
0.5743504166603088,
-0.08750532567501068,
0.18884019553661... | |
library into a Palm OS shared library using CodeWarrior, then you should be able to call it from PRC-Tools applications. The Palm OS shared library interface works across tools, but shared libraries have limited system support so you'll need to be sure the original code doesn't use global variables for this to work.
For more information on shared libraries, see [Shared libraries on the Palm Pilot](http://www.isaac.cs.berkeley.edu/pilot/shlib.html "Shared libraries on the Palm Pilot"). | [
0.39842838048934937,
0.14367999136447906,
-0.10658146440982819,
0.4618664085865021,
-0.08419574797153473,
-0.3975541889667511,
-0.27855974435806274,
-0.012293968349695206,
-0.2054724395275116,
-0.5878413915634155,
0.0359211303293705,
0.29209840297698975,
-0.13865333795547485,
0.07875705510... | |
I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concrete type?
There are two rules I follow:
* Accept the most basic type that will work
* Return the richest type your user will need
So when writing a function or method that takes a collection, write it not to take a List, but an | [
0.14698933064937592,
-0.021281015127897263,
0.11621689796447754,
0.05932792276144028,
-0.16783688962459564,
0.1708431988954544,
0.08013200759887695,
-0.4227173626422882,
-0.1089714840054512,
-0.7213680744171143,
0.32753050327301025,
0.6790357828140259,
-0.47368931770324707,
-0.053923197090... | |
IList<T>, an ICollection<T>, or IEnumerable<T>. The generic interfaces will still work even for heterogenous lists because System.Object can be a T too. Doing this will save you headache if you decide to use a Stack or some other data structure further down the road. If all you need to do in the function is foreach through it, IEnumerable<T> is really all you should be asking for.
On the other hand, when returning an object out of a function, you want to give the user the richest possible set of operations without them having to cast around. So in that case, if | [
-0.03725188225507736,
-0.24059627950191498,
0.2447335124015808,
0.18925420939922333,
-0.22352324426174164,
0.2047039270401001,
0.15687528252601624,
-0.14776155352592468,
-0.18890465795993805,
-0.8944662809371948,
-0.030672550201416016,
0.4328465461730957,
-0.29168736934661865,
0.0618228577... | |
it's a List<T> internally, return a copy as a List<T>. | [
0.631262481212616,
0.056823328137397766,
0.26829198002815247,
0.14151953160762787,
0.11650914698839188,
-0.00933297909796238,
-0.18631796538829803,
0.15548263490200043,
-0.1933448165655136,
-0.6899808049201965,
-0.1595378816127777,
0.43760138750076294,
-0.09031053632497787,
0.3779104650020... | |
I've tried to do this several times with no luck. After reading [this post](https://stackoverflow.com/questions/1451/what-is-the-best-way-to-handle-multiple-permission-types#1477), it made me interested in doing this again. So can anyone tell me why the following doesn't work?
```
<?php
$guest = 1;
$editor = 2;
$admin = 4;
$user = $editor;
if( $user == ($editor | $admin) ) {
echo "Test";
}
?>
```
Use the bitwise OR operator (|) to set bits, use the AND operator (&) to check bits. Your code should look like this:
```
<?php
$guest = 1;
$editor = 2;
$admin = 4;
$user | [
0.22708041965961456,
0.1953457146883011,
0.2806345224380493,
-0.13129696249961853,
-0.07126384228467941,
-0.09866412729024887,
0.527718186378479,
-0.7061822414398193,
-0.19083741307258606,
-0.25909578800201416,
-0.14340616762638092,
0.4324066936969757,
-0.5358758568763733,
0.05015283450484... | |
= $editor;
if( $user & ($editor | $admin) ) {
echo "Test";
}
?>
```
If you don't understand binary and exactly what the bitwise operators do, you should go learn it. You'll understand how to do this much better. | [
0.07441382855176926,
0.11423392593860626,
-0.21223831176757812,
-0.26455000042915344,
0.023635374382138252,
-0.2725623548030853,
0.5633549690246582,
-0.3542240858078003,
0.15948998928070068,
-0.2509341537952423,
-0.19282245635986328,
0.489183634519577,
-0.45921313762664795,
-0.161566898226... | |
I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this:
```
Category | Revenue | Yearh | Month
Bikes 10 000 2008 1
Bikes 12 000 2008 2
Bikes 12 000 2008 3
Bikes | [
0.18668171763420105,
0.11461826413869858,
0.6727898716926575,
-0.08340024203062057,
-0.35295239090919495,
0.35040992498397827,
0.29624271392822266,
-0.20604240894317627,
-0.4418693482875824,
-0.17577460408210754,
0.6006072163581848,
0.6181735992431641,
0.33189231157302856,
0.01129974052309... | |
15 000 2008 1
Bikes 11 000 2007 2
Bikes 11 500 2007 3
Bikes 15 400 2007 4
```
... And so forth
The view has a product category, a revenue, a year and a month. I want to create | [
0.34140145778656006,
0.03463534265756607,
0.6812522411346436,
-0.3655714690685272,
-0.5357721447944641,
0.5576701164245605,
0.12644103169441223,
0.031097905710339546,
-0.04987187311053276,
-0.10419060289859772,
0.5148027539253235,
0.8198314905166626,
0.423234224319458,
-0.03159661591053009... | |
a report comparing 2007 and 2008, showing 0 for the months with no sales. So the report should look something like this:
```
Category | Month | Rev. This Year | Rev. Last Year
Bikes 1 10 000 0
Bikes 2 12 000 | [
0.14463192224502563,
-0.32152679562568665,
0.7037626504898071,
0.1050732210278511,
-0.45358455181121826,
0.2377009242773056,
0.24498535692691803,
-0.28607645630836487,
-0.38699817657470703,
-0.16476033627986908,
0.38332033157348633,
0.3750366270542145,
0.3401632010936737,
0.235392004251480... | |
11 000
Bikes 3 12 000 11 500
Bikes 4 0 15 400
```
The key thing to notice is how month 1 only has sales | [
0.4054979979991913,
-0.01601983793079853,
0.5497385859489441,
-0.08875717967748642,
-0.5936241149902344,
-0.0648937001824379,
0.15067489445209503,
0.036039698868989944,
-0.46950268745422363,
-0.1600283980369568,
0.0569390170276165,
0.35889342427253723,
0.004411956295371056,
-0.103636384010... | |
in 2008, and therefore is 0 for 2007. Also, month 4 only has no sales in 2008, hence the 0, while it has sales in 2007 and still show up.
Also, the report is actually for financial year - so I would love to have empty columns with 0 in both if there was no sales in say month 5 for either 2007 or 2008.
The query I got looks something like this:
```
SELECT
SP1.Program,
SP1.Year,
SP1.Month,
SP1.TotalRevenue,
IsNull(SP2.TotalRevenue, 0) AS LastYearTotalRevenue
FROM PVMonthlyStatusReport AS SP1 | [
0.000280193577054888,
-0.4109257161617279,
0.7219196557998657,
0.06721871346235275,
-0.3778423070907593,
0.31254124641418457,
-0.2135065197944641,
-0.10175126045942307,
-0.7680521607398987,
0.013860615901648998,
0.03388772904872894,
0.24481764435768127,
0.4649655222892761,
0.13907675445079... | |
LEFT OUTER JOIN PVMonthlyStatusReport AS SP2 ON
SP1.Program = SP2.Program AND
SP2.Year = SP1.Year - 1 AND
SP1.Month = SP2.Month
WHERE
SP1.Program = 'Bikes' AND
SP1.Category = @Category AND
(SP1.Year >= @FinancialYear AND SP1.Year <= @FinancialYear + 1) AND | [
-0.04427298530936241,
-0.3738407790660858,
0.9335657954216003,
0.08346248418092728,
0.00459664361551404,
-0.015473399311304092,
-0.11880501359701157,
-0.27801135182380676,
-0.7447819113731384,
-0.06390366703271866,
-0.041586730629205704,
0.3095945119857788,
0.31394875049591064,
-0.15052001... | |
((SP1.Year = @FinancialYear AND SP1.Month > 6) OR
(SP1.Year = @FinancialYear + 1 AND SP1.Month <= 6))
ORDER BY SP1.Year, SP1.Month
```
The problem with this query is that it would not return the fourth row in my example data above, since we didn't have any sales in 2008, but we actually did in 2007.
This is probably a common query/problem, but my SQL is rusty after doing front-end development for so long. Any help is greatly appreciated!
Oh, btw, I'm using SQL 2005 for this query so if there are any helpful new features that might | [
0.006371612194925547,
0.44739657640457153,
0.7950267791748047,
-0.10003580898046494,
-0.3888036906719208,
0.11390707641839981,
0.0836438313126564,
-0.09945642203092575,
-0.43142539262771606,
0.006512393243610859,
-0.14918579161167145,
0.2953636050224304,
0.2797095477581024,
0.4311143755912... | |
help me let me know.
The Case Statement is my best sql friend. You also need a table for time to generate your 0 rev in both months.
Assumptions are based on the availability of following tables:
> sales: Category | Revenue | Yearh |
> Month
and
> tm: Year | Month (populated with all
> dates required for reporting)
Example 1 without empty rows:
```
select
Category
,month
,SUM(CASE WHEN YEAR = 2008 THEN Revenue ELSE 0 END) this_year
,SUM(CASE WHEN YEAR = 2007 THEN Revenue ELSE 0 END) last_year
from
sales
where | [
-0.17641592025756836,
0.0799228772521019,
0.6988236308097839,
0.15867279469966888,
-0.01470588706433773,
-0.20078586041927338,
0.04059460014104843,
-0.296308696269989,
-0.01807628758251667,
-0.35731834173202515,
0.19022098183631897,
0.6432709693908691,
0.03549269959330559,
0.08885563164949... | |
year in (2008,2007)
group by
Category
,month
```
RETURNS:
```
Category | Month | Rev. This Year | Rev. Last Year
Bikes 1 10 000 0
Bikes 2 12 000 | [
-0.2800940275192261,
-0.0761004164814949,
0.7105362415313721,
-0.023461857810616493,
-0.3261948525905609,
0.39620792865753174,
0.2759895324707031,
-0.4000748097896576,
-0.5863036513328552,
-0.13542020320892334,
0.24171437323093414,
0.29314643144607544,
0.1925104707479477,
0.271715760231018... | |
11 000
Bikes 3 12 000 11 500
Bikes 4 0 15 400
```
Example 2 with empty rows:
I am going to use a sub query (but others may not) and will return | [
0.15206752717494965,
-0.024139219895005226,
0.48555809259414673,
0.07299613207578659,
-0.2166711837053299,
0.12141027301549911,
-0.0019983481615781784,
-0.4485657811164856,
-0.1634576916694641,
-0.5477420687675476,
0.1999162882566452,
0.6029879450798035,
-0.06620827317237854,
-0.3581039011... | |
an empty row for every product and year month combo.
```
select
fill.Category
,fill.month
,SUM(CASE WHEN YEAR = 2008 THEN Revenue ELSE 0 END) this_year
,SUM(CASE WHEN YEAR = 2007 THEN Revenue ELSE 0 END) last_year
from
sales
Right join (select distinct --try out left, right and cross joins to test results.
product | [
-0.08685987442731857,
0.2243098020553589,
0.5965870022773743,
-0.17435428500175476,
0.03923606127500534,
0.4196242392063141,
-0.09622175246477127,
-0.23558378219604492,
-0.1422550529241562,
-0.24390067160129547,
-0.12416538596153259,
0.34914618730545044,
0.032719071954488754,
0.58130925893... | |
,year
,month
from
sales --this ideally would be from a products table
cross join tm | [
0.5322535634040833,
0.11712469905614853,
0.46643930673599243,
-0.053670596331357956,
-0.010254113003611565,
-0.015200477093458176,
-0.08401274681091309,
0.06871892511844635,
-0.3429921567440033,
0.07893534004688263,
-0.31384050846099854,
0.05639088526368141,
0.4411165416240692,
0.567452132... | |
where
year in (2008,2007)) fill
where
fill.year in (2008,2007)
group by
fill.Category
,fill.month
```
RETURNS:
```
Category | Month | Rev. This Year | Rev. Last Year
Bikes 1 10 000 0
Bikes | [
-0.35477176308631897,
-0.12972484529018402,
0.6073992848396301,
-0.046230778098106384,
-0.013381349854171276,
0.6045253872871399,
-0.01848476566374302,
-0.445648193359375,
-0.6128673553466797,
-0.24362562596797943,
0.33514273166656494,
0.5737594366073608,
0.22846081852912903,
0.17329840362... | |
2 12 000 11 000
Bikes 3 12 000 11 500
Bikes 4 0 | [
0.3256305754184723,
-0.018073691055178642,
0.29489558935165405,
0.07938025891780853,
-0.44225525856018066,
0.2683572769165039,
0.04624408483505249,
-0.20788051187992096,
-0.32264184951782227,
-0.4542446732521057,
0.5029626488685608,
0.3019940257072449,
0.40036430954933167,
-0.1378479301929... | |
15 400
Bikes 5 0 0
Bikes 6 0 0
Bikes 7 | [
0.06421460956335068,
0.12785743176937103,
0.5367573499679565,
-0.025997193530201912,
-0.20977723598480225,
0.3560931980609894,
-0.016655899584293365,
-0.147226020693779,
-0.3330821096897125,
-0.46773889660835266,
0.1082913875579834,
0.3666798770427704,
0.38405531644821167,
0.17390324175357... | |
0 0
Bikes 8 0 0
```
Note that most reporting tools will do this crosstab or matrix functionality, and now that i think of it SQL Server 2005 has pivot syntax that will do this as well.
Here are some additional resources.
CASE
<https://web.archive.org/web/20210728081626/https://www.4guysfromrolla.com/webtech/102704-1.shtml>
SQL | [
0.2617781162261963,
0.0877784863114357,
0.2673836946487427,
0.09548169374465942,
-0.4722954332828522,
-0.11231600493192673,
-0.06250197440385818,
-0.13690920174121857,
-0.3036470413208008,
-0.05533087998628616,
0.231903538107872,
0.7116191983222961,
-0.18936125934123993,
-0.114461921155452... | |
SERVER 2005 PIVOT
<http://msdn.microsoft.com/en-us/library/ms177410.aspx> | [
-0.7721689939498901,
-0.17089316248893738,
0.35662367939949036,
0.030806856229901314,
-0.39854535460472107,
0.3779143989086151,
0.0854836031794548,
-0.029345745220780373,
-0.19740907847881317,
0.04761630296707153,
0.060533247888088226,
-0.14671508967876434,
-0.06369569152593613,
-0.3796303... | |
Browse to a webpage with hyperlinks using IE (I am using IE7) Once on the page, enlarge the fonts using ctl + mouse wheel. Now when you try to hover over the hyperlinks, they are laterally displaced to the right. To click on the link, i have to move the mouse to the right till the cursor turns into a hand.
Anyone has a comment on this??
---
[I was browsing the following page](http://blogs.msdn.com/tom/archive/2008/08/19/hyper-v-and-visual-studio-2008-sp1.aspx).
It is the 2nd hyperlink in the body of the article. (the link text is "here")
IE7 doesn't handle Zoom correctly, You can see this error on this page (I | [
-0.052321843802928925,
0.1920309066772461,
0.7416024804115295,
0.0017729346873238683,
-0.23201188445091248,
-0.2919343113899231,
0.4160967171192169,
0.35543355345726013,
-0.38006511330604553,
-0.6326327323913574,
-0.09650649130344391,
0.5441927313804626,
-0.11752277612686157,
0.29663988947... | |
mean the page you're reading right now) if you zoom large enough, view the logout | about link at the top, hover over it, hover off to the right, back over. | [
0.508716881275177,
-0.3534335792064667,
0.6790801286697388,
0.31055504083633423,
0.15788568556308746,
-0.4602786600589752,
-0.08169766515493393,
0.45880070328712463,
-0.17206138372421265,
-0.7986536622047424,
-0.19975653290748596,
0.3993167281150818,
-0.14745518565177917,
0.090715929865837... | |
I am trying to build a function in C/C++ to sort an array and replace each value with its "score" or rank. It takes in a double pointer array to an array of ints, and sorts the double pointers based on the dereferenced value of the integers. I have tried quite a few times to make it work, but can't get it down. Once again, it must sort the double pointers based on the values they point to. This is what I have:
```
void SortArray( int ** pArray, int ArrayLength )
{
int i, j, flag = 1; | [
-0.017872929573059082,
-0.014365813694894314,
0.20562194287776947,
-0.2213769257068634,
-0.0023206938058137894,
0.20767374336719513,
-0.028333356603980064,
-0.34921643137931824,
-0.03967162221670151,
-0.45895901322364807,
0.07483921200037003,
0.11920199543237686,
-0.5915406346321106,
0.150... | |
// set flag to 1 to begin initial pass
int * temp; // holding variable orig with no *
for(i = 1; (i <= ArrayLength) && flag; i++)
{
flag = 0;
for (j = 0; j < (ArrayLength -1); j++)
{
if (*pArray[j+1] > *pArray[j]) // ascending order simply changes to <
{ | [
0.0014895162312313914,
-0.2800217270851135,
0.5281230211257935,
-0.38766422867774963,
-0.1586102843284607,
0.29745158553123474,
0.47954875230789185,
-0.7487061023712158,
-0.16835202276706696,
-0.10135055333375931,
-0.14257046580314636,
0.18542024493217468,
-0.4535365104675293,
0.0710760653... | |
temp = &pArray[j]; // swap elements
pArray[j] = &pArray[j+1];
pArray[j+1] = &temp;
flag = 1; // indicates that a swap occurred. | [
-0.13508807122707367,
-0.1760958731174469,
-0.03349516913294792,
-0.1484176516532898,
0.026485854759812355,
0.39817872643470764,
0.4916534721851349,
-0.36228641867637634,
-0.10338754206895828,
0.07465194910764694,
-0.2397332340478897,
0.25607895851135254,
-0.570060133934021,
-0.26057279109... | |
}
}
}
}
```
You're close. You're referencing the address of the array items when you swap, which isn't necessary. The items in the array are pointers, and that's what needs to be swapped.
See below:
```
void SortArray( int ** pArray, int ArrayLength )
{
int i, j, flag = 1; // set flag to 1 to begin initial pass
int * temp; // holding variable orig with no *
for(i = ArrayLength - 1; i > | [
0.029165208339691162,
-0.19951912760734558,
0.28524693846702576,
-0.17544077336788177,
0.06311766058206558,
0.04681413248181343,
0.026113243773579597,
-0.36186733841896057,
-0.06168398633599281,
-0.5393756628036499,
-0.2330579310655594,
0.4370317757129669,
-0.4224484860897064,
-0.136961668... | |
0 && flag; i--)
{
flag = 0;
for (j = 0; j < i; j++)
{
if (*pArray[j] > *pArray[j+1]) // ascending order simply changes to <
{
temp = pArray[j]; | [
0.025816988199949265,
-0.17323215305805206,
0.4748956859111786,
-0.34052905440330505,
-0.055312588810920715,
0.2691914439201355,
0.6439322233200073,
-0.5588739514350891,
-0.18236541748046875,
-0.14904819428920746,
-0.20581063628196716,
0.32126492261886597,
-0.45674532651901245,
0.082617707... | |
// swap elements
pArray[j] = pArray[j+1];
pArray[j+1] = temp;
flag = 1; // indicates that a swap occurred.
} | [
-0.09681212157011032,
-0.3070055842399597,
-0.26514101028442383,
-0.12973672151565552,
0.16587603092193604,
0.368927001953125,
0.5008543729782104,
-0.29887092113494873,
-0.11073614656925201,
0.02821139618754387,
-0.14700756967067719,
0.35158035159111023,
-0.49974045157432556,
-0.1587330102... | |
}
}
}
```
Also, check out [this lovely blog post on Bubble Sorting](http://rant.blackapache.net/2008/08/14/sorting-algorithms-the-bubble-sort/) in case you're interested (sorry, shameless plug :)). Hope that helps you with your homework ;)
---
Edit: Note the subtle "optimisation" where you count back from the array length and only increment up until 'i' in the inner loop. This saves you from needlessly reparsing items that have already been sorted. | [
0.12710526585578918,
-0.11489797383546829,
0.1317664235830307,
-0.10388213396072388,
0.07997381687164307,
-0.07778805494308472,
0.1773415505886078,
0.38962605595588684,
-0.16923946142196655,
-0.6764917373657227,
0.004413625691086054,
0.42053499817848206,
-0.3170071244239807,
-0.06909497827... | |
How do I open the default mail program with a Subject and Body in a cross-platform way?
Unfortunately, this is for a a client app written in Java, not a website.
I would like this to work in a cross-platform way (which means Windows and Mac, sorry Linux). I am happy to execute a VBScript in Windows, or AppleScript in OS X. But I have no idea what those scripts should contain. I would love to execute the user's default program vs. just searching for Outlook or whatever.
In OS X, I have tried executing the command:
```
open mailto:?subject=MySubject&body=TheBody
```
URL escaping is needed to replace | [
0.31112268567085266,
0.3381918668746948,
0.39616599678993225,
-0.16128653287887573,
-0.30747053027153015,
-0.07371179759502411,
0.3900223970413208,
0.168838769197464,
-0.14819318056106567,
-0.9976646304130554,
-0.28031328320503235,
0.5017001628875732,
-0.4226008951663971,
0.098967961966991... | |
spaces with `%20`.
**Updated** On Windows, you have to play all sorts of games to get `start` to run correctly. Here is the proper Java incantation:
```
class Win32 extends OS {
public void email(String subject, String body) throws Exception {
String cmd = "cmd.exe /c start \"\" \"" + formatMailto(subject, body) + "\"";
Runtime.getRuntime().exec(cmd);
}
}
```
In Java 1.6 you have a stardard way to open the default mailer of the platform:
[the Desktop.mail(URI) method](http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html).The URI can be used to set all the fields of | [
-0.035760439932346344,
0.01606559567153454,
0.5704231262207031,
-0.19898296892642975,
-0.03161871060729027,
-0.16213248670101166,
0.10463833808898926,
-0.07878857105970383,
-0.007272328250110149,
-0.7657760977745056,
-0.3606336712837219,
0.7125669717788696,
-0.45582059025764465,
-0.0779932... | |
the mail (sender, recipients, body, subject).
You can check a full example of desktop integration in Java 1.6 on [Using the Desktop API in Java SE 6](http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/) | [
0.17910213768482208,
-0.006513075437396765,
0.3179282546043396,
0.03707486391067505,
-0.13777820765972137,
0.27922818064689636,
0.2584022581577301,
0.013815602287650108,
-0.3545275628566742,
-0.6710911393165588,
-0.33365485072135925,
0.4677608013153076,
-0.5007166266441345,
-0.338948190212... | |
I have a blogengine.net install that requires privatization.
I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met.
How can I privatize my blogEngine.net install so that readers must log in to read my posts?
I use this extension. Just save the file as RequireLogin.cs in your App\_Code\Extensions folder and make sure the extension is activated.
```
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using BlogEngine.Core;
using BlogEngine.Core.Web.Controls;
using System.Collections.Generic;
/// <summary>
/// Summary description for PostSecurity
/// </summary>
[Extension("Checks to see if a user can see this blog post.", | [
0.6126832962036133,
0.12220076471567154,
0.6438425779342651,
-0.043234702199697495,
-0.0018787566805258393,
-0.21975140273571014,
0.37002062797546387,
-0.40184229612350464,
-0.2748166620731354,
-0.6939102411270142,
-0.09464960545301437,
0.3862549364566803,
-0.42937541007995605,
0.404711574... | |
"1.0", "<a href=\"http://www.lavablast.com\">LavaBlast.com</a>")]
public class RequireLogin
{
static protected ExtensionSettings settings = null;
public RequireLogin()
{
Post.Serving += new EventHandler<ServingEventArgs>(Post_Serving);
ExtensionSettings s = new ExtensionSettings("RequireLogin");
// describe specific rules for entering parameters
s.Help = "Checks to see if the user has any of those roles before displaying the post. ";
s.Help += "You can associate a | [
0.009948831051588058,
-0.2725830376148224,
0.8443607091903687,
-0.24691981077194214,
0.0642760619521141,
0.039654817432165146,
0.48806115984916687,
-0.49373531341552734,
-0.07428005337715149,
-0.6282177567481995,
-0.40988853573799133,
0.4981118142604828,
-0.48761725425720215,
-0.0119093433... | |
role with a specific category. ";
s.Help += "All posts having this category will require that the user have the role. ";
s.Help += "A parameter with only a role without a category will enable to filter all posts to this role. ";
ExtensionManager.ImportSettings(s);
settings = ExtensionManager.GetSettings("PostSecurity");
}
protected void Post_Serving(object sender, ServingEventArgs e)
{
MembershipUser | [
0.0653512105345726,
-0.44100385904312134,
0.4964849054813385,
-0.25668132305145264,
-0.09140753000974655,
-0.01837085373699665,
0.4436303377151489,
-0.1967562884092331,
-0.3096151351928711,
-0.5203641057014465,
-0.25790053606033325,
0.30046555399894714,
-0.6564058065414429,
0.1654220372438... | |
user = Membership.GetUser();
if(HttpContext.Current.Request.RawUrl.Contains("syndication.axd"))
{
return;
}
if (user == null)
{
HttpContext.Current.Response.Redirect("~/Login.aspx");
}
}
}
``` | [
-0.19578583538532257,
-0.2472967803478241,
0.6785259246826172,
-0.273844450712204,
-0.002834542654454708,
-0.11002562195062637,
0.21082015335559845,
-0.13451124727725983,
-0.2985772490501404,
-0.639379620552063,
-0.4559228718280792,
0.470307856798172,
-0.5269594192504883,
0.522232770919799... | |
Try loading [this normal .jpg file](http://www.zodiacwheels.com/images/wheels/blackout_thumb.jpg) in Internet Explorer 6.0. I get an error saying the picture won't load. Try it in any other browser and it works fine. What's wrong? The .jpg file is just a normal picture sitting on the web server. I can even create a simple web page:
```
<a href="http://www.zodiacwheels.com/images/wheels/blackout_thumb.jpg">blah</a>
```
and use right click + save target as with IE6 to save it to my desktop, and it's a valid JPG file. However, *it won't load in the browser!*
Why?!
I even tried checking the header response and MIME type and it looks fine:
```
andy@debian:~$ telnet www.zodiacwheels.com 80
Trying 72.167.174.247...
Connected to zodiacwheels.com.
Escape | [
0.29658064246177673,
-0.17616693675518036,
0.5473635196685791,
0.31523850560188293,
-0.14386551082134247,
-0.16962693631649017,
0.5818296670913696,
0.04844937101006508,
-0.8680160641670227,
-0.3902376592159271,
0.38114094734191895,
0.5849966406822205,
-0.8183290362358093,
-0.17599318921566... | |
character is '^]'.
HEAD /images/wheels/blackout_thumb.jpg HTTP/1.1
Host: www.zodiacwheels.com
HTTP/1.1 200 OK
Date: Wed, 20 Aug 2008 06:19:04 GMT
Server: Apache
Last-Modified: Wed, 20 Aug 2008 00:29:36 GMT
ETag: "1387402-914ac-48ab6570"
Accept-Ranges: bytes
Content-Length: 595116
Content-Type: image/jpeg
```
The site needs to be able to work with IE6, how come it won't load a simple .jpg file?
The JPG you uploaded is in [CMYK](http://en.wikipedia.org/wiki/Cmyk), IE and Firefox versions before 3 can't read these. Open it using Photoshop (or anything similar, I'm sure GIMP would work too) and resave it in [RGB](http://en.wikipedia.org/wiki/Rgb).
edit: Further Googling makes me suspect that CMYK isn't really a part of the jpeg standard, but **can** be shoehorned in there. That's why some | [
-0.21894775331020355,
-0.02205628529191017,
0.7611023783683777,
-0.03962569311261177,
-0.36746299266815186,
0.13067559897899628,
0.28659316897392273,
0.02774730697274208,
-0.5624308586120605,
-0.22171761095523834,
0.08566147089004517,
0.06820797920227051,
-0.111353799700737,
-0.33360892534... | |
software does not consider the file valid. It does however open just fine in Photoshop CS3, and shows a cmyk colorspace. | [
0.18845103681087494,
0.21891389787197113,
0.554614782333374,
0.18144792318344116,
0.11424528062343597,
-0.4281991422176361,
0.0036772226449102163,
-0.21523939073085785,
-0.18366676568984985,
-0.38573157787323,
-0.06711845844984055,
0.18390393257141113,
-0.24160100519657135,
-0.092910774052... | |
Summary
-------
Hi All,
OK, further into my adventures with custom controls...
In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong!
1. **UserControls** - Which inherit from *UserControl* and are contained within an *ASCX* file. These are pretty limited in what they can do, but are a quick and light way to get some UI commonality with designer support.
2. **Custom Composite Controls** - These are controls that inherit from *WebControl* where you add pre-existing controls to the control within the *CreateChildControls* method. This provides great | [
0.44035249948501587,
0.017886696383357048,
0.19411714375019073,
0.39397338032722473,
-0.17692892253398895,
0.05460673198103905,
0.023210875689983368,
-0.13520574569702148,
-0.2835949957370758,
-0.7107956409454346,
0.17569556832313538,
0.6315119862556458,
-0.10973531007766724,
0.02921783737... | |
flexibility, but lack of designer support without additional coding. They are highly portable though since they can be compiled into a DLL.
3. **Custom Rendered Controls** - Similar to Custom Composite Controls, these are added to a Web Control Library project. The rendering of the control is completely controlled by the programmer by overriding the *Render* method.
My Thoughts..
-------------
OK, so while playing with custom composites, I found the following:
* You have little/no control over the HTML output making it difficult to "debug".
* The *CreateChildControls* (and subsequent methods) can get real busy with *Controls.Add(myControl)* everywhere.
* I found rendering tables (be it for layout | [
0.08218599855899811,
-0.17186804115772247,
0.24361084401607513,
0.17343944311141968,
-0.2920572757720947,
0.10798609256744385,
0.12660877406597137,
-0.18352891504764557,
-0.3120090663433075,
-0.9286884665489197,
0.07131525874137878,
0.49993303418159485,
-0.15258406102657318,
-0.21071751415... | |
or content) to be considerably awkward.
The Question(s)..
-----------------
So, I admit, I am new to this so I could be way off-base with some of my points noted above..
* Do you use Composites?
* Do you have any neat tricks to control the HTML output?
* Do you just say "to hell with it" and go ahead and create a custom rendered control?
**Its something I am keen to get really firm in my mind since I know how much *good* control development can cut overall development time.**
I look forward to your answers ^\_^
I say go ahead with the custom rendered control. I find that | [
0.5214720964431763,
0.14237552881240845,
0.13539326190948486,
0.3404029905796051,
-0.3056832551956177,
0.20669838786125183,
0.2356903851032257,
0.2373996376991272,
-0.3181720972061157,
-0.6985020637512207,
-0.06923514604568481,
0.5298333764076233,
-0.07710213959217072,
-0.3266702890396118,... | |
in most cases the composite can be easier done and used in a UserControl, but anything beyond that and you'd need to have a finer degree of control (pun unintended) to merit your own rendering strategy.
There maybe controls that are simple enough to merit a composite (e.g., a textbox combined with a javascript/dhtml based datepicker, for example) but beyond that one example, it looks like custom rendered controls are the way to go. | [
0.17983171343803406,
-0.0015454021049663424,
0.07703781872987747,
0.23711571097373962,
-0.23401892185211182,
0.2791111171245575,
0.08410590887069702,
-0.052738532423973083,
-0.17561979591846466,
-0.7999515533447266,
0.051278382539749146,
0.5010852813720703,
-0.25008344650268555,
-0.3425959... | |
Can anyone suggest some good browser add-on tools/extensions to help with development?
I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions?
[Firebug](https://addons.mozilla.org/en-US/firefox/addon/1843)
Firefox:
* [Inspect This](https://addons.mozilla.org/en-US/firefox/addon/1913) if you use the DOM Inspector at all
* [Measure It](https://addons.mozilla.org/en-US/firefox/addon/539) for telling you pixel distances (if you need that)
* [IE View](https://addons.mozilla.org/en-US/firefox/addon/35) or [Safari View](https://addons.mozilla.org/en-US/firefox/addon/4641) for ease of testing in other browsers
* [HTML Validator](https://addons.mozilla.org/en-US/firefox/addon/249) if you care about validation
* [Console2](https://addons.mozilla.org/en-US/firefox/addon/1815) to improve your js error console
* The [Javascript Shell](https://www.squarefree.com/bookmarklets/webdevel.html) bookmarklet is also handy (and look at the others there as well)
Edit: This is in addition to the [Web Development | [
0.26500147581100464,
0.21745255589485168,
0.3971916735172272,
0.2677636742591858,
-0.4076390564441681,
-0.001927700825035572,
0.13051193952560425,
-0.4679826498031616,
-0.24196739494800568,
-0.711319625377655,
0.30640700459480286,
0.3199823796749115,
-0.2991878092288971,
-0.348228842020034... | |
Toolbar](https://addons.mozilla.org/en-US/firefox/addon/60) mentioned by others | [
0.3303000032901764,
0.10726926475763321,
-0.01511596329510212,
0.04076407477259636,
0.21375419199466705,
0.1432071179151535,
-0.05578272044658661,
-0.2290584295988083,
-0.5110788941383362,
-0.2764854431152344,
-0.18159779906272888,
0.5004540681838989,
-0.45556044578552246,
-0.2179522514343... | |
What is the most proper way to sending email of minimal 1000 or more in PHP? Any reliable email queuing technique that is capable to handle that?
You could just insert your emails into a Mail Queue database table, and have a separate process check the queue and batch send a certain number at once. | [
0.3326992988586426,
0.11378447711467743,
0.1532958745956421,
0.4147704541683197,
-0.16394570469856262,
0.06766017526388168,
0.16608908772468567,
-0.01943773403763771,
-0.18127748370170593,
-0.5502630472183228,
0.4153039753437042,
0.33061203360557556,
-0.06667785346508026,
-0.16055050492286... | |
I have a table with a 'filename' column.
I recently performed an insert into this column but in my haste forgot to append the file extension to all the filenames entered. Fortunately they are all '.jpg' images.
How can I easily update the 'filename' column of these inserted fields (assuming I can select the recent rows based on known id values) to include the '.jpg' extension?
The solution is:
```
UPDATE tablename SET [filename] = RTRIM([filename]) + '.jpg' WHERE id > 50
```
RTRIM is required because otherwise the [filename] column in its entirety will be selected for the string concatenation i.e. if it is a varchar(20) | [
0.08704216778278351,
0.27170875668525696,
0.7730880379676819,
-0.087160125374794,
-0.1308313012123108,
0.10358841717243195,
0.06572908908128738,
-0.6787028312683105,
-0.2599177956581116,
-0.6063146591186523,
-0.0814017727971077,
0.6602070927619934,
-0.17383459210395813,
0.03637245669960975... | |
column and filename is only 10 letters long then it will still select those 10 letters and then 10 spaces. This will in turn result in an error as you try to fit 20 + 3 characters into a 20 character long field. | [
-0.15892307460308075,
0.0134406927973032,
0.6442556381225586,
-0.033354584127664566,
0.11376477032899857,
0.22314225137233734,
0.047546546906232834,
-0.28943967819213867,
-0.1728205680847168,
-0.6979323625564575,
0.013277370482683182,
0.19040155410766602,
-0.05592915043234825,
0.0263382606... | |
Am I correct in assuming that the only difference between "windows files" and "unix files" is the linebreak?
We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format.
I need to automate the translation between unix/windows before the files get delivered to the system in our "transportsystem". I'll probably need something to determine the current format and something to transform it into the other format.
If it's just the newline thats the big difference then I'm considering just reading the files with the java.io. As far as I know, they | [
0.30628615617752075,
-0.07379821687936783,
0.47559553384780884,
0.08018086850643158,
0.11325478553771973,
-0.24669958651065826,
0.17769496142864227,
-0.08956671506166458,
-0.42915740609169006,
-0.8299503922462463,
0.012007046490907669,
0.5271963477134705,
-0.06687409430742264,
0.3212025463... | |
are able to handle both with readLine. And then just write each line back with
```
while (line = readline)
print(line + NewlineInOtherFormat)
....
```
---
Summary:
--------
> [samjudson](https://stackoverflow.com/users/1908/samjudson):
>
>
>
> > *This is only a difference in text files, where UNIX uses a single Line Feed (LF) to signify a new line, Windows uses a Carriage Return/Line Feed (CRLF) and Mac uses just a CR.*
>
>
> to which [Cebjyre](https://stackoverflow.com/users/1612/cebjyre) elaborates:
>
>
>
> > *OS X uses LF, the same as UNIX - MacOS 9 and below did use CR though*
>
>
> [Mo](https://stackoverflow.com/users/1870/mo)
>
>
>
> > *There could also | [
-0.05333135649561882,
0.009394335560500622,
1.0051029920578003,
-0.07873682677745819,
-0.15261584520339966,
0.1558660864830017,
-0.1685556024312973,
-0.24772123992443085,
-0.4147483706474304,
-0.6382008194923401,
-0.4397558271884918,
0.18272018432617188,
-0.28161492943763733,
0.11687629669... | |
be a difference in character encoding for national characters. There is no "unix-encoding" but many linux-variants use UTF-8 as the default encoding. Mac OS (which is also a unix) uses its own encoding (macroman). I am not sure, what windows default encoding is.*
>
>
> [McDowell](https://stackoverflow.com/users/304/mcdowell)
>
>
>
> > *In addition to the new-line differences, the byte-order mark can cause problems if files are treated as Unicode on Windows.*
>
>
> [Cheekysoft](https://stackoverflow.com/users/1820/cheekysoft)
>
>
>
> > *However, another set of problems that you may come across can be related to single/multi-byte character encodings. If you see strange unexpected chars | [
0.10662460327148438,
-0.11315830051898956,
0.23534834384918213,
-0.2246374636888504,
-0.15705041587352753,
0.28420501947402954,
0.1442556232213974,
-0.11405915766954422,
-0.23711322247982025,
-0.8934842944145203,
-0.21369153261184692,
0.33511456847190857,
-0.05258454754948616,
0.1364337503... | |
(not at end-of-line) then this could be the reason. Especially if you see square boxes, question marks, upside-down question marks, extra characters or unexpected accented characters.*
>
>
> [Sadie](https://stackoverflow.com/users/1000/sadie)
>
>
>
> > *On unix, files that start with a . are hidden. On windows, it's a filesystem flag that you probably don't have easy access to. This may result in files that are supposed to be hidden now becoming visible on the client machines.*
> >
> >
> > File permissions vary between the two. You will probably find, when you copy files onto a unix system, that the | [
0.09240079671144485,
-0.013486415147781372,
0.22003096342086792,
-0.104576475918293,
0.10047538578510284,
-0.20473690330982208,
0.23886270821094513,
0.16105596721172333,
-0.4798412322998047,
-0.3644905984401703,
-0.31499892473220825,
0.07384240627288818,
0.017420189455151558,
0.32225778698... | |
files now belong to the user that did the copying and have limited rights. You'll need to use chown/chmod to make sure the correct users have access to them.
There exists tools to help with the problem:
> [pauldoo](https://stackoverflow.com/users/755/pauldoo)
>
>
>
> > *If you are just interested in the content of text files, then yes the line endings are different. Take a look at something like dos2unix, it may be of help here.*
>
>
> [Cheekysoft](https://stackoverflow.com/users/1820/cheekysoft)
>
>
>
> > *As pauldoo suggests, tools like dos2unix can be very useful. Note that these may be on your linux/unix system as fromdos | [
0.11605692654848099,
-0.057921022176742554,
0.3322915732860565,
0.16161911189556122,
0.01102429162710905,
-0.23316600918769836,
0.12625059485435486,
0.20734679698944092,
-0.20722170174121857,
-0.7791460752487183,
-0.25646600127220154,
0.545807957649231,
0.009403977543115616,
0.332153439521... | |
or tofrodos, or perhaps even as the general purpose toolbox recode.*
Help for java coding
> [Cheekysoft](https://stackoverflow.com/users/1820/cheekysoft)
>
>
>
> > *When writing to files or reading from files (that you are in control of), it is often worth specifying the encoding to use, as most Java methods allow this. However, also ensuring that the system locale matches can save a lot of pain*
This is only a difference in text files, where UNIX uses a single Line Feed (LF) to signify a new line, Windows uses a Carriage Return/Line Feed (CRLF) and Mac uses just a CR.
Binary files there should be no | [
0.1702510416507721,
-0.08139529824256897,
0.6168014407157898,
-0.065751813352108,
-0.19044040143489838,
0.12979574501514435,
0.003894608234986663,
-0.12529894709587097,
-0.09556112438440323,
-0.7748783826828003,
-0.29619714617729187,
0.371974378824234,
-0.10271891951560974,
-0.138116285204... | |
difference (i.e. a JPEG on a windows machine will be byte for byte the same as the same JPEG on a unix box.) | [
-0.18522420525550842,
0.06521285325288773,
0.14690835773944855,
0.10600737482309341,
-0.31959137320518494,
0.0936204195022583,
-0.37685802578926086,
-0.28960052132606506,
-0.11216188222169876,
-0.5558643937110901,
0.03469447046518326,
0.2762329578399658,
-0.2042822241783142,
0.173099115490... | |
We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function [CryptEncrypt.](http://msdn.microsoft.com/en-us/library/aa379924.aspx) (direct and de-cryptable)
The problem is that CryptEncrypt can produce NULL's in the output, meaning that when it's stored in the database, the string manipulations will at some point truncate the CipherText.
Ideally we'd like to use an algo that will produce CipherText that doesn't contain NULLs as that will cause the least amount of change to the existing databases | [
-0.09170134365558624,
0.1542845070362091,
0.08514231443405151,
0.22754456102848053,
0.1810503751039505,
-0.1986348032951355,
0.29878124594688416,
0.05645262077450752,
-0.07971885055303574,
-0.537660539150238,
-0.2921670377254486,
0.32638561725616455,
-0.33123576641082764,
0.315706193447113... | |
(changing a column from string to binary and code to deal with binary instead of strings) and just decrypt existing data and re-encrypt with the new algorithm at database upgrade time.
The algorithm doesn't need to be the most secure, as the database is already in a reasonably secure environment (not an open network / the inter-webs) but does need to be better than ROT13 (which I can almost decrypt in my head now!)
edit: btw, any particular reason for changing ciphertext to cyphertext? ciphertext seems more widely used...
Any semi-decent algorithm will end up with a strong chance of generating a NULL | [
0.07476630806922913,
0.13240529596805573,
0.12012454122304916,
0.09450776875019073,
-0.12501156330108643,
-0.3142564296722412,
0.6599722504615784,
-0.04130466282367706,
-0.21794554591178894,
-0.5809468030929565,
-0.24995775520801544,
0.24131564795970917,
-0.5115480422973633,
0.216705918312... | |
value somewhere in the resulting ciphertext.
Why not do something like [base-64 encode](http://en.wikipedia.org/wiki/Base64) your resulting binary blob before persisting to the DB? ([sample implementation in C++](http://synesis.com.au/software/b64.html)). | [
0.35673820972442627,
0.09937909245491028,
0.006456797476857901,
-0.1397116482257843,
0.14201940596103668,
0.098892942070961,
0.24086928367614746,
-0.20561255514621735,
0.014936696738004684,
-0.3577650785446167,
-0.3307059407234192,
0.08401185274124146,
-0.447875052690506,
0.140163719654083... | |
I know this is not programming directly, but it's regarding a development workstation I'm setting up.
I've got a Windows Server 2003 machine that needs to be on two LAN segments at the same time. One of them is a 10.17.x.x LAN and the other is 10.16.x.x
The problem is that I don't want to be using up the bandwidth on the 10.16.x.x network for internet traffic, etc (this network is basically only for internal stuff, though it does have internet access) so I would like the system to use the 10.17.x.x connection for anything that is external to the LAN (and | [
0.24834658205509186,
0.2966640889644623,
0.23717299103736877,
0.23219947516918182,
-0.07634879648685455,
-0.12975062429904938,
0.010740023106336594,
0.1608438938856125,
-0.3675205409526825,
-0.8753445148468018,
0.2028808891773224,
0.7652460932731628,
-0.334670752286911,
0.25957658886909485... | |
for anything on 10.17.x.x of course, and to only use the 10.16.x.x connection for things that are on *that* specific LAN.
I've tried looking into the windows "route" command but it's fairly confusing and won't seem to let me delete routes tha tI believe are interfering with what I want it to do. Is there a better way of doing this? Any good software for segmenting your LAN access?
I'm no network expert but I have fiddled with the route command a number of times...
```
route add 0.0.0.0 MASK 0.0.0.0 <address of gateway on 10.17.x.x net>
```
Will route all default traffic through the 10.17.x.x | [
0.4714524447917938,
0.2608010172843933,
0.6109630465507507,
-0.2518032193183899,
-0.04346024617552757,
-0.08456027507781982,
0.47272664308547974,
0.06482469290494919,
-0.24655652046203613,
-1.095367193222046,
-0.09516582638025284,
0.6632335782051086,
-0.41590532660484314,
0.087330937385559... | |
gateway, if you find that it still routes through the other interface, you should make sure that the new rule has a lower metric than the existing routes. Do this by adding METRIC 1 for example to the end of the line above.
You could also adjust the metric in the Advanced TCP/IP Settings window of the 10.17.x.x interface, unticking the Automatic Metric checkbox and setting the value to something low, like 1 or 2. | [
-0.1195773109793663,
-0.27028003334999084,
0.2776210308074951,
0.1625315248966217,
-0.14968442916870117,
-0.28848350048065186,
0.26038190722465515,
-0.05723169818520546,
-0.32523125410079956,
-1.196300983428955,
0.1452009677886963,
0.15685951709747314,
-0.24875088036060333,
0.0881738588213... | |
When compiling my C++ .Net application I get 104 warnings of the type:
```
Warning C4341 - 'XX': signed value is out of range for enum constant
```
Where XX can be
* WCHAR
* LONG
* BIT
* BINARY
* GUID
* ...
I can't seem to remove these warnings whatever I do. When I double click on them it takes me to a part of my code that uses OdbcParameters - any when I try a test project with all the rest of my stuff but no OdbcParameters it doesn't give the warnings.
Any idea how I can get rid of these warnings? They're making real warnings from code I've | [
0.3891300857067108,
0.6201282143592834,
0.16418148577213287,
-0.33176806569099426,
-0.24445025622844696,
0.16669228672981262,
0.5811558365821838,
-0.12340442091226578,
-0.41312259435653687,
-0.3452337980270386,
-0.00017615796241443604,
0.5842627286911011,
-0.4721953868865967,
0.19740702211... | |
actually written hard to see - and it just gives me a horrible feeling knowing my app has 104 warnings!
This is a [compiler bug](http://forums.msdn.microsoft.com/en-US/vclanguage/thread/7bc77d72-c223-4d5e-b9f7-4c639c68b624/). Here's [another post](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=159519&SiteID=1) confirming it's a known issue. I've got the same issue in one of my projects and there's no way to prevent it from being triggered unless you have some way of avoiding the use of OdbcParameter. The most conservative way to suppress only the buggy warnings is to use
```
#pragma warning( push )
#pragma warning( disable: 4341 )
// code affected by bug
#pragma warning( pop )
``` | [
0.4313066303730011,
0.3030726909637451,
0.3100190758705139,
0.27231743931770325,
-0.13317972421646118,
-0.2269536703824997,
0.4495137333869934,
0.14041228592395782,
-0.24779921770095825,
-0.4417758882045746,
-0.062248338013887405,
0.2920587658882141,
-0.39998042583465576,
-0.12307499349117... | |
I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem).
The problem is that if I include an external component I always get the following warning:
> Found conflicts between different versions of the same dependent assembly.
What exactly does this warning mean and is there maybe a possibility to exclude this warning (like using #pragma disable in the source code files)?
This warning means that two projects reference the same assembly (e.g. `System.Windows.Forms`) but the two projects require different versions. You | [
0.73787921667099,
0.17044493556022644,
0.30065178871154785,
-0.15878379344940186,
0.02238192968070507,
-0.049991000443696976,
0.31089407205581665,
-0.30825796723365784,
-0.1760006994009018,
-0.853744626045227,
-0.00795077160000801,
0.43788355588912964,
-0.28931617736816406,
0.2423488199710... | |
have a few options:
1. Recompile all projects to use the same versions (e.g. move all to .Net 3.5). This is the preferred option because all code is running with the versions of dependencies they were compiled with.
2. Add a [binding redirect](http://msdn.microsoft.com/en-us/library/433ysdt1.aspx). This will suppress the warning. However, your .Net 2.0 projects will (at runtime) be bound to the .Net 3.5 versions of dependent assemblies such as `System.Windows.Forms`. You can quickly add a binding redirect by double-clicking on error in Visual Studio.
3. Use `CopyLocal=true`. I'm not sure if this will suppress the warning. It will, like option 2 above, mean that | [
0.5638733506202698,
-0.06018773093819618,
0.39756491780281067,
-0.0288624819368124,
-0.15530788898468018,
-0.6041479706764221,
0.5765988230705261,
-0.34096407890319824,
-0.20454442501068115,
-0.5801889896392822,
-0.36442384123802185,
0.6635355353355408,
-0.6926167011260986,
0.2027360051870... | |
all projects will use the .Net 3.5 version of System.Windows.Forms.
Here are a couple of ways to identify the offending reference(s):
* You can use a utility such as the one found at
<https://gist.github.com/1553265>
* Another simple method is to set Build
output verbosity (Tools, Options, Projects and Solutions, Build and
Run, MSBuild project build output verbosity, Detailed) and after
building, search the output window for the warning, and look at the
text just above it. *(Hat tip to [pauloya](https://stackoverflow.com/users/44547/pauloya) who suggested this in the
comments on this answer)*. | [
0.16656364500522614,
0.03313472867012024,
0.4291360676288605,
0.0818023532629013,
-0.332728773355484,
-0.1505667120218277,
0.6052868366241455,
-0.04807348921895027,
-0.15614715218544006,
-0.4872649312019348,
-0.24473047256469727,
0.4175296723842621,
-0.3186837434768677,
0.03194870799779892... | |
I've found a few resources on the subject, but they all require a deep understanding of [SmallTalk](http://en.wikipedia.org/wiki/Smalltalk) or [Haskell](http://en.wikipedia.org/wiki/Haskell_%28programming_language%29), neither of which I know.
Here are some parser combinator libraries in more mainstream languages:
* [Spirit](http://spirit.sourceforge.net/documentation.html) (C++)
* [Jparsec](http://jparsec.codehaus.org/) (Java) | [
-0.11282114684581757,
0.31234389543533325,
0.0015482354210689664,
0.043924689292907715,
-0.2518349885940552,
0.017386125400662422,
0.5915352702140808,
-0.26147106289863586,
-0.16561484336853027,
-0.46179911494255066,
-0.4160352349281311,
0.41836118698120117,
-0.28432774543762207,
-0.290780... | |
Is there a way to select data where any one of multiple conditions occur on the same field?
Example: I would typically write a statement such as:
```
select * from TABLE where field = 1 or field = 2 or field = 3
```
Is there a way to instead say something like:
```
select * from TABLE where field = 1 || 2 || 3
```
Any help is appreciated.
Sure thing, the simplest way is this:
```
select foo from bar where baz in (1,2,3)
``` | [
0.12111395597457886,
0.06724333763122559,
-0.1495867222547531,
-0.05885479226708412,
-0.12440361827611923,
-0.031076956540346146,
0.0607687309384346,
-0.025576338171958923,
-0.12792262434959412,
-0.38257285952568054,
-0.15260174870491028,
0.5228428840637207,
-0.49963894486427307,
-0.055360... | |
Suppose I have two applications written in C#. The first is a third party application that raises an event called "OnEmailSent".
The second is a custom app that I've written that I would like to somehow subscribe to the "OnEmailSent" even of the first application.
Is there any way that I could somehow attach the second application to an instance of the first application to listen for "OnEmailSent" event?
---
So for further clarification, my specific scenario is that we have a custom third party application written in c# that raises an "OnEmailSent" event. We can see the event exists using reflector.
What we want | [
0.3166031837463379,
-0.20403823256492615,
0.07029440253973007,
0.09780558943748474,
-0.14193664491176605,
0.051165081560611725,
0.07678554952144623,
0.16695193946361542,
-0.30535998940467834,
-0.7202169895172119,
0.33371660113334656,
0.5413325428962708,
-0.32732000946998596,
0.035928174853... | |
to do is have some other actions take place when this component sends an email.
The most efficient way we can think of would be to be able to use some form of IPC as anders has suggested and listen for the OnEmailSent event being raised by the third party component.
Because the component is written in C# we are toying with the idea of writing another C# application that can attach itself to the executing process and when it detect the OnEmailSent event has been raise it will execute it's own event handling code.
---
I might be missing something, but from what | [
0.3184928596019745,
-0.09496510028839111,
0.009853133000433445,
0.25573262572288513,
-0.1645134687423706,
-0.4044325649738312,
0.328707218170166,
-0.2063700407743454,
-0.29577022790908813,
-0.24595442414283752,
0.009742340072989464,
0.58067786693573,
-0.2885333001613617,
-0.229782938957214... | |
I understand of how remoting works is that there would need to be a server defining some sort of contract that the client can subscribe to.
I was more thinking about a scenario where someone has written a standalone application like outlook for example, that exposes events that I would like to subscribe to from another application.
I guess the scenario I'm thinking of is the .net debugger and how it can attach to executing assemblies to inspect the code whilst it's running.
In order for two applications (separate processes) to exchange events, they must agree on how these events are communicated. There | [
0.41548043489456177,
-0.04459157586097717,
0.29481738805770874,
-0.03948561102151871,
-0.30147919058799744,
-0.1929043084383011,
0.38924434781074524,
-0.04942960664629936,
-0.3646811842918396,
-0.40985432267189026,
0.126691073179245,
0.5647143721580505,
-0.3955438733100891,
0.0772922635078... | |
are many different ways of doing this, and exactly which method to use may depend on architecture and context. The general term for this kind of information exchange between processes is [Inter-process Communication (IPC)](http://en.wikipedia.org/wiki/Inter-process_communication). There exists many standard ways of doing IPC, the most common being files, pipes, (network) sockets, [remote procedure calls (RPC)](http://en.wikipedia.org/wiki/Remote_procedure_call) and shared memory. On Windows it's also common to use [window messages](http://msdn.microsoft.com/en-us/library/aa931932.aspx).
I am not sure how this works for .NET/C# applications on Windows, but in native Win32 applications you can [hook on to the message loop of external processes and "spy" on the messages they are | [
0.5251560211181641,
-0.003152040299028158,
0.04960094392299652,
0.2211637943983078,
0.05691062659025192,
-0.2301962673664093,
-0.13501708209514618,
0.04935387521982193,
-0.5209257006645203,
-0.5845855474472046,
-0.21515031158924103,
0.25311771035194397,
-0.3031950891017914,
0.2912655770778... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.