text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
fairly trivial example. The larger point is that symbols can be used to refer to constants, methods, and instance variables, if for some reason you don't want to refer to them directly via their identifiers. I see this most often used in metaprogramming. | [
0.35259178280830383,
0.2014925181865692,
-0.26177629828453064,
0.3970530927181244,
-0.266189306974411,
-0.013702637515962124,
0.15102975070476532,
0.04626920074224472,
-0.15773028135299683,
-0.4680338203907013,
0.0063336133025586605,
0.3371617794036865,
-0.41154274344444275,
-0.03488937392... | |
We're trying to trim the number of assemblies we load during startup, and one of the easiest to cut is the Microsoft.VisualBasic assembly. There are alot of things in it that were easy enough to replace, like Left(), but I'm struggling to find a good way to replace vbLf and Chr(). vbCrLf was easy enough to replace with... | [
0.5426017642021179,
-0.0545569583773613,
0.0834260806441307,
0.027111686766147614,
-0.11873389780521393,
-0.2784522771835327,
0.04888565093278885,
0.2132353037595749,
-0.23408734798431396,
-0.7804896235466003,
-0.11282564699649811,
0.22371971607208252,
-0.5530030727386475,
0.09425453096628... | |
Microsoft.VisualBasic.dll, are always available to all .Net programs and using or not using any of these assemblies in your program has *zero* impact on your program's memory footprint. You can even use Microsoft.VisualBasic.dll from C# programs with no issues. The only case where you might possibly run into a problem ... | [
0.20450635254383087,
0.1672048419713974,
0.24101436138153076,
0.01634659618139267,
-0.20473432540893555,
-0.07012075185775757,
0.24988332390785217,
0.2026469111442566,
-0.10935349762439728,
-0.780973494052887,
-0.200194850564003,
0.6151462197303772,
-0.49858540296554565,
0.0509977638721466... | |
ASCII, but if you have code that's expecting single line feeds this is a pretty safe bet. | [
0.49425315856933594,
-0.4884697198867798,
0.09515000134706497,
0.40334179997444153,
-0.10086918622255325,
-0.005861160811036825,
-0.07146673649549484,
0.2781842052936554,
-0.3519982695579529,
-0.39211422204971313,
-0.20854638516902924,
0.387762188911438,
-0.22009076178073883,
-0.0991638451... | |
I am binding a WPF ComboBox to a nullable property of type MyEnum? (where MyEnum is an enumerated type)
I am programmatically populating the ComboBox items like this:
```
// The enum type being bound to
enum MyEnum { Yes, No }
// Helper class for representing combobox listitems
// (a combination of display string a... | [
0.22613346576690674,
-0.3403968811035156,
0.5807012319564819,
-0.1394265741109848,
0.019964199513196945,
0.14424291253089905,
-0.03847218304872513,
-0.5671346783638,
-0.13262510299682617,
-0.8196625113487244,
-0.32994693517684937,
0.39652830362319946,
-0.5429955124855042,
0.117491826415061... | |
ComboItem {Value = MyEnum.Yes, Display = "Yes"},
new ComboItem {Value = MyEnum.No, Display = "No"},};
// Bind the combo's items to this list.
theCombo.ItemsSource = items;
theCombo.DisplayMemberPath = "Display";
theCombo.SelectedValuePath = "Value";
}
```
Also in the code-behind, I am setting the DataCon... | [
-0.08510810881853104,
-0.444674015045166,
0.7421301603317261,
-0.22000469267368317,
0.3420914113521576,
0.2851126790046692,
-0.06176779419183731,
-0.6022412776947021,
-0.005761279724538326,
-0.8702157139778137,
-0.41769444942474365,
0.556503176689148,
-0.4147683084011078,
0.067314766347408... | |
UpdateSourceTrigger=PropertyChanged}"/>
```
**Problem:**
When the value of the bound property is initially non-null, the combo box displays the value properly.
But when the value of the bound property is initially null, the combo box is blank.
It looks like every aspect of data binding is working apart from the re... | [
0.045578863471746445,
-0.08575453609228134,
0.6126527190208435,
0.2852412760257721,
0.43105778098106384,
-0.31514373421669006,
0.45010873675346375,
0.08648455888032913,
-0.32481852173805237,
-0.6498040556907654,
-0.1670970916748047,
0.9545719623565674,
-0.25923556089401245,
-0.215444803237... | |
Add a hidden textblock databound to the underlying nullable enum value via a Converter that converts from the nullable enum to a string (enum.ToString, or "null").
* Load up the combo box with 'ComboItems' each having a string Label (displayed in the combo) and a string Value equal to the enum values as strings (and "n... | [
0.15236304700374603,
-0.33566024899482727,
0.3137643039226532,
-0.11947433650493622,
0.02018372341990471,
0.23796413838863373,
0.23959259688854218,
-0.4002073109149933,
0.07332110404968262,
-0.6359025835990906,
-0.3683769404888153,
0.6792166233062744,
-0.54947429895401,
0.02514584362506866... | |
return "null";
return c.ToString();
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return To((T?)value);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
var s = (string) value;
if (s == "nu... | [
0.4316190183162689,
-0.3194993734359741,
0.37719255685806274,
-0.22844696044921875,
0.2374868392944336,
0.3888743221759796,
0.2832287847995758,
-0.3130459785461426,
0.13182681798934937,
-0.6164982318878174,
-0.46678388118743896,
0.581444263458252,
-0.5433756709098816,
0.547211766242981,
... | |
e, string label)
{
Value = MyEnumConverter.To(e);
Label = label;
}
}
static IEnumerable<ComboItem> GetItems()
{
yield return new ComboItem(null, "maybe");
yield return new ComboItem(MyEnum.Yes, "yup");
yield return new ComboItem(MyEnum.No, "nope");
}
private void SetupComboBox()
{
thecombo.ItemsSo... | [
0.3166569173336029,
-0.3670324683189392,
0.6310528516769409,
-0.1291830688714981,
0.41662532091140747,
-0.1428261250257492,
0.6112597584724426,
-0.5151270031929016,
-0.1681084930896759,
-0.6057339906692505,
-0.3708125948905945,
0.6782553195953369,
-0.425567626953125,
0.22366338968276978,
... | |
your binding via Value Converter. So that Converter transforms null value to some "Undefined" (non-null) for the Targets and than is able to convert your "Undefined" back to null... | [
0.09561451524496078,
-0.20485760271549225,
0.4151010811328888,
0.21548797190189362,
-0.19045716524124146,
-0.06959744542837143,
0.2883802652359009,
-0.332520455121994,
0.033806197345256805,
-0.7201220989227295,
0.002344850217923522,
0.2893884778022766,
-0.6180078983306885,
0.25909838080406... | |
How do I set up Selenium to kill the test browser page on occasions where the test fails?
Currently, when running Selenium test cases and a test fails, the browser page stays open and that causes problems when a large number of tests is failing. Interestingly enough, it isn't the case when the test passes.
Any sugge... | [
0.6761276721954346,
-0.030923815444111824,
-0.007333213463425636,
0.010301590897142887,
-0.14822691679000854,
-0.2711896598339081,
0.3629511594772339,
-0.004665578715503216,
0.22867818176746368,
-0.693693220615387,
-0.04815873131155968,
0.4953288733959198,
-0.33222612738609314,
0.144165754... | |
isn't called, for instance when the error occurs in setUp(), or if you're doing something sill when a failure occurs. | [
0.7009230852127075,
-0.3318992257118225,
0.1144154891371727,
0.04482581093907356,
0.13110245764255524,
-0.18315564095973969,
0.24997864663600922,
-0.21339543163776398,
-0.18659687042236328,
-0.21775367856025696,
-0.23576092720031738,
0.7316036224365234,
-0.01685849204659462,
-0.08076124638... | |
I've really been struggling to make SQL Server into something that, quite frankly, it will never be. I need a database engine for my analytical work. The DB needs to be fast and does NOT need all the logging and other overhead found in typical databases (SQL Server, Oracle, DB2, etc.)
Yesterday I listened to [Michael... | [
0.6534079909324646,
0.14129461348056793,
-0.07528559863567352,
0.42875736951828003,
0.25588181614875793,
-0.21012341976165771,
0.04036331549286842,
-0.00762016698718071,
-0.18869072198867798,
-0.37746483087539673,
0.15344849228858948,
0.4613054394721985,
-0.24530866742134094,
0.21178643405... | |
open source projects (which I like) and a few commercial/open source projects (which I don't fully understand).
My question is this: In an applied analytical environment, how do the different column based DB's differ? How should I be thinking about them? Anyone have practical experience with multiple column based sys... | [
0.38129934668540955,
0.23223091661930084,
0.057696834206581116,
0.11946769058704376,
-0.30046346783638,
-0.30053621530532837,
0.1630212813615799,
-0.11188051849603653,
-0.10379329323768616,
-0.4852832853794098,
0.07165030390024185,
0.5671327710151672,
-0.34310588240623474,
0.11657631397247... | |
of what I would like to do:
Create a table that has 4 million rows and 20 columns (5 dims, 15 facts). Create 5 aggregation tables that calculate max, min, and average for each of the facts. Join those 5 aggregations back to the starting table. Now calculate the percent deviation from mean, percent deviation of min, and... | [
0.43296393752098083,
0.2859889566898346,
0.665245532989502,
0.38332080841064453,
0.18002837896347046,
0.43423914909362793,
0.21484221518039703,
-0.29191505908966064,
-0.3248547613620758,
-0.5765351057052612,
0.2749572992324829,
0.2714643180370331,
-0.18140292167663574,
0.49229830503463745,... | |
logs... ohhhhh the logs! :)
The short answer is that for analytic data, a column store will tend to be faster, with less tuning required.
A row store, the traditional database architecture, is good at inserting small numbers of rows, updating rows in place, and querying small numbers of rows. In a row store, these ope... | [
0.05134805664420128,
0.2888582944869995,
0.23512065410614014,
0.5775092840194702,
0.13483615219593048,
-0.0824383795261383,
-0.13836181163787842,
0.051581915467977524,
-0.35902807116508484,
-0.35857224464416504,
-0.25576409697532654,
0.4073936641216278,
-0.20679005980491638,
0.316564887762... | |
high proportion of the rows in the table, but only a few of these columns. So, it makes sense from an I/O standpoint to store values of the same column together.
Turns out that this gives the database a huge opportunity to do value compression. For instance, if a string column has an average length of 20 bytes but has... | [
-0.18157406151294708,
0.07114583253860474,
0.4780973494052887,
0.26501160860061646,
0.048405278474092484,
0.1123981922864914,
-0.014021252281963825,
-0.427401065826416,
-0.3409653604030609,
-0.7008500695228577,
-0.012263105250895023,
0.17903567850589752,
-0.14279238879680634,
0.12858474254... | |
improvements often improve locality of reference, reduce cache paging activity, and allow greater compression factors, so that CPU gains also.
Column store databases also tend to have other analytic-oriented features like bitmap indexes (yet another case where better organization allows better compression, reduces I/O... | [
-0.16368161141872406,
-0.12716005742549896,
0.7586814761161804,
0.4685908854007721,
0.08837231993675232,
0.15971648693084717,
-0.30546870827674866,
-0.1262000948190689,
-0.65062415599823,
-1.026727557182312,
-0.28675317764282227,
0.3834887444972992,
-0.1171199157834053,
0.16818299889564514... | |
of transactions or a not-quite-SQL query language.
I'd recommend that you give LucidDB a try. (Disclaimer: I'm a committer to LucidDB.) It is open-source column store database, optimized for analytic applications, and also has other features such as bitmap indexes. It currently only runs on one node, but utilizes seve... | [
0.21416075527668,
-0.33929985761642456,
0.5692259669303894,
0.23770256340503693,
0.05196048319339752,
-0.26907220482826233,
0.08736489713191986,
0.0026285573840141296,
-0.06555484235286713,
-0.23716869950294495,
0.16161102056503296,
0.43177321553230286,
-0.5170927047729492,
0.3689751625061... | |
I am a developer working on several iPhone apps. I am an administrator in our Apple dev portal team. The Agent of our team is NOT a developer. I understand that ONLY the Agent can request an ad hoc deployment cert, and prepare an app for ad hoc distribution.
I assume that the Agent can generate the certificate and pas... | [
0.8532140254974365,
0.6001400947570801,
0.20253770053386688,
0.044919293373823166,
0.20308808982372284,
-0.18359382450580597,
0.37795430421829224,
-0.2090957909822464,
0.051049016416072845,
-0.5360949039459229,
-0.18322992324829102,
0.24182000756263733,
-0.0850827619433403,
0.0753711760044... | |
anyone dealt with this issue? What pitfalls are there in using multiple certs in xCode? I suppose that I would also need to have the Agents public and private key in my keychain.
You are expected to use separate development and distribution certificates; you actually set up different configurations for them. The "night... | [
0.6336214542388916,
0.2387462556362152,
0.022110966965556145,
0.2399900257587433,
0.30653083324432373,
-0.21900658309459686,
0.34472861886024475,
-0.020474690943956375,
-0.31128937005996704,
-0.450334757566452,
-0.13001075387001038,
0.5342388153076172,
-0.09792493283748627,
0.0611653253436... | |
key (you'll need both). He needs to realize that Apple will hold him responsible for your distribution of packages, though. | [
0.13540852069854736,
-0.05634862184524536,
-0.0957188755273819,
0.4641495943069458,
0.7288186550140381,
-0.18345759809017181,
-0.28516316413879395,
-0.12521310150623322,
-0.252261221408844,
-0.1297159045934677,
-0.2597513198852539,
0.8184879422187805,
-0.20339402556419373,
0.03576319664716... | |
I have two queries. One of them makes sense to me, the other don't. First one:
```
SELECT gender AS 'Gender', count(*) AS '#'
FROM registrations
GROUP BY gender WITH ROLLUP
```
That gives me this:
```
Gender #
Female 20
Male 19
NULL 39
```
So, I get the count, and the total count... | [
0.21632802486419678,
0.36046692728996277,
0.3212570548057556,
0.18564920127391815,
0.19972461462020874,
0.3791417181491852,
0.03376515582203865,
-0.13750910758972168,
-0.5000447034835815,
-0.26438096165657043,
-0.1495300680398941,
-0.04838903993368149,
-0.19767563045024872,
0.2143183797597... | |
country c ON r.country = c.country_id
GROUP BY country WITH ROLLUP
Country #
Denmark 9
Norway 10
Sweden 18
United States 1
Uzbekistan 1
Uzbekistan 39
```
Same result. But why do I get Uzbekistan for the total??
> But why do I get Uzbekistan for the total??
Because you... | [
-0.14865928888320923,
-0.03773652762174606,
0.3401663899421692,
0.10175465792417526,
-0.2854228615760803,
0.18767967820167542,
-0.0563214011490345,
0.11043894290924072,
-0.6723955869674683,
-0.04571424797177315,
-0.2866530418395996,
-0.6320675611495972,
-0.8716891407966614,
0.4543720483779... | |
the expected NULL. However you're grouping by a different column so MySQL doesn't know that printable\_name is taking part in a rollup-group, and selects any old value from that column, in the join of *all* registrations. (So it is possible you will see other countries than Uzbekistan.)
This is part of a wider problem... | [
0.24606603384017944,
-0.06613226234912872,
0.15274032950401306,
0.05973370373249054,
-0.19062554836273193,
0.04437246173620224,
0.040659405291080475,
0.2120065838098526,
-0.33466705679893494,
-0.38098669052124023,
-0.14338986575603485,
-0.2745417356491089,
-0.5141634941101074,
0.2971417903... | |
link (aka “functional dependency”) between country and gender. Other DBMSs will refuse the above command on the grounds that there isn't guaranteed to be one gender per country.(\*)
Now, this:
```
SELECT c.printable_name AS 'Country', count(*) AS '#'
FROM registrations r
INNER JOIN country c ON r.country = c.countr... | [
0.1269918978214264,
0.1347256749868393,
0.34241560101509094,
-0.11738406121730804,
0.08480407297611237,
0.1524057686328888,
0.1031511127948761,
-0.0039015456568449736,
-0.21577508747577667,
-0.5002486109733582,
-0.4061351716518402,
0.17178912460803986,
-0.3355591297149658,
0.24660392105579... | |
set to grab its values, and *then* sets the group-by column to NULL. **It doesn't also null other columns that have a functional dependency on that column.** It probably should, but MySQL currently doesn't really understand the whole thing about functional dependencies.
So if you select c.printable\_name it will show ... | [
0.19339801371097565,
-0.13343805074691772,
0.39060109853744507,
-0.02889276295900345,
0.06691458821296692,
0.0532567985355854,
-0.05986175686120987,
-0.16237200796604156,
-0.4039379954338074,
-0.46709445118904114,
-0.13990841805934906,
0.25050246715545654,
-0.6163263320922852,
0.0913693830... | |
instead; should be OK if printable\_names are unique, or
* select “r.country” as well as printable\_name, and check that for being NULL, or
* forget WITH ROLLUP and do a separate query for the end sum. This will be a little slower but it will also be ANSI SQL-92 compliant so your app could work on other databases.
(\*... | [
0.018333978950977325,
0.2278081178665161,
0.4917723834514618,
-0.04699615389108658,
0.01805044896900654,
-0.20438481867313385,
0.5325861573219299,
-0.20648138225078583,
-0.3720899820327759,
-0.4082632064819336,
-0.1885395348072052,
0.33586835861206055,
-0.3616194427013397,
-0.0544507950544... | |
valid queries fail as well, making it generally useless.) | [
0.058853764086961746,
0.42482733726501465,
0.2485763281583786,
0.29759278893470764,
0.11076300591230392,
0.1899731606245041,
0.5641292929649353,
-0.38194844126701355,
0.08636601269245148,
-0.20849137008190155,
-0.4770607054233551,
0.47390216588974,
0.08130642026662827,
-0.02587773278355598... | |
I have a Content Query Web Part on my page that rolls up all the contacts lists from all the sub-webs in my site collection. this works fine. I'd like to be able dynamically filter the contacts rollup by having the user click on a list of leters of the aphhabet at the top of the page. click A and see the contacts that ... | [
0.2634054720401764,
0.08263812959194183,
0.42616671323776245,
0.14763543009757996,
-0.15065214037895203,
-0.13166871666908264,
-0.02344745211303234,
0.18962667882442474,
-0.2536921203136444,
-0.8696994185447693,
0.2425824999809265,
0.636140763759613,
-0.30797430872917175,
0.044839523732662... | |
or CQWP like that.
What you can do is extend the CQWP and add some functionality to it - take a look at [Enhanced Content Query Web Part](http://www.codeplex.com/ECQWP) over at codeplex.com for inspiration.
Then send the clicked letter to the QueryString and have your extended CQWP read the filter value from the quer... | [
0.5354735255241394,
-0.466734915971756,
0.4532018005847931,
0.04758114740252495,
-0.23064474761486053,
-0.5022904276847839,
-0.04101084917783737,
-0.231748566031456,
-0.10895216464996338,
-0.5629606246948242,
0.007725847419351339,
0.44420671463012695,
-0.2895808219909668,
-0.25987151265144... | |
```
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
char *czas()
{
time_t rawtime;
struct tm * timeinfo;
char buffer [80];
time ( &rawtime );
timeinfo = localtime ( &rawtime );
strftime (buffer,80,"Now it's %I:%M%p.",timeinfo);
return buffer;
}
int main()
{
printf("%s",czas());
system("PAUSE");... | [
0.1672726720571518,
0.07996897399425507,
0.4361633062362671,
-0.41961750388145447,
0.42906755208969116,
0.2004307508468628,
0.5268469452857971,
-0.29423487186431885,
-0.24305662512779236,
-0.5946807265281677,
-0.36635223031044006,
0.7151739597320557,
-0.37769386172294617,
0.227804005146026... | |
is an option, but forcing the caller to free the memory that a callee allocated can leave open issues of ownership and removes the possibility of using anything but heap memory for the buffer.
Your best bet, in my opinion, is to take a modification of Andrew Grant's suggest, but pass around the length of the buffer as... | [
0.1487935483455658,
-0.2580150365829468,
0.39620286226272583,
-0.5586919188499451,
0.2737174332141876,
0.2649392783641815,
0.4607982337474823,
-0.4019739031791687,
-0.11742392182350159,
-0.4968475103378296,
-0.43370580673217773,
0.5964984893798828,
-0.3803096115589142,
0.27152571082115173,... | |
printf("%s",czas(buffer, sizeof(buffer)));
system("PAUSE");
}
```
Or
```
#define TIME_BUFFER_LENGTH 80
int main()
{
char *buffer = malloc(TIME_BUFFER_LENGTH);
if (buffer)
printf("%s",czas(buffer, TIME_BUFFER_LENGTH));
free(buffer);
system("PAUSE");
}
```
This makes it easier to keep track of... | [
-0.06529111415147781,
-0.17631521821022034,
0.3417477011680603,
-0.3277621865272522,
0.4294942617416382,
0.22699670493602753,
0.31762874126434326,
-0.08500692248344421,
-0.3177643418312073,
-0.5083456635475159,
-0.41639402508735657,
0.6291239857673645,
-0.2925988733768463,
0.08329711109399... | |
bufferLength parameter accurately specifies the amount of space that buffer points to.) | [
-0.2706676721572876,
0.05148972570896149,
0.4696580469608307,
0.015520621091127396,
-0.04102091118693352,
0.2940658926963806,
-0.11435608565807343,
-0.3050139546394348,
-0.4115106761455536,
-0.508842408657074,
-0.012001807801425457,
0.048772502690553665,
0.0069833979941904545,
0.2820631265... | |
I currently host my company's website and blog on separate servers, reached by separate domain names - www.example.com and www.example.net. This is so I can give blog server access to our partners without compromising security on our main server. However, our SEO guy is now demanding that the blog be put on our main se... | [
0.5543003678321838,
0.6320449709892273,
0.5244202017784119,
-0.3991257846355438,
-0.20031841099262238,
0.2471548169851303,
0.3884580135345459,
0.3274652361869812,
-0.5649304986000061,
-0.4679262936115265,
0.27515262365341187,
0.1857140213251114,
0.020807364955544472,
0.25267547369003296,
... | |
server is a Debian box running Apache 2, and I have full root access to it. The blog server is run by Hostgator, and I have limited access.
Edit: Thanks, all. In this particular situation I don't particularly want to transfer the blog *again*, and I don't have easy access to the DNS records, so i went with mod\_proxy ... | [
0.4469415545463562,
0.09388723969459534,
0.19581113755702972,
0.14713574945926666,
-0.31026116013526917,
-0.4910280406475067,
0.5628261566162109,
0.3161759376525879,
-0.24913863837718964,
-0.6542051434516907,
0.16612982749938965,
0.22535818815231323,
-0.30598390102386475,
0.364401966333389... | |
mod\_proxy module](http://httpd.apache.org/docs/2.0/mod/mod_proxy.html) to proxy requests to /blog to your second server. | [
0.0704357698559761,
-0.2217234969139099,
0.6149945855140686,
-0.07434043288230896,
-0.15352249145507812,
-0.23611268401145935,
0.2598938047885895,
-0.4055081605911255,
-0.21774017810821533,
-0.7089906334877014,
-0.28523731231689453,
0.7109599113464355,
-0.39025992155075073,
-0.053275931626... | |
I've got a string in .NET which is actually a URL. I want an easy way to get the value from a particular parameter.
Normally, I'd just use `Request.Params["theThingIWant"]`, but this string isn't from the request. I can create a new `Uri` item like so:
```
Uri myUri = new Uri(TheStringUrlIWantMyValueFrom);
```
I ca... | [
0.447883665561676,
0.08471697568893433,
0.4821856915950775,
0.08210692554712296,
-0.222652405500412,
-0.19245727360248566,
0.325808048248291,
-0.2525407671928406,
-0.08298061043024063,
-0.5303365588188171,
0.09558309614658356,
0.29892903566360474,
-0.2353745400905609,
0.6044573187828064,
... | |
`NameValueCollection`.
```
Uri myUri = new Uri("http://www.example.com?param1=good¶m2=bad");
string param1 = HttpUtility.ParseQueryString(myUri.Query).Get("param1");
```
Check documentation at <http://msdn.microsoft.com/en-us/library/ms150046.aspx> | [
-0.17932946979999542,
0.20676955580711365,
0.372886061668396,
-0.031719084829092026,
0.03032873570919037,
0.24562813341617584,
0.32707008719444275,
-0.2441805601119995,
-0.19966840744018555,
-0.5104023218154907,
-0.6069085001945496,
0.15150108933448792,
-0.40035316348075867,
0.482041388750... | |
I'm attempting to use Fogbugz's BugzScout in order to automatically submit unhanded application exceptions to my Fogbugz on demand Account. I've written up a wrapper class for it and everything appears to be just groovy - on my box. Testing the same code in the production environment, behind a Proxy that requires authe... | [
0.411268025636673,
0.44542860984802246,
0.7184364795684814,
-0.0049789948388934135,
0.21740160882472992,
-0.19447118043899536,
0.5406724810600281,
0.3331618010997772,
-0.08185672014951706,
-0.3065905272960663,
0.0273489560931921,
0.39579591155052185,
-0.5021138191223145,
0.3459406495094299... | |
from Fogbugz itself, and I don't know what to do.
Here is the code where the BugzScout connects via a .net WebClient to submit a new case, with my modifications to deal with our Proxy. What am I doing that would cause Fogbugz to refuse my request? I've removed all non web-client related code from the procedure for eas... | [
0.310131698846817,
0.21820400655269623,
0.8465827703475952,
-0.027790043503046036,
0.05324697121977806,
-0.04328830540180206,
-0.02915037050843239,
-0.38744503259658813,
0.028741147369146347,
-0.4376300871372223,
-0.10559610277414322,
0.4800490438938141,
-0.6152581572532654,
0.385379821062... | |
proxy.UseDefaultCredentials = true;
client.Proxy = proxy;
Byte[] response = client.DownloadData(fogBugzUrl);
string responseText = System.Text.Encoding.UTF8.GetString(response);
return (responseText == "") ? this.defaultMsg : responseText;
}
```
The url is c... | [
-0.264330118894577,
0.009728245437145233,
0.794323205947876,
0.03205255791544914,
0.022284768521785736,
0.008152712136507034,
0.4468902051448822,
0.1309138983488083,
-0.27656134963035583,
-0.5324860215187073,
-0.3155151307582855,
0.44864165782928467,
-0.3631846308708191,
0.2680003046989441... | |
Demand.
* Using FogBugz.net code in it's entirety, with only these additions
```
WebProxy proxy = new WebProxy();
proxy.UseDefaultCredentials = true;
client.Proxy = proxy;
```
* Error occurs when attempting to connect to both <https://oursite.fogbugz.com/scoutsubmit.asp> and <http://... | [
0.35904568433761597,
0.07971026748418808,
0.6361302137374878,
-0.14064332842826843,
0.11050771176815033,
0.0449165403842926,
0.46505624055862427,
-0.1849788874387741,
-0.13911063969135284,
-0.5827799439430237,
0.05878416448831558,
0.5717554688453674,
-0.18785245716571808,
-0.21627503633499... | |
to answer that for you.
Got the fix from Fogbugz- this is the appropriate network code to get though the proxy authentication and not mis-authenticate with Bugzscout.
```
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
WebRequest request = WebRequest.Create(fogBugzUrl);
request.Cont... | [
-0.06858998537063599,
-0.042041100561618805,
0.8972505331039429,
0.1516948789358139,
0.06149551644921303,
0.03641669824719429,
0.5611602663993835,
-0.11082468926906586,
-0.12044396996498108,
-0.6181772351264954,
-0.14863993227481842,
0.41029036045074463,
-0.4743354916572571,
0.034187931567... | |
> **Possible Duplicate:**
>
> [What is the best way to increase number of locks in java](https://stackoverflow.com/questions/12890586/what-is-the-best-way-to-increase-number-of-locks-in-java)
Suppose I want to lock based on an integer id value. In this case, there's a function that pulls a value from a cache and do... | [
0.015573088079690933,
0.18701571226119995,
0.22505590319633484,
-0.30571040511131287,
0.09689537435770035,
0.10630740225315094,
0.3622431755065918,
-0.5598612427711487,
-0.3954363465309143,
-0.6486538648605347,
-0.08984997123479843,
0.23211899399757385,
-0.30410197377204895,
-0.08702579885... | |
like to do is synchronize the retrieve on the id, e.g.
```
if (p==null)
{
synchronized (id)
{
..retrieve, store
}
}
```
Unfortunately this won't work because 2 separate calls can have the same Integer id value but a different Integer object, so they won't share the lock, and no... | [
0.037961795926094055,
-0.04164521023631096,
0.20376241207122803,
0.1604316532611847,
0.1319519728422165,
-0.10543416440486908,
0.17436593770980835,
-0.3297457695007324,
-0.1863190084695816,
-0.31337520480155945,
0.12413576990365982,
0.5983933806419373,
-0.6626033186912537,
0.25529235601425... | |
this work:
```
syncrhonized (Integer.valueOf(id.intValue())){
```
The javadoc for Integer.valueOf() seems to imply that you're likely to get the same instance, but that doesn't look like a guarantee:
> Returns a Integer instance
> representing the specified int value.
> If a new Integer instance is not
> requir... | [
-0.11649921536445618,
0.031630922108888626,
0.13437509536743164,
-0.04074053466320038,
0.11803659796714783,
-0.1717674434185028,
0.21409441530704498,
-0.3419343829154968,
-0.11490566283464432,
-0.6549379825592041,
-0.1136554479598999,
0.631888210773468,
-0.3401261270046234,
-0.034022498875... | |
elaborate solutions like keeping a WeakHashMap of Lock objects keyed to the int? (nothing wrong with that, it just seems like there must be an obvious one-liner than I'm missing).
You really don't want to synchronize on an `Integer`, since you don't have control over what instances are the same and what instances are d... | [
-0.25288376212120056,
-0.09745647013187408,
0.13954316079616547,
0.33246511220932007,
0.018366044387221336,
-0.14666780829429626,
0.4668566882610321,
-0.09561825543642044,
-0.2265447974205017,
-0.6512876749038696,
-0.03193153440952301,
0.33572742342948914,
-0.5100262761116028,
-0.111285373... | |
getting the exact instance you want.
Better would be to create a new object, perhaps stored in a `HashMap` that is keyed by the `Integer`, to synchronize on. Something like this:
```
public Page getPage(Integer id) {
Page p = cache.get(id);
if (p == null) {
synchronized (getCacheSyncObject(id)) {
p = ge... | [
-0.040393561124801636,
-0.21326246857643127,
0.5934320092201233,
0.22913148999214172,
0.11179502308368683,
0.008886987343430519,
0.20978118479251862,
-0.022304674610495567,
-0.4173828363418579,
-0.6893346309661865,
-0.11065179854631424,
0.3788016140460968,
-0.5145856738090515,
0.4020014703... | |
You could do this:
```
locks.putIfAbsent(id, new Object());
```
but then you incur the (small) cost of creating an Object for each access. To avoid that, I just save the Integer itself in the `Map`. What does this achieve? Why is this any different from just using the Integer itself?
When you do a `get()` from a ... | [
0.05100265145301819,
0.06101034954190254,
0.31352749466896057,
0.12511420249938965,
0.04547331854701042,
0.10538817197084427,
0.19436869025230408,
-0.4650097191333771,
-0.3324664235115051,
-0.749752938747406,
0.06808456033468246,
0.6962913274765015,
-0.023991568014025688,
0.276168972253799... | |
as the parameter to `getCacheSyncObject` and you will always get back only the very first instance that was passed in that contained that value.
There are reasons why you may not want to synchronize on `Integer` ... you can get into deadlocks if multiple threads are synchronizing on `Integer` objects and are thus unwi... | [
0.1649009734392166,
-0.230142280459404,
0.2301727533340454,
0.28440725803375244,
0.15792644023895264,
-0.14957839250564575,
0.45822885632514954,
-0.04352123662829399,
-0.3334970772266388,
-0.6046879887580872,
0.10527970641851425,
0.5291569828987122,
-0.39198851585388184,
0.3932642042636871... | |
synchronization on an object that no other class will be synchronizing on. Always a Good Thing. | [
-0.019829947501420975,
-0.25717583298683167,
0.21730470657348633,
0.4995747208595276,
0.0031589630525559187,
-0.14616551995277405,
0.41565296053886414,
0.44447755813598633,
-0.24980390071868896,
-0.5288422703742981,
-0.14373701810836792,
0.3723596930503845,
-0.18690037727355957,
-0.0000503... | |
I have a form with a date value in a TextBox control. The form uses data binding with a BindingSource against a DataSet and a SQL 2005 CE database.
Where do I control the formatting of the date? Nowhere in the properties along the way did I see a possibility to strip out the time part, for instance.
I could of course ... | [
0.2271614372730255,
0.1343860626220703,
0.5176393985748291,
0.12210297584533691,
0.05612209439277649,
-0.2469511777162552,
-0.1394346058368683,
-0.31413641571998596,
0.10856436938047409,
-0.6389187574386597,
0.1655186116695404,
0.19667798280715942,
0.009595438838005066,
0.36149662733078003... | |
Time datatype and optionally strip out just the date or the time etc. | [
0.18155136704444885,
-0.12364492565393448,
0.36351317167282104,
0.40442708134651184,
0.41408658027648926,
-0.039677802473306656,
-0.1484500765800476,
0.11990311741828918,
-0.01133007276803255,
-0.5529566407203674,
-0.39398494362831116,
0.06880386173725128,
0.04673410579562187,
0.2885481417... | |
This question is mainly geared towards Zend in PHP, although it certainly applies to other languages and frameworks, so I welcome everyone's opinion.
I've only recently been using the Zend framework, and while it's not perfect, I have had a pretty good time with it. One thing that drives me crazy, however, is that mos... | [
0.5273736715316772,
0.0699516236782074,
0.17712853848934174,
0.05857667699456215,
-0.2878703773021698,
-0.16498257219791412,
0.24578364193439484,
-0.4423089623451233,
0.009614926762878895,
-0.3404431641101837,
0.010638208128511906,
0.40666353702545166,
0.2255510687828064,
-0.17860940098762... | |
to be bent and twisted to validate other input, or validation must be done in a second place, and logic duplicated.
I've found some other posts and blogs out there with people who feel the same way I do, but the developers of Zend made this choice for a reason, and other people seem to use it without issue, so I wante... | [
0.7759513258934021,
-0.051178161054849625,
-0.020797794684767723,
0.08326756209135056,
-0.49539363384246826,
-0.002181490184739232,
0.16126620769500732,
-0.18110980093479156,
-0.023267624899744987,
-0.2556833028793335,
0.28585192561149597,
0.43638962507247925,
0.07012448459863663,
0.195343... | |
Zend was designed so that you could use as much, or as little, as you wished.
This is a non-zend specfic answer, however I believe that the model should be responsible for the validity of its own data. If this is the case then the validation belongs in the model, however this may not always be achievable and it may be ... | [
0.5762419104576111,
0.22318023443222046,
0.11058050394058228,
0.3190751075744629,
-0.30769020318984985,
-0.243484765291214,
0.14144638180732727,
-0.49604007601737976,
0.11787033081054688,
0.0935388058423996,
0.20706021785736084,
0.6807579398155212,
0.2200322449207306,
0.003673442406579852,... | |
you will probably want another view on your data. Your site may become popular and customers are asking for XML based APIs to generate their own views. Do you then rely on the customer to validate the data?
Even if you do not have to provide APIs some customers may want customized views that are sufficiently different... | [
0.6325536966323853,
0.04089229181408882,
0.4169352650642395,
0.3260868191719055,
-0.143482506275177,
-0.07313286513090134,
0.09321082383394241,
0.057903241366147995,
-0.4056535065174103,
-0.23203685879707336,
0.31589168310165405,
0.4345611035823822,
-0.14288859069347382,
0.2331922948360443... | |
and render the page again with the validation results displayed.
I think it is perfectly reasonable to have the view doing validation if you want to instantly display validation data back to the user etc but the final decision on data validity should rest with the model. | [
0.35355567932128906,
0.11294561624526978,
0.5900193452835083,
0.06271402537822723,
-0.21808692812919617,
0.03503669798374176,
0.20134705305099487,
-0.039797961711883545,
0.05934283882379532,
-0.31008514761924744,
0.05032626539468765,
0.6485788822174072,
0.1920672059059143,
0.09114097803831... | |
Somewhat inspired by [this question](https://stackoverflow.com/questions/659166/write-c-in-a-graphical-scratch-like-way/659203) about a graphical programming environment. I don't think that C++ or C# are really conducive to this type of environment, but perhaps there's something halfway there.
Lot's of IDEs that I've ... | [
0.29020407795906067,
-0.12198814004659653,
-0.13433179259300232,
0.15212365984916687,
-0.2433183193206787,
0.24480946362018585,
-0.02965119108557701,
0.30498191714286804,
-0.24521780014038086,
-0.4993622899055481,
0.0905500277876854,
0.35822978615760803,
-0.24723641574382782,
-0.0488137118... | |
environment, the highlighting would still give an overall view of the structure of the code. Personally, learning C# after years of C++, I still catch myself tripping over the fact that at the end of a file you usually have the end of a class and the end of a namespace, so the end of a function is two-levels in. (In a ... | [
-0.022585554048419,
0.113597571849823,
-0.10411586612462997,
-0.07011677324771881,
-0.16144056618213654,
-0.272123247385025,
0.417669415473938,
0.11392173916101456,
-0.289943128824234,
-0.7913602590560913,
-0.10213067382574081,
0.3778126835823059,
-0.17962327599525452,
0.14309825003147125,... | |
// end namespace
```
But it seems to me that some automatic colouring would make that completely unnecessary. Anyway, has this been done already? Bonus if it's an add-on to Visual Studio.
The closest thing that I've seen is [Codekana](http://www.codekana.com/), although doesn't have "background syntax-highlighting" i... | [
-0.11613970249891281,
-0.300720751285553,
0.07047390192747116,
-0.24042420089244843,
-0.11577441543340683,
-0.03932612016797066,
0.33437585830688477,
-0.23561610281467438,
-0.24495232105255127,
-0.8287733197212219,
-0.32904288172721863,
0.2588512897491455,
-0.3754027485847473,
-0.386708319... | |
I am reading data from a stream (provided by a process) character by character and adding it to a textbox so the user can see. The only problem is, this is **SLOW**. The user needs to see the data as it is given to the program (with little to no delay). I would like something like how terminals handle text, it can scro... | [
0.44134488701820374,
-0.013154935091733932,
0.34768548607826233,
0.02224654331803322,
-0.06793830543756485,
-0.1437569260597229,
-0.0876164361834526,
0.06156884506344795,
0.05820079520344734,
-0.7180766463279724,
0.0006237094639800489,
0.5747354626655579,
-0.08045300841331482,
0.0444195978... | |
a string). This means that each time that you add a character, you will be creating a new copy of the string with one character added at the end.
If you for example have 10000 characters in the textbox, you will be copying 20kB of data to add the next character. Adding a hundred characters one at a time means copying ... | [
0.08594676852226257,
-0.2550974488258362,
0.3941013813018799,
0.1894053965806961,
-0.08237894624471664,
0.24112798273563385,
0.25779232382774353,
-0.1753765493631363,
-0.28212839365005493,
-0.6355716586112976,
-0.1977706253528595,
0.1308707892894745,
-0.19090308248996735,
0.289139568805694... | |
How do I list all tga files in a directory (non recursive) in Python?
If you are doing it based on file extension, you can do something like this:
```
import os
directory = "C:/"
extension = ".tga"
list_of_files = [file for file in os.listdir(directory) if file.lower().endswith(extension)]
```
Obviously you can omit... | [
0.4331575036048889,
-0.07860681414604187,
0.050064243376255035,
-0.21801038086414337,
0.0023214961402118206,
-0.12834914028644562,
-0.034820105880498886,
-0.207014799118042,
-0.3576420545578003,
-0.6132513284683228,
-0.1499384045600891,
0.5725764632225037,
-0.48588937520980835,
-0.06068652... | |
I'm trying to find a really good example for implementing the MetaWeblog API using a WCF service. I can't seem to clear my head and think of a clean way to do this. Any help is appreciated.
This seems to be a reasonable start, [wfc-for-metaweblog](http://blogs.msdn.com/clemensv/archive/2009/04/03/xml-rpc-with-wcf-updat... | [
0.371654748916626,
0.12031308561563492,
0.44288644194602966,
0.08229102194309235,
-0.23001717031002045,
-0.23985035717487335,
0.46451449394226074,
0.17295311391353607,
-0.23509177565574646,
-0.6542441844940186,
-0.0440816804766655,
0.3220607042312622,
-0.04772786423563957,
0.36799433827400... | |
my question involves the following partial view with a remote form:
```
<% remote_form_for :phone_number, :url => {:controller => "edit", :action => "add_phone_number" }, :update => "phone_number_div" do |form| %>
<%= form.text_field :number%>
<%= form.select :type, PhoneNumber::PHONE_TYPE%>
<%= submit_ta... | [
-0.009100871160626411,
0.12666666507720947,
0.5808032155036926,
0.022609230130910873,
0.08462827652692795,
0.2994787096977234,
0.17628596723079681,
-0.15131428837776184,
0.0814843699336052,
-0.5395603775978088,
-0.16137802600860596,
0.1797657161951065,
0.025281425565481186,
0.2442819029092... | |
node in an illegal location in the DOM (like inside a TR, for example (and not in a TD).
I ran into this problem once. | [
0.060940977185964584,
-0.3443683683872223,
-0.012399958446621895,
0.09808147698640823,
0.34350571036338806,
-0.09726608544588089,
0.03738170862197876,
-0.07295913249254227,
-0.10319981724023819,
-0.1602170467376709,
0.12318184971809387,
0.27340880036354065,
-0.3662647008895874,
-0.04502635... | |
I have a program that downloads basic historical stock data from yahoo and puts it into an SQLite database. I'd like to be able to perform queries such as finding the moving average, and determining the longest period where a stock has either continued to go up or down. I could write perl functions to do this but this ... | [
0.43121322989463806,
0.026198744773864746,
0.13717016577720642,
0.22992798686027527,
0.12385329604148865,
0.28504329919815063,
-0.37435266375541687,
-0.05746600776910782,
-0.19470199942588806,
-0.0562659315764904,
0.3083050847053528,
0.41608667373657227,
0.014061064459383488,
0.16968227922... | |
ODBC module that will let you access SQLite. | [
0.11713200062513351,
0.05862661451101303,
0.3100842833518982,
0.1490618884563446,
0.27290815114974976,
-0.3776649534702301,
-0.1983349621295929,
0.19400601089000702,
-0.02234138362109661,
-0.6158766150474548,
0.03847522288560867,
0.35891982913017273,
-0.3981873691082001,
-0.114171564579010... | |
Working on routing my site and am wondering what a good standard is for naming regular pages? I was going to name them like:
```
/Daily-Winners
```
But I want to reserve the - multiword syntax for titles of threads, blog posts, etc., not for regular traffic pages.
Is there a standard or guideline to make this more ... | [
0.48755455017089844,
0.2818690538406372,
0.37678059935569763,
0.17396806180477142,
-0.44651952385902405,
-0.47815757989883423,
0.226354718208313,
-0.07104058563709259,
-0.19253146648406982,
-0.39637717604637146,
-0.30253303050994873,
0.5316512584686279,
-0.19365549087524414,
-0.40794467926... | |
search engines, will like the latter better. | [
0.2669064402580261,
0.03331878408789635,
0.3114481270313263,
0.5043023824691772,
0.09299027174711227,
-0.26220762729644775,
0.023585351184010506,
0.37456053495407104,
-0.37714484333992004,
-0.6738492250442505,
-0.28151994943618774,
0.5550968647003174,
-0.045834630727767944,
0.2054134458303... | |
We have a couple of SQL Server instances at our main office, and one on our colocated web server. There are a few replications that handle data exchange between the web server and the main office servers.
We switched ISPs today at our main office. We did our homework and were ready for the switch (ips in hosts files c... | [
0.3080461621284485,
0.03879247605800629,
0.39916566014289856,
0.45172446966171265,
0.21526819467544556,
-0.024456683546304703,
0.11336207389831543,
0.18445956707000732,
-0.5187646746635437,
-0.7528459429740906,
0.42408156394958496,
0.17717520892620087,
-0.2725527882575989,
0.50136017799377... | |
server names from our web server. I saw that ports 1433 and 1434 were blocked by the new ISP, and notified the appropriate people; they should be unblocked now. Still no dice from SMSS.
I then tried connecting with sqlcmd, which amazingly worked. SMSS won't connect to the server, but sqlcmd will. Why is this? Everythi... | [
0.08722299337387085,
0.05354424938559532,
0.5817480087280273,
0.08555082976818085,
-0.06549122929573059,
0.16576306521892548,
0.45992347598075867,
-0.17649604380130768,
-0.5458107590675354,
-0.7344492077827454,
-0.010595863685011864,
0.46509164571762085,
-0.360329270362854,
0.1122671663761... | |
Network Interfaces, error: 26 - Error locating server/instance specified)
```
SQL Doesn't listen on TCP 1434, it listens on UDP 1434. You can't test UDP ports using telnet. Have your ISP open UDP 1434.
Check the client connection order on the server, and I'll get that Named Pipes is above TCP/IP, but SSMS isn't use ... | [
-0.03719336539506912,
0.11993903666734695,
0.7113469243049622,
0.2485511302947998,
0.01215039100497961,
-0.12669508159160614,
0.10610698163509369,
-0.04831075295805931,
-0.5084268450737,
-1.0546354055404663,
0.2439255714416504,
0.6311392188072205,
-0.3414545953273773,
0.16748131811618805,
... | |
that you don't have to worry about firewalls between the two. | [
0.4299684464931488,
0.2188573181629181,
-0.1524033397436142,
0.46380531787872314,
0.037302374839782715,
0.0043729934841394424,
-0.11915802955627441,
-0.03050626814365387,
-0.2363402098417282,
-0.4500288665294647,
-0.1738598793745041,
0.4205892086029053,
0.0025582346133887768,
0.05650487914... | |
How does one create a mapping file for a generic class in NHibernate.
Say I have a class Foo
How would it look in the mapping document?
class name="mydll.Foo ???? , mydll" ...
I know if it was a Foo it would be:
class name="mydll.Foo`1[[mydll.Fee, mydll]], mydll"
Would it be something like:
class name="mydll.Foo`1[[m... | [
0.28048110008239746,
-0.2516361176967621,
0.551479697227478,
-0.01482029166072607,
-0.16518406569957733,
-0.050248388200998306,
-0.41499173641204834,
0.02812856435775757,
-0.13841211795806885,
-0.7920582890510559,
0.21339952945709229,
0.43992161750793457,
-0.23595212399959564,
0.0069680917... | |
In Powershell I can create COM objects which can be used, for example, to control Microsoft Office applications:
```
$excel = New-Object -com "Excel.Application"
$excel.visible = $true
```
How can I list all of the available COM objects that can be created in Powershell?
I found this powershell one-liner script that... | [
0.05335022136569023,
0.07581598311662674,
0.8108564019203186,
0.3045007884502411,
0.22745151817798615,
-0.2701417803764343,
-0.028691189363598824,
0.012289139442145824,
0.023843852803111076,
-0.8786282539367676,
-0.22084349393844604,
0.7121239304542542,
-0.3564899265766144,
0.0849722847342... | |
Got some C code I'm working on, and it looks like it should work. When I try to link the object files, I get an error saying "undefined reference to outputBus" and so on for each of them in the getLine function in main. I've tried it with and without the ampersand before the function names. compiling with `gcc -ansi`. ... | [
0.02021491900086403,
-0.2735823690891266,
0.24512599408626556,
0.04528014361858368,
-0.04970342293381691,
0.3482666313648224,
0.47236111760139465,
-0.044371988624334335,
-0.18714965879917145,
-0.6175232529640198,
-0.14552101492881775,
0.524530827999115,
-0.4809168577194214,
0.1225834563374... | |
const int);
void outputPeople(const int, const int);
void outputTotal(const int, const int, const double);
int main(int argc, char **argv){
node *head = NULL;
node *tail = NULL;
getLines(&head, &tail, outputBus, outputPeople, outputTotal);
return 0;
}
```
Do those functions have bodies anywhere in your ... | [
0.5512667298316956,
-0.1238211914896965,
0.49348750710487366,
0.017829174175858498,
0.17194031178951263,
0.114255890250206,
0.3860134482383728,
-0.07530239224433899,
0.02994963712990284,
-0.6732755899429321,
-0.493178129196167,
0.40409812331199646,
-0.2862565517425537,
-0.04763808101415634... | |
the linker sees that you broke your promise and gets upset. | [
0.13035066425800323,
-0.25150543451309204,
0.41989561915397644,
0.12161117047071457,
0.06723044067621231,
-0.2886512279510498,
0.46143022179603577,
0.00043284991988912225,
-0.1222110316157341,
-0.3602932095527649,
-0.02072751335799694,
0.20643459260463715,
-0.2557143568992615,
0.3808807730... | |
I have an application that supplies long list of parameters to a web page, so I have to use POST instead of GET. The problem is that when page gets displayed and user clicks the Back button, Firefox shows up a warning:
> To display this page, Firefox must send information that will repeat any action (such as a search... | [
0.5866933465003967,
0.09275330603122711,
0.17324306070804596,
0.07519812881946564,
-0.1439235508441925,
-0.2782662510871887,
0.46109047532081604,
-0.24917039275169373,
0.0603674091398716,
-0.3911302089691162,
0.033388350158929825,
0.18456114828586578,
-0.5457972884178162,
0.233711630105972... | |
submit, and click Back button. No warning, it just goes back.
Googling I found out that this might be a bug in Firefox 3, but I'd like to somehow get this behavior even after they "fix" it.
I guess it could be doable with some HTTP headers, but which exactly?
One way round it is to redirect the POST to a page which ... | [
0.4712037146091461,
-0.04556857794523239,
0.3845771551132202,
0.19220036268234253,
-0.2935635447502136,
-0.19220861792564392,
0.5639787316322327,
-0.2733539938926697,
-0.20104850828647614,
-0.8980234861373901,
0.06785576045513153,
0.19448183476924896,
-0.3147333264350891,
0.246627405285835... | |
a database. Keep doing that, or if it's a huge search form create a temporary copy of it in a database that gets purged after a few days or on a LRU basis when a space limit is used. Now create a representation of the data which can be accessed using GET. If it's temporary, generate an ID for it and use that as the URL... | [
0.24461932480335236,
0.029538458213210106,
0.22461725771427155,
0.5007171034812927,
0.07936622947454453,
-0.40220844745635986,
0.10261864960193634,
0.14777304232120514,
-0.466783344745636,
-0.7072580456733704,
-0.4512237012386322,
0.14085805416107178,
-0.2149103283882141,
0.417618393898010... | |
big URL to a much smaller one. Redirect the POST to GET the representation of the data.
---
As a historical note, this technique was [established practice in 1995](https://lists.w3.org/Archives/Public/ietf-http-wg-old/1995JanApr/0195.html). | [
-0.02291538193821907,
-0.3381216824054718,
0.34473100304603577,
-0.06401553750038147,
-0.206623837351799,
-0.3265279233455658,
0.21885015070438385,
-0.1077042892575264,
-0.6046945452690125,
-0.14073961973190308,
-0.4748920202255249,
0.20089657604694366,
-0.396668404340744,
0.17767645418643... | |
I'm using yum on CentOS 5.1 - I hand-compiled PHP 5.2.8 from source, but have other packages installed using yum. I need to install a PHP extension via pecl, and it requires phpize to be installed as well. However, doing the following yields a dependency error:
> sudo yum install php-devel
Error: Missing Dependency: ... | [
0.07237773388624191,
0.12909796833992004,
0.7038066983222961,
-0.03528225049376488,
-0.10791946202516556,
-0.11231550574302673,
0.47199171781539917,
-0.13896934688091278,
0.11012346297502518,
-0.6118985414505005,
0.20939303934574127,
0.701383113861084,
-0.11866797506809235,
-0.036042325198... | |
a combo of compiles and yum installs.
Any thoughts?
Thanks,
Kyle
As a rule of thumb, it's better to have one package management in the system, so you'll be better off packaging everything in RPMS and managing it via yum. It will save you lots of time in the long run.
If you absolutely want to have something (fe PHP)... | [
0.6858251690864563,
-0.15078838169574738,
0.07443003356456757,
0.25177204608917236,
0.025462938472628593,
-0.08690236508846283,
0.24453899264335632,
-0.12658308446407318,
-0.15472084283828735,
-0.6863511204719543,
-0.04129977896809578,
1.0291681289672852,
-0.2367841899394989,
-0.2784221172... | |
since yum does not have any option for forced installations | [
0.3399216830730438,
-0.07843498885631561,
0.280599981546402,
-0.12110794335603714,
0.04774123802781105,
0.09901618212461472,
0.5982488393783569,
0.241045281291008,
-0.07071153819561005,
-0.28007546067237854,
-0.2076558619737625,
0.27058395743370056,
0.15108250081539154,
0.03427101671695709... | |
I have a very big problem... I'm working with sockets in C. I send a request to the server which sends me many responses. The problem is that the client receives the first response and then the connection is closed. What can I do? I tried with `setsockopt()`... SO\_KEEPALIVE or SO\_LINGER but I haven't resolved the pro... | [
0.24912095069885254,
0.30257076025009155,
0.26792943477630615,
-0.10219249874353409,
-0.17083102464675903,
0.11994897574186325,
0.22266751527786255,
0.23836985230445862,
-0.42636677622795105,
-0.7232068181037903,
-0.1435733437538147,
0.6087329983711243,
-0.4147326648235321,
0.4245717227458... | |
SERVEUR_PORT*/int port){
int socket_client=socket(PF_INET,SOCK_STREAM,0);
memset(&(c_args->adresse_serveur),0,sizeof(c_args->adresse_serveur));
c_args->adresse_serveur.sin_family=AF_INET;
c_args->adresse_serveur.sin_addr.s_addr=inet_addr(SERVEUR_IP);
//int port=APHash(SERVEUR_PORT,strlen(SERVEUR_PORT));
c_args->adresse... | [
-0.4819331169128418,
-0.12652425467967987,
0.8985745906829834,
-0.6512941718101501,
-0.009144227020442486,
0.609586775302887,
0.8074266314506531,
-0.6686509847640991,
-0.1333724856376648,
-0.7439825534820557,
-0.6749341487884521,
0.3759470582008362,
-0.58476722240448,
0.10236021876335144,
... | |
printf("rasp error!!\n");
exit(-3);
}
```
Are you sure you don't get all responses on first call?
TCP/IP is stream protocol without flow control built-in so different messages, sent using separate `send()` calls, can be received in one `recv()`. Because you use `printf()`, it prints the buffer until it sees null-... | [
0.02659996598958969,
-0.13935905694961548,
0.5649830102920532,
-0.12106261402368546,
-0.20980267226696014,
-0.08644114434719086,
0.12853172421455383,
-0.024659842252731323,
-0.297085702419281,
-0.5823591351509094,
-0.10665729641914368,
0.6018019914627075,
-0.5291743278503418,
-0.1632221043... | |
replacing your `printf()` with
```
char *ptr;
for (ptr = buffer; ptr <= buffer + num; ptr += strlen(ptr)+1;)
printf("%s\n", ptr);
```
It will print all strings from your response buffer.
And you don't need `malloc()` inside the loop - you leak memory.
BTW `SO_KEEPALIVE` and `SO_LINGER` have nothing to do with ... | [
0.258328378200531,
-0.29348230361938477,
0.4917660355567932,
-0.3248887062072754,
0.386069655418396,
-0.11418377608060837,
0.5709521174430847,
-0.19610367715358734,
-0.22882051765918732,
-0.35235175490379333,
-0.4615829288959503,
0.3962784707546234,
-0.3111395239830017,
-0.0020213297102600... | |
What happens if I have one socket, `s`, there is no data currently available on it, it is a blocking socket, and I call `recv` on it from two threads at once? Will one of the threads get the data? Will both get it? Will the 2nd call to `recv` return with an error?
One thread will get it, and there's no way to tell whic... | [
0.41850101947784424,
-0.17678576707839966,
0.24783167243003845,
0.11505316942930222,
0.07844947278499603,
-0.030845286324620247,
0.2784668505191803,
-0.04415766894817352,
-0.32688790559768677,
-0.5744252800941467,
0.05819207802414894,
0.3946376144886017,
-0.5294507741928101,
0.549903690814... | |
I have a class Request.cs
It has an abstract method:
```
public abstract Response CreateResponse(XmlReader reader);
```
and there's also a method:
```
public Response SendRequest(string requestURI)
{
...
XmlReader reader = XmlReader.Create(responseStream);
return CreateResponse(reader);
}
```
The `... | [
0.10268135368824005,
-0.056768499314785004,
0.4523593485355377,
-0.012116738595068455,
-0.46700775623321533,
-0.11186201125383377,
0.09981091320514679,
-0.34410953521728516,
0.03678004443645477,
-0.6648210883140564,
-0.09741470217704773,
0.3436277210712433,
-0.21999116241931915,
0.37054803... | |
code or even messy? I'm trying to figure out how this can even be done (is this basic OOP principal or design pattern) and is this a good practice or good use of OOP?
Yes, this is template method. Since the Response class is abstract, you are forced to implement CreateResponse before you can call SendRequest. This way,... | [
0.29040345549583435,
-0.21345651149749756,
-0.07448948174715042,
0.20048359036445618,
-0.42466747760772705,
-0.3005439341068268,
0.41034993529319763,
-0.2942621111869812,
0.055727533996105194,
-0.5178129076957703,
-0.06526274979114532,
0.5824874639511108,
-0.5399820804595947,
0.01896181888... | |
Say I have a string coming in, `"2007-02-28"`, what's the simplest code I could write to turn that into `"2007-03-01"`? Right now I'm just using `strtotime()`, then adding `24*60*60`, then using `date()`, but just wondering if there is a cleaner, simpler, or more clever way of doing it.
A clean way **is** to use `strto... | [
0.2979995906352997,
-0.09739788621664047,
0.6714520454406738,
-0.15660302340984344,
-0.09409484267234802,
0.017683466896414757,
0.26375246047973633,
0.017264001071453094,
-0.10746704041957855,
-0.2870684862136841,
-0.13745342195034027,
0.41715508699417114,
-0.12665912508964539,
0.376588016... | |
The obvious solution would be to have a row number property on a ModelView element, but the drawback is that you have to re-generate those when you add records or change sort order.
Is there an **elegant** solution?
I think you *have* the elegant solution, but this works.
XAML:
```
<ListView Name="listviewNames">
... | [
-0.24088972806930542,
-0.3752952218055725,
0.7186150550842285,
0.08976046741008759,
0.12569791078567505,
0.1367374062538147,
-0.1826944649219513,
-0.3153384327888489,
-0.17584477365016937,
-0.9475784301757812,
0.07297008484601974,
0.37454211711883545,
-0.24358263611793518,
0.18182532489299... | |
AncestorType={x:Type ListViewItem}},
Converter={StaticResource IndexConverter}}" />
<GridViewColumn
Header="Name" | [
0.05950184911489487,
-0.28896188735961914,
0.19728024303913116,
-0.005078280344605446,
0.1807563602924347,
0.28234851360321045,
-0.00468378746882081,
-0.18058794736862183,
-0.019743463024497032,
-1.009162187576294,
0.22237998247146606,
0.01147222239524126,
-0.18395382165908813,
0.402173161... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.