text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I installed CruiseControl.net ( from the CruiseControl.NET-1.4-Setup.exe installer ) on my Vista x64 development machine. The server portion is running fine; however, the webdashboard piece is not working.
The first error message I saw when I tried to pull up <http://localhost/ccnet> squawked about not being able to r... | [
0.026199176907539368,
-0.14174024760723114,
0.7635205388069153,
-0.03140180930495262,
0.2293880581855774,
-0.18678413331508636,
0.294209361076355,
0.0022000533062964678,
-0.31588560342788696,
-0.7251372933387756,
0.15332989394664764,
1.00055730342865,
-0.20959137380123138,
0.06402966380119... | |
in the hopes that maybe it was a file permissions issue. No joy.
After a bit of digging and trial and error I found a set of steps which seems to fix the problem. I'll post a follow up answer right after this, but wanted to share this out on stackoverflow in the hopes that it might aid someone else down the line. Also... | [
0.3579535186290741,
0.09422631561756134,
0.32752224802970886,
0.12917564809322357,
-0.028695281594991684,
-0.12665335834026337,
0.3729386329650879,
0.18374919891357422,
-0.4258984625339508,
-0.5831257104873657,
0.07676912099123001,
0.5178815722465515,
-0.10781378298997879,
0.14486920833587... | |
an internal server error has occurred.
>
>
> Error Code: 0x800700c1
>
>
> Notification: ExecuteRequestHandler
>
>
> Module: IsapiModule
>
>
> Requested URL: <http://localhost/ccnet/default.aspx>
>
>
> Physical Path: C:\Program Files (x86)\CruiseControl.NET\webdashboard\default.aspx
>
>
> Logon User: A... | [
-0.34883496165275574,
-0.04212484508752823,
0.5460691452026367,
-0.11509189009666443,
0.17292937636375427,
0.16702069342136383,
0.3406996428966522,
0.03274569287896156,
-0.4757959246635437,
-0.6717491745948792,
-0.06298472732305527,
0.41199371218681335,
-0.20895545184612274,
0.197054132819... | |
error occurred.
> IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
> IIS was not able to process configuration for the Web site or application.
> The authenticated user does not have permission to use this DLL.
> The requ... | [
0.07381146401166916,
-0.28917402029037476,
0.25669941306114197,
0.18061797320842743,
-0.1318291872739792,
-0.26784393191337585,
0.4580572843551636,
-0.076529860496521,
-0.022980213165283203,
-0.5828173160552979,
0.13417404890060425,
0.3274502158164978,
-0.5667064189910889,
0.34421101212501... | |
over \*.aspx. The real handler, from Thoughtworks, is set in the web.config file. However, when I opened the Handler Mappings section of the IIS7 control panel for the ccnet app I saw that there was another handler named AboMapperCustom-80778 already created and set to look for \*.aspx.
I right clicked the handler an... | [
0.28498172760009766,
-0.3132462203502655,
0.046960532665252686,
-0.19312076270580292,
-0.012795536778867245,
-0.11581822484731674,
0.2135295271873474,
0.07129014283418655,
-0.34251153469085693,
-0.5565528273582458,
0.19078569114208221,
0.508690357208252,
-0.5756142735481262,
0.005837365984... | |
From <http://support.microsoft.com/kb/317277>:
If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you...
How can *my* app know that "Windows XP has restarted because of a serious error"?
Note: this is a good question for a **[code-challenge](https://stackoverflow.com/questions/... | [
-0.11072786897420883,
0.02549322508275509,
0.2938196659088135,
0.15699909627437592,
0.11889408528804779,
-0.269559770822525,
0.5265725255012512,
0.29132822155952454,
-0.5876920223236084,
-0.11608081310987473,
-0.38374173641204834,
0.4696865975856781,
-0.33685606718063354,
0.042724464088678... | |
good way to retrieve that information.
Based on the update time, you can make a query like:
```
Set colEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where LogFile = 'System' AND
TimeWritten >= '" _
& dtmStartDate & "' and TimeWritten < '" & dtmEndDate & "'")
```
to easily spot an e... | [
-0.05568799749016762,
0.10188359767198563,
0.2829144299030304,
0.2623772621154785,
0.35332533717155457,
-0.37383711338043213,
0.3626552224159241,
0.04156849905848503,
-0.22561794519424438,
-0.5587381720542908,
-0.37677547335624695,
0.5714762806892395,
-0.11786164343357086,
-0.0418521426618... | |
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("SELECT * FROM Win32_NTLogEvent WHERE Logfile = 'System'" _
& " AND SourceName = 'Save Dump'")
For Each objEvent in colLoggedEvents
Wscript.Echo "Event date: " & objEvent.TimeGenerated
... | [
-0.20367100834846497,
0.07339632511138916,
0.6524913311004639,
-0.17221012711524963,
0.2995162904262543,
0.31497400999069214,
0.6469528675079346,
-0.055038005113601685,
-0.07254514843225479,
-0.32959821820259094,
-0.552056610584259,
0.14112867414951324,
-0.3994472026824951,
0.2005276530981... | |
I'm creating a .net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set :
```
[Browsable(true), Category("Configuration"), Description("List of Files to Load")]
public string ListFiles
{
get { return m_oList; }
set { m_oList... | [
0.1834123283624649,
-0.09570291638374329,
0.4815414249897003,
0.13283291459083557,
0.020308908075094223,
0.06991636753082275,
0.1271440088748932,
-0.19460619986057281,
-0.12252254039049149,
-0.7634230256080627,
-0.10754815489053726,
0.4231080412864685,
-0.39050254225730896,
0.1962192207574... | |
user to choose multiple files and return it as an array or string (or something else...).
Sooo... Here's my question : **How can I get an OpenFileDialog in a custom control's property grid?**
Thanks a lot!
You can do this by adding a [UITypeEditor](http://msdn.microsoft.com/en-us/library/ms171839.aspx).
[Here is an ... | [
0.0494011752307415,
-0.14268217980861664,
0.4826514720916748,
0.35145148634910583,
-0.04872641712427139,
-0.14706090092658997,
0.2946315407752991,
0.024160150438547134,
-0.3382454812526703,
-0.6728564500808716,
-0.06985566765069962,
0.23800401389598846,
-0.09577201306819916,
0.172524333000... | |
I'm trying to embed a window from my process into the window of an external process using the **SetParent** function and have encountered a few problems that I'm hoping someone can help me out with. First off, here is an outline of what I am currently doing to embed my window into the application:
```
HWND myWindow; /... | [
0.23104135692119598,
0.39501580595970154,
0.6726841926574707,
-0.19047649204730988,
0.2633543312549591,
0.281770259141922,
0.21281194686889648,
-0.23870989680290222,
0.16107644140720367,
-1.026340126991272,
-0.1292567253112793,
0.5225688219070435,
-0.2570023834705353,
0.40354856848716736,
... | |
window gains input focus, the main application window of the external process loses focus (i.e. title bar changes color)
* Keyboard shortcut commands of the main application do not work while my window has focus
Does anybody know a workaround for this? I would like my window to be treated as just another child window ... | [
0.2145809829235077,
-0.09319709986448288,
0.7967999577522278,
0.20502959191799164,
-0.13063359260559082,
0.0889270231127739,
0.3154810667037964,
-0.07031060755252838,
0.02160433866083622,
-0.826628565788269,
-0.18356484174728394,
0.7435928583145142,
-0.13583970069885254,
0.1758683025836944... | |
to WM\_KEYDOWN messages to ensure accelerator messages of the main app are triggered. | [
0.2953014373779297,
-0.14334309101104736,
0.2735382318496704,
0.11475636810064316,
0.35920679569244385,
-0.0031579723581671715,
0.3121498227119446,
0.1034168228507042,
-0.264909029006958,
-0.42204153537750244,
-0.5237741470336914,
0.6985368132591248,
-0.2547396421432495,
-0.027521468698978... | |
I have seen a few mentions of this idiom (including [on SO](https://stackoverflow.com/questions/9033/hidden-features-of-c#9282)):
```
// Deliberately empty subscriber
public event EventHandler AskQuestion = delegate {};
```
The upside is clear - it avoids the need to check for null before raising the event.
**Howev... | [
0.3900321125984192,
-0.024060823023319244,
-0.038649387657642365,
-0.014747620560228825,
-0.04456271976232529,
-0.5422511696815491,
0.25064724683761597,
0.01315266452729702,
-0.4564044177532196,
-0.42056936025619507,
-0.1869231015443802,
0.4619922935962677,
-0.2134382277727127,
0.261017531... | |
no maintenance penalty or other drawback. | [
0.03495785966515541,
0.16137216985225677,
0.1929718554019928,
0.15952257812023163,
0.06079244986176491,
-0.1724047064781189,
0.35924699902534485,
0.12288753688335419,
0.04737517237663269,
-0.2814500629901886,
-0.3110840618610382,
0.5515305399894714,
0.024226071313023567,
-0.624747633934021... | |
In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and \*nix; so that select() would work correctly. You can use the pre-processor for the platform specific code.
On linux:
```
fcntl(fd, F_SETFL, O_NONBLOCK);
```
[Windows](http://msdn.microsoft.com/en-us/library/ms738573.aspx):
... | [
-0.05697159469127655,
-0.1442553699016571,
0.4137188196182251,
-0.1209007203578949,
0.21316084265708923,
-0.018188651651144028,
-0.11255406588315964,
-0.08679676800966263,
-0.07361358404159546,
-0.5553296208381653,
-0.3216877281665802,
0.4813006520271301,
-0.5600550174713135,
0.06031309813... | |
I am thinking about making a website with some fairly intense JavaScript/canvas usage and I have been looking at [Processing.js](http://ejohn.org/blog/processingjs/) and it seems to me that it would make manipulating the canvas significantly easier. Does anyone know any reasons why I **shouldn't** use Processing.js? I ... | [
0.4166669547557831,
-0.10742779076099396,
0.11075232177972794,
-0.16696952283382416,
-0.43259507417678833,
-0.13380062580108643,
0.1636231541633606,
0.10051100701093674,
-0.35734060406684875,
-0.9283216595649719,
0.04746764898300171,
0.5333011150360107,
-0.2711503803730011,
-0.092395186424... | |
the javascript API).
I personally prefer the canvas API over the processing wrapper, because it gives more me control. For example:
The processing line() function is implemented like this (roughly):
```
function line (x1, y1, x2, y2) {
context.beginPath();
context.moveTo(x1, y1);
context.lineTo(x2, y2);
cont... | [
-0.10029313713312149,
-0.37651461362838745,
0.8151144981384277,
-0.4430525302886963,
-0.14534321427345276,
0.5591896176338196,
-0.05919374153017998,
-0.5736539959907532,
-0.19338458776474,
-0.8243852257728577,
-0.13494926691055298,
0.39369145035743713,
-0.5690615177154541,
-0.3853131830692... | |
10);
//...so on
context.lineTo(200, 200);
////End lines...///
context.closePath();
context.stroke();
``` | [
-0.26516059041023254,
-0.10740663856267929,
0.961800754070282,
-0.3668730854988098,
-0.07898424565792084,
0.6464720368385315,
0.22385750710964203,
-0.2947986423969269,
0.0033167018555104733,
-0.6921458840370178,
-0.47386419773101807,
0.16812844574451447,
-0.2730713188648224,
-0.13427811861... | |
I tried committing files with CRLF-ending lines, but it failed.
I spent a whole work day on my Windows computer trying different strategies and was almost drawn to stop trying to use Git and instead try [Mercurial](http://en.wikipedia.org/wiki/Mercurial).
How to properly handle CRLF line endings?
Almost four years af... | [
-0.16422903537750244,
-0.023704295977950096,
0.7315125465393066,
0.07342041283845901,
-0.4042113423347473,
0.11611071228981018,
0.3690728545188904,
-0.2777724266052246,
-0.09618096798658371,
-0.5245403051376343,
-0.26893794536590576,
0.6765414476394653,
-0.16195878386497498,
0.047738563269... | |
`core.autocrlf` setting,
> allowing you to ensure consistent behaviour for all
> users regardless of their git settings.
And thus
> The advantage of this is that your end of line
> configuration now travels with your repository and you
> don't need to worry about whether or not collaborators
> have the proper gl... | [
0.17541635036468506,
0.07149288058280945,
0.43240657448768616,
0.06170094013214111,
-0.105386883020401,
-0.1581011861562729,
0.052155569195747375,
-0.27892857789993286,
-0.30739444494247437,
-0.8237833976745605,
-0.33820396661758423,
0.4668939709663391,
-0.3084803819656372,
0.0912180840969... | |
text
*.csproj text merge=union
*.sln text merge=union eol=crlf
*.docx diff=astextplain
*.DOCX diff=astextplain
# absolute paths are ok, as are globs
/**/postinst* text eol=lf
# paths that don't start with / are treated relative to the .gitattributes folder
relative/path/*.txt text eol=lf
```
There is a con... | [
-0.025353392586112022,
-0.19142210483551025,
0.869369626045227,
0.12688802182674408,
-0.15294846892356873,
-0.011821003630757332,
0.3793121576309204,
-0.042143285274505615,
-0.19468006491661072,
-0.7411385774612427,
-0.6989209055900574,
0.5381287932395935,
-0.1490538865327835,
-0.205142199... | |
try that, click the gear icon (in the upper right corner) > Repository settings ... > Line endings and attributes. You will be asked to add the recommended **`.gitattributes`** and if you agree, the app will also perform a normalization of all the files in your repository.
Finally, the [Mind the End of Your Line](http... | [
0.21957772970199585,
-0.3268994390964508,
0.30710703134536743,
0.21435986459255219,
-0.2132595181465149,
-0.06179662421345711,
0.20347094535827637,
0.123323455452919,
0.07044404000043869,
-0.9178676605224609,
-0.0019403763581067324,
0.7199350595474243,
0.15085859596729279,
-0.1757382750511... | |
@gatinueta explained in this answer's comments:
> This setting will not satisfy you completely if you have people working with Egit or JGit in your team, since those tools will just ignore .gitattributes and happily check in CRLF files <https://bugs.eclipse.org/bugs/show_bug.cgi?id=342372>
One trick might be to have ... | [
0.2894847095012665,
-0.02500220388174057,
0.41052424907684326,
0.24854202568531036,
-0.19023938477039337,
-0.06522402912378311,
0.11477582156658173,
-0.15667974948883057,
-0.21216845512390137,
-0.7066769003868103,
0.1460648626089096,
0.7827965617179871,
-0.2232411652803421,
-0.063167840242... | |
What is the best method for adding options to a `<select>` from a JavaScript object using jQuery?
I'm looking for something that I don't need a plugin to do, but I would also be interested in the plugins that are out there.
This is what I did:
```
selectValues = { "1": "test 1", "2": "test 2" };
for (key in selectV... | [
-0.21754370629787445,
-0.45341956615448,
0.372065931558609,
-0.038464631885290146,
0.1718161404132843,
-0.003063527401536703,
0.07308758795261383,
-0.25790610909461975,
-0.17975613474845886,
-0.740641713142395,
-0.17956584692001343,
0.5895018577575684,
-0.32413265109062195,
-0.250319898128... | |
.append($('<option>', { value : key })
.text(value));
});
```
Changes from matdumsa's: (1) removed the close tag for the option inside append() and (2) moved the properties/attributes into an map as the second parameter of append().
The same as other answers, in a jQuery fashion:
```
$.each(selectValues, f... | [
-0.32460591197013855,
-0.1865713745355606,
0.7249590754508972,
-0.10952123999595642,
0.07012487202882767,
0.45181742310523987,
0.202223539352417,
-0.3737526535987854,
0.02155204489827156,
-0.7637884616851807,
-0.4068314731121063,
0.7061193585395813,
-0.4443117082118988,
0.03701376914978027... | |
.text(value));
});
``` | [
-0.1938052475452423,
0.1947859674692154,
0.5351343750953674,
-0.42970260977745056,
0.33244767785072327,
-0.15457113087177277,
0.2854164242744446,
0.03937671333551407,
0.07043173164129257,
-0.47348231077194214,
-0.7988199591636658,
0.9740057587623596,
-0.5081316828727722,
0.2513424456119537... | |
Any pointers on how to initiate serial communication with the iphone? Or any other idea to interact with external hardware?
The only supported way to connect external hardware to the iPhone is through the iPod accessory protocol, through the 30-pin connector. Details on that program are at <http://developer.apple.com/i... | [
0.06520651280879974,
-0.0005539736011996865,
0.5286074876785278,
0.22017529606819153,
0.3829634487628937,
0.24981151521205902,
0.06242666020989418,
0.0846225917339325,
-0.4851621091365814,
-0.2827809751033783,
0.0346684530377388,
0.6776151061058044,
-0.37888041138648987,
-0.176170170307159... | |
I am attempting to use Ant's XMLValidate task to validate an XML document against a DTD. The problem is not that it doesn't work, but that it works too well. My DTD contains an xref element with an "@linkend" attribute of type IDREF. Most of these reference IDs outside of the current document. Because of this, my build... | [
0.14736831188201904,
0.34448346495628357,
0.18152861297130585,
0.08557398617267609,
-0.17275778949260712,
0.020125826820731163,
0.4182203710079193,
-0.23349584639072418,
0.24283359944820404,
-0.5339106321334839,
0.4014381766319275,
0.6589133739471436,
-0.34565117955207825,
0.30297926068305... | |
the "lenient" option on XMLValidate makes the task only check the document's well-formedness, not it's validity against a DTD. [The XMLValidate task in the Ant manual](http://ant.apache.org/manual/Tasks/xmlvalidate.html) lists some JAXP and SAX options you can set, but none seem applicable.
Here's my code:
```
<targ... | [
-0.3149394989013672,
-0.19606511294841766,
0.28520435094833374,
-0.00736955925822258,
-0.061848416924476624,
0.014318355359137058,
0.21718162298202515,
-0.4442656338214874,
-0.23700058460235596,
-0.3332676887512207,
-0.1839388757944107,
0.6435617804527283,
-0.293705016374588,
-0.2096918970... | |
I'm using ResolvingXMLReader to resolve the DTD against a catalog of public identifiers. However, I get the same behavior if I specify the DTD directly using a nested xmlcatalog element.
Your problem derives from the difference between two interpretations of the DTD: yours, and the [spec's](http://www.w3.org/TR/REC-xml... | [
0.25347545742988586,
-0.13741886615753174,
0.3621761202812195,
0.28679144382476807,
-0.10907771438360214,
-0.09515485912561417,
-0.011220692656934261,
-0.5229871869087219,
-0.04273951053619385,
-0.4826534688472748,
-0.03906225040555,
0.7963176965713501,
-0.21284693479537964,
0.167491972446... | |
There are several web applications which allow you to send photos from your mobile phone and post them to web site/application. How do these work and what sort of technologies would one use to implement such a feature? Is it an MMS server or does one need to get into socket programming? For example, some applications p... | [
1.1270954608917236,
0.17853565514087677,
0.21573352813720703,
0.40289923548698425,
0.0473250150680542,
-0.06841463595628738,
-0.004482348915189505,
0.16365669667720795,
-0.5299897193908691,
-0.3887893557548523,
0.42930692434310913,
0.34075188636779785,
-0.11330480128526688,
0.0293127913028... | |
Thanks
I think you have three options to support this:
1. MMS - you would need an [MMS gateway](http://www.google.com/search?hl=en&q=mms+gateway&btnG=Google+Search&aq=1&oq=mms+gate) to recieve MMS messages. This can be software/hardware that you run yourself, or there are services were you pay per message. You would l... | [
0.4518398642539978,
0.011132818646728992,
0.9663985967636108,
0.1730509251356125,
-0.1561315506696701,
0.06915450096130371,
0.10241825878620148,
-0.25374478101730347,
-0.27757298946380615,
-0.5650144815444946,
0.07232940942049026,
0.4075556993484497,
-0.26302143931388855,
-0.26088994741439... | |
upload pictures. In truth I have no idea if and how many devices support `<input type="file" />`, so this may not actually be an option at all.
You can use whatever server-side technology you prefer for processing each of these. | [
0.6861816644668579,
-0.003025657497346401,
0.5421631336212158,
0.4247879981994629,
-0.3074106276035309,
-0.29832780361175537,
-0.01749938167631626,
0.2416764795780182,
-0.5911458730697632,
-0.5343740582466125,
0.19641077518463135,
0.5704037547111511,
-0.45866072177886963,
-0.06765521317720... | |
I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch.
I've used CodeIgniter (<http://codeigniter.com/>) and it is... | [
0.7011178135871887,
0.17320550978183746,
0.0858992263674736,
0.02897963859140873,
-0.42066285014152527,
-0.07780618220567703,
0.11096042394638062,
0.09203656762838364,
-0.13456101715564728,
-0.5729295015335083,
0.26289767026901245,
0.4965599477291107,
-0.07622084021568298,
-0.3769859075546... | |
aware of asynchronous events, etc.
The [Zend Framework](http://framework.zend.com/) is integrated with [Dojo Toolkit](http://dojotoolkit.org/). I haven't used the latest Zend Framework yet, but I do know that in the past, it has proven to be reliable. | [
0.2614111006259918,
-0.21578887104988098,
0.3413562774658203,
0.17735758423805237,
-0.27362295985221863,
-0.7986323237419128,
0.5467129945755005,
-0.2510930299758911,
-0.0937783420085907,
-0.4908727705478668,
-0.14571331441402435,
0.49904873967170715,
0.09802194684743881,
-0.30901166796684... | |
I'm trying to perform a bitwise NOT in SQL Server. I'd like to do something like this:
```
update foo
set Sync = NOT @IsNew
```
Note: I started writing this and found out the answer to my own question before I finished. I still wanted to share with the community, since this piece of documentation was lacking on MSDN... | [
0.26957613229751587,
0.0694601982831955,
0.2960590422153473,
-0.02050376683473587,
0.1447523683309555,
-0.503311276435852,
0.3572598099708557,
0.18192893266677856,
0.15643492341041565,
-0.6367061734199524,
0.09745941311120987,
0.664359986782074,
-0.4579046666622162,
-0.04927431792020798,
... | |
I need to make sure that user can run only one instance of my program at a time.
Which means, that I have to check programatically, whether the same program is already running, and quit in such case.
The first thing that came to my mind was to create a file somewhere, when the program starts. Then, each other insta... | [
0.38269785046577454,
0.16680771112442017,
0.04871219024062157,
0.06719928234815598,
0.38701313734054565,
-0.1692238748073578,
0.3460831344127655,
-0.006947484333068132,
-0.25472915172576904,
-0.6651802062988281,
-0.029902510344982147,
0.48107123374938965,
-0.06124931946396828,
0.3654229044... | |
say, power outage, the lock file remains in place and the program can't be started again.
To solve this, I decided to store the first program's process ID into the lock file and when another instance starts, it checks if the PID from the file is attached to some running process.
If the file doesn't exist, is empty,... | [
0.35619011521339417,
0.09196729212999344,
0.2188228964805603,
0.05417595058679581,
0.41108354926109314,
0.02098843827843666,
0.06735542416572571,
-0.2550209164619446,
-0.3688827157020569,
-0.36007800698280334,
-0.07204393297433853,
0.4498940706253052,
-0.31980830430984497,
0.33193451166152... | |
be associated with some other program, seems to be quite low.
But it still doesn't feel right (there *is* a chance of getting locked by some unrelated process) and working with process IDs seems to go beyond the standard C++ and probably isn't very portable either.
So, is there another (more clean and secure) way of ... | [
0.4015757739543915,
0.1259949952363968,
0.05276550352573395,
0.2634923458099365,
0.10678704082965851,
-0.40561842918395996,
0.2551875114440918,
-0.3125278651714325,
-0.43328341841697693,
-0.49180030822753906,
-0.12810853123664856,
0.4419015347957611,
-0.15530361235141754,
0.131838366389274... | |
application:
**Method 1: Global synchronization object or memory**
It's usually done by creating a named global mutex or event. If it is already created, then you know the program is already running.
For example in windows you could do:
```
#define APPLICATION_INSTANCE_MUTEX_NAME "{BA49C45E-B29A-4359-A07C-51B65... | [
-0.12267566472291946,
0.02681407891213894,
0.5427924394607544,
-0.056303370743989944,
0.26405131816864014,
-0.007163802161812782,
0.4790440499782562,
-0.06467743963003159,
-0.18288975954055786,
-0.6580269932746887,
-0.36756858229637146,
0.5746465921401978,
-0.33619892597198486,
0.237538769... | |
::ReleaseMutex(hMutexOneInstance);
::CloseHandle(hMutexOneInstance);
}
throw std::exception("The application is already running");
}
```
**Method 2: Locking a file, second program can't open the file, so it's open**
You could also exclusively open a file by locking it on application o... | [
0.2193138599395752,
0.19356031715869904,
0.39149582386016846,
-0.3084838092327118,
0.11135603487491608,
-0.32602402567863464,
0.5233781337738037,
-0.3436834514141083,
-0.23835307359695435,
-0.31573760509490967,
-0.5030524134635925,
0.5447449684143066,
-0.4635694921016693,
0.323068767786026... | |
simply not specify sharing flags `FILE_SHARE_WRITE` on the file you're opening with `CreateFile` API. On linux you'd use `flock`.
**Method 3: Search for process name:**
You could enumerate the active processes and search for one with your process name. | [
0.41381242871284485,
0.04087532311677933,
0.13475173711776733,
-0.11768092215061188,
-0.04295641556382179,
-0.4361691176891327,
-0.05364297330379486,
-0.05500560998916626,
-0.17728611826896667,
-0.647152304649353,
0.11389460414648056,
0.6017564535140991,
-0.41880732774734497,
0.15100397169... | |
I need to get access to the iTunes tags in an RSS feed using PHP. I've used simplepie before for podcast feeds, but I'm not sure how to get the iTunes tags using it. Is there a way to use simplepie to do it or is there a better way?
---
Okay I tried Simple XML.
All this (the code below) seems to work
```
$feed = si... | [
0.5280929207801819,
0.056198082864284515,
0.8369002938270569,
-0.07854493707418442,
-0.1950933188199997,
-0.15067191421985626,
-0.1611369401216507,
-0.20692549645900726,
-0.29777881503105164,
-0.5854417681694031,
-0.10672217607498169,
0.6300592422485352,
-0.2928648591041565,
0.143424615263... | |
<itunes:category text="Software How-To"/>
</itunes:category>
```
I would expect to be able to get the category with something like this:
```
$category_text = $channel_itunes->category['text'];
```
But that does not seem to work.
I've seen other ways to represent the category that I really don't know who to get.
... | [
0.09294764697551727,
-0.006405058316886425,
0.4780821204185486,
-0.02603495679795742,
-0.1523875743150711,
-0.11215445399284363,
0.2572658956050873,
-0.17222559452056885,
-0.20641574263572693,
-0.535310685634613,
-0.5464077591896057,
0.7445247769355774,
-0.2181084156036377,
0.0526973493397... | |
something with $category
}
}
``` | [
0.0839831531047821,
0.23832079768180847,
0.0650385171175003,
-0.027201589196920395,
0.10682003945112228,
-0.11444017291069031,
0.10283215343952179,
0.4287246763706207,
-0.21178613603115082,
-0.5115640759468079,
-0.4547632932662964,
0.5639466047286987,
-0.25835880637168884,
0.24541492760181... | |
I'm about to deal with managing and running my first Internet connected Apache webserver and I was wondering if there are any sys admins and developers out there that would like to share some of their knowledge regarding security and optimization tips for running Apache webserver.
Maybe you can share your top five (or... | [
0.5377064347267151,
0.09235695004463196,
0.015171393752098083,
0.41288724541664124,
-0.2198391854763031,
-0.4633549451828003,
0.6559271216392517,
0.13993488252162933,
0.03149038180708885,
-0.7328481674194336,
0.05033571273088455,
0.8748083710670471,
0.0034409069921821356,
-0.18893110752105... | |
only the intended requests are actually processed**. You should consider *who* has to access the web resources exposed by Apache and *how*.
3. **Avoid running Apache as root**. This is a must.
4. **Handle your logs**. Logs tend to become bigger and bigger; consider to setup logrotate or to clean your log periodically.
... | [
0.3923070728778839,
-0.20067080855369568,
0.17943842709064484,
0.21937423944473267,
-0.46928930282592773,
-0.43705251812934875,
0.4814738929271698,
-0.06540285050868988,
-0.4230358302593231,
-0.9531624913215637,
0.09948229789733887,
0.9127403497695923,
0.03122120536863804,
-0.2514067590236... | |
the right order**.
7. **Write a nice 404 and 500 message**. Sooner or later your visitors will catch an error.
8. **Stop and restart Apache**, so you can be sure both the shoutdown and start procedure is working flawlessy.
9. Use **mod\_security**
Security
--------
1. Protect Apache against DOS.
2. Load only the modu... | [
0.4498559832572937,
-0.12544475495815277,
0.33296486735343933,
0.31330496072769165,
-0.24636417627334595,
-0.4752074182033539,
0.8582016825675964,
-0.18420003354549408,
-0.46577611565589905,
-0.6919959783554077,
-0.34697601199150085,
0.7410284280776978,
-0.17507940530776978,
-0.22501985728... | |
mod\_deflate module, it provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network. | [
0.24281258881092072,
-0.272806853055954,
0.7290036678314209,
-0.06450225412845612,
-0.12460697442293167,
-0.07446518540382385,
0.2644348740577698,
-0.2976328134536743,
-0.12688373029232025,
-0.6653690934181213,
-0.11048373579978943,
0.9272409677505493,
-0.5943779945373535,
-0.1647653728723... | |
I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to:
```
var obj1 = { food: 'pizza', car: 'ford' }
var obj2 = { animal: 'dog' }
obj1.merge(obj2);
//obj1 now has three properties: food, car, and animal
```
Is there a built in way to do this? I do not need recursion, a... | [
-0.02913280762732029,
0.10548261553049088,
0.32049667835235596,
-0.25421395897865295,
0.05803871154785156,
0.46983373165130615,
0.028961673378944397,
-0.12998661398887634,
-0.1657644659280777,
-1.0913729667663574,
-0.1978147327899933,
0.3241468369960785,
-0.3512783646583557,
0.092826135456... | |
of objects you can merge.
* Later properties overwrite earlier properties with the same name. */
const allRules = {...obj1, ...obj2, ...obj3};
```
Here is also the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) for this syntax. If you're using babel yo... | [
0.16131924092769623,
0.02394111454486847,
0.43441659212112427,
-0.30829256772994995,
-0.25523364543914795,
-0.028562849387526512,
0.2054990977048874,
-0.41583701968193054,
-0.46989718079566956,
-0.9278671741485596,
-0.349545955657959,
0.405864953994751,
-0.5557389259338379,
0.1701351106166... | |
the same name. */
const allRules = Object.assign({}, obj1, obj2, obj3, etc);
```
(see [MDN JavaScript Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Browser_compatibility))
---
**Method for ES5 and Earlier**
```
for (var attrname in obj2) { obj1[attrname] ... | [
0.03951755911111832,
0.1860925555229187,
0.30656784772872925,
-0.025041978806257248,
-0.11804862320423126,
0.26435181498527527,
0.38951876759529114,
-0.5377729535102844,
-0.3351423442363739,
-0.5803914070129395,
-0.15364766120910645,
0.3766714632511139,
-0.3157377541065216,
0.1254918426275... | |
obj1
* @param obj2
* @returns obj3 a new object based on obj1 and obj2
*/
function merge_options(obj1,obj2){
var obj3 = {};
for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
return obj3;
}
``` | [
-0.5516703128814697,
0.1096147671341896,
0.6403982639312744,
-0.3805014491081238,
-0.33030569553375244,
0.781527042388916,
0.6847420334815979,
-0.3368653357028961,
-0.366202712059021,
-0.5403605103492737,
-0.40800055861473083,
0.3131297826766968,
-0.49075737595558167,
0.08327364921569824,
... | |
I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is:
```
FieldInfo[] _fields =
typeof(ButtonedForm.TitleButton).GetFields(
BindingFlags.NonPublic |... | [
0.13852636516094208,
0.061003003269433975,
0.25927937030792236,
-0.21672309935092926,
0.09040814638137817,
0.06699176877737045,
0.26982423663139343,
-0.4048576056957245,
0.1672624945640564,
-0.5239134430885315,
0.00939241610467434,
0.6006003618240356,
-0.37377122044563293,
0.18605315685272... | |
tests that Visual Studio can produce, it asked about something to do with displaying internals to the Test project. Well, now I'm using NUnit and really liking it, but how can I achieve the same thing with it?
It would be more appropriate to use the [`InternalsVisibleTo`](http://msdn.microsoft.com/en-us/library/system.... | [
0.3544093072414398,
0.2799665927886963,
-0.08151128888130188,
0.11129983514547348,
-0.12991517782211304,
0.07814749330282211,
0.29971861839294434,
-0.2459610104560852,
-0.31800392270088196,
-0.3898588716983795,
0.09933555126190186,
0.4264320135116577,
0.2259279042482376,
-0.112781107425689... | |
C# keywords protected and internal have no meaning in IL and are not used in the Reflection APIs. The corresponding terms in IL are Family and Assembly. To identify an internal method using Reflection, use the [IsAssembly](http://msdn.microsoft.com/en-us/library/system.reflection.methodbase.isassembly.aspx) property. T... | [
0.1937534511089325,
0.16099664568901062,
0.3353724479675293,
-0.23190218210220337,
-0.22737254202365875,
-0.08716274052858353,
0.15418483316898346,
-0.3104851245880127,
-0.24088157713413239,
-0.20238471031188965,
-0.5404300093650818,
0.4962867498397827,
-0.449226975440979,
0.07234714925289... | |
I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another.
If you use the [Kernel.system()](http://www.ruby-doc.org/core/classes/Kernel.html#M005982) method it will return a boolean indicating... | [
0.09608031064271927,
0.04529708996415138,
0.6521669626235962,
-0.15283404290676117,
-0.034829627722501755,
0.031530559062957764,
0.3001099228858948,
-0.004288533702492714,
-0.2791688144207001,
-0.42410409450531006,
-0.07289078086614609,
0.6356265544891357,
-0.12084553390741348,
0.212675929... | |
I am VERY new to ASP.NET. I come from a VB6 / ASP (classic) / SQL Server 2000 background. I am reading a lot about Visual Studio 2008 (have installed it and am poking around). I have read about "reflection" and would like someone to explain, as best as you can to an older developer of the technologies I've written abov... | [
0.7076714634895325,
0.18401958048343658,
-0.10623035579919815,
-0.15796908736228943,
-0.5123872756958008,
-0.3415689766407013,
0.05833382532000542,
0.04867114871740341,
-0.3431234359741211,
-0.6080445051193237,
0.32157233357429504,
0.4978172779083252,
0.1700320988893509,
-0.005565780214965... | |
of all the properties and methods in these types, etc.
As an example:
```
myobject.GetType().GetProperty("MyProperty").SetValue(myobject, "wicked!", null)
``` | [
0.1538621038198471,
-0.023040644824504852,
0.08110764622688293,
-0.09695027023553848,
-0.024983922019600868,
-0.21210342645645142,
0.5671131610870361,
-0.09275694191455841,
0.1559019535779953,
-0.4724774956703186,
-0.42020750045776367,
0.5288164615631104,
-0.5776503682136536,
0.33834889531... | |
For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up...
I'm wondering if these days when floating point run... | [
-0.0459914356470108,
0.14116302132606506,
0.3392679691314697,
0.2887040972709656,
-0.012231833301484585,
0.06686220318078995,
0.05746838077902794,
0.34070324897766113,
-0.5623125433921814,
-0.41180944442749023,
0.16310563683509827,
0.43285489082336426,
0.32004642486572266,
0.02089163288474... | |
CPU as found in most computers, not DSP or specialized embedded systems.)
It's still worth it. Floating point is faster than in the past, but fixed-point is also. And fixed is still the only way to go if you care about precision beyond that guaranteed by IEEE 754. | [
-0.006725487299263477,
-0.06756946444511414,
0.344040185213089,
0.502274215221405,
0.23761920630931854,
0.007109425030648708,
-0.21008753776550293,
0.1170269101858139,
-0.46722638607025146,
-0.6729326844215393,
0.3013800084590912,
0.49206089973449707,
0.13315579295158386,
0.021241148933768... | |
I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32 library. I can of course use P/Invoke and create a static class to handle ... | [
0.441394567489624,
-0.1419365555047989,
0.10578364133834839,
0.06407555192708969,
0.14970089495182037,
-0.2167264074087143,
0.07252763956785202,
0.1685180962085724,
-0.43350890278816223,
-0.8602389693260193,
0.04554680734872818,
0.701359748840332,
-0.29481086134910583,
0.2532429099082947,
... | |
built into the .NET framework that already provides this functionality, or will I need to take the P/Invoke route?
I was recently experimenting with creating my own windowing system, really just create new borders around all the windows, but it required a lot of functions from the Win32 API that I add to P/Invoke in.
... | [
0.4884836971759796,
-0.08199388533830643,
0.2238648682832718,
0.04341372102499008,
0.05971987918019295,
-0.32875871658325195,
0.14091713726520538,
-0.07908026874065399,
-0.2706731855869293,
-0.7725903391838074,
-0.2639386057853699,
0.3475767970085144,
-0.23768168687820435,
0.12568564713001... | |
I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 ([adLDAP](http://adldap.sourceforge.net/) does it on Apache). Anyone had done anything similar, with success?
* Edit: I'd prefer a library/class with code that's read... | [
0.27144870162010193,
-0.06361056119203568,
0.49409452080726624,
0.10383092612028122,
-0.20855511724948883,
-0.38381561636924744,
0.11184099316596985,
-0.06598468124866486,
0.05483567342162132,
-0.7999184131622314,
-0.029862312600016594,
0.5896878838539124,
-0.3974454402923584,
0.1429603993... | |
I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID.
After a task is completed the service app then unloads the AppDomain allocated to that task and then it's removed it from the appdomain Hashtable.... | [
0.34905821084976196,
0.33979353308677673,
0.6486677527427673,
0.28680428862571716,
0.18366557359695435,
0.25853267312049866,
0.07786285132169724,
-0.07240749895572662,
-0.49365177750587463,
-0.26505059003829956,
-0.011533014476299286,
0.45365700125694275,
-0.3642626404762268,
0.10601682215... | |
the bug. The line
```
d1 = create_task(:parent_id => @root.id, :sort_order => 2)
```
creates d1. This calls the `before_save` callback, which in turn calls `self.children`. As Orion pointed out, this caches the children of d1.
However, at this point, d1 doesn't have any children yet. So d1's cache of children is em... | [
0.030000120401382446,
0.17924870550632477,
0.11917325854301453,
0.04407167807221413,
0.38189035654067993,
0.5826053619384766,
0.09907831251621246,
0.001029645442031324,
-0.3847733438014984,
-0.7196009755134583,
0.11851535737514496,
0.3805396556854248,
-0.5340341925621033,
0.389044612646102... | |
:) I think it is also possible to fix this by either reloading d1 (`d1.reload`) or self.children (`self.children(true)`) although I didn't try any of these solutions. | [
-0.07441836595535278,
0.3164420425891876,
0.1292760819196701,
0.254363089799881,
0.07184827327728271,
0.5139431357383728,
0.17340658605098724,
-0.12539887428283691,
-0.17160871624946594,
-0.41836556792259216,
-0.12744629383087158,
0.5725966095924377,
0.022343160584568977,
-0.04763636738061... | |
I have always been for documenting code, but when it comes to AJAX + PHP, it's not always easy: the code is really spread out! Logic, data, presentation - you name it - are split and mixed between server-side and client-side code. Sometimes there's also database-side code (stored procedures, views, etc) doing part of t... | [
0.6849777102470398,
0.3989436626434326,
-0.06279721856117249,
-0.11263632029294968,
-0.44211313128471375,
-0.2742951214313507,
0.0013855479191988707,
0.05808233842253685,
-0.2832100987434387,
-0.6798276305198669,
0.17486749589443207,
0.39624834060668945,
0.008621877990663052,
-0.0869114696... | |
list what function is used by what file and what output is expected. I do similar tasks for database procedures. Maybe there's a better method?
Any ideas or experiences?
Note: This question applies to any client+server-side applications, not just Javascript+PHP.
I think it's best to take a hierarchical approach.
Fo... | [
0.33860859274864197,
0.04872710257768631,
0.24168917536735535,
0.31598106026649475,
-0.12931334972381592,
-0.058079201728105545,
0.07352109998464584,
-0.20490805804729462,
-0.36113327741622925,
-0.67634516954422,
-0.02453627996146679,
0.6826491951942444,
-0.12169329077005386,
-0.1726615577... | |
of code from your api docs.
Once you have your doc tools in place, start generating the documentation as part of your build process (you have a build process, right?) for each new build and push the documentation to a standard web location.
Once these api docs are online, you can create a wiki for high level document... | [
0.8822064399719238,
0.29292991757392883,
0.010088377632200718,
0.18695376813411713,
-0.22184893488883972,
-0.04490326717495918,
0.3011838495731354,
-0.03731180727481842,
0.00527501804754138,
-0.760481595993042,
-0.3417189419269562,
0.5713691711425781,
-0.029473524540662766,
-0.030301867052... | |
I've got a data object with a component in it that is an System.Collections.Generic.IList, and I'd like to reflect changes to that list into a Gtk# NodeView, so that when an item is added to the list, the NodeView will get a new item added to it.
How would I listen for changes to an IList? I have considered wrapping ... | [
0.24159100651741028,
-0.06660609692335129,
0.036591868847608566,
0.19528231024742126,
-0.07959430664777756,
-0.2474719136953354,
0.23402468860149384,
-0.11921785771846771,
-0.1416030377149582,
-0.7478095889091492,
-0.19009017944335938,
0.4819444715976715,
-0.35446715354919434,
-0.054247532... | |
on a properly normalized database design. I would say that when you are forced to make design tradeoffs in your code vs. database design, if performance is your goal, make tradeoffs in your object design instead of your database design. Understand that you aren't going to be able to do a proper supertype/subtype databa... | [
0.32628899812698364,
-0.22981858253479004,
-0.07489553838968277,
0.45177802443504333,
0.027941405773162842,
-0.22514943778514862,
0.28507137298583984,
-0.008686905726790428,
-0.07467031478881836,
-0.4392099678516388,
0.04472365602850914,
0.5490507483482361,
-0.5255717039108276,
0.014739703... | |
want to put lists of objects across the wire, just use the ToArray() extension method on your IEnumerable collections to ship arrays of your business objects over the wire. | [
0.744660496711731,
-0.3228963315486908,
0.09385427087545395,
0.24102579057216644,
0.2489795684814453,
-0.2740021049976349,
-0.03749265894293785,
-0.18179355561733246,
-0.4078661799430847,
-0.4699750244617462,
0.13104727864265442,
0.5879025459289551,
-0.4095994532108307,
-0.1018035709857940... | |
When using one's own iPhone for development it's easy enough to access any crash logs via XCode->Organizer->Crash Logs.
How does one access crash logs on another person's phone if they don't have it set up for development in XCode, as would likely be the case if you were distributing your app to them via ad hoc distri... | [
0.09491412341594696,
0.25295668840408325,
0.025537695735692978,
0.3160109519958496,
0.32236912846565247,
0.18027594685554504,
0.3492881655693054,
0.03665287420153618,
-0.2273961305618286,
-0.57776939868927,
-0.15594163537025452,
0.6657227873802185,
-0.23860563337802887,
-0.3326340317726135... | |
access the phone's console and crash logs. Note: *the iPhone Web Configuration Utility, which is available for Windows and Mac (note the "web" in the name) **does not** allow this kind of access and only provides a portion of the Configuration Utility's features*. Er, no you can't. Xcode provides this facility in the ... | [
0.07083071768283844,
0.020225195214152336,
0.3487536311149597,
0.28140586614608765,
0.424751877784729,
-0.05586550012230873,
0.4658856987953186,
0.08693555742502213,
-0.10070782899856567,
-0.6261995434761047,
-0.3878466784954071,
0.6782634854316711,
-0.31882938742637634,
-0.122699931263923... | |
I have not used generics much and so cannot figure out if it is possible to turn the following three methods into one using generics to reduce duplication. Actually my code currently has six methods but if you can solve it for the three then the rest should just work anyway with the same solution.
```
private obje... | [
0.3963371813297272,
0.09175872802734375,
0.18436412513256073,
-0.1049758791923523,
-0.03465137630701065,
0.21256683766841888,
0.398793488740921,
-0.2911752760410309,
-0.16167999804019928,
-0.5872585773468018,
0.22214648127555847,
0.5556768774986267,
-0.4934201240539551,
0.2876134514808655,... | |
return x + y;
case BinaryOp.Subtract:
return x - y;
case BinaryOp.Multiply:
return x * y;
case BinaryOp.Divide: | [
-0.34390532970428467,
-0.22548924386501312,
-0.19653885066509247,
-0.18450342118740082,
-0.024196773767471313,
0.401445209980011,
-0.01219267025589943,
-0.10576258599758148,
0.15817691385746002,
-0.24614737927913666,
-0.3811044991016388,
0.2067507803440094,
-0.6287149786949158,
-0.04235451... | |
return x / y;
case BinaryOp.Remainder:
return x % y;
default:
throw new ApplicationException("error");
}
}
private object EvaluateFloat(float x, float y)
{ | [
-0.18927240371704102,
0.12842918932437897,
0.020574769005179405,
-0.2654774487018585,
0.17503154277801514,
0.35191282629966736,
0.4250383675098419,
-0.09542082250118256,
0.32659077644348145,
-0.14918826520442963,
-0.36829134821891785,
0.5461716055870056,
-0.21321798861026764,
0.05708761513... | |
switch(Operation)
{
case BinaryOp.Add:
return x + y;
case BinaryOp.Subtract:
return x - y;
case BinaryOp.Multiply: | [
0.14801323413848877,
-0.521991491317749,
-0.030996952205896378,
-0.06192925199866295,
0.24295710027217865,
0.3369181752204895,
-0.22882317006587982,
-0.14854009449481964,
-0.31718558073043823,
-0.31097719073295593,
-0.21957486867904663,
0.4422493278980255,
-0.4618845582008362,
0.0120221041... | |
return x * y;
case BinaryOp.Divide:
return x / y;
case BinaryOp.Remainder:
return x % y;
default: | [
-0.30490437150001526,
-0.1285494565963745,
-0.22912836074829102,
-0.05515183508396149,
0.29214438796043396,
0.33556896448135376,
0.09067905694246292,
0.05341938138008118,
0.1391788125038147,
-0.04438161104917526,
-0.5674087405204773,
0.4404992461204529,
-0.28572145104408264,
-0.03379373624... | |
throw new ApplicationException("error");
}
}
private object EvaluateDouble(double x, double y)
{
switch (Operation)
{
case BinaryOp.Add:
return x + y;
case BinaryOp.Subtract: | [
0.08841849863529205,
-0.25788944959640503,
-0.04875088855624199,
-0.1967293918132782,
0.06293375790119171,
0.24206845462322235,
0.27378135919570923,
-0.23995628952980042,
0.06097495183348656,
-0.34642449021339417,
-0.32039088010787964,
0.5708456635475159,
-0.47708213329315186,
0.0427082255... | |
return x - y;
case BinaryOp.Multiply:
return x * y;
case BinaryOp.Divide:
return x / y;
case BinaryOp.Remainder: | [
-0.2920913100242615,
-0.09310895204544067,
-0.11944866925477982,
-0.050104204565286636,
-0.010462181642651558,
0.5012041330337524,
-0.04372067749500275,
-0.23506952822208405,
0.053499430418014526,
-0.007825229316949844,
-0.4267602264881134,
0.17584478855133057,
-0.30967676639556885,
-0.081... | |
return x % y;
default:
throw new ApplicationException("error");
}
}
```
I am building a simple expression parser that then needs to evaluate the simple binary operations such as addition/subtraction etc. I use the above methods to get the actual maths performed using the releva... | [
0.017658427357673645,
0.2492651641368866,
0.16225336492061615,
0.14785301685333252,
-0.21238726377487183,
-0.20474077761173248,
0.7031863331794739,
-0.051545318216085434,
0.1235262081027031,
-0.3620920777320862,
-0.09438321739435196,
0.6290425062179565,
-0.6016460657119751,
-0.072118252515... | |
be done with .NET 3.5, [like so](http://www.pobox.com/~skeet/csharp/miscutil/usage/genericoperators.html). The Operator class is part of [MiscUtil](http://www.yoda.arachsys.com/csharp/miscutil/). This then becomes:
```
public T Evaluate<T>(T x, T y) {
switch (Operation)
{
case BinaryOp.Add:
... | [
0.3564828336238861,
-0.3452073037624359,
0.20762109756469727,
-0.3217769265174866,
0.10911574959754944,
-0.17534199357032776,
0.19625909626483917,
-0.30511733889579773,
0.03539426624774933,
-0.4221985936164856,
-0.4006263315677643,
0.6485702991485596,
-0.30703771114349365,
-0.1971522271633... | |
a good idea to use Expression directly, but you're welcome to use the above. | [
0.4225856363773346,
0.23423144221305847,
-0.2028319537639618,
0.07249239832162857,
-0.1986873745918274,
-0.023087581619620323,
0.27162566781044006,
0.28106915950775146,
0.0027610845863819122,
-0.536155641078949,
-0.15136457979679108,
0.6817846298217773,
0.20283247530460358,
-0.031826525926... | |
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework.
My test case right now includes a SQL Server 2008 database with 2 tables, Member and Profile, with a 1:1 relationship.
I then used the Entity Data Model wizard to auto-generate the EDM from the database. It generated a model with the correct ... | [
-0.1708146631717682,
0.067191943526268,
0.42323800921440125,
0.07776898890733719,
-0.11612308025360107,
-0.11816911399364471,
0.06333822757005692,
-0.3028535544872284,
-0.20255598425865173,
-0.513980507850647,
0.4830763638019562,
0.46593141555786133,
-0.48314592242240906,
0.229151844978332... | |
problem I'm having is that m.Profile is always null. The examples for LINQ to Entities on the MSDN library seem to suggest that I will be able to seamlessly follow the navigation relationships like that, but it doesn't seem to work that way. I found that if I first load the profiles in a separate call somehow, such as ... | [
0.14964251220226288,
0.2116451859474182,
0.20318983495235443,
0.07795938849449158,
-0.10859563946723938,
-0.27774176001548767,
0.22764845192432404,
-0.021165629848837852,
-0.27500075101852417,
-0.5426638722419739,
0.22242075204849243,
0.38989153504371643,
-0.1993301510810852,
0.27663922309... | |
join or something else?
Thanks
Okay I managed to find the answer I needed here <http://msdn.microsoft.com/en-us/magazine/cc507640.aspx>. The following query will make sure that the Profile entity is loaded:
```
IQueryable<Member> membersQuery = from m in members.Include("Profile") select m;
``` | [
0.3108356297016144,
-0.15401802957057953,
0.5517774820327759,
0.11127948760986328,
0.04480666667222977,
-0.16468088328838348,
0.2854483723640442,
-0.12543651461601257,
-0.400216281414032,
-0.46525025367736816,
-0.01342586800456047,
0.24792155623435974,
-0.2848159968852997,
0.34666821360588... | |
I've updated my TortoiseSVN client and now I'm getting the error when trying to update or commit to different repositories:
> The requested name is valid, but no data of the requested type was
> found
Any ideas on how I can solve this? Internet Explorer shows up appropriate URL just fine.
*TortoiseSVN 1.5.3, Build ... | [
0.006145970895886421,
0.1950370967388153,
0.463302880525589,
0.1123858243227005,
-0.1256837099790573,
-0.10415759682655334,
0.6354761123657227,
0.3975304365158081,
-0.7498404383659363,
-0.47040361166000366,
-0.2037682831287384,
0.8631541132926941,
-0.07041454315185547,
0.34942519664764404,... | |
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.
I would think that there would be so... | [
0.5909215211868286,
-0.02833140641450882,
0.22811874747276306,
-0.1241450086236,
-0.1501159816980362,
-0.11039316654205322,
0.15576644241809845,
-0.07524634897708893,
-0.029858985915780067,
-0.6002033948898315,
-0.05138758569955826,
0.6693915128707886,
-0.16451357305049896,
-0.029978632926... | |
When authoring a library in a particular namespace, it's often convenient to provide overloaded operators for the classes in that namespace. It seems (at least with g++) that the overloaded operators can be implemented either in the library's namespace:
```
namespace Lib {
class A {
};
A operator+(const A&, const A&)... | [
-0.2848641872406006,
-0.07884062081575394,
0.1471223682165146,
-0.07119608670473099,
0.037481922656297684,
-0.03216009959578514,
0.09565139561891556,
-0.2501784861087799,
-0.07404039055109024,
-0.5310715436935425,
-0.5076826810836792,
0.5682004690170288,
-0.6399231553077698,
-0.34598934650... | |
lookup.
No need to pollute the global namespace. | [
0.28514716029167175,
0.24064435064792633,
0.04567641019821167,
0.130379781126976,
-0.19016027450561523,
-0.4321933686733246,
0.436494916677475,
0.5562055110931396,
-0.17392638325691223,
-0.5618699789047241,
-0.2146497368812561,
0.11395782977342606,
-0.38885849714279175,
-0.1759838610887527... | |
I have a simple, real life problem I want to solve using an OO approach. **My harddrive is a mess.** I have 1.500.000 files, duplicates, complete duplicate folders, and so on...
The first step, of course, is parsing all the files into my database. No problems so far, now I got a lot of nice entries which are kind of "... | [
0.22199766337871552,
0.41512027382850647,
0.18744148313999176,
0.08626586198806763,
0.19081400334835052,
-0.01948692463338375,
0.33978673815727234,
0.06835373491048813,
-0.571684718132019,
-0.6836858987808228,
0.07069516181945801,
0.4431387484073639,
-0.10582103580236435,
0.260723769664764... | |
groups with a little more natural meaning. There are different strategies for this, depending on the "use case".
Assume I have a bad habit of putting all my downloaded files first on the desktop. Then I extract them to the appropriate folder, without deleting the ZIP file always. The I move them into a "attic" folder.... | [
0.10614942759275436,
-0.0674808919429779,
0.24284683167934418,
0.19335992634296417,
0.045278843492269516,
-0.18140631914138794,
0.5248311161994934,
-0.44561630487442017,
-0.5366353988647461,
-0.6659187078475952,
-0.22196471691131592,
0.1177988201379776,
-0.29347553849220276,
-0.05435028299... | |
a **nice structure**, and another **messy folders**. Now my clean folder has 20 picture galleries, my messy folder has 5 duplicated and 1 new gallery. A human user could easily identify this logic by seeing "Oh, thats all just duplicates, thats a new one, so I put the new one in the clean folder and trash all the dupli... | [
0.6087368726730347,
-0.14569899439811707,
0.029362447559833527,
0.24190694093704224,
-0.1413111835718155,
0.15966230630874634,
0.19073174893856049,
-0.12973171472549438,
-0.6419874429702759,
-0.7525450587272644,
0.12646350264549255,
0.26363682746887207,
-0.40228092670440674,
0.148042097687... | |
And it seemes to me it is more then just filtering. Its dynamic grouping by combining multiple criteria to find the "best" groups.
One very rough approach would be this:
1. In the beginning, all files are equal
2. The first, not so "good" group is the directory
3. If you are a big, clean directory, you earn points (e... | [
0.22231562435626984,
0.014330476522445679,
0.11378006637096405,
0.20952726900577545,
0.06820329278707504,
-0.07255903631448746,
-0.07446063309907913,
-0.19245992600917816,
-0.26859068870544434,
-0.5083443522453308,
-0.06208916753530502,
0.31894394755363464,
-0.23087431490421295,
0.44127976... | |
best patterns fitting this situation. Strategy, Filters and Pipes, "Grouping".. Any comments welcome!
**Edit in reacation to answers:**
**The tagging approach:**
Of course, tagging crossed my mind. But where do I draw the line. I could create different tag types, like InDirTag, CreatedOnDayXTag, TopicZTag, AuthorPTag... | [
0.4017553925514221,
-0.21427999436855316,
0.29833585023880005,
0.2008144110441208,
-0.4235684275627136,
0.031309597194194794,
0.2841646671295166,
0.06323973089456558,
-0.2628706097602844,
-0.7607388496398926,
0.13008257746696472,
0.1519407331943512,
-0.292938768863678,
-0.1360020637512207,... | |
of the bigger picture of grouping related data in dynamic ways. Perhaps I should have kept it more abstract, to stress this: I am **NOT searching for** a file tagging **tool** or a search engine, **but an algorithm or pattern** to approach this problem... (or better, ideas, like tagging)
Chris
I don't have a solution ... | [
0.48868319392204285,
0.09679128974676132,
0.284133642911911,
0.2989785373210907,
0.01794104091823101,
-0.3593933880329132,
-0.03803940862417221,
-0.0800284892320633,
-0.606838583946228,
-0.3681563138961792,
0.10331081598997116,
0.39424723386764526,
-0.08014331012964249,
0.16674518585205078... | |
files can have interesting metadata. A hash of the entire contents helps if looking for duplicates.
* out-of-band metadata such as can be stored in NTFS alternate data streams - eg. what you can edit in the Summary tab for non-Office files
* your browsers keep information on where you have downloaded files from (though... | [
0.38573387265205383,
-0.05902668833732605,
0.2605421245098114,
0.30725979804992676,
0.21799777448177338,
-0.5774267911911011,
0.0719713568687439,
0.15142202377319336,
-0.5620527267456055,
-0.7213487029075623,
-0.23089158535003662,
0.3389938175678253,
0.03628474846482277,
0.1323885768651962... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.