text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm just starting with NumPy so I may be missing some core concepts...
What's the best way to create a NumPy array from a dictionary whose values are lists?
Something like this:
```
d = { 1: [10,20,30] , 2: [50,60], 3: [100,200,300,400,500] }
```
Should turn into something like:
```
data = [
[10,20,30,?,?],
[... | [
0.2956644594669342,
0.07216443121433258,
0.4118000566959381,
0.17746829986572266,
-0.137920081615448,
0.44582313299179077,
0.09239276498556137,
-0.23026162385940552,
-0.11055264621973038,
-0.5421959161758423,
0.0062112025916576385,
0.3303183615207672,
-0.08509747684001923,
-0.0405173152685... | |
different. If I understand correctly numpy wants uniform size, so what do I fill in for the missing items to make std() happy?
Update: One thing I forgot to mention - while the python techniques are reasonable (eg. looping over a few million items is fast), it's constrained to a single CPU. Numpy operations scale nice... | [
0.23252511024475098,
-0.16418299078941345,
-0.024457138031721115,
0.13620257377624512,
-0.21222074329853058,
0.13587810099124908,
0.06763407588005066,
-0.0010135873453691602,
-0.6139163374900818,
-0.53826904296875,
0.010307899676263332,
0.5511488914489746,
-0.4431372582912445,
-0.062276255... | |
to compute the standard variation.
The downside of this method is that the main loop will be in python and not in C. But I guess this should be fast enough: you will still compute std at C speed, and you will save a lot of memory as you won't have to store 0 values where you have variable size arrays.
* If you want ... | [
0.30132994055747986,
-0.1444614976644516,
0.2972933053970337,
-0.060838278383016586,
-0.25452861189842224,
0.10194071382284164,
0.4566553831100464,
-0.28313735127449036,
-0.3827844262123108,
-0.513983964920044,
0.11896298080682755,
0.6072700619697571,
-0.3893934190273285,
-0.02371025830507... | |
slow, try to use psycho to optimize the python loop.
* if this is still too slow, try using [Cython](http://www.cython.org/) together with the numpy module. This [Tutorial](http://wiki.cython.org/tutorials/numpy) claims impressive speed improvements for image processing. Or simply program the whole std function in Cyth... | [
0.2418433427810669,
-0.2427375763654709,
-0.018344780430197716,
0.3200109302997589,
-0.3894786536693573,
0.1351061761379242,
-0.26703670620918274,
-0.28901365399360657,
-0.4971219301223755,
-0.5805869698524475,
0.05855339765548706,
0.36236950755119324,
-0.3503451645374298,
0.12884712219238... | |
the following example.
example with O(N) complexity:
```
import numpy
list_size_1 = []
list_size_2 = []
for row in data.itervalues():
if len(row) == 1:
list_size_1.append(row)
elif len(row) == 2:
list_size_2.append(row)
list_size_1 = numpy.array(list_size_1)
list_size_2 = numpy.array(list_size_2)
... | [
-0.3769126236438751,
-0.1905858963727951,
0.28103160858154297,
-0.2668846845626831,
-0.21673764288425446,
0.3796750605106354,
-0.08522845804691315,
-0.33292168378829956,
-0.4015289545059204,
-0.5539101362228394,
-0.20024022459983826,
0.5626329779624939,
-0.37012553215026855,
0.156480982899... | |
I got this error while (re)building, using cygwin make.exe version :3.81.
```
Error : *** target pattern contains no `%'.
```
This error is due to a presence of a `":"`. Therefore it no longer supports windows paths.
You need to download version 3.80 and replace the `make.exe` in the `\bin` directory.
Apparently it... | [
0.6614593863487244,
0.1556861698627472,
0.0718025416135788,
-0.1810656487941742,
0.1898009181022644,
-0.36418482661247253,
0.6373888850212097,
0.3265869915485382,
0.30977514386177063,
-0.6531451344490051,
-0.007507145870476961,
0.3775947093963623,
-0.3774290978908539,
0.5363304615020752,
... | |
I'd like to automatically kill a command after a certain amount of time. I have in mind an interface like this:
```
% constrain 300 ./foo args
```
Which would run "./foo" with "args" but automatically kill it if it's still running after 5 minutes.
It might be useful to generalize the idea to other constraints, such... | [
0.25638484954833984,
0.13141126930713654,
0.1079840436577797,
-0.17192892730236053,
0.13579799234867096,
-0.14389438927173615,
0.4478130340576172,
0.20593765377998352,
-0.10171456634998322,
-0.4428907036781311,
0.11588489264249802,
0.7480325698852539,
-0.47760215401649475,
-0.1182185634970... | |
on Mac OSX. I got rid of the SIGRTMIN which lets it compile fine, but the signal just doesn't get sent to the child process. Anyone know how to make this work on Mac?
[Added: Note that an update is available from Jonathan that works on Mac and elsewhere.]
I've arrived rather late to this party, but I don't see my favo... | [
-0.18119724094867706,
0.045720212161540985,
0.30154046416282654,
-0.10528657585382462,
0.02675780840218067,
-0.2780528664588928,
0.6036173701286316,
-0.21258974075317383,
-0.12791374325752258,
-0.4735918939113617,
-0.09592656791210175,
0.7805638313293457,
-0.3690588176250458,
0.10631572455... | |
doalarm 300 ./foo.sh args
```
or install a [trivial C wrapper](http://www.pilcrow.madison.wi.us/) to do that for you.
**Advantages** Only one PID is involved, and the mechanism is simple. You won't kill the wrong process if, for example, `./foo.sh` exited "too quickly" and its PID was re-used. You don't need several... | [
0.05633116886019707,
0.19183561205863953,
0.1381165236234665,
-0.16585811972618103,
0.11194507777690887,
-0.23252135515213013,
0.0716891810297966,
-0.4795784652233124,
-0.07224579900503159,
-0.2862159013748169,
-0.09188943356275558,
0.5610528588294983,
-0.3783745765686035,
-0.2143887430429... | |
other approaches.
Some (very old, I think) systems implement `sleep(2)` in terms of `alarm(2)`, and, even today, some programmers use `alarm(2)` as a crude internal timeout mechanism for I/O and other operations. In my experience, however, this technique is applicable to the vast majority of processes you want to time... | [
0.2947997748851776,
-0.13585993647575378,
-0.2202659398317337,
-0.13833239674568176,
0.19255419075489044,
-0.18840292096138,
0.09995640069246292,
-0.22459587454795837,
-0.3140985667705536,
-0.5549620985984802,
-0.21555376052856445,
0.661893904209137,
-0.21584860980510712,
-0.11458474397659... | |
I am asking about a good reference for multithreading programming in terms of concepts
with good examples using C++/C#?
Good reference for reading:
[Thread Management In The CLR](http://msdn.microsoft.com/en-us/magazine/dd252943.aspx)
[Round-Robin Access To The ThreadPool](http://msdn.microsoft.com/en-us/magazine... | [
-0.3348107933998108,
0.08886434882879257,
0.37123584747314453,
0.1557248830795288,
-0.22671829164028168,
-0.09770167618989944,
0.34533122181892395,
-0.46209508180618286,
-0.36125341057777405,
-0.21955804526805878,
-0.20082896947860718,
0.48726099729537964,
-0.10158631205558777,
0.108894906... | |
access to a shared resource in a multithreading environment by using Visual C#](http://support.microsoft.com/default.aspx?scid=kb;en-us;816161)
[Use Threads Correctly = Isolation + Asynchronous Messages](http://www.ddj.com/go-parallel/article/showArticle.jhtml?articleID=215900465)
[Parallel and Multi-Core Computi... | [
-0.17949278652668,
0.0036477406974881887,
0.2604377865791321,
0.4643855392932892,
-0.0677788034081459,
0.24421915411949158,
0.2473612278699875,
-0.09601446986198425,
-0.7802445292472839,
-0.5176541805267334,
-0.20208626985549927,
0.6162060499191284,
-0.2516901195049286,
0.095374196767807,
... | |
[Overview of concurrency in .NET Framework 3.5](http://igoro.com/archive/overview-of-concurrency-in-net-framework-35/)
[Multi-threading in .NET: Introduction and suggestions](http://www.yoda.arachsys.com/csharp/threads/)
[Oracle - Multithreaded Programming Guide](http://download.oracle.com/docs/cd/E19963-01/html/... | [
-0.0016712825745344162,
0.08917858451604843,
0.17382286489009857,
0.17359070479869843,
-0.31422293186187744,
-0.024846050888299942,
0.2886171340942383,
-0.2632025480270386,
-0.6057769060134888,
-0.1911410540342331,
-0.06390173733234406,
0.42495784163475037,
-0.20664311945438385,
0.19780965... | |
My problem is: When my application is opened, I disable all buttons (in form\_Load) and their color changes to the color of the background. But then I do some action (like clicking on a button), and in this action I disable the buttons again.
Now some of these buttons become GRAY and others become as the background. ... | [
0.1769491732120514,
0.2568085789680481,
0.1321192979812622,
-0.23067042231559753,
0.17729324102401733,
-0.0528852604329586,
0.4653097689151764,
0.2326270192861557,
-0.46325817704200745,
-0.6903311014175415,
-0.05459219217300415,
0.5872589349746704,
-0.501682460308075,
0.19985748827457428,
... | |
code is like:
```
private void _btnDownload2PC_Click(object sender, EventArgs e)
{
// do action
_btnDownloadToPC.Enabled=false; // its color became gray
_btnDownloadToPhone.Enabled=false; // its color became like the
// background color and it can't | [
0.21476738154888153,
-0.1535540521144867,
0.04664872586727142,
-0.14435750246047974,
0.2595517635345459,
-0.06759383529424667,
0.7249341607093811,
-0.07860338687896729,
-0.10434209555387497,
-0.42815107107162476,
-0.3624289035797119,
0.44277092814445496,
-0.41535690426826477,
0.08448848128... | |
// be pressed
}
```
I figured out that the problem is when I use the `button_MouseLeave()` or `button_MouseMove()` functions. For example:
```
private void _btnOneToCort_MouseLeave(object sender, EventArgs e)
{
this._btnOneToCart.Image=global::MyProject.Properties.Resources.button3over;
}
```
but this doesn'... | [
-0.027143744751811028,
-0.19931825995445251,
0.33033260703086853,
-0.1943744421005249,
0.3483686149120331,
0.014272278174757957,
0.2706869840621948,
-0.1170191615819931,
-0.37877991795539856,
-0.8055399060249329,
0.04363961145281792,
0.8581684231758118,
-0.4273507297039032,
0.0746586918830... | |
click on button if it's disabled?
Are form color settings default? Have you changed windows theme color preferences? | [
0.3393821716308594,
-0.22877511382102966,
0.3120235502719879,
-0.07357299327850342,
0.4853742718696594,
-0.169199138879776,
0.3600577116012573,
0.41443273425102234,
-0.36063289642333984,
-0.40009805560112,
-0.42242684960365295,
0.570820152759552,
-0.2561188042163849,
0.18587952852249146,
... | |
At my place of work, we use SVN and TortoiseSVN (Windows XP) as a client. I have a longish commute and work offline during that.
Now, I'd like to have some sort of "extended undo" locally; i.e. I would like to have local version control of my SVN working copy, in order to dare to refactor for example.
Switching a... | [
0.2360529601573944,
0.1546889990568161,
0.5213207602500916,
-0.2985289990901947,
-0.0911075696349144,
-0.23767247796058655,
0.24753795564174652,
0.4311331510543823,
-0.5293628573417664,
-0.5629650950431824,
-0.30862727761268616,
0.8084263205528259,
0.10882401466369629,
0.2958890497684479,
... | |
or similar?
Are there any potential drawbacks? (perhaps messing with .svn folders or similar)
I usually do like this:
1. Get SVN repository as working copy.
2. Initialize Git repository in this working copy.
3. Hack hack hack;
4. Commit to my Git repo.
5. Update from company SVN.
6. Resolve conflicts.
7. Commit to ... | [
0.4733598232269287,
-0.08783149719238281,
0.5252924561500549,
-0.011149232275784016,
-0.2082969844341278,
-0.2576706111431122,
0.23694853484630585,
-0.0887913927435875,
-0.11517296731472015,
-0.6444793343544006,
-0.29410696029663086,
0.9766314625740051,
0.012970304116606712,
0.090353406965... | |
I tried this:
```
from Table where (:par1 is null or col1 = :par1)
```
but it happens that
```
from Table where :par1 is null
```
always returns all the rows of the table, even if the :par1 is not null.
while
```
select * from table where col1 = 'asdf'
```
does not return any row.
I can't use native grammar... | [
-0.2679732143878937,
0.08662447333335876,
0.036747317761182785,
-0.14041131734848022,
-0.28335899114608765,
0.14889374375343323,
0.32601937651634216,
-0.004524511750787497,
-0.18131865561008453,
-0.6626661419868469,
-0.2701255679130554,
0.5615907311439514,
-0.3034771680831909,
0.1177169978... | |
Apparently [there is no generic version of a HybridDictionary](https://stackoverflow.com/questions/386823/is-there-a-generic-version-of-the-hybriddictionary).
Why is this? I always considered it to be a best-practice when you needed to store items in a dictionary, but didn't know how many items were going to be in it.... | [
0.2542603611946106,
-0.0006823572912253439,
0.1474989503622055,
0.13105244934558868,
-0.0686192512512207,
-0.12065761536359787,
0.08686394989490509,
0.14952944219112396,
-0.008052404969930649,
-0.6305975317955017,
-0.0577741339802742,
0.17935046553611755,
-0.19921638071537018,
0.3297989070... | |
Quick question: When do you decide to use properties (in C#) and when do you decide to use methods?
We are busy having this debate and have found some areas where it is debatable whether we should use a property or a method. One example is this:
```
public void SetLabel(string text)
{
Label.Text = text;
}
```
I... | [
0.5539575219154358,
-0.2278621345758438,
0.04427601397037506,
0.14601103961467743,
0.194371297955513,
-0.5103585124015808,
-0.2053246945142746,
-0.1798064410686493,
-0.23589405417442322,
-0.5105552673339844,
-0.049916576594114304,
0.6804901361465454,
-0.24459101259708405,
-0.09918732196092... | |
the example that I have given.
From the [Choosing Between Properties and Methods](https://msdn.microsoft.com/en-us/library/ms229054(v=vs.100).aspx) section of Design Guidelines for Developing Class Libraries:
> In general, methods represent actions and properties represent data. Properties are meant to be used like fi... | [
0.15967677533626556,
-0.0761408656835556,
-0.29056617617607117,
0.535785436630249,
0.04472104087471962,
-0.21074816584587097,
0.08802741765975952,
-0.28115230798721313,
-0.1494152694940567,
-0.4953450560569763,
-0.18784113228321075,
0.5913975834846497,
-0.17639005184173584,
0.1178340092301... | |
I want to load part of an external page int on OS X widget. Using JQuery I can load the page but I then encounter errors trying ot put it in to the page.
I am having a problem filtering the returned html before I put it on the page.
I would like to be able to fetch the page, filter out the table I want, then append ... | [
0.2558457851409912,
0.048317745327949524,
0.47009792923927307,
-0.17880816757678986,
0.012617984786629677,
-0.16536782681941986,
0.18073779344558716,
-0.18381351232528687,
-0.0022838814184069633,
-0.8801032304763794,
-0.10612418502569199,
0.5042508840560913,
-0.5108890533447266,
0.06946082... | |
asynchronous and you cant filter it before it is all there)
});
});
```
When I do the above nothing appened to the screen and the page is blank (it should be the color black -> something is breaking the whole page)
Is doing it with the empty selector $() the right way? Am I going about it generally in the right... | [
0.1208510473370552,
-0.20727677643299103,
0.40946435928344727,
-0.22987064719200134,
-0.14897021651268005,
-0.22493276000022888,
0.5707535147666931,
-0.3290989100933075,
-0.37638944387435913,
-0.7120257616043091,
-0.455698698759079,
0.5636821389198303,
-0.5207000374794006,
-0.0923691391944... | |
I have a php script that checks for updates on many (thousands) of sites.
On occasion (more frequently as the number of sites increases), I get an execution timeout on the update of one of these sites, and the whole script goes down the drain.
The best idea I could come up with is to fork each update, so if it dies, t... | [
0.39320945739746094,
0.1698688119649887,
0.14622120559215546,
0.03427239507436752,
-0.1651962399482727,
-0.26978716254234314,
0.4178966283798218,
0.4367612898349762,
-0.1716821789741516,
-0.48377811908721924,
0.3639867603778839,
0.1455390304327011,
-0.34824174642562866,
0.3554578721523285,... | |
be much more costly for the server (in time and processing power)?
I'd be happy to hear some ideas and experience about PHP forking/threading...
thanks,
Omer.
Well, at the end I went for curl, and it works just fine.
I needed a cross-platform solution, as I develop on a Mac while in this case the production serer is... | [
0.2526830732822418,
0.1042654812335968,
0.3824006915092468,
0.07659924775362015,
-0.1724063903093338,
0.0719289481639862,
0.05742239952087402,
0.27803876996040344,
-0.0806846097111702,
-0.6528999209403992,
0.1783382147550583,
0.5792747735977173,
-0.1380995362997055,
0.13874270021915436,
... | |
that initiates all the curl calls, otherwise it just times out. | [
0.4511989653110504,
0.4307246804237366,
0.6395093202590942,
-0.22101594507694244,
0.07011117041110992,
-0.29403525590896606,
0.29512283205986023,
-0.14662620425224304,
-0.11479657888412476,
-0.1694173663854599,
0.22822044789791107,
0.24884451925754547,
0.26347580552101135,
0.20316480100154... | |
When an unhandled exception happens while debugging some code in any procedure/function/method, the debugger stops there and shows the message.
If I now continue debugging step by step, the execution jumps directly from the line that created the exception to the end of the current procedure (if there is no finally bl... | [
0.10357977449893951,
0.15805284678936005,
0.20208238065242767,
-0.13107344508171082,
-0.10014655441045761,
-0.09999679774045944,
0.5209096074104309,
0.000787456810940057,
-0.2241242676973343,
-0.26875677704811096,
-0.33311256766319275,
0.2073548138141632,
-0.4248974919319153,
0.24160389602... | |
hidden "finally" in each function on the stack, as it "unwinds" up to an exception handler. This cleans up local variables in each stackframe. In languages like C++ with the Resource Acquisition Is Initialization paradigm, it will also cause destructors to run.
Eventually, somewhere up the callstack, the exception wil... | [
-0.028226297348737717,
-0.2582520544528961,
0.0769040510058403,
-0.07815087586641312,
0.19020529091358185,
-0.18517976999282837,
0.37948930263519287,
-0.026031088083982468,
-0.27237454056739807,
-0.5829816460609436,
-0.5950597524642944,
0.3766838610172272,
-0.4642024338245392,
0.2263073474... | |
I'm trying to pick between the [Oolong](http://code.google.com/p/oolongengine/) and [SIO2](http://sio2interactive.com/store.php) iPhone game engines for my first game programming project. I have some Cocoa experience and many years of C++ including relatively low level 2D graphics and developing [Quicktime plugins](htt... | [
-0.10829520225524902,
0.08438647538423538,
0.4222943186759949,
-0.0416293740272522,
-0.07698129862546921,
0.22802360355854034,
-0.22817789018154144,
0.15268854796886444,
-0.2129623293876648,
-0.7005544900894165,
-0.02799432910978794,
0.7565847635269165,
-0.08426299691200256,
-0.37832608819... | |
range of [tutorials](http://sio2interactive.com/TECHNOLOGY.html).
I'm also willing to spend money on [Unity](http://unity3d.com/unity/features/iphone-publishing) or [Torque Game Environment](http://www.garagegames.com/products/consoles) if they will save me significant time. The pricing gets interesting though - the ... | [
0.5057945847511292,
0.020573768764734268,
0.446704238653183,
0.18927493691444397,
-0.03649379685521126,
0.2175784856081009,
-0.2557041049003601,
0.025561364367604256,
0.1956300139427185,
-0.18252582848072052,
0.22690923511981964,
0.8442882895469666,
0.5573506951332092,
-0.01002444140613079... | |
license (their income threshold is USD 250,000).
\*\*Edit Dec 2011 - SIO2 is no longer free \*\*
I started my first SIO2 app last night and it was easy to get up & running from the tutorials (the tutorials include a full XCode project that you can load and start hacking on). The tutorial projects are also very well co... | [
0.4297220706939697,
0.044232163578271866,
0.6870309114456177,
0.08574467897415161,
-0.11856649070978165,
-0.6197185516357422,
0.34020695090293884,
0.11696925014257431,
-0.21651515364646912,
-0.5513511896133423,
-0.1768464893102646,
0.6327037811279297,
-0.35451483726501465,
-0.2492127716541... | |
comments & code. You'll be able to tell pretty quickly if it's a toolkit & style you like.
Not directly related to speed of uptake, but a big plus for me was the Blender integration. It lets me use a free 3d toolkit to make & export models and then go from there. I saw that Oolong uses 3DS and I'm not sure if Blender ... | [
0.735832691192627,
-0.012309824116528034,
0.3947443962097168,
0.13193529844284058,
-0.20470206439495087,
0.060107070952653885,
-0.40307673811912537,
0.2362816035747528,
-0.1245240718126297,
-0.6012406349182129,
0.13054615259170532,
0.48636525869369507,
-0.11865720897912979,
-0.014282213523... | |
from the scene and pull them in to your iPhone app. | [
0.42124104499816895,
-0.15998242795467377,
0.27044913172721863,
0.15375341475009918,
0.36735352873802185,
-0.22081680595874786,
0.32347819209098816,
0.20571368932724,
-0.1375454217195511,
-0.5342091917991638,
-0.46049997210502625,
0.24583840370178223,
-0.13404452800750732,
-0.0837917998433... | |
I have a long text and show first sentence in a TextBlock.
I wish by clicking the TextBlock or a button to show a panel below the TextBlock with full text. I wish this panel be absolutely positioned and be displayed above any other elements, you can do a similar thing in HTML showing and hiding absolutely positioned 'd... | [
0.3795182704925537,
-0.01759008690714836,
0.32179102301597595,
-0.03065900132060051,
-0.21964587271213531,
-0.02882315218448639,
0.4219214916229248,
-0.17054975032806396,
0.10603891313076019,
-0.7267888188362122,
-0.03202178329229355,
0.6415879726409912,
-0.24661976099014282,
0.08677258342... | |
really depends on what kind of panel you're using. For example, if you're using a `Canvas`, all you have to do is make sure to set the correct `ZIndex` on the element.
In order to make this more robust, I'd suggest the following:
```
<!-- Set Panel.ZIndex="99" when showing hidden area to ensure top placement -->
<Gr... | [
0.4005987048149109,
-0.1577300727367401,
0.37100541591644287,
0.14465613663196564,
-0.20564262568950653,
0.014771397225558758,
0.1385418027639389,
-0.11800919473171234,
-0.19049705564975739,
-0.8612164258956909,
-0.041824355721473694,
0.6566200256347656,
0.16196368634700775,
-0.23821909725... | |
I must produce a parsing automat of SPDH protocol.
SPDH defines the structure of request and response messages exchanged between an electronic payment terminal and the server of the bank.
The specifications of this protocol are described in this document:
<http://www.trauco.com/docs/SPDH-specification_070212.pdf>
I ... | [
-0.02096937969326973,
0.05160827934741974,
0.5970291495323181,
-0.021471330896019936,
-0.08586756139993668,
0.09585383534431458,
0.03346079960465431,
-0.5585862994194031,
0.10051480680704117,
-0.4822118580341339,
-0.10339892655611038,
0.4246731698513031,
-0.1539219319820404,
-0.01857780851... | |
: = string | number ;
fids : = fid FieldSeparator fids | epsilon ;
fid : = exp | subfids ;
exp : = string | number| whitespace ;
subfids : = exp RecordSeparator subfids |epsilon ;
whitespace : = space whitespace | epsilon ;
space : | [
-0.4687536358833313,
-0.35034698247909546,
0.20606431365013123,
-0.10479824990034103,
0.1625944823026657,
0.25017595291137695,
-0.12603886425495148,
-0.5281163454055786,
-0.30780813097953796,
-0.6112361550331116,
-0.42846158146858215,
0.14180682599544525,
-0.48417437076568604,
-0.164397090... | |
= ' ' ;
string : = letter string | digits string | '-' string | period string |epsilon ;
FieldSeparator : = period | epsilon ;
RecordSeparator : = '!'| epsilon ;
number : = digits number | epsilon ;
digits : = '0'|'1'|...|'8'| '9' ;
letter : = 'a'|...|'z'|'A'|...|'Z' ... | [
-0.4944705367088318,
-0.46586382389068604,
0.08422517776489258,
-0.21143198013305664,
0.22043322026729584,
0.31771618127822876,
0.1914343237876892,
-0.21142823994159698,
-0.3548724353313446,
-0.1431204229593277,
-0.5860081911087036,
0.3100019097328186,
0.165212482213974,
0.3866086006164551... | |
: = '.' ;
etx : = 'ETX'| epsilon ;
```
I need some help to conceive my application and to implement my grammar.
`AdornerLayer` can work, but may be a little complex. Other options include using [`PopUps`](http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup.aspx)... | [
0.34152987599372864,
0.03133440390229225,
0.25943678617477417,
0.07722202688455582,
-0.2003190517425537,
0.206816166639328,
0.17759698629379272,
-0.29544007778167725,
-0.043211646378040314,
-0.9864155650138855,
-0.19218942523002625,
0.7035335302352905,
-0.2794544994831085,
-0.2291462123394... | |
have to do is make sure to set the correct `ZIndex` on the element.
In order to make this more robust, I'd suggest the following:
```
<!-- Set Panel.ZIndex="99" when showing hidden area to ensure top placement -->
<Grid>
<TextBlock>This is my primary bit of text ...</TextBlock>
<!-- Canvas stays hidden until we... | [
0.17426717281341553,
-0.08350042998790741,
0.54011070728302,
0.025012614205479622,
-0.11938733607530594,
-0.17768369615077972,
0.23492087423801422,
-0.3963165879249573,
-0.0928836464881897,
-0.7510091662406921,
-0.19488957524299622,
0.8351510167121887,
0.07175923138856888,
-0.2871372103691... | |
My usercase is an iphone application where I do an animation on the scale, rotation and translation of an image.
So, I concat everything and feed it to the transform property, but there is one problem:
Since my images vary in size, it is a problem to position them correctly. I'm used to an inverted y axis coordinate ... | [
0.21262630820274353,
-0.13946935534477234,
0.7197153568267822,
0.1014632135629654,
0.07156963646411896,
0.31783559918403625,
0.23104703426361084,
-0.10460837185382843,
0.04015778750181198,
-0.8765195608139038,
0.13485656678676605,
0.43825632333755493,
-0.09389929473400116,
0.17577020823955... | |
to shift your origin to the bottom-left of the screen by using (screenheight - viewheight - y) instead of y in the origins of your views.
However, you can flip the coordinate system of your main view's layers using a CATransform3D. I do this so that I can share the same Core Animation CALayer layout code between my iP... | [
0.15747612714767456,
-0.035912297666072845,
0.8445015549659729,
-0.05357928201556206,
-0.09870996326208115,
0.23255141079425812,
0.11350816488265991,
-0.021324122324585915,
0.03351650759577751,
-0.8454530239105225,
0.1724461168050766,
0.5562955737113953,
0.006250177044421434,
0.18836218118... | |
your layer-hosting UIView. Remember that this will flip your CALayers, so any UIKit text rendering in those layers may also need to be flipped using code similar to the following:
```
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0f, self.frame.size.height);
CGContextScaleCTM(context, 1.0f, -1.0f);
U... | [
0.10510911047458649,
-0.11098175495862961,
1.0593591928482056,
0.08678155392408371,
0.07007911801338196,
-0.09908807277679443,
-0.04275171831250191,
-0.09734442830085754,
-0.010492372326552868,
-0.893387496471405,
-0.18027308583259583,
0.4703458845615387,
-0.0444183386862278,
0.21115638315... | |
I'm working on a project which is similar in nature to website visitor analysis.
It will be used by 100s of websites with average of 10,000s to 100,000s page views a day each so the data amount will be very large.
Should I use a single table with websiteid or a separate table for each website?
Making changes to a li... | [
0.5170841813087463,
0.011067147366702557,
0.4850352704524994,
0.17997252941131592,
0.0033449132461100817,
-0.07643134146928787,
0.21288634836673737,
0.004218879155814648,
-0.44355180859565735,
-0.7295300960540771,
0.160321444272995,
0.2847513258457184,
0.08432326465845108,
0.29768481850624... | |
about one table [partitioned](http://dev.mysql.com/doc/refman/5.1/en/partitioning-overview.html) by website FK? | [
0.15382027626037598,
0.012906217947602272,
0.2519043982028961,
0.15625141561031342,
0.061677489429712296,
0.06881316006183624,
-0.05859006941318512,
0.107836052775383,
-0.6927050948143005,
-0.4416351616382599,
-0.06465274840593338,
-0.46847668290138245,
-0.004448349587619305,
0.44439530372... | |
Since the beginning, Rails has had issues with namespaced models. As time went on, pretty much everybody gave up on using it. Myself included.
With Rails 2.3 out, I'd like an update on the situation. Specifics questions I have in mind are:
* first off, is it good to go?
* table naming, what rule to follow?
* associat... | [
0.07020579278469086,
-0.1650903970003128,
0.13343006372451782,
-0.05956855043768883,
-0.18796110153198242,
-0.31571102142333984,
0.30576208233833313,
0.1444173902273178,
-0.23062065243721008,
-0.21256141364574432,
0.04577939584851265,
0.3966794013977051,
-0.2205153852701187,
0.039136111736... | |
handles namespaces successfully and correctly?
* generation, how about the scaffold generator, which includes controllers?
* any incompatibilities/quirkinesses one should be aware of?
The best writeup I've seen on the issue is from [Strictly Untyped](http://www.strictlyuntyped.com/2008/08/activerecord-can-haz-namespace... | [
-0.20929905772209167,
-0.023328080773353577,
0.2818278968334198,
0.3443421721458435,
-0.1630266010761261,
-0.15902142226696014,
0.1400400549173355,
-0.14097224175930023,
-0.431705117225647,
-0.4277074933052063,
-0.08451379090547562,
0.42977532744407654,
-0.16309845447540283,
-0.17711476981... | |
[Surface.blit](http://www.pygame.org/docs/ref/surface.html#Surface.blit) has a new parameter in 1.8: blend. The following values are defined:
* `BLEND_ADD`
* `BLEND_SUB`
* `BLEND_MULT`
* `BLEND_MIN`
* `BLEND_MAX`
* `BLEND_RGBA_ADD`
* `BLEND_RGBA_SUB`
* `BLEND_RGBA_MULT`
* `BLEND_RGBA_MIN`
* `BLEND_RGBA_MAX`
* `BLEND_R... | [
0.262573778629303,
-0.37776893377304077,
0.9679921865463257,
-0.3063599467277527,
-0.3211546540260315,
0.1942882388830185,
-0.1796523630619049,
-0.6410660743713379,
0.026503777131438255,
-1.0311602354049683,
0.15632006525993347,
0.6190155744552612,
-0.17469027638435364,
-0.2463210821151733... | |
there is an additional blend mode which isn't obvious from the docs: `0` (or just leave the parameter out). This mode will "stamp" source surface into the destination. If the source surface has an alpha channel, this will be determine how "strong" each pixel is (`0`=no effect, `255`=copy pixel, `128`: `result = .5*sour... | [
0.15675580501556396,
-0.2351321130990982,
0.4922407567501068,
-0.32588109374046326,
0.05013074725866318,
-0.02951759658753872,
0.19571059942245483,
-0.33186569809913635,
0.07989442348480225,
-0.7495177388191223,
-0.030759017914533615,
0.4629606008529663,
-0.32499784231185913,
-0.1563925892... | |
I've been trying to use CDT with Eclipse 3.4 under Windows XP with cygwin.
What do I need to do, in order to get startet?
I used "eclipse-cpp-ganymede-SR1-win32.zip" found on the Eclipse homepage.
Edit:
The main problem is, that I cannot compile and run the code.
In the run configuration, I tried gcc.exe for the C/... | [
0.6465551853179932,
0.23411783576011658,
0.09113886952400208,
-0.06795752048492432,
-0.14246200025081635,
-0.43619245290756226,
0.12760308384895325,
0.0946352481842041,
-0.0491514690220356,
-0.8364850878715515,
-0.0899348109960556,
0.8457682132720947,
-0.29522979259490967,
-0.0203548911958... | |
How do I get the text in RTF of a `RichTextBox`? I'm trying to get like this, but the property does not exist.
```
RichTextBox rtb = new RichTextBox();
string s = rtb.Rtf;
```
To get the actual XAML created by the user inside of the RichTextBox:
```
TextRange tr = new TextRange(myRichTextBox.Document.ContentStart... | [
0.12384498864412308,
0.19745662808418274,
0.8047625422477722,
-0.09632609784603119,
0.22934198379516602,
0.07431505620479584,
0.4511807858943939,
-0.15212216973304749,
-0.08068428188562393,
-0.7885108590126038,
-0.4611727297306061,
0.5570423007011414,
-0.43229940533638,
0.1589868813753128,... | |
have code in front of me to test, but an instance of the `TextRange` type has a `Save` (to stream) method that takes a `DataFormats` parameter, which can be `DataFormats.Rtf` | [
0.45220085978507996,
-0.1307329684495926,
0.2157447338104248,
-0.10588809847831726,
-0.08980556577444077,
-0.22437641024589539,
0.15605486929416656,
-0.17707479000091553,
-0.018369758501648903,
-0.5536674857139587,
-0.14590588212013245,
0.6407368183135986,
-0.28850480914115906,
-0.03503121... | |
I'm using `webClient.DownloadFile()` to download a file can I set a timeout for this so that it won't take so long if it can't access the file?
Try `WebClient.DownloadFileAsync()`. You can call `CancelAsync()` by timer with your own timeout. | [
0.5582507252693176,
-0.5024360418319702,
0.2597525119781494,
0.23765000700950623,
0.4251592755317688,
-0.32786938548088074,
0.1206018254160881,
0.47455132007598877,
-0.44471225142478943,
-0.5425679683685303,
0.028509503230452538,
0.8123854994773865,
-0.43773722648620605,
0.1420650929212570... | |
I am using the new [free .net chart controls](http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx) and they appear to work fine when I run the project up in visual studio, but when hitting the same via IIS I get and exception:
```
[HttpException (0... | [
-0.027612026780843735,
-0.0028313875664025545,
0.6362160444259644,
0.03031282126903534,
0.12629705667495728,
0.4167640209197998,
0.5668877959251404,
-0.5475972890853882,
-0.1457541435956955,
-0.8227866888046265,
-0.32743769884109497,
0.4832918643951416,
-0.10595913976430893,
-0.10064199566... | |
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +253
System.Web.UI.HtmlControls.HtmlForm.Render... | [
-0.29367595911026,
0.2838910222053528,
0.8006649613380432,
-0.09857217967510223,
0.06433434039354324,
0.7087926864624023,
0.5078147649765015,
-0.45579153299331665,
-0.2658393383026123,
-0.8619133830070496,
-0.1282346397638321,
0.3420056700706482,
0.17479895055294037,
0.22851578891277313,
... | |
not sure why that WOULD work when running it with visual studio. Figure without those setting is should have failed in both environments (visual studio and iis). Curious.
Thanks for everyone's help in pointing in some good directions. | [
0.3712056875228882,
-0.15754170715808868,
0.13575546443462372,
0.5008105039596558,
-0.4647735059261322,
-0.10027650743722916,
0.448303759098053,
0.2545309066772461,
0.007180779241025448,
-0.3791715204715729,
0.36188969016075134,
0.2529537081718445,
0.6029595732688904,
-0.007249425631016493... | |
What, in Your opinion is a meaningful docstring? What do You expect to be described there?
For example, consider this Python class's `__init__`:
```
def __init__(self, name, value, displayName=None, matchingRule="strict"):
"""
name - field name
value - field value
displayName - nice display name, if e... | [
0.00385967711918056,
0.2601029872894287,
0.1835983395576477,
0.026035187765955925,
-0.11223024129867554,
-0.17834457755088806,
0.19255542755126953,
0.042876556515693665,
0.019499024376273155,
-0.5923556089401245,
-0.05603674426674843,
0.7616100907325745,
-0.410328209400177,
-0.109400250017... | |
can be accepted).
I agree with "Anything that you can't tell from the method's signature". It might also mean to explain what a method/function returns.
You might also want to use [Sphinx](http://www.sphinx-doc.org/) (and reStructuredText syntax) for documentation purposes inside your docstrings. That way you can incl... | [
0.2143140584230423,
-0.019496962428092957,
0.20030473172664642,
0.24287188053131104,
-0.03269203379750252,
-0.3786223530769348,
0.1694241464138031,
-0.367003858089447,
-0.5436080098152161,
-0.4216916859149933,
-0.16019794344902039,
0.4759933650493622,
-0.20812010765075684,
0.06705292314291... | |
same time. | [
0.31251630187034607,
-0.0053409431129693985,
0.36691176891326904,
-0.019754987210035324,
0.1624891608953476,
0.13077060878276825,
0.16511325538158417,
-0.012231532484292984,
-0.2625214159488678,
-0.5832106471061707,
0.49400413036346436,
0.036989908665418625,
0.14027930796146393,
0.04894258... | |
In the diagram below there is a 1:1 relationship between 'DodgyOldTable' and 'MainTable'. Table 'Option' contains records with 'OptionVal1', 'OptionVal2' and 'OptionVal3' in the 'OptionDesc' field.
I need to do an insert into MainTable\_Option with a select from DodgyOldTable. Something like this:
```
INSERT MainTable... | [
-0.418617308139801,
-0.23765763640403748,
0.3857305645942688,
-0.12278570979833603,
0.3526991605758667,
0.13545940816402435,
-0.058855846524238586,
-0.13756418228149414,
-0.24503736197948456,
-0.6230617761611938,
-0.2583673298358917,
0.9426597356796265,
-0.142756387591362,
-0.1734757870435... | |
OptionID
)
SELECT
d.ID,
o.OptionId
FROM
DodgyOldTable d
INNER JOIN Option o ON
(d.OptionVal1 = 'Y' AND o.OptionDesc = 'OptionVal1') OR
(d.OptionVal2 = 'Y' AND o.OptionDesc = 'OptionVal2') OR
(d.OptionVal3 = 'Y' AND o.OptionDesc = 'OptionVal3')
``` | [
-0.4084450900554657,
-0.4073479473590851,
0.6867411136627197,
-0.14616435766220093,
0.487108439207077,
0.2869308590888977,
0.0935794785618782,
-0.07832901924848557,
0.017951788380742073,
-0.7792724967002869,
-0.7256177663803101,
0.887542188167572,
-0.11078449338674545,
-0.02788401953876018... | |
I'm doing an iPhone application which uses a navigation control to browse through some data. This data is stored in a sqlite database and I have a class which gets it and returns it in a NSMutableArray of NSStrings.
The problem is that in the first screen of the navigation everything works prefectly, but in the second... | [
0.08979482203722,
0.34941402077674866,
-0.011026228778064251,
0.11519467085599899,
0.32620105147361755,
-0.13604150712490082,
0.5394906401634216,
0.19220271706581116,
-0.11304588615894318,
-0.6065680384635925,
-0.09110477566719055,
0.6165698766708374,
-0.2775023281574249,
0.112748935818672... | |
breakpoints in all my functions, and I can't see anywhere where it can get corrupted. And as the first view, which uses the same exact code, even accesing the same eact tables, works correctly I don't really know where to look.
If anyone want to have a look at the code I have uploaded it to my site: [http://sachafuent... | [
-0.21447360515594482,
-0.05150498449802399,
0.30067068338394165,
0.11778474599123001,
0.28965359926223755,
-0.09052465856075287,
0.36362791061401367,
0.13454625010490417,
-0.18613992631435394,
-0.4430200159549713,
-0.14749306440353394,
0.5440297722816467,
-0.5200605988502502,
-0.0322023704... | |
NSString *aPais = get the value;
[paises addObject:aPais];
[aPais release];
}
return paises;
}
```
If I comment out [aPais release] everything works, but to me this looks like a memory leak, as the NSString won't be released.
Look for wrong [memory management](http://developer.apple.com/documentation/Cocoa/Conc... | [
-0.030931727960705757,
0.36083337664604187,
0.3231038749217987,
-0.10683577507734299,
0.1465177685022354,
-0.11706588417291641,
0.566959023475647,
-0.017632918432354927,
-0.6043816208839417,
-0.35683387517929077,
-0.4841776192188263,
0.5900112986564636,
-0.40405526757240295,
0.023998640477... | |
a `retain` can also be an `alloc init`, but I always try to use `alloc init autorelease`, but this is a matter of style.)
BTW
---
You should autorelease your array, you're only retaining it here with `[[alloc] init]`. | [
0.15600146353244781,
-0.01560653280466795,
0.353956401348114,
-0.22309505939483643,
-0.08989723026752472,
-0.23569448292255402,
0.3039012849330902,
-0.1110459491610527,
-0.19263048470020294,
-0.14738865196704865,
-0.44788581132888794,
0.6856784820556641,
-0.02485525608062744,
-0.2881135344... | |
I get this error when attempting to reference a Web Service in my Compact Framework application. Hunting through Google seems to indicate it's a common occurance, but there's been no useful suggestions as to what causes it, and how to fix it. I can successfully access the web service from a WinForms application by addi... | [
0.5931183099746704,
0.49151039123535156,
0.2669731080532074,
0.0028247074224054813,
-0.1813783496618271,
-0.12214881926774979,
0.7670478820800781,
0.12001319974660873,
-0.3104300796985626,
-0.6932461261749268,
0.379396915435791,
0.8844105005264282,
-0.27879831194877625,
0.1189713329076767,... | |
your for loop, placing each item accordingly, then use TweenLite, or your favorite Tweening Package.
```
package
{
import flash.display.Sprite;
import flash.events.Event;
import gs.TweenLite;
import gs.easing.*;
public class ExampleDocumentClass extends Sprite
{
if(stage) _init();
... | [
0.16460242867469788,
-0.18176119029521942,
0.4717663526535034,
-0.28047633171081543,
0.006081440951675177,
0.10842861980199814,
0.4739304780960083,
-0.5058400630950928,
-0.0077865165658295155,
-0.5416260361671448,
-0.23201246559619904,
0.6500861644744873,
-0.5523333549499512,
-0.1263385713... | |
{
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(Math.random() * 0x000000);
mc.graphics.drawRect(0,0,stage.stageWidth,25);
//Seperates them by 25, their width, so they will touch.
mc.x= i * 25; //i * 25 + 1 leaves a space in between. | [
-0.10830939561128616,
0.14055663347244263,
1.0655897855758667,
-0.1367025524377823,
0.17205096781253815,
0.4763573110103607,
-0.04004352167248726,
-0.6131581664085388,
-0.2784443795681,
-0.6546966433525085,
-0.03947899490594864,
0.3767126798629761,
0.16653577983379364,
0.22630687057971954,... | |
mc.y=0;
addChild(mc);
TweenLite.to(mc, 0.9, {y:math.random()*1000-500, x: 0, ease: Expo.easeOut});
if(i == 24) //Total length - 1
{
//The loop ended.
}
}
}
```
It is important to note that screen updates DO NOT happen within code blocks such as | [
0.26818978786468506,
0.02813875302672386,
0.6486725211143494,
-0.06705319136381149,
0.08016166090965271,
0.017585059627890587,
0.31305375695228577,
-0.15617993474006653,
-0.5052831768989563,
-0.6475173830986023,
-0.16577406227588654,
0.5183172821998596,
-0.13041305541992188,
0.267628669738... | |
for and while loops. You could not space these based on each other in the fashion that I have shown because even though the prior items x may have just been set, it has not been drawn to screen; In order to build a system where say all the images aren't the same width, yet one must start after another, we must wait for... | [
0.5858156681060791,
-0.42813923954963684,
0.14377151429653168,
0.1308353692293167,
-0.08396218717098236,
0.3148692548274994,
0.1586684137582779,
-0.22433537244796753,
-0.387912392616272,
-0.34871891140937805,
0.050504595041275024,
0.3747709393501282,
-0.28480955958366394,
-0.00511029828339... | |
merely use "i" to separate them
Whats happening:
i \* 25 = 0;
i++;
i \* 25 = 25;
i++;
i \* 25 = 50;
as you can see we have achieve the spacing we were looking for.
Brian Hodge
[hodgedev.com](http://hodgedev.com)
[blog.hodgedev.com](http://blog.hodgedev.com) | [
0.06104405224323273,
-0.13678693771362305,
0.39986470341682434,
-0.18598341941833496,
-0.13351736962795258,
-0.15739654004573822,
0.6999552249908447,
-0.39513689279556274,
-0.08562098443508148,
-0.6036537885665894,
-0.4121568202972412,
-0.30497807264328003,
-0.2743142545223236,
0.293155580... | |
We're developing in C++ under Linux and about to set up automated tests. We intend to use a testing framework like CppUnit oder CxxTest. We're using Ant to build the software and we will also use it to run the tests.
As some tests are going to involve database access, we are looking for a tool or framework which facil... | [
0.4896168112754822,
-0.07656053453683853,
0.07091669738292694,
0.19972574710845947,
0.05067319795489311,
-0.036868445575237274,
0.20420187711715698,
-0.015874987468123436,
-0.04209691658616066,
-0.6709061861038208,
0.07097410410642624,
0.3677000105381012,
-0.3817708492279053,
-0.0251720752... | |
Ant task seems to be most promising. Any related field reports are welcome!
As there seems to be no DbUnit-like tool for C++ development, we've built a little framework of our own. Basically it's an adaptor for calling actual DbUnit operations from within C/C++ testrunners. It makes use of the [Ant tasks](http://www.db... | [
0.13386249542236328,
-0.12256015092134476,
-0.020398303866386414,
0.01544580701738596,
-0.20087704062461853,
0.14319558441638947,
0.09127441048622131,
-0.31035375595092773,
0.025562861934304237,
-0.7489668130874634,
0.1814270168542862,
0.2867770493030548,
-0.43235209584236145,
-0.104378052... | |
macro which wraps a DbUnit `compare`.
The test case might look like this:
```
void testDatabaseStuff
{
TS_DB_INSERT("input.xml");
TestedClass::doSomething();
TS_DB_ASSERT("expected.xml");
}
``` | [
0.13515609502792358,
-0.10833441466093063,
0.053716644644737244,
-0.2711808979511261,
-0.05916515737771988,
-0.04124871641397476,
0.000806574709713459,
-0.44927164912223816,
0.20973700284957886,
-0.5352327823638916,
-0.049439746886491776,
0.5053868293762207,
-0.39721983671188354,
-0.137241... | |
Whats the best way to read Xml from either an XmlDocument or a String into a DataGrid?
Does the xml have to be in a particular format?
Do I have to use A DataSet as an intermediary?
I'm working on a client that consumes Xml sent over from a Server which is being developed by one of my colleagues, I can get him to ch... | [
0.4072863757610321,
0.3128572404384613,
0.23001299798488617,
0.3111955225467682,
0.06035808101296425,
-0.210065096616745,
-0.23464183509349823,
-0.0005370267317630351,
-0.17213235795497894,
-0.5639200806617737,
0.086621955037117,
0.4174012839794159,
-0.22600321471691132,
0.1591699421405792... | |
DataSet ds = new DataSet();
XmlTextReader xmlreader = new XmlTextReader(xmlSource, XmlNodeType.Document, null);
ds.ReadXml(xmlreader);
``` | [
-0.20801056921482086,
-0.21817493438720703,
0.7169864773750305,
0.24075135588645935,
-0.17028258740901947,
-0.1576124131679535,
0.009695150889456272,
-0.3869662284851074,
-0.25439321994781494,
-0.7723413705825806,
-0.7003905177116394,
0.33402881026268005,
-0.3038531243801117,
0.36930903792... | |
I have developed a solution that relies on an AJAX call to retrieve information and update the client page every 10 seconds. This is working fine, but I am concerned at the scalability of the code, given the number and length of headers being passed from client to server and back again. I have removed a number of redun... | [
0.2930199205875397,
0.06472475081682205,
0.6935877799987793,
-0.1893177181482315,
-0.09289339184761047,
-0.33362331986427307,
0.4405909776687622,
0.2848002016544342,
-0.12339532375335693,
-1.0362000465393066,
-0.21244780719280243,
0.6875646710395813,
-0.19187070429325104,
-0.08260925859212... | |
my current code:
```
var xmlHTTP = new ActiveXObject('Microsoft.XMLHTTP');
xmlHTTP.onreadystatechange = function() {
if ((xmlHTTP.readyState == 4) && (xmlHTTP.status == 200)) {
myCallbackFunction(xmlHTTP);
}
};
xmlHTTP.open('GET', 'myUrl.aspx');
try {
xmlHTTP.setRequestHeader("User-Agent", ".");... | [
0.0857829600572586,
0.07004884630441666,
0.7353032231330872,
-0.0904521718621254,
0.18775182962417603,
-0.10687360912561417,
0.5118104219436646,
-0.16512686014175415,
0.026321595534682274,
-0.8031572103500366,
-0.41149476170539856,
0.3237931430339813,
-0.322053462266922,
0.1944823563098907... | |
for the time being. Is there another way of clearing them or an alternative method of reducing the submitted HTTP headers?
Also, there seems to be no way of replacing or shortening the 'Referrer' header at all.
According to the [WD spec](http://www.w3.org/TR/XMLHttpRequest/#setrequestheader)
> The setRequestHeader() ... | [
0.172589510679245,
-0.05549819394946098,
0.7150546312332153,
0.025964660570025444,
-0.19803130626678467,
-0.12266533076763153,
0.13318082690238953,
-0.37861302495002747,
-0.057056136429309845,
-0.45545175671577454,
-0.3024628758430481,
0.3851790726184845,
-0.22980733215808868,
0.2225455492... | |
the long term. In any case current browser behaviour with setting headers is very varied and generally can't be relied upon.
> There seems to be no way of replacing or shortening the 'Referrer' header at all.
That wouldn't surprise me, given that some people misguidedly use ‘Referer’ [sic] as an access-control mechan... | [
0.4684312641620636,
-0.2265731245279312,
0.44963371753692627,
0.22659482061862946,
-0.2802322506904602,
-0.25420236587524414,
0.35868167877197266,
0.16860991716384888,
-0.18841420114040375,
-0.6268216967582703,
-0.1413680464029312,
0.40192392468452454,
-0.1694919615983963,
0.20637872815132... | |
may be worthwhile for Mibbit (as mentioned on the blog you linked) to try this stuff, because Mibbit draws a quite staggering amount of traffic, but for a simple company-wide application I don't think the cross-browser-and-proxy-testing-burden:end-user-benefit ratio of messing with the headers is worth it. | [
0.44395363330841064,
0.2952571511268616,
0.006067340262234211,
0.22922563552856445,
-0.1126764640212059,
-0.5169864892959595,
0.3237234950065613,
0.346012145280838,
-0.19029457867145538,
-0.14268988370895386,
0.19301757216453552,
0.3064444363117218,
-0.31436315178871155,
-0.038499072194099... | |
Note: this is not [a duplicate of Jeff's question](https://stackoverflow.com/questions/181188/c-equivalent-to-vb-net-catch-when).
That question asked "Is an equivalent?" I know there isn't, and I want to know why!
The reason I ask is that I've only just become clear on how important it is, and the conclusion seems ve... | [
0.29301193356513977,
0.03425220027565956,
0.2376752346754074,
-0.049783267080783844,
-0.059277940541505814,
-0.3103078305721283,
0.09492791444063187,
-0.062361184507608414,
-0.27010658383369446,
-0.32400766015052795,
-0.2535385191440582,
0.3919726014137268,
-0.29005512595176697,
0.15518194... | |
issue, we can modify the policy to assist with tracking down (or perhaps papering over) the problem to give them a fast resolution until we deal with it properly - which may involve arguing with 3rd parties, about whose fault it all is.
This is basically an acknowledgement of the simple fact that in real applications... | [
0.23876480758190155,
0.415363073348999,
0.3931409418582916,
0.159312903881073,
0.05811966955661774,
-0.3035430312156677,
0.26108238101005554,
-0.1559761017560959,
-0.5900823473930359,
-0.18774224817752838,
-0.12939675152301788,
0.47160181403160095,
-0.21564362943172455,
-0.0159595608711242... | |
that right before the `catch` block runs, any `finally` blocks nested inside the `try` block will be executed. So those `finally` blocks may do any of the following:
* Harmlessly modify the program state (phew, lucky).
* Trash something important in the customer's data, because the program state is screwed up to an un... | [
0.42129653692245483,
0.1573266088962555,
0.19531723856925964,
-0.015743350610136986,
0.12636956572532654,
-0.19697046279907227,
0.5006547570228577,
0.20326532423496246,
-0.2086595594882965,
-0.30757856369018555,
-0.49780237674713135,
0.3398630619049072,
-0.1619310826063156,
0.2271348387002... | |
clearly the `catch`/`throw` pattern for filtering exceptions is no good. What is actually needed is a way to filter exceptions, via a policy, without actually catching them and so triggering the execution of `finally` blocks, unless we find a policy that tells us the exception is safe to recover from.
The CLR team blo... | [
0.19999806582927704,
0.14341598749160767,
0.3082466423511505,
0.04133572801947594,
0.06387466937303543,
-0.5670567750930786,
0.4976786673069,
-0.20035994052886963,
-0.45267632603645325,
-0.5205317735671997,
-0.28725096583366394,
0.37923404574394226,
-0.23645740747451782,
0.0997627750039100... | |
is that there is code in the BCL that does this. Lots of people have blogged about doing it, but they rarely if ever mention the thing about `try`/`finally` blocks, which is the killer.
What I would like to know is:
* Are there any public statements or direct emails people have received from the C# team on this subje... | [
0.8067531585693359,
0.20387569069862366,
-0.24085021018981934,
0.1559096872806549,
-0.2273074984550476,
-0.32028812170028687,
0.14896981418132782,
0.6436637043952942,
-0.34575676918029785,
-0.5913892388343811,
-0.013040365651249886,
0.09955290704965591,
0.060691289603710175,
0.213949531316... | |
I've only found people [explaining why they need this feature](http://www.codeproject.com/KB/cs/csmverrorhandling.aspx), or pointing out the [advantages of it in VB.NET](http://blogs.msdn.com/vbteam/archive/2008/10/09/vb-catch-when-why-so-special.aspx), or fruitlessly hoping that it will be [added in a future version o... | [
0.41152799129486084,
0.14304810762405396,
-0.12967252731323242,
-0.017059003934264183,
-0.30422666668891907,
-0.36163222789764404,
0.2345428168773651,
0.07274129986763,
-0.606151819229126,
-0.2030676007270813,
-0.27910158038139343,
0.21660365164279938,
-0.3102087080478668,
0.03532669320702... | |
of the C# team:
> "Yes, being able to put a condition on
> a catch is somewhat more convenient
> than having to write the test
> yourself, but it doesn't really enable
> you to do anything new."
That was the same assumption I had until it was properly explained to me!
As to any existing connect bugs. The followin... | [
0.44026386737823486,
-0.312573105096817,
0.09920351207256317,
0.15963099896907806,
-0.3220481872558594,
-0.1368965059518814,
0.18952570855617523,
-0.14952075481414795,
-0.3107093274593353,
-0.47654181718826294,
-0.023793339729309082,
0.5858633518218994,
-0.3523745536804199,
-0.243199929594... | |
can find or know of that are related to what you are looking for. I think it would do good to have a separate issue which explicitly calls out the want for VB.Net style exception filters.
I wouldn't worry too much about introducing a duplicate question if you've done a bit of due diligence looking for an existing one... | [
0.628803014755249,
-0.029271241277456284,
0.10996708273887634,
0.5100296139717102,
-0.022204263135790825,
-0.5028092265129089,
0.18229690194129944,
0.11775050312280655,
-0.4327017068862915,
-0.5145785212516785,
-0.19803322851657867,
0.4386998116970062,
-0.1502981334924698,
0.01231029443442... | |
connect bug or 2) get duped against the main bug. I really doubt there is an official reason / justification out there right now.
Here's my **speculation** on the issue: My guess is that this feature simply wasn't on the original C# 1.0 feature set and since that time there hasn't been enough demand to make it into t... | [
0.28901055455207825,
-0.07400620728731155,
0.0337592288851738,
0.12593244016170502,
0.010235940106213093,
-0.011389655992388725,
0.2777431905269623,
0.3785956799983978,
-0.5044560432434082,
-0.6766271591186523,
-0.16144447028636932,
0.8315389156341553,
-0.5246474146842957,
0.04113886132836... | |
feature will make it into the language.
Up until recently I bet you would be hard pressed to find 1 out of 10 people who understood the difference between VB.Net's Try/When and just using a plain old if statement in a C# catch block. It seems to be a bit more on peoples minds lately so maybe it will make it into a fu... | [
0.6343333125114441,
-0.3683527112007141,
0.256763756275177,
-0.14949868619441986,
-0.0016093687154352665,
0.0016323680756613612,
0.4077913165092468,
0.2615559995174408,
-0.3250811696052551,
-0.6380040645599365,
-0.23453742265701294,
0.7361804842948914,
0.2753300964832306,
-0.16732981801033... | |
I noticed that you can change the colour of text in textboxes which are disabled in Firefox applying a simple class but could not get a way to do it in IE 6/7. Does anyone out there have a elegant solution to achieve this.
> I noticed that you can change the colour of text in textboxes which are disabled in Firefox
I ... | [
0.2796103358268738,
0.10032317787408829,
0.08863655477762222,
-0.3704052269458771,
-0.04539671540260315,
0.0274575874209404,
0.4608458876609802,
0.06023825332522392,
-0.1978936344385147,
-0.8311451077461243,
-0.3069474399089813,
0.7478775382041931,
-0.32969775795936584,
0.09338302910327911... | |
to do with how much form fields are rendered according to the OS's widget set and how much according to the CSS rules. This has always been an area of great cross-browser difference. Scripting is not relevant, much though SO would like “use jQuery” to be the answer to every question.
The usual workaround is to use ‘re... | [
0.3136535584926605,
-0.051052264869213104,
0.2805542051792145,
0.29220348596572876,
-0.04182562604546547,
-0.04500453919172287,
0.18305563926696777,
0.015270562842488289,
-0.009833318181335926,
-0.7295805811882019,
-0.10223402082920074,
0.7619265913963318,
-0.17398613691329956,
-0.29357779... | |
I have a simple PyQT project. I would like to know how to build it in Windows in such way, that it becomes runnable executable. I don't want to require user to install heavy QT framework for his computer. How to make executable with only necessary parts of QT?
I use `py2exe` for deploying a Windows standalone GUI cross... | [
0.45074817538261414,
0.1505585014820099,
0.1556658297777176,
-0.17822235822677612,
-0.16841483116149902,
-0.211061492562294,
0.23292633891105652,
-0.028172310441732407,
0.03536604717373848,
-0.6043990254402161,
-0.2799266576766968,
0.7316600680351257,
-0.4524441957473755,
-0.25433745980262... | |
windows was the long-time requirement, but the recent [0.6.9 release](http://sourceforge.net/project/shownotes.php?release_id=640751&group_id=15583) added python2.6 (and python2.7?) support. No python3 yet.
Also, you may want to consult [Py2exeAndPyQt](http://www.py2exe.org/index.cgi/Py2exeAndPyQt) on py2exe wiki. | [
0.1715247929096222,
0.028119713068008423,
0.2766704261302948,
-0.06016566604375839,
-0.09752388298511505,
0.007161736488342285,
0.5548084378242493,
0.41624584794044495,
-0.49703162908554077,
-0.4188389778137207,
-0.3816603422164917,
0.5962245464324951,
-0.30961260199546814,
-0.054304700344... | |
> **Possible Duplicate:**
>
> [How do I query a table based with HABTM relationship while providing additional conditions in CakePHP?](https://stackoverflow.com/questions/602227/how-do-i-query-a-table-based-with-habtm-relationship-while-providing-additional)
Pls help me implement this in cakephp
```
table safari:
... | [
-0.3148750066757202,
-0.042162586003541946,
0.5805312395095825,
0.001380261266604066,
-0.10693970322608948,
-0.1442020833492279,
0.20151031017303467,
-0.2907963693141937,
-0.6143695712089539,
-0.876151442527771,
-0.1856091320514679,
0.025330355390906334,
-0.07086848467588425,
0.22637768089... | |
I'm developing an App for my iPod Touch that doesn't use the iPhone-Special-Hardware like phone or cam. I want to test it on my iPod touch. I am already a registered developer (free account, no fee). What are the steps to get my app working on my iPod touch?
If you just want to double space the output of a command or s... | [
0.4660939574241638,
0.11662518978118896,
0.29965096712112427,
-0.04746964946389198,
0.3360992670059204,
0.32713109254837036,
0.08468668907880783,
0.12973959743976593,
-0.12217900902032852,
-0.8341114521026611,
0.12244158238172531,
0.6444627046585083,
-0.25601324439048767,
-0.08447198569774... | |
I have created a .Net application to run on an App Server that gets requests for a report and prints out the requested report.
The C# application uses Crystal Reports to load the report and subsequently print it out.
The application is run on Server which is connected to via a Remote Desktop connection under a partic... | [
0.30958500504493713,
0.27582496404647827,
0.5407414436340332,
0.03311918303370476,
-0.10691910982131958,
-0.1680936962366104,
0.4463067650794983,
-0.22081929445266724,
-0.17170190811157227,
-0.6482448577880859,
0.08116576820611954,
0.3002736270427704,
-0.46279674768447876,
0.46866515278816... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.