text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
"must-revalidate"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1
Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1
Response.AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1
Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1
``` | [
0.17803986370563507,
0.33673110604286194,
0.8416123390197754,
-0.17565329372882843,
0.1318613737821579,
-0.12342631816864014,
0.9676274061203003,
-0.272125780582428,
-0.2574228048324585,
-0.16722750663757324,
-0.5170691013336182,
0.4508941173553467,
-0.6453001499176025,
0.4770934283733368,... | |
Does anyone know how IE7 determines what Security Zone to use for a site? I see the basics for IE6 [here](http://www.microsoft.com/technet/prodtechnol/ie/reskit/6/default.mspx?mfr=true), but I can't find the equivalent for IE7.
I could use a little more information to narrow down my answer, but here is what I have:
Internet Explorer has 5 different security zones be default: Local Machine Zone, Intranet, Internet, Trusted, and Restricted
These are determined in urlmon.dll (Url Moniker)
More information here: <http://msdn.microsoft.com/en-us/library/ms537183(VS.85).aspx>
But you can also implement your own custom security zone:
<http://msdn.microsoft.com/en-us/library/ms537182(VS.85).aspx>
The way that IE determines the security zones should not have changes between IE6 and IE7 (or IE8 for that matter)
Intranet | [
0.36404868960380554,
-0.10063286125659943,
0.45898017287254333,
0.14913086593151093,
0.04568899795413017,
-0.33639654517173767,
0.27629509568214417,
0.05723030865192413,
-0.417031466960907,
-0.7394323945045471,
-0.27875784039497375,
0.41071122884750366,
-0.0757681205868721,
0.1495909839868... | |
sites are determined:
1. By url host names do not have any dots (<http://stackoverflow> vs <http://stackoverflow.com>)
2. Sites from the file:// scheme where the resource is collected from UNC | [
0.01851704716682434,
-0.01335857156664133,
0.6098000407218933,
0.1662074774503708,
0.11590534448623657,
-0.15661339461803436,
0.21654610335826874,
-0.12407579272985458,
-0.3915875554084778,
-0.6328787207603455,
-0.4294964075088501,
-0.18082284927368164,
0.05331726744771004,
0.4434756040573... | |
Where can I get some decent looking free ASP.Net or CSS themes?
I wouldn't bother looking for ASP.NET stuff specifically (probably won't find any anyways). Finding a good CSS theme easily can be used in ASP.NET.
Here's some sites that I love for CSS goodness:
<http://www.freecsstemplates.org/>
<http://www.oswd.org/>
<http://www.openwebdesign.org/>
<http://www.styleshout.com/>
<http://www.freelayouts.com/> | [
0.5779179930686951,
-0.12027845531702042,
0.18235096335411072,
0.4195837378501892,
-0.02995363622903824,
-0.007899250835180283,
-0.06466154009103775,
0.2879505455493927,
-0.39820626378059387,
-0.8576456904411316,
0.13170628249645233,
0.34338483214378357,
0.03386223688721657,
0.195107951760... | |
Anything thats as good and as stable and as feature-rich as gigaspaces?
Gigaspaces is top notch as far as a Javaspaces implementation goes for scalability and performance. Are you restricted to a Javaspaces implementation? Blitz Javaspaces is top notch for a free product. | [
0.28121939301490784,
-0.08581613004207611,
0.02165018767118454,
0.07536236196756363,
-0.3292035758495331,
-0.44027793407440186,
0.3896181583404541,
-0.0706634521484375,
-0.2715040445327759,
-0.6083549857139587,
-0.15518036484718323,
0.5242695808410645,
-0.18624937534332275,
-0.307119965553... | |
I have a CC.NET project configured to call a common NAnt build file, which does some stuff, and then calls a child NAnt build file. The child build file name is specified by CC.NET to the command build file using a property.
The hurdle that I am trying to get over is that the common build file log gets overwritten by the child build file log, so I don't get the common build log in the CC.NET build log.
Anyone have any ideas on how to fix this?
I thought about changing the child build's log, but reading up on the NAnt `<nant>` | [
0.7979550957679749,
0.39750516414642334,
-0.31736472249031067,
-0.09955153614282608,
0.13882897794246674,
-0.07835235446691513,
0.0014984140871092677,
0.10183507949113846,
-0.111261747777462,
-0.7190288305282593,
0.4409501850605011,
0.5705516338348389,
-0.08451545238494873,
0.3864687979221... | |
task doesn't allow me to change the child's output log.
Use the [nant task](http://nant.sourceforge.net/release/0.85-rc1/help/tasks/nant.html), so you get one single build file. | [
0.21434159576892853,
-0.07288874685764313,
-0.06190397962927818,
0.03217890113592148,
-0.058493539690971375,
0.423691987991333,
0.20083382725715637,
-0.010673526674509048,
-0.4784533381462097,
-0.6956830024719238,
0.19071178138256073,
0.4855184257030487,
0.023373311385512352,
-0.0706855282... | |
How do you calculate the distance between 2 cities?
If you need to take the curvature of the earth into account, the Great-Circle distance is what you're looking for. [The Wikipedia article](http://en.wikipedia.org/wiki/Great-circle_distance) probably does a better job of explaining how the formula works than me, and there's also [this aviation formulary page](http://www.edwilliams.org/avform.htm) that covers that goes into more detail.
The formulas are only the first part of the puzzle though, if you need to make this work for arbitrary cities, you'll need a location database to get the lat/long from. Luckily you can get this for free from [Geonames.org](http://www.geonames.org/), although there are | [
0.4794367253780365,
0.012363205663859844,
0.755924642086029,
0.21578218042850494,
-0.08919807523488998,
-0.19907847046852112,
0.12567344307899475,
-0.005980899091809988,
-0.19635453820228577,
-0.7235288023948669,
0.058662429451942444,
0.1157921701669693,
-0.0076372697949409485,
0.336551547... | |
commercial db's available (ask google). So, in general, look up the two cities you want, get the lat/long co-orinates and plug them into the formula as in [the Wikipedia Worked Example](http://en.wikipedia.org/wiki/Great-circle%5Fdistance#Worked_example).
Other suggestions:
* For a full commercial solution,
there's [PC Miler](http://www.alk.com/pcmiler/pcmiler-system-req.asp) which is used
by many trucking companies to
calculate shipping rates.
* Make calls to the Google Maps (or other) api. If you need to do many requests per day, consider caching the results on the server.
* Also **very important** is to consider building an equivalence database for cities, suburbs, towns etc. if you think you'll ever need to group your data. This gets | [
0.8520605564117432,
0.06781409680843353,
0.3952585458755493,
0.08645012974739075,
-0.2000288963317871,
0.01557999663054943,
-0.14146769046783447,
0.13011375069618225,
-0.017053386196494102,
-0.5128336548805237,
0.0788923129439354,
0.45473772287368774,
-0.10018877685070038,
0.21324107050895... | |
really complicated though, and you may not find a one-size-fits-all solution for your problem.
Last but not least, Joel wrote an article about this problem a while back, so here you go: [New Feature: Job Search](http://www.joelonsoftware.com/items/2006/10/09.html) | [
-0.08289878815412521,
-0.09199205785989761,
0.20041057467460632,
0.2797974944114685,
0.200564444065094,
-0.10339689254760742,
0.08350727707147598,
0.15047821402549744,
-0.3862164616584778,
-0.11504114419221878,
0.0837409570813179,
0.363235205411911,
0.12413709610700607,
0.22753272950649261... | |
I'm using visual studio 2008 and [ReSharper](http://en.wikipedia.org/wiki/ReSharper) 4 and it's kind of slow. My machine has 2 GB of RAM, dual core processor and a 7200 rpm hard disk. I know more RAM and a faster hard disk could improve performance, but do you have any tips to improve ReSharper/Visual Studio performance?
**Turn off the annoying RSS reader**
* Tools, Options, Environment, Startup
**Turn off all the animations**
* Tools, Options, Environment, Animate Environment Tools
**Install the [recent Service Pack](http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx)**
**Clean out your WebCache**
* AppData\Local\Microsoft\WebSiteCache | [
0.2623364329338074,
0.19593019783496857,
0.4135550260543823,
0.12620380520820618,
-0.14999935030937195,
0.10836000740528107,
0.39073461294174194,
0.07606534659862518,
-0.28673696517944336,
-0.7744983434677124,
0.002434351248666644,
0.7925564050674438,
-0.014956078492105007,
0.0713246464729... | |
I'm working on some code to colorize an image in Java. Basically what I'd like to do is something along the lines of GIMP's colorize command, so that if I have a BufferedImage and a Color, I can colorize the Image with the given color. Anyone got any ideas? My current best guess at doing something like this is to get the rgb value of each pixel in the BufferedImage and add the RGB value of the Color to it with some scaling factor.
I have never used GIMP's colorize command. However, if your getting the RGB value of each pixel | [
0.35310545563697815,
0.010026977397501469,
0.15999004244804382,
-0.11136796325445175,
0.08467977494001389,
0.22538241744041443,
-0.07739218324422836,
0.11576507985591888,
-0.17995333671569824,
-0.755500316619873,
0.3125133514404297,
0.6963500380516052,
-0.31052249670028687,
0.1158721745014... | |
and adding RGB value to it you should really use a **[LookupOp](http://docs.oracle.com/javase/7/docs/api/java/awt/image/LookupOp.html).** Here is some code that I wrote to apply a BufferedImageOp to a BufferedImage.
Using Nicks example from above heres how I would do it.
> Let Y = 0.3\*R + 0.59\*G + 0.11\*B for
> each pixel
>
>
> (R1,G1,B1) is what you are colorizing
> with
```
protected LookupOp createColorizeOp(short R1, short G1, short B1) {
short[] alpha = new short[256];
short[] red = new short[256];
short[] green = new short[256];
short[] blue = new short[256]; | [
0.33919990062713623,
-0.06802739202976227,
0.2460998147726059,
-0.23104166984558105,
-0.1661306470632553,
0.17541451752185822,
0.13861235976219177,
-0.45292675495147705,
-0.22582578659057617,
-0.6376324892044067,
-0.12864987552165985,
0.37386631965637207,
-0.685968816280365,
-0.22036267817... | |
int Y = 0.3*R + 0.59*G + 0.11*B
for (short i = 0; i < 256; i++) {
alpha[i] = i;
red[i] = (R1 + i*.3)/2;
green[i] = (G1 + i*.59)/2;
blue[i] = (B1 + i*.11)/2;
}
short[][] data = new short[][] {
red, green, blue, alpha
}; | [
0.19516229629516602,
-0.13188892602920532,
0.12366565316915512,
-0.3729380965232849,
-0.05528075620532036,
0.5005219578742981,
0.5167093276977539,
-0.5981194972991943,
-0.01915770024061203,
-0.24934516847133636,
-0.4168006181716919,
0.2857445180416107,
-0.5963957905769348,
0.04813699424266... | |
LookupTable lookupTable = new ShortLookupTable(0, data);
return new LookupOp(lookupTable, null);
}
```
It creates a [BufferedImageOp](http://docs.oracle.com/javase/7/docs/api/java/awt/image/BufferedImageOp.html) that will mask out each color if the mask boolean is true.
Its simple to call too.
```
BufferedImageOp colorizeFilter = createColorizeOp(R1, G1, B1);
BufferedImage targetImage = colorizeFilter.filter(sourceImage, null);
```
If this is not what your looking for I suggest you look more into BufferedImageOp's.
This is would also be more efficient since you would not need to do the calculations multiple times on different images. Or do the calculations over again on different BufferedImages as long as the R1,G1,B1 values don't change. | [
0.16697818040847778,
-0.34660425782203674,
0.4703901410102844,
-0.28689879179000854,
-0.011481820605695248,
0.14794781804084778,
0.3160254955291748,
-0.24687246978282928,
-0.06955061852931976,
-0.8380232453346252,
-0.1780685931444168,
0.5056083798408508,
-0.5266406536102295,
-0.38411623239... | |
What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a more comprehensive way of tracking how records have changed over time. For instance, right now records can have a number of timestamp and modified user fields, but we currently don't have a scheme for logging multiple change, for instance if an operation is rolled back. In a perfect world, it would be possible to reconstruct the record as it was after each | [
0.5124884247779846,
-0.06230897083878517,
0.1266077309846878,
0.42529261112213135,
0.4201361835002899,
0.07617147266864777,
-0.08259785175323486,
0.05659468099474907,
-0.7040749788284302,
-0.4711746871471405,
0.5278270840644836,
0.21831423044204712,
-0.07844715565443039,
0.3584311902523041... | |
save, etc.
Some info on the DB:
* Needs to have the capacity to grow by thousands of records per week
* 50-60 Tables
* Main revisioned tables may have several million records each
* Reasonable amount of foreign keys and indexes set
* Using PostgreSQL 8.x
In the past I have used triggers to construct db update/insert/delete logging.
You could insert a record each time one of the above actions is done on a specific table into a logging table that keeps track of the action, what db user did it, timestamp, table it was performed on, and previous value.
There is probably a better answer | [
0.5234299898147583,
0.09566149115562439,
0.1314821094274521,
-0.02175927348434925,
-0.17378970980644226,
0.08847237378358841,
0.2761598229408264,
-0.3680468797683716,
-0.4459749460220337,
-0.5396148562431335,
0.16399091482162476,
0.5005760192871094,
-0.3972691297531128,
0.08577953279018402... | |
though as this would require you to cache the value before the actual delete or update was performed I think. But you could use this to do rollbacks. | [
0.19871284067630768,
-0.00037454997072927654,
0.25615623593330383,
0.2568759620189667,
0.08821680396795273,
-0.2623482346534729,
-0.03777303919196129,
0.09583717584609985,
0.005109761375933886,
-0.2681574523448944,
0.24735496938228607,
0.6947424411773682,
0.10870500653982162,
-0.1299385279... | |
What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern.
Currently I use code like this:
```
// mObjList is a List<MyObject>
MyObject match = null;
foreach (MyObject mo in mObjList)
{
if (Criteria(mo))
{
match = mo;
break;
}
}
```
or
```
// mObjList is a List<MyObject>
bool foundIt = false;
foreach (MyObject mo in mObjList)
{
if (Criteria(mo)) | [
0.06105772778391838,
-0.039676178246736526,
0.20384766161441803,
-0.19950322806835175,
0.1262943297624588,
-0.31243979930877686,
0.3169974088668823,
-0.40576741099357605,
-0.20319221913814545,
-0.6953185796737671,
0.08049078285694122,
0.80946946144104,
-0.5141305923461914,
-0.2194054275751... | |
{
foundIt = true;
break;
}
}
```
> @ Konrad: So how do you use it? Let's say I want to match mo.ID to magicNumber.
In C# 2.0 you'd write:
```
result = mObjList.Find(delegate(int x) { return x.ID == magicNumber; });
```
3.0 knows lambdas:
```
result = mObjList.Find(x => x.ID == magicNumber);
``` | [
0.14967648684978485,
-0.07956968992948532,
0.22686289250850677,
0.06908896565437317,
0.0415923073887825,
-0.2682948112487793,
0.3569577634334564,
-0.4575698971748352,
0.13589049875736237,
-0.48346641659736633,
0.07303261756896973,
0.7479895353317261,
-0.2479744851589203,
0.0053656245581805... | |
Basically I want to get the number of lines-of-code in the repository after each commit.
The only (really crappy) ways I have found is to use `git filter-branch` to run `wc -l *`, and a script that runs `git reset --hard` on each commit, then runs `wc -l`
To make it a bit clearer, when the tool is run, it would output the lines of code of the very first commit, then the second and so on. This is what I want the tool to output (as an example):
```none
me@something:~/$ gitsloc --branch master
10
48
153
450
1734
1542
```
I've played around with the ruby 'git' library, but the closest | [
0.4751910865306854,
0.29985031485557556,
0.14588220417499542,
0.03920133411884308,
0.04638701677322388,
0.02099335752427578,
0.3600962460041046,
0.2629009783267975,
-0.2661147713661194,
-0.7851704955101013,
0.022521669045090675,
0.40183305740356445,
-0.278973788022995,
0.0859270915389061,
... | |
I found was using the `.lines()` method on a diff, which seems like it should give the added lines (but does not: it returns 0 when you delete lines for example)
```rb
require 'rubygems'
require 'git'
total = 0
g = Git.open(working_dir = '/Users/dbr/Desktop/code_projects/tvdb_api')
last = nil
g.log.each do |cur|
diff = g.diff(last, cur)
total = total + diff.lines
puts total
last = cur
end
```
You might also consider [gitstats](http://gitstats.sourceforge.net/), which generates this graph as an html file. | [
0.2066933512687683,
0.05131296440958977,
0.5149059891700745,
-0.12188270688056946,
-0.28697407245635986,
0.013240646570920944,
0.20102421939373016,
-0.31225597858428955,
-0.17841555178165436,
-0.6362557411193848,
-0.10139887779951096,
0.3253171145915985,
-0.3524813652038574,
0.289304405450... | |
What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful?
What if my hoster doesn't permit ***PUT*** and ***DELETE***?
Is this actually important, can I live happily ever after with just ***GET*** and ***POST*** ?
---
**Update:** Thanks for the answers folks, [Roger's answer](https://stackoverflow.com/questions/23963/restful-web-services-and-http-verbs#23971) was probably best because of the link to the Bill Venners and Elliotte Rusty Harold interview. I now get it.
---
Yes, you can live without PUT and DELETE.
This article tells you why:
<http://www.artima.com/lejava/articles/why_put_and_delete.html>
While to true RESTafrians this may be heresy, in the real world you do what you | [
0.45724356174468994,
0.0031321581918746233,
0.6613729596138,
0.13600897789001465,
-0.08181890100240707,
-0.4013735055923462,
0.4666144549846649,
0.03432606905698776,
-0.19173337519168854,
-0.3344503343105316,
-0.3045700788497925,
0.6187407374382019,
-0.13151846826076508,
0.0899072587490081... | |
can, with what you have. Be as rational as you can and as consistent with your own convention as you can, but you can definitely build a good RESTful system without P and D.
rp | [
0.46720269322395325,
0.202076718211174,
0.1967485547065735,
0.2493281215429306,
0.24501670897006989,
-0.3119180202484131,
0.29600682854652405,
-0.19270320236682892,
-0.15827316045761108,
-0.5009358525276184,
-0.19995932281017303,
0.35646671056747437,
0.007712384220212698,
-0.08818236738443... | |
I don't understand where the extra bits are coming from in [this article](http://en.wikipedia.org/wiki/S-box) about s-boxes. Why doesn't the s-box take in the same number of bits for input as output?
It is the way s-boxes work. They can be m \* n ==> m bit input , n bit output.
For example, in the [AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) S-box the number of bits in input is equal to the number of bits in output.
In [DES](http://en.wikipedia.org/wiki/Data_Encryption_Standard), m=6 and n=4.
The input is expanded from 32 to 48 bits in the first stages of DES. So it is be reduced to 32 bits again by applying one round | [
0.09931580722332001,
-0.06232757866382599,
0.10391710698604584,
-0.0675937756896019,
-0.21418370306491852,
0.45010724663734436,
0.1920223832130432,
-0.8519469499588013,
-0.38501492142677307,
-0.5771615505218506,
-0.22708925604820251,
0.3241875171661377,
-0.33013877272605896,
0.097895354032... | |
of S-box substitution. Thus no information is lost here.
The Wikipedia article on itself can be a bit confusing. It will make people think that information is lost. You should read the article in conjuncture with implementation details of some encryption algorithm using s-boxes. | [
0.27395719289779663,
0.05073770508170128,
-0.01737114228308201,
0.24164971709251404,
-0.022672997787594795,
-0.5174746513366699,
0.36895033717155457,
0.016488898545503616,
-0.08220365643501282,
-0.45142456889152527,
-0.3274371027946472,
0.3368403911590576,
-0.35396265983581543,
0.109351098... | |
I am wondering what experiences people are having using the ASP.NET MVC Framework? In particular I am looking for feedback on the type of experience folks are having using the framework.
What are people using for their view engine? What about the db layer, NHibernate, LINQ to SQL or something else?
I know stackoverflow uses MVC, so please say this site.
Thank you.
---
Why the choice of NHibernate over anything else? I am not against NHibernate, just wondering the rational.
I've just been recently turned on to MVC and Linq to Sql for Asp.Net. I'm still learning both, and I'm really enjoying them both. There | [
0.39293864369392395,
0.2536207139492035,
0.17735151946544647,
-0.06689231097698212,
-0.5749145150184631,
-0.27040648460388184,
-0.003307386999949813,
0.07074708491563797,
-0.32304930686950684,
-0.5386350154876709,
0.3287639617919922,
0.7894518971443176,
-0.10161423683166504,
0.274899065494... | |
are quite a few screen casts on <http://www.asp.net/learn/>. | [
0.504736602306366,
-0.10847078263759613,
-0.022938886657357216,
0.08966897428035736,
0.18404613435268402,
0.18462136387825012,
0.2669368088245392,
0.6373013257980347,
-0.6554616093635559,
-0.688962459564209,
-0.012633093632757664,
-0.11901519447565079,
0.4197118580341339,
-0.29323768615722... | |
I'm working with [Webby](http://webby.rubyforge.org "Webby") and am looking for some clarification. Can I define attributes like `title` or `author` in my layout?
Not really. The layout has access to the page attributes rather than the other way.
The easiest way to do what you want is to populate the SITE.page\_defaults hash in your site's Rakefile (probably build.rake). Add something like the following:
```
SITE.page_defaults['title'] = "My awesome title"
SITE.page_defaults['author'] = "Shazbug"
SITE.page_defaults['is_mando_awesome'] = "very yes"
```
You can now access those hash members in | [
0.5738037824630737,
0.2870776653289795,
0.29616114497184753,
-0.04433444142341614,
-0.10433221608400345,
-0.39522334933280945,
0.18986822664737701,
0.28400322794914246,
0.012421182356774807,
-0.6259689927101135,
0.14562159776687622,
0.4888143539428711,
0.17149625718593597,
0.27154752612113... | |
your template:
```
Written by <%= @page.author %>
```
You can find more info about Webby's page default stuff on the Google Group, specifically here:
<http://groups.google.com/group/webby-forum/browse_thread/thread/f3dc1f4187959634/c30d7883705f6218?lnk=gst&q=SITE#c30d7883705f6218> | [
0.5220137238502502,
0.10462655872106552,
0.7065601944923401,
0.21825158596038818,
-0.03888697549700737,
-0.3112248182296753,
0.09003210812807083,
0.12161707878112793,
-0.34767797589302063,
-0.7907065749168396,
-0.1052701398730278,
0.4915325343608856,
-0.26815345883369446,
0.256653696298599... | |
I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN?
AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch.
I used VisualSVN until Ankh hit 2.0, and ever since, I've abandoned VisualSVN. Ankh has surpassed VisualSVN in functionality, in my mind, and all the 1.x perf and integration issues are gone. | [
0.5142046809196472,
0.06003320962190628,
0.6036294102668762,
-0.09636189788579941,
-0.6419262290000916,
-0.0972798690199852,
0.2597263753414154,
0.2913741171360016,
-0.0026616898830980062,
-0.6852481961250305,
0.26034030318260193,
0.6159684658050537,
-0.01396202016621828,
0.488703846931457... | |
I had an idea, if I add a python .py file to my C# project, and tag the file with a custom generator that would execute the python file, and treat the output as the result of the code generation, ie. put it into a C# file, that would allow me to do quite a lot of code generation as part of the build process.
Does anyone know if such a custom generator for Visual Studio 2008 exists?
OK, I see. Well, as far as I know there isn't any code generator for Python. There is a good introduction on how to | [
0.7348825931549072,
0.21308167278766632,
-0.09783757477998734,
0.05126253515481949,
-0.27547863125801086,
-0.034039970487356186,
-0.002944396808743477,
0.15230372548103333,
-0.340993195772171,
-0.15546870231628418,
0.3078742027282715,
0.7102595567703247,
-0.23144233226776123,
-0.1085153147... | |
roll your own [here](http://www.drewnoakes.com/snippets/WritingACustomCodeGeneratorToolForVisualStudio/).
Actually, that's quite an under-used part of the environment, I suppose it's so because it needs you to use the IDE to compile the project, as it'd seem only the IDE knows about these "generators", but MSBuild ignores them. | [
0.6564183235168457,
0.06832852214574814,
0.39260658621788025,
0.04258684441447258,
-0.1653318852186203,
-0.11930876970291138,
-0.25404325127601624,
0.22381672263145447,
-0.36908289790153503,
-0.23579329252243042,
0.20197677612304688,
0.4462828040122986,
0.04543955624103546,
-0.066217474639... | |
I'm trying to use “rusage” statistics in my program to get data similar to that of the [time](http://en.wikipedia.org/wiki/Time_%28Unix%29) tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better?
Sorry for the long code.
```
class StopWatch {
public:
void start() {
getrusage(RUSAGE_SELF, &m_begin);
gettimeofday(&m_tmbegin, 0);
}
void stop() { | [
0.24679023027420044,
-0.2503661513328552,
0.37323787808418274,
-0.1958659291267395,
0.2291891872882843,
0.09117510914802551,
0.24598702788352966,
0.1265212446451187,
-0.315374493598938,
-0.5856641530990601,
-0.06725432723760605,
0.5974029302597046,
-0.4100041091442108,
0.12419435381889343,... | |
getrusage(RUSAGE_SELF, &m_end);
gettimeofday(&m_tmend, 0);
timeval_sub(m_end.ru_utime, m_begin.ru_utime, m_diff.ru_utime);
timeval_sub(m_end.ru_stime, m_begin.ru_stime, m_diff.ru_stime);
timeval_sub(m_tmend, m_tmbegin, m_tmdiff);
}
void printf(std::ostream& out) const {
using namespace std;
timeval const& utime = m_diff.ru_utime;
timeval const& stime = m_diff.ru_stime;
format_time(out, utime); | [
-0.5834051966667175,
-0.5813570618629456,
0.7812425494194031,
-0.29512351751327515,
0.25987187027931213,
0.3478115499019623,
0.5952433943748474,
-0.1545153111219406,
0.17827634513378143,
-0.7965198755264282,
-0.712195873260498,
0.7066119909286499,
-0.2421056032180786,
0.19406339526176453,
... | |
out << "u ";
format_time(out, stime);
out << "s ";
format_time(out, m_tmdiff);
}
private:
rusage m_begin;
rusage m_end;
rusage m_diff;
timeval m_tmbegin;
timeval m_tmend;
timeval m_tmdiff;
static void timeval_add(timeval const& a, timeval const& b, timeval& ret) {
ret.tv_usec = a.tv_usec + b.tv_usec; | [
-0.07114396244287491,
-0.2199496328830719,
0.708989143371582,
-0.5049853324890137,
0.19562400877475739,
0.46682247519493103,
0.2997208833694458,
-0.36592817306518555,
-0.10599569231271744,
-0.4962148666381836,
-0.6688282489776611,
0.7223794460296631,
-0.4801730215549469,
0.5180748105049133... | |
ret.tv_sec = a.tv_sec + b.tv_sec;
if (ret.tv_usec > 999999) {
ret.tv_usec -= 1000000;
++ret.tv_sec;
}
}
static void timeval_sub(timeval const& a, timeval const& b, timeval& ret) {
ret.tv_usec = a.tv_usec - b.tv_usec;
ret.tv_sec = a.tv_sec - b.tv_sec; | [
0.010718111880123615,
-0.4378999173641205,
0.9708818793296814,
-0.26476040482521057,
0.29238638281822205,
0.26280543208122253,
0.6270659565925598,
-0.3982962369918823,
-0.23400497436523438,
-0.42978787422180176,
-0.7308824062347412,
0.6920120716094971,
-0.363913357257843,
0.486458390951156... | |
if (a.tv_usec < b.tv_usec) {
ret.tv_usec += 1000000;
--ret.tv_sec;
}
}
static void format_time(std::ostream& out, timeval const& tv) {
using namespace std;
long usec = tv.tv_usec;
while (usec >= 1000) | [
0.35504576563835144,
-0.2694721519947052,
0.8258897662162781,
-0.2624400854110718,
0.5109041929244995,
0.19954819977283478,
0.22107641398906708,
-0.304471880197525,
-0.12875190377235413,
-0.5827198624610901,
-0.5394818186759949,
0.6472246646881104,
-0.26259222626686096,
0.4250226616859436,... | |
usec /= 10;
out << tv.tv_sec << '.' << setw(3) << setfill('0') << usec;
}
}; // class StopWatch
```
What is the purpose of:
```
while (usec >= 1000)
usec /= 10;
```
I gather that you want the most significant three digits of the usec; in that case, the most straightforward way I can think of is to divide usec by 1000, and be done with that.
Test cases:
* 999999 ⇒ 999
* 99999 ⇒ 999 (should be 099)
* 9999 ⇒ 999 (should be 009)
* 999 ⇒ 999 (should be 000) | [
0.3353159725666046,
0.07085328549146652,
0.6398022174835205,
-0.1364799588918686,
-0.05965742841362953,
0.25167515873908997,
-0.05246854946017265,
-0.39888477325439453,
-0.21089912950992584,
-0.13957974314689636,
-0.2554471492767334,
0.41040968894958496,
-0.29058316349983215,
-0.1098360791... | |
What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time?
What are their typical usages?
Are they unique to Java? Is there a C++ equivalent?
Annotations are primarily used by code that is inspecting other code. They are often used for modifying (i.e. decorating or wrapping) existing classes at run-time to change their behavior. Frameworks such as [JUnit](http://www.junit.org/) and [Hibernate](http://www.hibernate.org/) use annotations to minimize the amount of code you need to write yourself to use the frameworks.
Oracle has [a good explanation | [
0.39721912145614624,
0.09707936644554138,
-0.1209167093038559,
0.14350543916225433,
-0.5057764649391174,
-0.036955174058675766,
0.07878731191158295,
-0.16299878060817719,
-0.06453052908182144,
-0.5258644223213196,
-0.3582681119441986,
0.1850869506597519,
-0.31720414757728577,
-0.1608769893... | |
of the concept and its meaning in Java](http://docs.oracle.com/javase/1.5.0/docs/guide/language/annotations.html) on their site. | [
0.33352401852607727,
0.3550068140029907,
-0.302726686000824,
-0.17951059341430664,
0.21000418066978455,
0.18849851191043854,
0.45180758833885193,
-0.07877744734287262,
-0.277482807636261,
-0.29568710923194885,
-0.25968849658966064,
0.37553152441978455,
-0.04043261334300041,
0.0074043488129... | |
Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?
Kevin,
it is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook into some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application's | [
0.5760028958320618,
-0.23002761602401733,
-0.033786751329898834,
-0.07131092995405197,
0.07018106430768967,
0.15853539109230042,
0.03523566201329231,
-0.236510768532753,
-0.2814532220363617,
-0.5451184511184692,
0.08534666150808334,
0.6641086339950562,
-0.7008824944496155,
-0.2161085456609... | |
AppDomain. Then you can call methods defined in your assembly using reflection. For example, [Snoop](https://web.archive.org/web/20081228210203/http://blois.us/Snoop/) uses this method. | [
0.17795418202877045,
-0.014841156080365181,
0.3898386061191559,
-0.09613177180290222,
-0.045716721564531326,
0.07012883573770523,
0.04762135073542595,
-0.4433671236038208,
-0.5241290330886841,
-0.5428498387336731,
-0.2651642858982086,
0.4749976694583893,
-0.7564679980278015,
-0.21448671817... | |
I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert scripts and have the same data to test and develop on.
Is there a good tool out there to do this? I'm **not** looking for a tool to generate data as discussed [here](https://stackoverflow.com/questions/16317/creating-test-data-in-a-database).
EMS DB Extract for SQL Server (<http://www.sqlmanager.net/en/products/mssql/extract>) seems to do what you want, and it seems to be free.
Hope | [
0.4621908962726593,
0.0014234143309295177,
0.048646535724401474,
0.11374292522668839,
0.14276884496212006,
-0.11251971125602722,
0.26697269082069397,
-0.17194399237632751,
0.19627371430397034,
-0.4929112493991852,
0.14951100945472717,
0.6651889085769653,
0.08784127980470657,
-0.10770282894... | |
this helps,
Robin | [
0.13895754516124725,
0.18105193972587585,
-0.0927765741944313,
0.08423905819654465,
0.1977708637714386,
-0.03139149770140648,
0.2022634893655777,
0.04476776346564293,
-0.37225279211997986,
-0.18189798295497894,
0.32642024755477905,
0.44823065400123596,
0.5297808647155762,
-0.32359853386878... | |
As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or understand principles such as LSP); there seems to be little uniformity or consistency to the approaches that people take to modelling problem domains. All too often, the class is used simply for its syntactic sugar; it puts the functions for a record type into their own little namespace.
I've written a large | [
-0.20073935389518738,
0.16001607477664948,
-0.23441115021705627,
0.2469041496515274,
0.1327192485332489,
0.10689613223075867,
0.018822163343429565,
0.5284761786460876,
-0.210271418094635,
-0.5568621158599854,
-0.13603274524211884,
-0.013873777352273464,
-0.2810399532318115,
-0.245262667536... | |
amount of code for a wide variety of applications. Although there have been places where true substitutable subtyping played a valuable role in the application, these have been pretty exceptional. In general, though much lip service is given to talk of "re-use" the reality is that unless a piece of code does *exactly* what you want it to do, there's very little cost-effective "re-use". It's extremely hard to design classes to be extensible *in the right way*, and so the cost of extension is normally so great that "re-use" simply isn't worthwhile.
In many regards, this doesn't surprise me. The real | [
0.6554539203643799,
-0.0036829723976552486,
-0.15799155831336975,
0.3660607933998108,
-0.07128642499446869,
-0.10264560580253601,
0.4864639341831207,
-0.13295325636863708,
-0.3953600823879242,
-0.7549762725830078,
-0.48258814215660095,
0.4635485112667084,
0.07676990330219269,
0.08421172946... | |
world isn't "OO", and the idea implicit in OO--that we can model things with some class taxonomy--seems to me very fundamentally flawed (I can sit on a table, a tree stump, a car bonnet, someone's lap--but not one of those is-a chair). Even if we move to more abstract domains, OO modelling is often difficult, counterintuitive, and ultimately unhelpful (consider the classic examples of circles/ellipses or squares/rectangles).
So what am I missing here? Where's the value of OOP, and why has all the time and money failed to make software any better?
There's no empirical evidence that suggests that object orientation is | [
0.028550058603286743,
0.08460821211338043,
0.1685009002685547,
0.3169499337673187,
-0.02316816709935665,
0.19682186841964722,
0.0037380740977823734,
0.46841248869895935,
-0.4889185130596161,
-0.560655951499939,
-0.014567575417459011,
-0.009499425068497658,
-0.2815758287906647,
0.2486232966... | |
a more natural way for people to think about the world. There's some work in the field of psychology of programming that shows that OO is not somehow more fitting than other approaches.
> Object-oriented representations do not appear to be universally more usable or less usable.
>
>
> It is not enough to simply adopt OO methods and require developers to use such methods, because that might have a negative impact on developer productivity, as well as the quality of systems developed.
Which is from "On the Usability of OO Representations" from Communications of the ACM Oct. 2000. The articles mainly | [
0.02237461693584919,
0.2111416757106781,
-0.0263254065066576,
0.1815652996301651,
-0.2005772739648819,
0.06941600888967514,
0.10587211698293686,
-0.07350988686084747,
-0.2022797167301178,
-0.6250569820404053,
-0.1091521605849266,
0.558181881904602,
-0.19671735167503357,
-0.2955313324928283... | |
compares OO against theprocess-oriented approach. There's lots of study of how people who work with the OO method "think" (Int. J. of Human-Computer Studies 2001, issue 54, or Human-Computer Interaction 1995, vol. 10 has a whole theme on OO studies), and from what I read, there's nothing to indicate some kind of naturalness to the OO approach that makes it better suited than a more traditional procedural approach. | [
-0.25732678174972534,
0.11414085328578949,
-0.2780565619468689,
-0.05797396972775459,
-0.17114956676959991,
0.07480651140213013,
-0.2508849799633026,
-0.01576240174472332,
0.03365325927734375,
-0.35116443037986755,
-0.08916393667459488,
0.5319187641143799,
0.12897378206253052,
-0.378035783... | |
I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me to pull the user that is currently logged into the application.
I've started to look into the already written pieces, but I've found it to be really confusing. I've looked at LoginGenerator, RestfulAuthentication, SaltedLoginGenerator, but there doesn't seem to be one place that has great tutorials or provide a comparison of them. If there's a site I just | [
0.27563196420669556,
-0.11282249540090561,
0.4941655099391937,
0.19440273940563202,
0.24602720141410828,
-0.12079410254955292,
0.2242361158132553,
0.012629542499780655,
-0.24242423474788666,
-0.4799869656562805,
0.17405274510383606,
0.5053410530090332,
0.14966228604316711,
-0.1970167011022... | |
haven't discovered yet, or if there is a de-facto standard that most people use, I'd appreciate the helping hand.
AuthLogic appears to be the new kid on the block and seems to be the next evolution of restful\_authentication, easier to use, etc
<http://github.com/binarylogic/authlogic/tree/master>
Edit: now that Rails 3 is out, Devise seems to be the new, new kid on the block
<https://github.com/plataformatec/devise>
or I have been rolling my own authentication now with the `has_secure_password` built in to Rails <http://railscasts.com/episodes/250-authentication-from-scratch-revised>
Side note: Ruby Toolbox is a great site for finding the current best solution in various categories (based on the number of GitHub watchers):
<http://ruby-toolbox.com/categories/rails_authentication.html> | [
0.1852443665266037,
-0.10961362719535828,
0.28965088725090027,
0.05417841672897339,
-0.17488433420658112,
-0.15978483855724335,
0.35873714089393616,
-0.12442326545715332,
-0.19115518033504486,
-0.7877431511878967,
0.0712072104215622,
0.4062921106815338,
0.051002588123083115,
-0.09697016328... | |
I started using IRC at a young age, and I have always been fascinated with it. As a language exercise, I was thinking about programming a simple IRC client in Ruby with [Shoes](http://www.shoooes.net/) as a graphical front-end. My question to you, kind-sirs, what do I need to become familiar with to start on this great adventure (besides shoes and Ruby of course)? I imagine there is some-sort of specification on IRC Protocol. Any pointers?
An earlier post mentioned RFC1459. While it is a very good introduction to IRC, it has actually been superseded by RFCs 2810-2813. Here is a more complete | [
0.4691629111766815,
0.25838789343833923,
0.25587230920791626,
0.07195334136486053,
-0.24098195135593414,
-0.36616501212120056,
0.24896323680877686,
0.18657727539539337,
-0.18380019068717957,
-0.5550405979156494,
0.04304177686572075,
0.5718514323234558,
-0.4586835503578186,
-0.1533169448375... | |
list of documentation you need to program anything IRC-related:
* [RFC1459](https://www.rfc-editor.org/rfc/rfc1459) (original RFC; superseded, but still useful)
* [RFC2810](https://www.rfc-editor.org/rfc/rfc2810) (IRC architecture)
* [RFC2811](https://www.rfc-editor.org/rfc/rfc2811) (IRC channel management)
* [RFC2812](https://www.rfc-editor.org/rfc/rfc2812) (IRC client protocol)
* [RFC2813](https://www.rfc-editor.org/rfc/rfc2813) (IRC server protocol)
* [CTCP specification](http://www.irchelp.org/irchelp/rfc/ctcpspec.html)
* [DCC specification](http://www.irchelp.org/irchelp/rfc/dccspec.html)
* [Updated CTCP specification](http://www.invlogic.com/irc/ctcp.html) (not all clients support this)
* [ISupport (response code 005) draft](http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt) (almost all servers support this nowadays)
* [Client capabilities (CAP command) draft](http://www.leeh.co.uk/draft-mitchell-irc-capabilities-02.html) (supported by some servers/clients)
* [IRCv3 standards and proposals](http://ircv3.org/) (the future features of IRC, some of which are already widely supported) | [
0.1791413277387619,
0.03905072063207626,
0.6833117008209229,
-0.11652220785617828,
-0.19143874943256378,
-0.27942556142807007,
0.004330252762883902,
-0.49459540843963623,
-0.10677561163902283,
-0.5796537399291992,
-0.519236147403717,
0.6137306690216064,
-0.3466793894767761,
-0.042413074523... | |
When I try to run a .NET assembly (`boo.exe`) from a network share (mapped to a drive), it fails since it's only partially trusted:
```
Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at BooCommandLine..ctor()
at Program..ctor()
at ProgramModule.Main(String[] argv)
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
boo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=32c39770e9a21a67
The Zone of the assembly that failed was:
Intranet
The Url of the assembly that failed was:
file:///H:/boo-svn/bin/boo.exe
```
With instructions from [a blog post](http://www.georgewesolowski.com/blog/PermaLink,guid,4cc5fcdf-cc68-4cf0-a083-b22a8bdc92d6.aspx), I added a policy | [
0.019484233111143112,
0.1396874487400055,
0.23653674125671387,
-0.25407862663269043,
0.24428881704807281,
0.15985532104969025,
1.162428617477417,
-0.49958881735801697,
-0.02294800989329815,
-0.2775489389896393,
-0.3282879590988159,
0.5788647532463074,
-0.3995261490345001,
0.079516619443893... | |
to the .NET Configuration fully trusting all assemblies with `file:///H:/*` as their URL. I verified this by entering the URL `file:///H:/boo-svn/bin/boo.exe` into the *Evaluate Assembly* tool in the .NET Configuration and noting that boo.exe had the *Unrestricted* permission (which it didn't have before the policy).
Even with the permission, `boo.exe` does not run. I still get the same error message.
What can I do to debug this problem? Is there another way to run "partially trusted" assemblies from network shares without having to change something for every assembly I want to run?
With .NET 3.5 SP1, .NET assemblies running from UNC shares have | [
0.5932039022445679,
0.3019397258758545,
-0.030021321028470993,
-0.051161669194698334,
-0.1763916015625,
-0.4389481544494629,
0.6894718408584595,
-0.2201049029827118,
0.1302792727947235,
-0.5734634399414062,
0.0817006453871727,
0.49840089678764343,
-0.2750950753688812,
0.316583514213562,
... | |
full permissions.
See Brad Abrams's [Allow .exes to be run off a network shares](http://blogs.msdn.com/brada/archive/2007/10/26/adhoc-poll-allowing-net-exes-to-run-off-a-network-share.aspx) for workaround and discussions, and finally the follow up [.NET 3.5 SP1 allows managed code to be launched from a network share](http://blogs.msdn.com/brada/archive/2008/08/13/net-framework-3-5-sp1-allows-managed-code-to-be-launched-from-a-network-share.aspx). | [
-0.06614445894956589,
-0.1855737715959549,
0.07808122783899307,
0.148848757147789,
0.0874406173825264,
-0.4686768054962158,
0.35876601934432983,
-0.19748681783676147,
-0.4996204376220703,
-0.33382025361061096,
-0.5736427307128906,
0.45828884840011597,
-0.294292688369751,
0.1703183352947235... | |
I'm trying to parse a grammar in ocamlyacc (pretty much the same as regular yacc) which supports function application with no operators (like in Ocaml or Haskell), and the normal assortment of binary and unary operators. I'm getting a reduce/reduce conflict with the '-' operator, which can be used both for subtraction and negation. Here is a sample of the grammar I'm using:
```
%token <int> INT
%token <string> ID
%token MINUS
%start expr
%type <expr> expr
%nonassoc INT ID
%left MINUS
%left APPLY
%%
expr: INT
{ ExprInt $1 }
| ID
{ ExprId $1 }
| expr MINUS expr
{ ExprSub($1, $3) | [
-0.04124985262751579,
0.02288469858467579,
0.14248700439929962,
-0.1678473800420761,
-0.40701213479042053,
0.19791924953460693,
0.505720853805542,
-0.24877698719501495,
0.08116333186626434,
-0.546080470085144,
-0.11503785103559494,
0.38458898663520813,
-0.5262341499328613,
-0.1112826541066... | |
}
| MINUS expr
{ ExprNeg $2 }
| expr expr %prec APPLY
{ ExprApply($1, $2) };
```
The problem is that when you get an expression like "a - b" the parser doesn't know whether this should be reduced as "a (-b)" (negation of b, followed by application) or "a - b" (subtraction). The subtraction reduction is correct. How do I resolve the conflict in favor of that rule?
Unfortunately, the only answer I can come up with means increasing the complexity of the grammar.
1. split `expr` into `simple_expr` and `expr_with_prefix`
2. allow only `simple_expr` or `(expr_with_prefix)` in an | [
-0.29416462779045105,
0.30210861563682556,
0.4181819260120392,
-0.3832324147224426,
-0.2339390367269516,
0.08733651787042618,
0.5547707676887512,
-0.554582953453064,
0.09010263532400131,
-0.23010721802711487,
-0.5168280005455017,
0.6219139695167542,
-0.48046836256980896,
-0.147229999303817... | |
APPLY
The first step turns your reduce/reduce conflict into a shift/reduce conflict, but the parentheses resolve that.
You're going to have the same problem with 'a b c': is it `a(b(c))` or `(a(b))(c)`? You'll need to also break off `applied_expression` and required `(applied_expression)` in the grammar.
I think this will do it, but I'm not sure:
```
expr := INT
| parenthesized_expr
| expr MINUS expr
parenthesized_expr := ( expr )
| ( applied_expr ) | [
0.0659981369972229,
0.27158939838409424,
0.4738479256629944,
-0.4321444630622864,
-0.2276516705751419,
0.08865848928689957,
0.25530779361724854,
-0.6224644184112549,
0.09803950041532516,
-0.41987133026123047,
-0.40995994210243225,
0.7189873456954956,
-0.5309084057807922,
-0.185234189033508... | |
| ( expr_with_prefix )
applied_expr := expr expr
expr_with_prefix := MINUS expr
``` | [
-0.16707521677017212,
0.32407134771347046,
0.6339704394340515,
-0.4239434599876404,
-0.23540876805782318,
0.22624225914478302,
0.19670143723487854,
-0.6091066002845764,
0.07245595753192902,
-0.15065844357013702,
-0.36348819732666016,
0.36800941824913025,
-0.5206962823867798,
-0.00918785575... | |
I'm curious to hear the experiences of those who are currently running their SVN server on Windows.
Jeff Atwood has a post on [how to setup SVN as a Windows service](https://blog.codinghorror.com/setting-up-subversion-on-windows/). It's a great first step, but it doesn't touch on other topics, such as:
* What to use for a web-based repository browser? [WebSVN](http://websvn.tigris.org/) *can* work on Windows, but it ain't pretty.
* How to manage the passwd file?
* Is it possible to integrate with Active Directory without running Apache?
* Strategies for backing up the repository.
* Useful global ignore patterns for Visual Studio development (suggestions [here](http://blog.jasonhoekstra.com/2008/07/useful-net-subversion-global-ignore.html), [here](http://www.thushanfernando.com/?p=12), and [here](http://blog.donnfelker.com/2007/08/10/SubVersionTortoiseSVNGlobalIgnorePattern.aspx) for example).
Our | [
0.44402605295181274,
-0.24298477172851562,
0.24760499596595764,
0.040696971118450165,
-0.3796475827693939,
-0.49656444787979126,
0.41329726576805115,
0.11050693690776825,
-0.3173835277557373,
-0.6328930258750916,
-0.10645827651023865,
0.4024146795272827,
-0.11624837666749954,
-0.1401721090... | |
company switched from SourceGear Vault to Subversion about one month ago. We've got the basics down pat, but would love to discover people's tips and tricks for running SVN in a MSFT world.
Use [VisualSVN Server](http://www.visualsvn.com/). It integrates with Windows authentication and it handles all the apache setup. It's as painless as SVN can be on Windows. | [
0.5636609792709351,
-0.14678490161895752,
0.5334914326667786,
-0.09722889959812164,
-0.42354685068130493,
-0.23177146911621094,
0.26368728280067444,
0.4064018726348877,
-0.041166674345731735,
-0.34544962644577026,
0.34335312247276306,
0.25375044345855713,
0.11857163906097412,
0.17310087382... | |
What should i use to code Classic ASP under Linux. I have really tried to use Emacs and Vim but I don't have the time to learn them.
What i'm looking for is:
* Syntax highlighting
* Code Browser (Ctags)
* Preferably som sort of code insight
Something like Ultra Edit or E-texteditor.
I'm not sure what you're asking here, but if you are simply looking for a text-editor, my recommendations would be:
Console-based:
* jed (simple, with a DOS Edit-like menubar, supports syntax-highlighing)
* nano / pico (even simpler)
X-based:
* Kate (KDE, syntax-highlighing)
* Mousepad (like notepad)
* SciTE (syntax-highlighing)
There are of course likely to be a gazillion other text-editors better | [
0.12213153392076492,
-0.14451864361763,
-0.031472280621528625,
0.2571137845516205,
-0.27548277378082275,
0.14966055750846863,
0.3049202263355255,
0.02192259207367897,
0.0004972789902240038,
-0.8143934011459351,
0.019946638494729996,
0.7142607569694519,
-0.09686052799224854,
-0.198623195290... | |
than the ones listed above, but these are the ones I tend to use. | [
0.16642706096172333,
0.027407582849264145,
-0.012496464885771275,
0.03018556721508503,
0.1766653060913086,
-0.1075100377202034,
-0.23748232424259186,
-0.2451256811618805,
-0.24275648593902588,
-0.33257797360420227,
0.3838678300380707,
0.4960639774799347,
0.07265514880418777,
0.100088872015... | |
I am considering creating my own website using Java and am trying to decide what framework to use. However, doing a quick search for Java frameworks returns more than 50 to choose from!
My website is just going to be for my own enjoyment of building it in the beginning, but if it becomes popular, it would be good for it to have some scalability, or to at least be able to redesign for that.
What are the main differences between the more popular frameworks? Are there instances where one significantly outperforms the others? For example, high-traffic enterprise applications versus low-traffic small | [
0.442863792181015,
0.2523233890533447,
0.07640153914690018,
0.16418156027793884,
-0.16582582890987396,
-0.06777681410312653,
0.19846439361572266,
0.12098640203475952,
-0.26331233978271484,
-0.8916801810264587,
0.23608116805553436,
0.39792558550834656,
-0.24952346086502075,
0.04029260203242... | |
applications. I'm also wondering if some are much easier to learn and use than others.
Is there anyone who has experience with some of these frameworks and can make a recommendation? Does the sheer number of choices just serve as an early warning to avoid Java-based web development where possible?
I've used [Tapestry 3](http://tapestry.apache.org/tapestry3/), [Wicket](http://wicket.apache.org/), [Echo](http://echo.nextapp.com/site/), and [JSF](http://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html) fairly extensively. I'd really recommend you look those over and pick the one that appears the easiest for you, and to most closely fit the way you prefer to work.
Of them, the most comfortable for me to work with was [Wicket](http://wicket.apache.org/), due to the | [
0.2773967981338501,
0.03492128103971481,
0.022772153839468956,
-0.16294369101524353,
-0.06561702489852905,
0.2018207162618637,
-0.039203498512506485,
-0.22705790400505066,
-0.4904577434062958,
-0.6032561659812927,
0.029626531526446342,
0.45416945219039917,
-0.36524176597595215,
-0.29760661... | |
lightweight nature of component building and simplicity of page templating. That goes doubly so if you are using your own db code instead of Hibernate or some other framework (I was never completely happy with Wicket Hibernate or Spring Integration).
[Echo](http://echo.nextapp.com/site/) is great if you don't mind writing all of your layout in Java. I know that is different now, but I still think that product serves a fairly narrow niche. They change the development model with every major release as well it seems.
[Tapestry](http://tapestry.apache.org/tapestry3/) is a great product, but it is obviously very different from the others in terms of development | [
0.45480814576148987,
-0.11239279061555862,
-0.2066987007856369,
-0.3413018584251404,
-0.561836838722229,
-0.10071878135204315,
0.3800949156284332,
-0.20417754352092743,
-0.3877800405025482,
-0.7792254090309143,
0.1437675952911377,
0.27038776874542236,
-0.12971894443035126,
-0.2103261947631... | |
model as it is led mainly by one dude. Howard Lewis Ship is no doubt quite smart, but I am disappointed with their decision to basically forget backwards compatibility with each release. Again, though, for your needs this may not matter, and I've always found the Tapestry products pleasurable to work against.
[JSF](http://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html) has been out for years, and still feels like something that a [Struts](http://struts.apache.org/) guy built to fix all of the problems of Struts. Without really understanding all of the problems with Struts. It still has an unfinished feel to it, although the product is obviously very flexible. I | [
0.6823025941848755,
-0.1660795956850052,
0.1512225866317749,
0.009017468430101871,
0.0549074225127697,
0.5749660134315491,
0.12681367993354797,
0.14695946872234344,
-0.513059139251709,
-0.2785103917121887,
-0.13785786926746368,
0.33167240023612976,
0.11905699968338013,
0.005590807646512985... | |
use it and have some fondness for it, with great hopes for its future. I think the next release (2.0) to be delivered in JEE6 will really bring it into its own, with a new template syntax (similar to Facelets) and a simplified component model (custom components in only 1 file... finally).
And, of course, there are a million smaller frameworks and tools that get their own following ([Velocity](http://velocity.apache.org/) for basic needs, raw [JSPs](http://en.wikipedia.org/wiki/JavaServer_Pages), Struts, etc). I generally prefer component oriented frameworks myself, though.
In the end, I'd recommend just taking a look at Tapestry, Wicket, and JSF and just picking | [
0.29059574007987976,
-0.19417345523834229,
0.35647091269493103,
0.05386286973953247,
-0.40657752752304077,
-0.29359734058380127,
0.1076788678765297,
0.22009176015853882,
-0.21631476283073425,
-0.797020673751831,
-0.11671092361211777,
0.31180351972579956,
-0.01122756116092205,
-0.1931418776... | |
the one that feels the best to you. You'll probably find one that just fits the way you like to work very quickly. | [
0.2242022454738617,
-0.17368140816688538,
-0.18432259559631348,
0.3194091022014618,
0.15088753402233124,
0.2945900857448578,
-0.13612298667430878,
0.16794082522392273,
-0.05972751975059509,
-0.6231734156608582,
0.04816875234246254,
0.3893389403820038,
0.22194452583789825,
-0.11056607961654... | |
I need to make a WebCast presentation soon and need to do some "whiteboarding" during that WebCast. Does anyone have any stylus/tablet input device recommendations? Anyone ever used such an input device with WebEx's whiteboard feature?
rp
Wacom <http://www.wacom.com/index2.cfm>
makes by far the best tablets I have ever used. They come in a variety of prices with associated features. If you want to be able to draw 'on-screen' they have the Cintiq, which is the most expensive, starting at $999 but definitely worth it. For a cheaper more 'traditional' tablet there is Bambo and Intuos which start at $79, however with | [
0.3775993883609772,
0.12636667490005493,
0.39243581891059875,
0.15687605738639832,
-0.009864634834229946,
0.3889385759830475,
-0.3632449805736542,
0.4922614097595215,
-0.21404986083507538,
-0.8665027618408203,
0.6177970767021179,
0.46502548456192017,
-0.06289991736412048,
0.075754992663860... | |
the Bambo and the Intuos there is quite a learning curve if your not already used to using tablets. | [
-0.3252497613430023,
0.410492867231369,
-0.038675881922245026,
-0.1659180372953415,
-0.2203369438648224,
0.36962249875068665,
-0.010934470221400261,
0.1524505615234375,
-0.33014342188835144,
-0.7226508855819702,
0.5749022364616394,
0.6539368629455566,
-0.13341033458709717,
-0.3034025728702... | |
I'm used to the Vi(m) editor and am using MS Visual Studio 2005 at work. I couldn't find a free Vi add-in (there's only one for the 2003 version). I googled a bit, saw that there was a 'Google summer of code' project this year to write such an add-in, and am eagerly awaiting the result. I've also heard of ViEmu (not free, and I can't test it at work).
Has anyone in my situation has found a solution (and/or tested ViEmu)?
Edit: I can't test ViEmu at work because they are paranoid about what we install on our boxes: it has | [
0.4159146249294281,
0.10463715344667435,
0.169061541557312,
0.06675051897764206,
-0.2877635657787323,
-0.09054034948348999,
0.4744848310947418,
-0.14214597642421722,
-0.14860303699970245,
-0.583823025226593,
0.18709638714790344,
0.7218843102455139,
-0.4249143898487091,
0.03396254777908325,... | |
to go through required channels, and for 30 days I don't reckon it's worth it (and I have no Windows box at home).
Edit: Since both answers were equivalent, I ended up accepting the first one that came in.
ViEmu works great with Visual Studio. I used Vi(m) strictly in Linux, but I was turned on to bringing the Vi(m) editing process into the Windows world by [JP Boodhoo](http://www.jpboodhoo.com/). JP [praises](http://blog.jpboodhoo.com/HookedOnVIM.aspx) about it also. | [
0.410411536693573,
-0.1371525228023529,
0.46236446499824524,
0.028170688077807426,
-0.3203046917915344,
-0.09597579389810562,
0.37973853945732117,
-0.23068159818649292,
-0.05282273516058922,
-0.6266202330589294,
0.052652157843112946,
0.7523090839385986,
-0.07930896431207657,
0.113136447966... | |
Can you tell me what is the difference between **abstraction** and **information hiding** in software development?
I am confused. Abstraction hides detail implementation and
information hiding abstracts whole details of something.
**Update:** I found a good answer for these three concepts. [See the separate answer below](https://stackoverflow.com/a/8694874/240733) for several citations taken from [there](http://web.archive.org/web/20080906224409/http://www.itmweb.com/essay550.htm).
Go to the source! Grady Booch says (in Object Oriented Analysis and Design, page 49, second edition):
> Abstraction and encapsulation are complementary concepts: abstraction
> focuses on the observable behavior of an object... encapsulation
> focuses upon the implementation that gives rise to this behavior...
> encapsulation is most often achieved through | [
0.19777177274227142,
-0.058841194957494736,
-0.3019583523273468,
0.3830976188182831,
-0.13089002668857574,
-0.2780091464519501,
0.21974356472492218,
-0.33232933282852173,
-0.06418362259864807,
-0.44692331552505493,
-0.23834876716136932,
0.7536311745643616,
-0.11230918020009995,
-0.13431841... | |
information hiding, which
> is the process of hiding all of the secrets of object that do not
> contribute to its essential characteristics.
In other words: abstraction = the object externally; encapsulation (achieved through information hiding) = the object internally,
Example:
In the .NET Framework, the `System.Text.StringBuilder` class provides an abstraction over a string buffer. This buffer abstraction lets you work with the buffer without regard for its implementation. Thus, you're able to append strings to the buffer without regard for how the `StringBuilder` internally keeps track of things such the pointer to the buffer and managing memory when the buffer | [
0.08831927925348282,
-0.19055746495723724,
-0.16075408458709717,
0.1666543334722519,
0.10018967092037201,
-0.16985198855400085,
0.36406970024108887,
-0.21881112456321716,
-0.13612666726112366,
-0.4279438853263855,
-0.21566615998744965,
0.5424308776855469,
-0.4092049300670624,
0.25300741195... | |
gets full (which it does with encapsulation via information hiding).
rp | [
-0.018316909670829773,
-0.0037952647544443607,
0.5336848497390747,
0.03032553195953369,
0.022346271201968193,
0.01730186678469181,
0.09233013540506363,
-0.3463788628578186,
-0.35403120517730713,
-0.18163633346557617,
-0.539833128452301,
0.3419487476348877,
-0.04409310221672058,
-0.08846060... | |
Is there any way, in any language, to hook my program when a user renames a file?
For example:
A user renames a file and presses enter (or clicks away) to confirm the rename action. BEFORE the file is actually renamed, my program "listens" to this event and pops up a message saying "Are you sure you want to rename C:\test\file.txt to C:\test\test.txt?".
I'm thinking/hoping this is possible with C++, C# or .NET.. But I don't have any clue where to look for.
You can probably solve this by using the [FileSystemWatcher class](http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx) in .NET framework.
From the class remarks:
> You can watch for renaming, | [
0.42700493335723877,
-0.06716451793909073,
-0.011887122876942158,
-0.14002545177936554,
0.24536080658435822,
-0.08709488809108734,
0.2027946561574936,
0.1315026730298996,
-0.3039952516555786,
-0.5327966213226318,
-0.18372780084609985,
0.32150912284851074,
-0.18404027819633484,
0.2876736819... | |
deletion,
> or creation of files or directories.
> For example, to watch for renaming of
> text files, set the Filter property to
> "\*.txt" and call the WaitForChanged
> method with a Renamed specified for
> its parameter. | [
-0.04995957762002945,
-0.7518182992935181,
0.11389446258544922,
-0.07825256139039993,
0.12330974638462067,
-0.16568642854690552,
0.22388726472854614,
-0.06775034219026566,
-0.2657211422920227,
-0.7868477702140808,
-0.4905838072299957,
0.30510103702545166,
-0.5992890000343323,
0.50549530982... | |
Before you answer this I have never developed anything popular enough to attain high server loads. Treat me as (sigh) an alien that has just landed on the planet, albeit one that knows PHP and a few optimisation techniques.
---
I'm developing a tool in **PHP** that could attain quite a lot of users, if it works out right. However while I'm fully capable of developing the program I'm pretty much clueless when it comes to making something that can deal with huge traffic. So here's a few questions on it (feel free to turn this question into a resource thread as | [
0.6848413348197937,
0.25019335746765137,
0.2944895029067993,
0.4324438273906708,
-0.06090037152171135,
-0.2211853712797165,
0.16114512085914612,
0.610766589641571,
-0.22156359255313873,
-0.5762271881103516,
0.2745981812477112,
0.2536064088344574,
0.006414512638002634,
0.17472927272319794,
... | |
well).
Databases
---------
At the moment I plan to use the MySQLi features in PHP5. However how should I setup the databases in relation to users and content? Do I actually *need* multiple databases? At the moment everything's jumbled into one database - although I've been considering spreading user data to one, actual content to another and finally core site content (template masters etc.) to another. My reasoning behind this is that sending queries to different databases will ease up the load on them as one database = 3 load sources. Also would this still be effective if they were all on the | [
0.33625471591949463,
0.17702288925647736,
0.47841331362724304,
0.42842942476272583,
-0.1236615851521492,
-0.21972931921482086,
0.22951313853263855,
-0.06711584329605103,
-0.47002506256103516,
-0.6733025312423706,
0.1397729068994522,
0.5065949559211731,
-0.22048985958099365,
0.1954689025878... | |
same server?
Caching
-------
I have a template system that is used to build the pages and swap out variables. Master templates are stored in the database and each time a template is called it's cached copy (a html document) is called. At the moment I have two types of variable in these templates - a static var and a dynamic var. Static vars are usually things like page names, the name of the site - things that don't change often; dynamic vars are things that change on each page load.
My question on this:
Say I have comments on different articles. Which is a | [
0.5571005344390869,
0.11787562817335129,
0.34674057364463806,
-0.05522967875003815,
-0.2830711901187897,
-0.09531193971633911,
-0.004729177337139845,
0.04547862336039543,
-0.2696123719215393,
-0.6531803607940674,
0.4142342805862427,
0.3609713017940521,
-0.38756904006004333,
0.3582294881343... | |
better solution: store the simple comment template and render comments (from a DB call) each time the page is loaded or store a cached copy of the comments page as a html page - each time a comment is added/edited/deleted the page is recached.
Finally
-------
Does anyone have any tips/pointers for running a high load site on PHP. I'm pretty sure it's a workable language to use - Facebook and Yahoo! give it great precedence - but are there any experiences I should watch out for?
No two sites are alike. You really need to get a tool like [jmeter](http://jakarta.apache.org/jmeter/) and benchmark to | [
0.2137344777584076,
-0.15907980501651764,
0.12893660366535187,
0.3120436370372772,
-0.38004177808761597,
-0.24197275936603546,
0.4563028812408447,
-0.2758042514324188,
-0.12294164299964905,
-0.7805257439613342,
0.2607271671295166,
0.6686014533042908,
-0.00656000105664134,
-0.40827745199203... | |
see where your problem points will be. You can spend a lot of time guessing and improving, but you won't see real results until you measure and compare your changes.
For example, for many years, the MySQL query cache was the solution to all of our performance problems. If your site was slow, MySQL experts suggested turning the query cache on. It turns out that if you have a high write load, the cache is actually crippling. If you turned it on without testing, you'd never know.
And don't forget that you are never done scaling. A site that handles 10req/s | [
-0.1439099907875061,
0.01416545920073986,
0.5412951707839966,
0.2802070379257202,
0.13246941566467285,
0.1317104697227478,
0.29204487800598145,
0.06812582910060883,
-0.4792855679988861,
-0.8642832636833191,
0.3395918905735016,
0.5190853476524353,
-0.0545157715678215,
0.176306813955307,
0... | |
will need changes to support 1000req/s. And if you're lucking enough to need to support 10,000req/s, your architecture will probably look completely different as well.
Databases
=========
* Don't use MySQLi -- [PDO](http://ca.php.net/pdo) is the 'modern' OO database access layer. The most important feature to use is placeholders in your queries. It's smart enough to use server side prepares and other optimizations for you as well.
* You probably don't want to break your database up at this point. If you do find that one database isn't cutting, there are several techniques to scale up, depending on your app. Replicating to additional servers typically | [
-0.05030018091201782,
0.14522576332092285,
0.4974261224269867,
0.22119402885437012,
0.3035579025745392,
0.008746891282498837,
-0.0428934171795845,
0.22819481790065765,
-0.32915443181991577,
-0.950714647769928,
-0.03988918289542198,
0.3301595449447632,
0.0076540554873645306,
-0.003594072535... | |
works well if you have more reads than writes. Sharding is a technique to split your data over many machines.
Caching
=======
* You probably don't want to cache in your database. The database is typically your bottleneck, so adding more IO's to it is typically a bad thing. There are several PHP caches out there that accomplish similar things like [APC](http://ca.php.net/apc) and Zend.
* Measure your system with caching on and off. I bet your cache is heavier than serving the pages straight.
* If it takes a long time to build your comments and article data from the db, integrate [memcache](http://www.danga.com/memcached/) into your | [
0.3644808232784271,
0.14552032947540283,
-0.03750370815396309,
0.06735553592443466,
-0.25843918323516846,
-0.0603647343814373,
0.20242974162101746,
-0.22951605916023254,
-0.25846073031425476,
-0.8733536005020142,
0.1881323605775833,
0.4265538454055786,
-0.07018567621707916,
-0.028480930253... | |
system. You can cache the query results and store them in a memcached instance. It's important to remember that retrieving the data from memcache must be faster than assembling it from the database to see any benefit.
* If your articles aren't dynamic, or you have simple dynamic changes after it's generated, consider writing out html or php to the disk. You could have an index.php page that looks on disk for the article, if it's there, it streams it to the client. If it isn't, it generates the article, writes it to the disk and sends it to the client. | [
0.0551653727889061,
-0.1337881237268448,
0.5260652303695679,
0.3161272406578064,
-0.08081159740686417,
-0.16522185504436493,
0.37576794624328613,
0.2181282639503479,
-0.5669751763343811,
-0.7783106565475464,
-0.06721389293670654,
0.5484701991081238,
-0.37508678436279297,
0.1738392114639282... | |
Deleting files from the disk would cause pages to be re-written. If a comment is added to an article, delete the cached copy -- it would be regenerated. | [
0.22037062048912048,
0.1257501244544983,
0.2314317226409912,
0.316895067691803,
0.005441251210868359,
-0.23431549966335297,
0.4175856411457062,
0.16585567593574524,
-0.24518996477127075,
-0.34519320726394653,
-0.46576157212257385,
0.2424454391002655,
-0.4505428075790405,
0.5291878581047058... | |
My team is moving from Visual SourceSafe to Subversion soon, while developing/supporting a legacy project in Visual Basic 6.0, so I have a couple of questions:
* What's the best tool for Subversion IDE integration in Visual Studio 6? (or is it not worth the trouble...)
* Are there any best practices for using Subversion with Visual Basic 6.0? (file types to ignore, etc.)
I would agree that Tortoise SVN in Windows Explorer would be the best way to use SVN with VB6.
The biggest change you will find migrating to SVN is the idea of "Check out" and "Check in" aren't exactly the | [
0.4848438501358032,
-0.10007310658693314,
0.11670510470867157,
-0.14461781084537506,
-0.334904283285141,
-0.35856032371520996,
0.3034520745277405,
0.17175212502479553,
-0.1796519011259079,
-0.6416739821434021,
-0.030557772144675255,
0.8376659154891968,
-0.23543354868888855,
0.0353296250104... | |
same as "Update" and "Commit". . . thus, any IDE integration with VB6 is limited because VB6 supports MSSCCI, a check-out/check-in mechanism. I once used TamTam SVN (<http://www.daveswebsite.com/software/tamtamsvn/index.shtml>) with Visual Studio 2003, but stopped since I found it limiting. Merging/branching/blaming, etc. are very powerful features Tortoise SVN provides that weren't in TamTam. Tigris also has <http://svnvb6.tigris.org/>, but I have not tried it.
Again, while you quite possibly get an IDE to work with VB6, I would not recommend it since the greatest strength of migrating to SVN is to break the Source Safe philosophy of check-in/check-out. | [
0.05105968192219734,
0.03290199488401413,
0.2627907991409302,
-0.40484336018562317,
-0.1885780245065689,
-0.20820802450180054,
0.3993859887123108,
-0.212932288646698,
-0.2538244128227234,
-0.5075925588607788,
-0.09915217757225037,
0.9680171012878418,
-0.4549848139286041,
0.1212994679808616... | |
What is the best way to convert a UTC datetime into local datetime. It isn't as simple as a getutcdate() and getdate() difference because the difference changes depending on what the date is.
CLR integration isn't an option for me either.
The solution that I had come up with for this problem a few months back was to have a daylight savings time table that stored the beginning and ending daylight savings days for the next 100 or so years, this solution seemed inelegant but conversions were quick (simple table lookup)
Create two tables and then join to them to convert stored GMT | [
0.21809467673301697,
-0.3686351180076599,
0.5946123003959656,
0.1449233889579773,
0.13676339387893677,
0.022284312173724174,
-0.06230992078781128,
0.09749002009630203,
-0.20937442779541016,
-0.7630360722541809,
0.21804310381412506,
0.3645099401473999,
-0.00695568835362792,
0.16268044710159... | |
dates to local time:
```
TimeZones e.g.
--------- ----
TimeZoneId 19
Name Eastern (GMT -5)
Offset -5
```
Create the daylight savings table and populate it with as much information as you can (local laws change all the time so there's no way to predict what the data will look like years in the future)
```
DaylightSavings
---------------
TimeZoneId 19
BeginDst 3/9/2008 2:00 AM
EndDst 11/2/2008 2:00 AM
```
Join them like this:
```
inner join | [
0.23006492853164673,
0.04738770052790642,
0.661376953125,
-0.10372141003608704,
0.19190631806850433,
0.010270999744534492,
-0.35353323817253113,
0.16174039244651794,
-0.3583248555660248,
-0.8310571908950806,
-0.22350306808948517,
0.30581289529800415,
0.20435795187950134,
0.3373924195766449... | |
TimeZones tz on x.TimeZoneId=tz.TimeZoneId
left join DaylightSavings ds on tz.TimeZoneId=ds.LocalTimeZone
and x.TheDateToConvert between ds.BeginDst and ds.EndDst
```
Convert dates like this:
```
dateadd(hh, tz.Offset +
case when ds.LocalTimeZone is not null
then 1 else 0 end, TheDateToConvert)
``` | [
0.24834677577018738,
-0.3884367346763611,
0.6743887662887573,
0.011555644683539867,
0.07416127622127533,
0.03350319340825081,
0.09836748987436295,
-0.20516838133335114,
0.017544202506542206,
-0.6889639496803284,
-0.30748212337493896,
0.2714828550815582,
-0.10715913772583008,
0.390828460454... | |
Does anyone have a good way to build MSI (vdproj) projects using MsBuild or Nant?
I know [one answer](http://forums.msdn.microsoft.com/en-US/msbuild/thread/6e213531-9d88-43ef-8262-fe0e4e7f479a/) was to install Visual Studio on the build server and just use devenv.exe to build the project, but, I prefer not to install Visual Studio on our build servers.
Short of the method you mentioned above (devenv), there is no way to do this with the current version of MSBuild.
The method the Visual Studio team uses to run their MSI builds is with [Windows Installer XML](http://wix.sourceforge.net/). You can learn more about using WiX to deploy setup packages [here](http://msdn.microsoft.com/en-us/magazine/cc163456.aspx).
Please note WiX doesn't | [
0.55739825963974,
0.14997981488704681,
-0.013594996184110641,
0.0952911376953125,
-0.272306889295578,
-0.27374163269996643,
0.4050048589706421,
-0.0192584041506052,
-0.1266961693763733,
-0.6426164507865906,
-0.020054897293448448,
0.723476767539978,
-0.07097022235393524,
-0.1872369050979614... | |
support vdproj files so it means you'll be recreating your installer projects.
Edit: Looks like I was beat to the chase when grabbing my references :) | [
0.42954573035240173,
-0.03134099766612053,
0.5395632982254028,
0.23182909190654755,
-0.022205272689461708,
-0.5431159734725952,
0.5825207829475403,
0.24081507325172424,
-0.24819089472293854,
-0.4633936882019043,
-0.17260198295116425,
0.804347813129425,
-0.2090766727924347,
-0.2398569136857... | |
I am using Java back end for creating an XML string which is passed to the browser. Currently I am using simple string manipulation to produce this XML. Is it essential that I use some XML library in Java to produce the XML string?
I find the libraries very difficult to use compared to what I need.
It's not essential, but advisable. However, if string manipulation works for you, then go for it! There are plenty of cases where small or simple XML text can be safely built by hand.
Just be aware that creating XML text is harder than it looks. Here's | [
0.47997310757637024,
0.154983788728714,
0.030058283358812332,
0.17362865805625916,
-0.17492058873176575,
-0.05847720801830292,
0.08532724529504776,
0.12523125112056732,
-0.168842613697052,
-0.7565517425537109,
0.008414757438004017,
0.609292209148407,
-0.06237933784723282,
0.062039505690336... | |
some criteria I would consider:
* First: how much *control* do you have on the information that goes into the xml?
The less control you have on the source data, the more likely you will have trouble, and the more advantageous the library becomes. For example: (a) Can you *guarantee* that the element names will never have a character that is illegal in a name? (b) How about quotes in an attribute's content? Can they happen, and are you handling them? (c) Does the data ever contain anything that might need to be encoded as an [entity](http://en.wikipedia.org/wiki/XML_entity) (like the less-than which often | [
0.4315202534198761,
-0.023262105882167816,
0.04478830471634865,
0.35202762484550476,
0.1206521987915039,
-0.5977281928062439,
-0.053486377000808716,
-0.3305762708187103,
-0.1961434781551361,
-0.3412724435329437,
-0.02496129833161831,
0.5053167939186096,
-0.06997279077768326,
-0.06921888142... | |
needs to be output as **<**); are you doing it correctly?
* Second, maintainability: is the code that builds the XML easy to understand *by someone else*?
You probably don't want to be stuck with the code for life. I've worked with second-hand C++ code that hand-builds XML and it can be surprisingly obscure. Of course, if this is a personal project of yours, then you don't need to worry about "others": substitute "in a year" for "others" above.
I wouldn't worry about performance. If your XML is simple enough that you can hand-write it, any overhead from the library is probably meaningless. | [
0.4483067989349365,
0.20391355454921722,
0.1216956228017807,
0.0313497819006443,
0.05406883731484413,
-0.38830646872520447,
0.3638654351234436,
-0.023370061069726944,
-0.3599581718444824,
-0.6538776755332947,
-0.16260045766830444,
0.41437849402427673,
0.423648864030838,
-0.2933732867240906... | |
Of course, your case might be different, but you should measure to prove it first.
Finally, Yes; you can hand build XML text by hand if it's simple enough; but not knowing the libraries available is *probably* not the right reason.
A modern XML library is a quite powerful tool, but it can also be daunting. However, learning the essentials of your XML library is not that hard, and it can be quite handy; among other things, it's almost a requisite in today's job marketplace. Just don't get bogged down by namespaces, schemas and other fancier features until you get the essentials.
Good | [
0.39520496129989624,
0.22663336992263794,
0.08659756183624268,
0.34895259141921997,
0.0881752073764801,
-0.2545944154262543,
-0.036390628665685654,
0.11725683510303497,
-0.25874757766723633,
-0.7728445529937744,
-0.09435907006263733,
0.6858807802200317,
0.316438764333725,
-0.24370191991329... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.