text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
would you want to happen? You certainly wouldn't want IIS to treat it like a text file and send the source for your app down to the browser.
Asp.Net could do the same it does with .cs, .csproj, .config, .resx, .licx, .webinfo file types. Namely, it registers these file types with IIS so that it can explicitly prevent ... | [
0.5126324892044067,
-0.18921254575252533,
0.24782109260559082,
0.2277327924966812,
0.2474556714296341,
-0.04419312626123428,
0.08256407082080841,
-0.1878499686717987,
-0.14048632979393005,
-0.68805992603302,
-0.12178653478622437,
0.522064745426178,
-0.2748630940914154,
-0.02592790871858596... | |
web site model sites.
But then why doesn’t Asp.Net also allow .cs, .csproj, .config, .resx, .licx, .webinfo files to be directly requested?
> a) and c) - as far as I am aware, these are not exposed to process any external requests
my book claims the two are mapped in IIS
I appreciate your help
EDIT:
> b) The .as... | [
0.007039931602776051,
-0.048190899193286896,
0.7380648851394653,
0.14908882975578308,
-0.40780752897262573,
-0.39874088764190674,
0.2772124409675598,
-0.3184255361557007,
-0.2712567448616028,
-0.919119656085968,
-0.2812245786190033,
0.29688143730163574,
-0.21512052416801453,
0.258749812841... | |
.ashx reads the Page directive in the .ashx file to map the request to a class specified in that directive. This saves you from having to put an explicit path in the web.config for every handler that you have, which could result in a very long web.config.
I thought Http handler class was defined inside .ashx file, but... | [
0.46928316354751587,
-0.3209972381591797,
0.2608603835105896,
0.13555499911308289,
-0.3617553114891052,
-0.08602412790060043,
0.5237216353416443,
-0.04686175659298897,
0.03536124527454376,
-0.8847910761833191,
-0.0029552814085036516,
0.21442148089408875,
-0.452002614736557,
-0.080323114991... | |
specific .ashx file --> thus if request is made for FirstHandler.asxh, then handler specified inside that file will be invoked?
**YET ANOTHER EDIT:**
I must confess that I’m still a bit unsure about ashx extension.
I realize that by using it we can for example create 'hey.ashx' page, where Page directive will tell w... | [
0.46587103605270386,
0.12439233064651489,
0.16111278533935547,
-0.09995460510253906,
-0.5857534408569336,
-0.21579834818840027,
0.2220432311296463,
-0.01272799912840128,
-0.06446859985589981,
-0.6436725854873657,
-0.05186204984784126,
0.34438350796699524,
-0.29194173216819763,
0.1618542522... | |
Http handler to be invoked for files with other extensions, such as .sourceC, then I will still need to register Http handler in web.config?!
To definitely clear any confusion you might have on what asp.net does with these requests, check the web.config in:
`%systemroot%\Microsoft.NET\Framework\v2.0.50727\CONFIG`
As ... | [
0.231845885515213,
-0.32112738490104675,
0.38305917382240295,
0.014747491106390953,
-0.4182262420654297,
0.015756238251924515,
0.5593872666358948,
-0.5290336012840271,
-0.17761556804180145,
-0.6669312119483948,
-0.13783858716487885,
0.40348246693611145,
-0.38642698526382446,
-0.13138517737... | |
validate="True"/>
<add path="*.exe.config" verb="GET,HEAD" type="System.Web.StaticFileHandler" validate="True"/>
<add path="*.config" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
<add path="*.cs" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
<add path="*.csproj" verb="*" type="S... | [
-0.1637853980064392,
0.34765395522117615,
0.8700283169746399,
0.04246676713228226,
-0.3283863961696625,
0.06462763249874115,
0.5444040894508362,
-0.8558362722396851,
-0.09589148312807083,
-0.530837893486023,
-0.30864420533180237,
0.5810751914978027,
0.09711938351392746,
-0.1481536775827407... | |
validate="True"/>
<add path="*.ldf" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
<add path="*.exclude" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
<add path="*.refresh" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
```
Also, bear in mind that IIS might no... | [
-0.048417557030916214,
-0.10141649842262268,
0.3796338438987732,
0.14023016393184662,
-0.2004576325416565,
-0.05784482881426811,
0.43052467703819275,
-0.7272525429725647,
0.06701810657978058,
-0.8156720399856567,
-0.33333855867385864,
0.40317898988723755,
-0.1586904525756836,
-0.1705250889... | |
What is the best way to validate a `gets` input against a very long word list (a list of all the English words available)?
I am currently playing with `readlines` to manipulate the text, but before there's any manipulation, I would like to first validate the entry against the list.
The simplest way, but by no means t... | [
0.07667513936758041,
0.01852412149310112,
0.477651983499527,
0.28039559721946716,
-0.2216944694519043,
0.1821218580007553,
0.17990140616893768,
-0.40052667260169983,
-0.15976883471012115,
-0.588357150554657,
-0.03293304890394211,
0.589390218257904,
0.11774691939353943,
-0.11297827214002609... | |
then we'll use [`File#foreach`](http://www.ruby-doc.org/core/classes/IO.html#M002268) to find it:
```
if File.foreach("word.list") {|x| break x if x.chomp == word}
#manipulate word
end
```
Note that `foreach` does not strip off the trailing newline character(s), so we get rid of them with [`String#chomp`](http://... | [
-0.11306341737508774,
0.28057196736335754,
0.4764765799045563,
-0.34284189343452454,
0.3679453730583191,
0.06026006489992142,
0.11659573018550873,
-0.06252700835466385,
-0.13594843447208405,
-0.580256462097168,
-0.42909950017929077,
0.24461916089057922,
-0.20811381936073303,
-0.00161794177... | |
I am developing a project on windows with wamp installed using zend framework.
Unfortunately it has very slow performance, although I did the things mentioned in the manual:
* remove require once
* added apc
I recently installed Scienta ZF Debug Bar v1.3, and here is an example of results i get:
> Queries: 48 in 53.... | [
0.21940341591835022,
0.1622120887041092,
0.3938383460044861,
0.027034804224967957,
-0.2354394942522049,
-0.2729385495185852,
0.42210641503334045,
-0.058121416717767715,
0.018576836213469505,
-0.9060544371604919,
0.10390662401914597,
0.4925074577331543,
-0.3223869800567627,
0.11981575936079... | |
lot ... 6-7 seconds like the bar is telling me ... but in wincachegrid i see a total run time of 641ms ... i am :|
A few more suggestions:
* Check your error logs, as most of the runtime is in your controller, it might be dumping tons of errors.
* Consider using the [xcache](http://xcache.lighttpd.net/) or [eaccelerat... | [
0.18295851349830627,
-0.15360954403877258,
0.23191717267036438,
0.2455632984638214,
0.140677809715271,
-0.005077881272882223,
0.5718609690666199,
0.05362493544816971,
-0.1428486853837967,
-0.957240641117096,
0.2018364816904068,
0.4421186149120331,
-0.09100951999425888,
0.008402218110859394... | |
I'm trying to get a gridview to sort and page manually with no success.
The problem is that when a user clicks the column they want to sort, it sorts that page, but doesn't sort the datasource (dataview) behind the gridview. So when they progress to a different page, their sort is lost. Pretty much I'm looking for a s... | [
0.0869302973151207,
0.013249587267637253,
0.3574911653995514,
-0.2875847816467285,
0.1619466096162796,
0.08790630847215652,
0.07724897563457489,
-0.2178189605474472,
-0.19951866567134857,
-0.972114622592926,
0.00013887052773498,
0.6948997378349304,
-0.39865073561668396,
0.18984480202198029... | |
if (GridViewSortDirection == SortDirection.Ascending)
{
DataView myDataView = new DataView(mybll.GetItemsOrdered());
myDataView.Sort = sortExpression + " DESC";
GridView.DataSource = myDataView;
GridView.DataBind();
}
else
{ | [
-0.26600393652915955,
-0.5097256898880005,
0.708415150642395,
-0.10277043282985687,
0.19232136011123657,
0.0872160941362381,
0.22307483851909637,
-0.3828032910823822,
-0.21813933551311493,
-0.8138105273246765,
-0.45506802201271057,
0.4891883432865143,
-0.1156158447265625,
0.166202455759048... | |
DataView myDataView = new DataView(mybll.GetItemsOrdered());
myDataView.Sort = sortExpression + " ASC";
GridView.DataSource = myDataView;
GridView.DataBind();
}
}
```
Any help would be appreciated. Thanks.
Save your sorting order in a ViewState.
```
private const strin... | [
-0.12938976287841797,
-0.3687559962272644,
0.7889284491539001,
-0.0574217215180397,
-0.06258901208639145,
0.10220465809106827,
0.27771878242492676,
-0.20360977947711945,
-0.29824477434158325,
-0.8961858749389648,
-0.4181312322616577,
0.47885972261428833,
-0.11767816543579102,
0.04417655244... | |
{
if (ViewState["sortDirection"] == null)
ViewState["sortDirection"] = SortDirection.Ascending;
return (SortDirection) ViewState["sortDirection"];
}
set { ViewState["sortDirection"] = value; }
}
protected void GridView_Sorting(object sender, GridViewSortEventArgs e... | [
-0.39647600054740906,
-0.3547201454639435,
0.6958866119384766,
-0.2766120731830597,
0.18289928138256073,
0.19183050096035004,
0.21729467809200287,
-0.2929025888442993,
-0.11129917949438095,
-0.7550663352012634,
-0.5943660140037537,
0.503959596157074,
-0.4615474045276642,
-0.048561424016952... | |
SortGridView(sortExpression, DESCENDING);
}
else
{
GridViewSortDirection = SortDirection.Ascending;
SortGridView(sortExpression, ASCENDING);
}
}
private void SortGridView(string sortExpression,string direction)
{
// You can cache the DataTable for improving performance
Dat... | [
-0.14062586426734924,
-0.48681730031967163,
0.665195643901825,
-0.11520350724458694,
-0.09190310537815094,
0.16791225969791412,
0.42019009590148926,
-0.20426516234874725,
-0.21900464594364166,
-0.9197890758514404,
-0.26235231757164,
0.3931829631328583,
-0.20040607452392578,
0.1041633412241... | |
GridView1.DataSource = dv;
GridView1.DataBind();
}
```
Why you don't want to use existing sorting functionality? You can always customize it.
[Sorting Data in a GridView Web Server Control](http://msdn.microsoft.com/en-us/library/hwf94875.aspx) at MSDN
Here is an example with customization:
<http://w... | [
0.04562139883637428,
-0.5080477595329285,
0.22668780386447906,
-0.1210063174366951,
-0.008644698187708855,
-0.05692427232861519,
-0.10897617787122726,
-0.2568792402744293,
-0.5255159139633179,
-0.7898208498954773,
-0.00989355705678463,
0.08399997651576996,
-0.39219361543655396,
0.105416558... | |
I see this pattern everywhere, but Linq to SQL does not implement it. If Session/Unit-of-Work objects are lightweight (can be created and destroyed without performance penalty), and connection pooling keeps database connections alive, why and when do I need the session-per-request pattern?
I believe the idea of session... | [
0.1220548078417778,
0.2066589742898941,
0.29013797640800476,
-0.02088308520615101,
-0.19107186794281006,
-0.5093892812728882,
0.2091722935438156,
-0.18853987753391266,
-0.4115406572818756,
-0.5872550010681152,
-0.0766686499118805,
0.5205634236335754,
-0.1264003962278366,
0.2527613043785095... | |
for you, instead of having to do it each time yourself
The idea of #2 is important so that you can mix web frameworks and lazy loading of data; if a getter method is called while rendering your data after your code has been executed, and you closed the session, you couldn't lazily load that getter's result. | [
-0.08750681579113007,
-0.2866817116737366,
0.06323236972093582,
0.057336609810590744,
-0.3564108610153198,
-0.17184850573539734,
0.2752068042755127,
-0.1618204116821289,
-0.20768582820892334,
-0.5094572305679321,
-0.1252545565366745,
0.4770348072052002,
-0.4863441586494446,
-0.109375827014... | |
I'm trying to build a web service using Ruby on Rails. Users authenticate themselves via HTTP Basic Auth. I want to allow any valid UTF-8 characters in usernames and passwords.
The problem is that the browser is mangling characters in the Basic Auth credentials before it sends them to my service. For testing, I'm usin... | [
0.28048017621040344,
0.23273301124572754,
-0.0432630218565464,
-0.2422189563512802,
-0.4334409832954407,
0.3933238387107849,
0.6438748836517334,
0.07340196520090103,
0.14688965678215027,
-0.46711254119873047,
0.12250552326440811,
0.26626044511795044,
-0.186262845993042,
0.3695094585418701,... | |
'3e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a83e28ba3e28fb3e28ba3e38a8' That seems about right for 32 kanji characters (3 bytes/6 hex digits per).
If I do the same with the username that's coming ... | [
0.05628557130694389,
0.2719076871871948,
0.5261605978012085,
-0.2669298052787781,
-0.24898982048034668,
0.1748209297657013,
0.5528448820114136,
-0.23503322899341583,
-0.22160273790359497,
-0.6740983724594116,
-0.23168741166591644,
0.4370086193084717,
-0.4826417565345764,
-0.064852640032768... | |
setting the content-type header to UTF-8, so the browser should be sending in that encoding. I get the correct data for form submissions.
The problem happens in both Firefox 3.0.8 and IE 7.
So... is there some magic sauce for getting web browsers to send UTF-8 characters via HTTP Basic Auth? Am I handling things wron... | [
0.05643387511372566,
0.024404924362897873,
0.4773592948913574,
-0.011652780696749687,
-0.19963307678699493,
-0.30543139576911926,
0.38956761360168457,
-0.028240997344255447,
0.12955068051815033,
-0.6201592087745667,
-0.39702099561691284,
0.4241986572742462,
-0.4302920997142792,
0.009894900... | |
Authentication username:password token before base64ing it. Consequently every browser does something different:
* Opera uses UTF-8;
* IE uses the system's default codepage (which you have no way of knowing, other than it's never UTF-8), and silently mangles characters that don't fit into to it using the Windows ‘gues... | [
-0.22112876176834106,
0.22929348051548004,
0.32232484221458435,
0.04239272326231003,
-0.02237738110125065,
-0.30083876848220825,
0.577522337436676,
-0.23548124730587006,
-0.03112795203924179,
-0.318136990070343,
-0.0914289653301239,
0.4258284866809845,
-0.004444613587111235,
-0.31928065419... | |
Chrome encode to ISO-8859-1, and fail to send the authorization header at all when a non-8859-1 character is used.
\*: some people interpret the standard to say that either:
* it should be always ISO-8859-1, due to that being the default encoding for including raw 8-bit characters directly included in headers;
* it s... | [
0.3753470182418823,
0.2562316954135895,
0.2782783508300781,
-0.13044856488704681,
-0.25846192240715027,
-0.3414766192436218,
0.29935112595558167,
-0.06380625069141388,
0.16037948429584503,
-0.7558887004852295,
-0.10020814090967178,
0.5151816010475159,
-0.5335146188735962,
-0.28812265396118... | |
rules of RFC2047 itself, even if HTTP headers honoured the rules and extensions of the RFC822 family, which they don't.
In summary: ugh. There is little-to-no hope of this ever being fixed in the standard or in the browsers other than Opera. It's just one more factor driving people away from HTTP Basic Authentication ... | [
0.35428696870803833,
-0.2128797173500061,
0.23494376242160797,
-0.023171572014689445,
-0.21490523219108582,
-0.6099728941917419,
0.49217575788497925,
0.032270170748233795,
-0.20110690593719482,
-0.08127911388874054,
0.0708925649523735,
0.3470792770385742,
-0.21846462786197662,
0.1903232932... | |
Is it because of string pooling by CLR or by the GetHashCode() method of both strings return same value?
```
string s1 = "xyz";
string s2 = "xyz";
Console.WriteLine(" s1 reference equals s2 : {0}", object.ReferenceEquals(s1, s2));
```
Console writes : **"s1 reference equals s2 : True"**
I believe that, it's not bec... | [
0.44595927000045776,
0.033734992146492004,
0.47433626651763916,
0.053394120186567307,
0.21223905682563782,
-0.33810314536094666,
0.3883189260959625,
-0.2421807050704956,
-0.1239054948091507,
-0.36927536129951477,
-0.09493950009346008,
0.6902004480361938,
-0.33949753642082214,
0.07958789169... | |
interning](http://en.wikipedia.org/wiki/String_intern_pool) - a method of storing only one copy of a string. It requires strings to be an immutable type in the language you are dealing with, and .Net satisfies that and uses string interning.
In string interning a string "xyz" is stored in the intern pool, and whenever... | [
0.035198409110307693,
0.2594483196735382,
0.1609119027853012,
0.1152331605553627,
-0.029552949592471123,
0.024818304926156998,
-0.29955556988716125,
-0.48084232211112976,
-0.18040087819099426,
-0.4614016115665436,
0.22894582152366638,
0.2942967712879181,
-0.34544897079467773,
0.14092278480... | |
I am learning C++ and I was wondering if I could gain some insight into the preferred way of creating binary operators that work on instances of two different types. Here is an example that I've made to illustrate my concerns:
```
class A;
class B;
class A
{
private:
int x;
public:
A(int x);
... | [
0.12338245660066605,
-0.1559702306985855,
0.009067129343748093,
-0.2743101418018341,
0.13083012402057648,
-0.19803069531917572,
0.31431564688682556,
-0.12889568507671356,
-0.033746931701898575,
-0.38926494121551514,
-0.5244386792182922,
0.7734221816062927,
-0.6567000150680542,
-0.107591353... | |
int x;
public:
B(int x);
int getX() const;
int operator + (const A& A);
};
A::A(int x) : x(x) {}
int A::getX() const { return x; }
// Method 1
int A::operator + (const B& b) { return getX() + b.getX(); }
B::B(int x) : x(x) {}
int B::getX() const { return x; }
// Method 1
int B::oper... | [
-0.13227088749408722,
-0.25300315022468567,
0.15661214292049408,
-0.18818704783916473,
-0.1528782844543457,
0.2391299605369568,
0.4061242938041687,
-0.4648324251174927,
-0.057738032191991806,
-0.20312440395355225,
-0.606387197971344,
0.47616732120513916,
-0.7844107151031494,
-0.14399252831... | |
return a.getX() + b.getX(); }
int operator + (const B& b, const A& a) { return a.getX() + b.getX(); }
#include <iostream>
using namespace std;
int main()
{
A a(2);
B b(2);
cout << a + b << endl;
return 0;
};
```
If I would like to have symmetry among the two types, which method is the best appro... | [
0.17511636018753052,
-0.09774480760097504,
0.2897568941116333,
-0.19963881373405457,
0.18142756819725037,
0.07082116603851318,
0.4406304657459259,
-0.3059193789958954,
-0.18825267255306244,
-0.3751010596752167,
-0.3637969493865967,
0.6070376634597778,
-0.5891634821891785,
-0.09966287016868... | |
`int operator+ (const A& a, const B& b)`, and make it a friend function of both classes if needed. In addition, define
```
int operator+(const B& b, const A& a) {return a + b;}
```
To make it symmetric. | [
-0.5978460311889648,
-0.1408022940158844,
0.2453889101743698,
-0.07824132591485977,
0.3708172142505646,
-0.06632287055253983,
0.07600968331098557,
-0.06200380623340607,
0.32760176062583923,
-0.4735495448112488,
-0.08686160296201706,
0.6766210198402405,
-0.3311048746109009,
-0.1300590783357... | |
Example:
```
template<class T>
class Base {
public:
Base();
friend class T;
};
```
Now this doesn't work... Is there a way of doing this?
I'm actually trying to make a general class sealer like this:
```
class ClassSealer {
private:
friend class Sealed;
ClassSealer() {}
};
class Sealed : private virt... | [
0.21341608464717865,
0.11120250821113586,
0.29240527749061584,
0.07182469218969345,
0.2918166220188141,
-0.5039494037628174,
0.3241655230522156,
-0.17518474161624908,
-0.4156564772129059,
-0.5285517573356628,
-0.0821940079331398,
0.5407243967056274,
-0.24591398239135742,
0.2954555153846741... | |
explicitly disallowed in the standard, even if some versions of VisualStudio do allow it.
C++ Standard 7.1.5.3 Elaborated type specifiers, paragraph 2
> 3.4.4 describes how name lookup proceeds for the identifier in an
> elaborated-type-specifier. If the
> identifier resolves to
> a class-name or enum-name,
> th... | [
0.03830039128661156,
-0.1190541684627533,
0.6724708676338196,
-0.044308073818683624,
-0.18241946399211884,
-0.012523245997726917,
-0.029262516647577286,
-0.29605457186698914,
-0.059409115463495255,
-0.38206228613853455,
-0.3600275218486786,
0.28681281208992004,
-0.30233222246170044,
0.0334... | |
T, the
> declaration *friend class T*; is
> ill-formed. ]
I recognize the code above as a pattern to seal (disallow the extension of) a class. There is another solution, that does not really block the extension but that will flag unadvertidly extending from the class. As seen in [ADOBE Source Library](http://stlab.a... | [
0.10409477353096008,
-0.04702102020382881,
0.6449188590049744,
-0.1859748363494873,
0.010237863287329674,
-0.08402039855718613,
0.2834874987602234,
-0.5221580266952515,
-0.04568028077483177,
-0.3086952865123749,
-0.45602771639823914,
0.42310377955436707,
-0.19150486588478088,
0.30600765347... | |
restrict users from mistakenly do it.
**EDIT**:
The upcoming C++11 standard does allow you to befriend a type argument with a slightly different syntax:
```
template <typename T>
class A {
// friend class T; // still incorrect: elaborate type specifier
friend T; // correct: simple specifier, note lac... | [
0.4306354522705078,
0.04352834075689316,
0.10320919007062912,
-0.12291568517684937,
-0.14675605297088623,
-0.33512091636657715,
0.47058409452438354,
-0.10894244909286499,
-0.11959376186132431,
-0.35970228910446167,
-0.11798633635044098,
0.48741692304611206,
-0.36263272166252136,
-0.2345558... | |
There's no way to do something like this, in C++ is there?
```
union {
{
Scalar x, y;
}
Scalar v[2];
};
```
Where `x == v[0]` and `y == v[1]`?
I've used something like this before. I'm not sure its 100% OK by the standard, but it seems to be OK with any compilers I've needed to use it on.
```
st... | [
0.100862056016922,
-0.0959850624203682,
0.3971528112888336,
-0.25653862953186035,
0.07065484672784805,
-0.40019869804382324,
0.4051014482975006,
-0.2957041263580322,
0.02653605304658413,
-0.3483673930168152,
-0.23838676512241364,
0.7406356930732727,
-0.5376569032669067,
-0.1547345668077469... | |
should want) and you can provide a const version of operator[] too.
If you're concerned about padding (and don't want to add the appropriate platform specific bits to force the struct to be unpadded) then you can use:
```
struct Vec2
{
float x;
float y;
float& operator[](int i) {
assert(i>=0);
assert(i<... | [
0.06922713667154312,
-0.3288104832172394,
0.6661103963851929,
-0.23115137219429016,
0.19398288428783417,
-0.05430793762207031,
0.3140455186367035,
-0.6313830018043518,
0.22067846357822418,
-0.48327940702438354,
-0.32408833503723145,
0.8347383141517639,
-0.32685139775276184,
-0.332935124635... | |
Is there an easy way to remove an identity from a table in SQL Server 2005?
When I use Management Studio, it generates a script that creates a mirror table without the identity, copies the data, drops the table, then renames the mirror table, etc. This script has 5231 lines in it because this table/column have many F... | [
-0.24354897439479828,
0.16419625282287598,
0.3812004029750824,
-0.0626387894153595,
-0.3952789604663849,
0.09257400035858154,
0.26040148735046387,
-0.014028635807335377,
-0.34749066829681396,
-0.43526414036750793,
0.5611390471458435,
0.19969339668750763,
-0.33646371960639954,
0.01084173284... | |
and control better. This table "behaves" strange, if you try to delete 1 row (even one you just inserted, which is not in any other FK table), you get this error:
```
delete MyTable where MyPrimaryKey=1234
Msg 8621, Level 17, State 2, Line 1
The query processor ran out of stack space during query optimization. ... | [
-0.30769047141075134,
0.46784868836402893,
0.476502001285553,
0.08985189348459244,
-0.0028774170204997063,
0.0632520318031311,
0.38145914673805237,
-0.13063165545463562,
-0.2802336812019348,
-0.5305399298667908,
0.03094000741839409,
0.33231091499328613,
-0.33835121989250183,
0.474948018789... | |
of how long it will take. I guess that I'll just have to test, test, test.
If you are on SQL Server 2005 or later, you can do this as a simple metadata change (NB: **doesn't** require an edition supporting partitioning as I originally stated).
Example code pilfered shamelessly from the workaround by Paul White on [thi... | [
-0.11455432325601578,
0.04699888080358505,
0.21399478614330292,
0.049043208360672,
-0.1698908656835556,
-0.023609045892953873,
0.1640271246433258,
-0.3983166515827179,
-0.281506210565567,
-0.6083590388298035,
-0.08120299130678177,
0.2775389552116394,
-0.6678168773651123,
0.2567790150642395... | |
(CONVERT(SQL_VARIANT, {d '2009-11-07'})),
(CONVERT(SQL_VARIANT, N'áéíóú'));
GO
-- Remove the identity property
BEGIN TRY;
-- All or nothing
BEGIN TRANSACTION;
-- A table with the same structure as the one with the identity column,
-- but without the identity property
CREATE TABLE dbo.Destin... | [
-0.08972063660621643,
-0.009163173846900463,
0.632723331451416,
0.06384819746017456,
0.16667449474334717,
-0.11334672570228577,
0.2970944941043854,
-0.593815267086029,
-0.21875587105751038,
-0.4668859541416168,
-0.5902655720710754,
0.5237962603569031,
-0.39347001910209656,
0.44661694765090... | |
no data
DROP TABLE dbo.Source;
-- Rename the new object to make it look like the old one
EXECUTE sp_rename N'dbo.Destination', N'Source', 'OBJECT';
-- Success
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
-- Bugger!
IF XACT_STATE() <> 0 ROLLBACK TRANSACTION;
PRINT ERROR_MESSAGE();
END CATCH;... | [
0.2230054885149002,
0.06405363976955414,
0.5746082067489624,
-0.04490526765584946,
0.21520833671092987,
-0.22487026453018188,
0.3963035047054291,
-0.35888105630874634,
-0.25253260135650635,
-0.3441292643547058,
-0.5801640748977661,
0.49703502655029297,
-0.47402507066726685,
0.0131828207522... | |
Say I have a string of words: `'a b c d e f'`. I want to generate a list of multi-word terms from this string.
Word order matters. The term `'f e d'` shouldn't be generated from the above example.
**Edit:** Also, words should not be skipped. `'a c'`, or `'b d f'` shouldn't be generated.
**What I have right now:**
`... | [
0.20521999895572662,
0.40871134400367737,
0.5444479584693909,
-0.2769978940486908,
0.004162927158176899,
0.04916367307305336,
0.16178804636001587,
-0.31117597222328186,
-0.09790385514497757,
-0.6914336681365967,
-0.21699576079845428,
0.730435848236084,
-0.21447157859802246,
0.5284095406532... | |
terms.append(' '.join([two_before, one_before, word]))
two_before = one_before
one_before = word
for term in terms:
print term
```
**Prints:**
```
a
b
a b
c
b c
a b c
d
c d
b c d
e
d e
c d e
f
e f
d e f
```
How would I make this a recursive function so that I can pass it a variable maximum number of w... | [
0.03795848786830902,
0.19035163521766663,
0.6347776055335999,
-0.05018831416964531,
-0.2801591157913208,
0.06919105350971222,
0.37297120690345764,
-0.690942108631134,
-0.015806518495082855,
-0.7342912554740906,
-0.18557120859622955,
0.6176061630249023,
-0.40049391984939575,
0.1126144155859... | |
Processing and whatnot).
This isn't recursive, but I think it does what you want.
```
doc = 'a b c d e f'
words = doc.split(None)
max = 3
for index in xrange(len(words)):
for n in xrange(max):
if index + n < len(words):
print ' '.join(words[index:index+n+1])
```
... | [
-0.27961352467536926,
-0.08246716856956482,
0.4674864709377289,
-0.18697255849838257,
-0.0026999907568097115,
0.16759221255779266,
0.20298618078231812,
-0.33491000533103943,
-0.22497503459453583,
-0.5119157433509827,
-0.27127742767333984,
0.6995302438735962,
-0.4647660553455353,
-0.1467161... | |
if len(words) == 0: return []
return [" ".join(words[:i+1]) for i in xrange(min(len(words), max_words_per_term))] + find_terms(words[1:], max_words_per_term)
doc = 'a b c d e f'
words = doc.split(None)
for term in find_terms(words, 3):
print term
```
Here's the recursive function again, with some explaining... | [
-0.2777349650859833,
-0.14736180007457733,
0.6036021709442139,
-0.3990798890590668,
-0.0778077021241188,
0.12951084971427917,
0.3491450548171997,
-0.23296181857585907,
0.058047644793987274,
-0.4433724284172058,
-0.5180211067199707,
0.6278204917907715,
-0.06204821914434433,
0.14292261004447... | |
# What's the max term length you could generate from the remaining
# words? It's the lesser of max_words_per_term and how many words
# you have left.
max_term_len = | [
0.21392756700515747,
-0.38674572110176086,
0.5038714408874512,
0.17165231704711914,
-0.35393285751342773,
0.09032249450683594,
0.3786084055900574,
-0.10562480986118317,
-0.32035428285598755,
-0.32526668906211853,
0.11733604222536087,
0.7468143701553345,
0.09460697323083878,
0.1692505627870... | |
min(len(words), max_words_per_term)
# Find all the terms that start with the first word.
initial_terms = [" ".join(words[:i+1]) for i in xrange(max_term_len)]
# Here's the recursion. Find all of the terms in the list
# of all but the first word.
other_terms = find_terms(words[1:], max_word... | [
-0.1873963624238968,
-0.04510488361120224,
0.5081453919410706,
-0.1589186042547226,
-0.2617338001728058,
0.4005119502544403,
0.11729847639799118,
-0.239694744348526,
0.1268284171819687,
-0.5634638071060181,
-0.30397287011146545,
0.6841160655021667,
0.10983560234308243,
0.11677365005016327,... | |
We have some html that looks like this:
```
<form id="MyUserControl" runat="server" method="post">
<script language="javascript" src="javascript.js"></script>
```
The javascript file contains something like this:
```
document.write('<object id="MyUserControl" ');
document.write('classid="MyUserControl.dll#MyName... | [
0.2510499954223633,
0.22340264916419983,
0.6150527000427246,
-0.082727812230587,
0.09461270272731781,
-0.1399088203907013,
0.17260172963142395,
-0.1625175178050995,
-0.21867933869361877,
-0.9286819100379944,
-0.09291981905698776,
0.2731718122959137,
-0.18324260413646698,
0.1602580845355987... | |
displayed in a browser object inside of FoxPro. The html and js above allow us to embed the winforms user control in a web page.
If a particular user does not have a code access group for our application server set up, the user control does not render and the screen just shows the little icon in the upper left corner ... | [
0.17440880835056305,
-0.15870904922485352,
0.23411555588245392,
0.15858906507492065,
-0.11902856081724167,
0.0434197373688221,
0.09292658418416977,
-0.006817532703280449,
0.19706444442272186,
-0.8439229726791382,
0.042116209864616394,
0.42480218410491943,
-0.29009053111076355,
-0.044278386... | |
of our users have IE7 and this is just a temporary solution (< 6 months).
You can put any inline elements within the object tag, and if it fails to load, they will be presented to the user.
```
<object>
This object failed to load,
try to install <a href="http://plugin-site/">here</a>
</object>
```
[MSDN: OBJECT ... | [
-0.05486604943871498,
0.10192790627479553,
0.7371598482131958,
-0.08711475878953934,
0.13927461206912994,
-0.18179412186145782,
0.6107928156852722,
0.0897241085767746,
-0.24707871675491333,
-0.7191058397293091,
-0.22247780859470367,
0.5221605896949768,
-0.109239861369133,
-0.01085031591355... | |
the load success.
```
<!DOCTYPE html>
<html>
<head>
<title>so-objects</title>
<script type="text/javascript">
function add(text) {
document.body.appendChild(document.createElement("div"))
.appendChild(document.createTextNode(text));
};
function each(o, f, c) {
for (var ... | [
-0.18460699915885925,
-0.1396944671869278,
0.9055150151252747,
-0.16387221217155457,
-0.06099994480609894,
0.26071852445602417,
0.4761646091938019,
-0.59824138879776,
-0.19824336469173431,
-0.41204774379730225,
-0.42869246006011963,
0.7569331526756287,
-0.033009227365255356,
0.186387240886... | |
add("byId = "+ document.getElementById("no-access") );
// IE returns 2 instead of 3
add("byTags = "+ document.getElementsByTagName("object").length );
// verify successful load if the object property is available
each(document.getElementsByTagName("object"), function(node) {
add(node.i... | [
0.07255870848894119,
-0.11603337526321411,
0.7353260517120361,
-0.23992003500461578,
0.0925222635269165,
0.09554678946733475,
0.2944503128528595,
-0.685204267501831,
-0.20077601075172424,
-0.6515544652938843,
-0.4881230592727661,
0.49435773491859436,
-0.055262092500925064,
-0.0638953968882... | |
<span>failed</span>
</object>
<object id="supported"
classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6">
</object>
</body>
</html>
```
Returned values for **IE < 8**
```
byId = null
byTags = 2
access = false
supported = true
```
Returned values for **W3C Compliant**
```
byId = [object HTMLObjectEle... | [
0.12057426571846008,
0.09967810660600662,
0.4951436221599579,
-0.0038346268702298403,
-0.016782473772764206,
0.0883510410785675,
0.8629476428031921,
-0.742285430431366,
-0.297177791595459,
-0.3367054760456085,
-0.17363303899765015,
0.44273319840431213,
-0.1594247817993164,
-0.1670852601528... | |
I can already populate the data into the spreadsheet, create the chart based on the range I select. However, when it comes to formatting the actual chart I feel a bit lost as their are so many options!!
It is an xlCylinderBarStacked type chart. I simply need to make the color of the bars a nice light orange and make t... | [
0.3680267632007599,
0.013594533316791058,
0.40422165393829346,
-0.14650878310203552,
0.022250540554523468,
0.04556293413043022,
0.1345442682504654,
0.20730921626091003,
-0.16709525883197784,
-0.8302487730979919,
0.28372544050216675,
0.266161173582077,
-0.19518528878688812,
-0.0300940349698... | |
chart.
```
xlChart.Interior.Color = ColorTranslator.ToOle(Color.LightSkyBlue);
chart.ChartArea.Fill.TwoColorGradient(
Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal,
1);
``` | [
-0.09392742812633514,
-0.008589737117290497,
0.6235648393630981,
-0.025395944714546204,
0.3252949118614197,
0.17488877475261688,
-0.10787399113178253,
-0.017597950994968414,
-0.33213815093040466,
-0.884733259677887,
-0.36495861411094666,
0.5533912181854248,
-0.48431047797203064,
0.00051060... | |
I have an ASP.Net Web Site with GridView control that in turn contains a ButtonField column. It's supposed to do a postback when this ButtonField is clicked, but that doesn't happen if I click on the button from within the Internet Explorer window that Visual Studio opens while debugging. I can get it to successfully p... | [
0.40424206852912903,
0.15481187403202057,
0.4618050456047058,
-0.2362586110830307,
-0.27722877264022827,
-0.12454894930124283,
0.2534078061580658,
-0.06791508197784424,
-0.24541273713111877,
-0.7813360095024109,
-0.025327295064926147,
0.9139132499694824,
-0.04666263237595558,
0.03154680877... | |
go with number 1. You could even make a user control that calculates the link ahead of time and cache it per user to reduce load. | [
0.017168324440717697,
-0.2523505985736847,
0.24351263046264648,
0.35991013050079346,
-0.24736741185188293,
-0.263203889131546,
-0.05794873461127281,
-0.05854702368378639,
-0.23259803652763367,
-0.474071204662323,
0.05332717299461365,
0.36627599596977234,
-0.5651382207870483,
-0.14013274013... | |
> **Possible Duplicate:**
>
> [How can I represent an 'enum' in Python?](https://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python)
What's the common practice for enums in Python? I.e. how are they replicated in Python?
```
public enum Materials
{
Shaded,
Shiny,
Transparent,
M... | [
0.41640758514404297,
0.10578668117523193,
0.1177939772605896,
0.1650131493806839,
-0.1330013871192932,
0.2711402177810669,
0.059636883437633514,
-0.11936260014772415,
-0.4983835518360138,
-0.7594902515411377,
-0.21641844511032104,
0.2847442328929901,
-0.18213383853435516,
0.142314061522483... | |
I would like to make a simple VST plugin that does this :
1. analyze an audio stream (volume, beat, etc...)
2. has triggers on the analyzer's output (e.g. do something when volume > threshold)
3. generate MIDI events based on the triggers
This is to be able to chain plugins, even if they are not designed for it. For ... | [
0.501835823059082,
-0.3869788646697998,
0.2088336944580078,
0.12250158190727234,
-0.38665246963500977,
-0.42890098690986633,
-0.21659530699253082,
-0.8027965426445007,
0.20965000987052917,
-0.4476465880870819,
0.49110397696495056,
1.0104206800460815,
-0.4583057165145874,
0.0294493790715932... | |
there support for direct MIDI connections like this in VSTs ? Or maybe I need some sort of "virtual midi device" for interconnects ?
Your hunch here is probably correct; this task will be easier to accomplish by writing a virtual MIDI device instead of a VST plugin. It is possible to send MIDI events to a sequencer usi... | [
0.36048629879951477,
-0.28180792927742004,
0.3103432059288025,
0.26208290457725525,
0.07033596187829971,
-0.22641532123088837,
0.30730322003364563,
0.10827836394309998,
-0.23722726106643677,
-0.6923303604125977,
-0.06548330932855606,
0.6538439989089966,
-0.396489679813385,
0.33283430337905... | |
a MIDI channel (maybe plogue bidule?).
You might be able to accomplish this with Audio Units with the kAudioUnitType\_Generator plugin type... though I've never written such a plugin, my impression was that this is what you'd use to generate MIDI to the host. But again, the problem here is that I'm not sure how the ho... | [
0.445370614528656,
-0.20902802050113678,
0.28407424688339233,
0.20934976637363434,
0.010694148018956184,
0.03448650985956192,
-0.11435086280107498,
-0.08527375757694244,
-0.07169190049171448,
-0.4838860332965851,
0.1773769110441208,
0.6419209837913513,
-0.4678944945335388,
0.37319764494895... | |
a far easier way to accomplish what you want is to create a virtual MIDI device, as you'd thought of already, and then use rewire to route an input signal to your program.
**Edit**: Here's some resources on writing MIDI drivers for various systems:
* [Audio device driver programming in OS X](http://developer.apple.co... | [
0.19221501052379608,
-0.08768397569656372,
0.4559185802936554,
0.24909979104995728,
0.016132086515426636,
-0.023257333785295486,
0.13743935525417328,
-0.16113857924938202,
-0.18994295597076416,
-0.4656412899494171,
-0.31122100353240967,
0.7436116337776184,
-0.1352204829454422,
0.1309759169... | |
I have several vehicles that send a data to server each minute. The server should be listening and decode the data to store in the database. There will be thousands of entries per minute. What is the best approach to solve that problem?
My personal favorite, WCF or WebService farm pumps the data to a Microsoft Message ... | [
0.6822347044944763,
0.27372151613235474,
0.3524320423603058,
0.14284873008728027,
0.026742637157440186,
0.10607034713029861,
0.26268529891967773,
0.10626567155122757,
-0.003731883130967617,
-0.7527384161949158,
0.20278264582157135,
0.3355625867843628,
0.049104634672403336,
0.21342721581459... | |
[Consider this article](http://www.csharphelp.com/archives3/archive581.html).
On the web facing side of this, because it is stateless and thin you can easily scale out this layer without thinking about complex load balancing. You can use DNS load balancing to start and then move to a better solution when you need it.
... | [
0.22743088006973267,
-0.12277468293905258,
0.40906038880348206,
0.22959069907665253,
-0.06717974692583084,
-0.14594174921512604,
0.1930655837059021,
0.26470038294792175,
-0.7084661722183228,
-0.7802056074142456,
-0.010855618864297867,
0.07774324715137482,
0.05338449031114578,
0.36609640717... | |
I was doing some testing with some sites (that I will not mention), and they are returning 200 code when they are page not found pages. Is this against any web development standard?
This is the code that I am using to see the return code of a URL:
```
System.out.println(new String("getRespCode=" + urlConnection.getRe... | [
0.3548571467399597,
0.10327734053134918,
0.31816530227661133,
0.11083649843931198,
0.0303456112742424,
-0.31061071157455444,
0.33942466974258423,
0.1731644570827484,
-0.377571702003479,
-0.5028597712516785,
-0.029162531718611717,
0.4563838243484497,
-0.17071183025836945,
0.3078079223632812... | |
I have this schema:
```
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element block="" final="" name="mensaje">
<xs:complexType>
<xs:all>
<xs:element minOccurs="1" maxOccurs="1" name="identificacion" type="Head" />... | [
-0.060425568372011185,
0.13890112936496735,
0.6951431035995483,
-0.024769850075244904,
-0.08723685890436172,
-0.2451271116733551,
-0.15874256193637848,
-0.4288570284843445,
0.2661748230457306,
-0.6057577133178711,
-0.06115748733282089,
0.3368041515350342,
-0.03852696344256401,
0.0158373620... | |
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:complexType name="Head">
<!-- etc etc -->
</xs:complexType>
</xs:schema>
```
As you can see, the element "cuit" is required. I have already created the classes that map to the schemas with Cas... | [
0.11750839650630951,
0.06284800916910172,
0.23748290538787842,
0.07982052117586136,
-0.19808916747570038,
-0.1796572059392929,
0.08127938210964203,
-0.37044620513916016,
0.1602177619934082,
-0.40793123841285706,
-0.22089062631130219,
0.6148818135261536,
-0.3889400362968445,
-0.001361373928... | |
etc
.append(" </identificacion>")
.append(" <consulta>")
.append(" <cuit>35890</cuit>")
.append(" </consulta>")
.append("</mensaje>")
.toString();
StringReader xmlReader = new StringReader(xml);
Consulta con = null;
try {
con = (Consulta) Unmarshaller.unmarshal(Consult... | [
0.08095578104257584,
-0.10073211789131165,
0.7646601796150208,
0.08838873356580734,
0.06123268976807594,
-0.006662891712039709,
0.2698298990726471,
-0.8872374296188354,
0.034777313470840454,
-0.15561184287071228,
-0.42593565583229065,
0.690600574016571,
-0.3371123671531677,
-0.049470204859... | |
fail("Exception: " + ex.getMessage());
}
}
```
The cuit field is there but I get:
Exception: The field '\_cuit' (whose xml name is 'cuit') is a required field of class 'XML.entities.Consulta'
Any ideas why?
Here's the generated class for Consulta (comments removed...)
```
package XML.entities;
import org.... | [
0.06873071938753128,
0.20005309581756592,
0.40768247842788696,
-0.3173266053199768,
0.30679866671562195,
0.034090157598257065,
0.5416144132614136,
-0.27511438727378845,
0.06645699590444565,
-0.3156866431236267,
-0.6209341287612915,
0.861545205116272,
-0.6469075083732605,
-0.027735179290175... | |
public boolean isValid(
) {
try {
validate();
} catch (org.exolab.castor.xml.ValidationException vex) {
return false;
}
return true;
}
public void marshal(
final java.io.Writer out) | [
0.39043524861335754,
0.08442890644073486,
0.24431546032428741,
0.040675725787878036,
0.28727349638938904,
-0.11987157166004181,
0.555528461933136,
-0.8663346767425537,
-0.11564809828996658,
-0.28589963912963867,
-0.10139690339565277,
0.43624451756477356,
-0.15060630440711975,
0.13665294647... | |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
Marshaller.marshal(this, out);
}
public void marshal(
final org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.Validation... | [
0.5623903870582581,
0.2596231997013092,
0.021518046036362648,
0.1458643525838852,
0.0899440199136734,
0.31476324796676636,
0.134487122297287,
-0.5866211652755737,
-0.2836218774318695,
-0.16429463028907776,
-0.4686196744441986,
0.4112018346786499,
-0.3047574460506439,
0.1591673344373703,
... | |
unmarshal(
final java.io.Reader reader)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
return (XML.entities.Consulta) Unmarshaller.unmarshal(XML.entities.Consulta.class, reader);
}
public void validate(
)
throws org.exolab.castor.xml.V... | [
-0.004573660437017679,
0.09064853936433792,
0.5404710173606873,
0.03744523227214813,
-0.229157492518425,
0.012858265079557896,
0.3801172375679016,
-0.44377872347831726,
-0.1863522082567215,
-0.11530648916959763,
-0.5981355309486389,
0.3983893096446991,
-0.27411407232284546,
0.2839533686637... | |
I am writing an article on Unicode and discussing the advantages of this encoding scheme over outdated methods like ASCII.
As part of my research I am looking for a reference that listed the languages that could be fully represented using only the characters supported by ASCII. Haven't had much luck tracking it down w... | [
0.1768416166305542,
0.38069313764572144,
0.005955340340733528,
0.04069216921925545,
-0.19653670489788055,
0.2343573272228241,
0.06688801199197769,
0.49497976899147034,
-0.3280492424964905,
-0.898357629776001,
-0.4588811695575714,
-0.004747410770505667,
0.027523700147867203,
0.0856594070792... | |
in the
most common written languages.
There are no natural languages that I know of that can be fully represented in ASCII. Even American English, the language for which ASCII was invented, doesn't work: for one, there are a lot of foreign words that have been integrated into the American English language that cannot b... | [
-0.04793654382228851,
0.0008574119419790804,
-0.05018575116991997,
0.33238720893859863,
-0.0573999248445034,
0.06717188656330109,
-0.05676242336630821,
0.527675211429596,
-0.2568991780281067,
-0.8404161930084229,
-0.4361162483692169,
0.09855453670024872,
-0.16887059807777405,
-0.0905623659... | |
are used in American English. | [
0.39342159032821655,
0.4790997803211212,
-0.10769028961658478,
-0.31902509927749634,
0.1650647670030594,
0.1261880248785019,
0.4020017981529236,
0.5225905776023865,
-0.07091135531663895,
-0.20570042729377747,
-0.4753551185131073,
0.8743027448654175,
-0.11365202814340591,
-0.240756079554557... | |
This might be an unusual question, but is there any framework or at least some helper classes that would help me use GNU Gettext for localizing a C# ASP.NET MVC website? I've been using Gettext in a previous (managed code) project and really appreciate the possibility to use PoEdit for translating the resources.
I gue... | [
0.3591461479663849,
0.03169799596071243,
0.017346924170851707,
0.5748863220214844,
-0.2857813835144043,
-0.31372177600860596,
0.2561418414115906,
0.3081103563308716,
-0.17132337391376495,
-0.5973848700523376,
0.04915664345026016,
0.42424455285072327,
-0.03444657847285271,
-0.05794736742973... | |
nice. I modified it to my own needs and am pretty happy with what it offered:
<http://www.fairtutor.com/fairlylocal/> | [
0.16763527691364288,
-0.5455194711685181,
0.5987978577613831,
0.25758692622184753,
0.06543967872858047,
0.1486939638853073,
0.13796497881412506,
0.15096260607242584,
-0.20836204290390015,
-0.46970510482788086,
0.7622730731964111,
0.5443225502967834,
0.13774220645427704,
-0.0055040763691067... | |
what if you have so many entries in a table, that 2^32 is not enough for your auto\_increment ID within a given period (day, week, month, ...)?
What if the largest datatype MySQL provides is not enough?
I'm wondering how should I solve a situation where I'm having so many entries added to my table which require uni... | [
0.034143541008234024,
0.1591700315475464,
0.1827387809753418,
0.16319996118545532,
0.02399751916527748,
0.16537316143512726,
0.22907046973705292,
-0.056729406118392944,
-0.49123209714889526,
-0.8191395401954651,
-0.050872255116701126,
0.18297046422958374,
-0.1642586886882782,
0.38901409506... | |
b |
+---+------+
| 1 | 1 |
| 1 | 2 |
| 1 | 3 |
|...| .... |
|...| .... |
| 1 | 2^32 |
| 2 | 1 |
| 2 | 2 |
+---+------+
```
Which exponentially increases the amount of entries.
How do you cope with such situations?
Remember - requirement is to have unique ID for any entry.
You could use BIGINT for... | [
0.037589747458696365,
0.18720743060112,
0.22556260228157043,
-0.1377604901790619,
0.020613357424736023,
-0.07323458790779114,
0.30007192492485046,
-0.3405643403530121,
-0.17224663496017456,
-0.2796747386455536,
-0.04776991903781891,
0.5114211440086365,
-0.30404242873191833,
0.3519643545150... | |
BIGINT *is* fixed at an 8-byte limit. | [
-0.09678995609283447,
-0.25474703311920166,
0.23487457633018494,
-0.17548862099647522,
-0.004768171813338995,
-0.11034214496612549,
0.3434431850910187,
0.002657234203070402,
-0.425502210855484,
-0.3373578190803528,
-0.06581053137779236,
0.14878791570663452,
-0.6085053086280823,
0.241044700... | |
What's the quickest way to print "debug" messages from Flex? You know, things like "got a mouse click at ($x, $y)" or "received and event from $sender".
```
trace(mouseEvent.x + ", " + mouseEvent.y);
```
prints it to the console if you're using Eclipse/Flex Builder. | [
0.288737416267395,
-0.3796764314174652,
0.12466661632061005,
0.002302207052707672,
0.1272670477628708,
-0.4244210720062256,
-0.00624146219342947,
0.005073149688541889,
-0.13999512791633606,
-0.6165971755981445,
-0.012958411127328873,
0.8888261318206787,
-0.3628375828266144,
-0.247406437993... | |
I don't really see the point of [UUID](http://en.wikipedia.org/wiki/UUID). I know the probability of a collision is *effectively nil*, but *effectively nil* is not even close to impossible.
Can somebody give an example where you have no choice but to use UUID? From all the uses I've seen, I can see an alternative desi... | [
0.21016629040241241,
0.24017314612865448,
0.1018119528889656,
0.10898341983556747,
-0.39648088812828064,
-0.01021698396652937,
0.4970508813858032,
0.268332302570343,
-0.15076501667499542,
-0.8142634630203247,
0.29173073172569275,
0.38703617453575134,
-0.36019375920295715,
0.410698473453521... | |
so I consider myself to be reasonably well-informed on the subject. There are four major UUID versions:
Version 4 UUIDs are essentially just 16 bytes of randomness pulled from a cryptographically secure random number generator, with some bit-twiddling to identify the UUID version and variant. These are extremely unlik... | [
0.011594320647418499,
-0.04460960626602173,
0.4695368707180023,
-0.19629858434200287,
-0.25332117080688477,
0.027250202372670174,
0.3279459774494171,
0.2620810568332672,
-0.36865878105163574,
-0.41319888830184937,
-0.12098386138677597,
-0.06724028289318085,
-0.05624210461974144,
0.52334451... | |
UUID. This will, for example, allow you to produce a UUID from a URL. Collisions here are only possible if the underlying hash function also has a collision.
Version 1 UUIDs are the most common. They use the network card's MAC address (which unless spoofed, should be unique), plus a timestamp, plus the usual bit-twidd... | [
-0.30409491062164307,
-0.2102220207452774,
0.7282240390777588,
0.07192996889352798,
-0.1351408064365387,
-0.2262009233236313,
0.029823489487171173,
0.2699621319770813,
-0.35677212476730347,
-0.7486274242401123,
-0.2213907688856125,
0.1597147434949875,
-0.4254321753978729,
0.539359807968139... | |
timestamp is incremented by 1. Collisions should not occur unless one of the following happens: The MAC address is spoofed; One machine running two different UUID generating applications produces UUIDs at the exact same moment; Two machines without a network card or without user level access to the MAC address are give... | [
-0.11661945283412933,
-0.12359806895256042,
0.45023974776268005,
0.35087868571281433,
0.26479044556617737,
-0.10727594792842865,
0.13021151721477509,
0.050161466002464294,
-0.393278032541275,
-0.6236822605133057,
-0.1144552156329155,
0.00023451722518075258,
-0.3297358751296997,
0.354615241... | |
scale, or with an untrusted environment where malicious individuals might be able to do something bad in the case of an ID collision, it's just not something you should worry about. It's critical to understand that if you happen to generate the same version 4 UUID as I do, in most cases, it doesn't matter. I've generat... | [
0.42207303643226624,
0.10555856674909592,
0.18419063091278076,
0.2779757082462311,
-0.17587146162986755,
-0.14606019854545593,
0.3057188093662262,
0.07733431458473206,
-0.3024759888648987,
-0.5921721458435059,
0.2723131477832794,
0.6051730513572693,
-0.19293877482414246,
0.2774623930454254... | |
you have a collision, even on a version 4 UUID, even if you're generating quite a few UUIDs per second.
Also, 2^64 \* 16 is 256 exabytes. As in, you would need to store 256 exabytes worth of IDs before you had a 50% chance of an ID collision in a single application space. | [
-0.2600677013397217,
0.026054896414279938,
0.234009250998497,
0.24290399253368378,
-0.19037504494190216,
-0.0398155152797699,
0.5019811987876892,
-0.26132798194885254,
-0.42454004287719727,
-0.6273858547210693,
0.02643491141498089,
0.3072003126144409,
-0.4110351800918579,
0.225148469209671... | |
Is there a way to turn a normal Eclipse Project into a JPA Project?
I have a normal project with Entities in it and a Persistence.xml file, but it is not an eclipse recognized JPA project. What can I do?
project properties --> project facets.
There you can click on the JPA check-box and you have an JPA project. | [
0.5063637495040894,
-0.0501735545694828,
-0.2079167664051056,
0.32835596799850464,
-0.41884785890579224,
-0.33209365606307983,
0.19105744361877441,
0.13381178677082062,
-0.024592775851488113,
-0.5117327570915222,
0.045192234218120575,
0.15023262798786163,
-0.07962740957736969,
0.1199445128... | |
When I make a new array/hash in **irb**, it prints out a nice format to show the structure, ex.
```
["value1", "value2", "value3"]
{"key1" => "value1"}
```
... but when I try to print out my variables using `puts`, I get them collapsed:
```
value1
value2
value3
key1
value1
```
I gather that `puts` is not the righ... | [
-0.04675495997071266,
0.22835853695869446,
0.39508888125419617,
-0.2862727642059326,
-0.12310915440320969,
0.08015462011098862,
0.17183880507946014,
-0.5825042128562927,
-0.22986438870429993,
-0.754167377948761,
-0.29612159729003906,
0.4004487693309784,
-0.2511429786682129,
-0.049208588898... | |
This is going to be very simple I know. I have seen so many different ways of using sql in asp.net with no real standard. What I want to know is how to cleanly select from an sql database in asp.net and retrieve multiple records. For example: select all userids.
```
String sql =
"SELECT [UserId] FROM [UserProfiles]... | [
0.08392471075057983,
-0.07593436539173126,
0.5381754040718079,
0.25156256556510925,
0.3584810197353363,
-0.28617802262306213,
-0.03989466279745102,
-0.18525004386901855,
-0.19450360536575317,
-0.8530737161636353,
0.15242676436901093,
0.4104059338569641,
-0.15864817798137665,
0.257281959056... | |
.WebConfigurationManager
.ConnectionStrings["SocialSiteConnectionString"]
.ConnectionString;
SqlConnection conn = new SqlConnection(strCon);
SqlCommand comm = new SqlCommand(sql, conn);
conn.Open();
/*
This is where I need to know how to retrieve the information from the
... | [
0.21520252525806427,
0.069322369992733,
0.46748241782188416,
0.20021985471248627,
-0.05880329757928848,
-0.2775269150733948,
0.21983209252357483,
0.09331922978162766,
-0.4439947009086609,
-0.7218220829963684,
0.16794924437999725,
0.3266680836677551,
-0.0997254028916359,
0.26296716928482056... | |
some
other form of retrieving all the data.
Also when the new SqlCommand is called...does that actual run the
SELECT STATEMENT or is there another step.
*/
conn.Close();
```
I think that this is what you are looking for.
```
String sql = "SELECT [UserId] FROM [UserProfiles] WHERE NOT [UserId] = 'CurrentUserId'";... | [
-0.08726698905229568,
-0.11890386044979095,
0.444161593914032,
-0.09717708081007004,
0.2302568107843399,
-0.31662631034851074,
0.02523871138691902,
-0.09207349270582199,
-0.24148361384868622,
-0.5563709139823914,
-0.19029036164283752,
0.5220767855644226,
-0.28938713669776917,
0.17699365317... | |
.ConnectionStrings["SocialSiteConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(strCon);
SqlCommand comm = new SqlCommand(sql, conn);
conn.Open();
SqlDataReader nwReader = comm.ExecuteReader();
while (nwReader.Read())
{
int UserID = (int)nwReader["UserID"];
// Do something with UserID... | [
-0.18552640080451965,
-0.2591186463832855,
0.7107873558998108,
0.16593655943870544,
-0.17307926714420319,
0.02095463126897812,
0.16004082560539246,
0.04966869205236435,
-0.4116111099720001,
-1.0496656894683838,
0.06627767533063889,
0.20145776867866516,
-0.32084494829177856,
0.3618242442607... | |
{
public static string ConnectionString;
void Application_Start(object sender, EventArgs e)
{
ConnectionString = ConfigurationManager.ConnectionStrings["SocialSiteConnectionString"].ConnectionString;
}
...
}
```
Now, throughout your code, just access it using:
```
SqlCo... | [
0.061048250645399094,
0.03714662417769432,
0.2857198715209961,
-0.07239886373281479,
0.3779541254043579,
-0.08653482049703598,
0.42318451404571533,
0.07770602405071259,
-0.25629332661628723,
-1.0128700733184814,
-0.04527133330702782,
0.28783270716667175,
-0.44651609659194946,
0.43381795287... | |
new BSDIQuery())
{
SqlDataReader nwReader = qry.Command("SELECT...").ReturnReader();
// If I needed to add a parameter I'd add it above as well: .ParamVal("CurrentUser")
while (nwReader.Read())
{
int UserID = (int)nwReader["UserID"]; | [
0.22329457104206085,
-0.2350970059633255,
0.6371627449989319,
-0.2684336304664612,
-0.02431762032210827,
0.2152099609375,
0.539831280708313,
-0.44495949149131775,
-0.02363261952996254,
-0.6732069849967957,
0.1454758644104004,
0.3220144510269165,
-0.3586979806423187,
0.6946492791175842,
0... | |
// Do something with UserID here...
}
nwReader.Close();
}
```
This is just an example using *my* DAL. However, notice that there is no connection string, no command or connection objects being created or managed, just a "BSDIQuery" (which does lots of different things in addition to th... | [
0.39077845215797424,
-0.12099103629589081,
-0.0017321238992735744,
-0.016592824831604958,
-0.1662282794713974,
-0.2841876149177551,
0.15365423262119293,
0.1781443953514099,
-0.20154008269309998,
-0.8448344469070435,
0.029800795018672943,
0.39569586515426636,
-0.1761496216058731,
0.20967768... | |
What are the deficiencies of the built-in **BinaryFormatter** based .Net serialization? (Performance, flexibility, restrictions)
Please accompany your answer with some code if possible.
Example:
*Custom objects being serialized must be decorated with the [Serializable] attribute or implement the ISerializable int... | [
0.23461870849132538,
-0.06949987262487411,
0.3188154399394989,
0.17590723931789398,
-0.23460042476654053,
-0.19921821355819702,
0.17841611802577972,
0.009647689759731293,
-0.3248443901538849,
-0.5393396615982056,
-0.08387167006731033,
0.6162863373756409,
-0.2345581203699112,
0.108404144644... | |
version specific)
* isn't obfuscation-safe
* isn't especially fast, or small output
* doesn't work on light frameworks (CF?/Silverlight)
* has a depressing habit of pulling in things you didn't expect (usually via `event`s)
I've spent lots of time in this area, including writing a (free) implementation of Google's "pr... | [
-0.05081787332892418,
-0.14011150598526,
0.6642951965332031,
-0.07000379264354706,
-0.22913023829460144,
-0.25148749351501465,
0.1925395429134369,
-0.27659252285957336,
-0.3164425492286682,
-0.8271582722663879,
-0.13567300140857697,
0.5059534907341003,
-0.35010015964508057,
-0.013889267109... | |
I have a view in my database that produces ordered results, but when I run a Linq query over that view, the results are no longer ordered (at least, according to the foreach I use to iterate over the results, and according to the debugger). Is this a known difficulty with Linq, or am I missing something?
**Update**: m... | [
-0.2888816297054291,
0.2725558280944824,
0.4874558448791504,
-0.045329101383686066,
-0.10830811411142349,
-0.02094791829586029,
-0.09494408220052719,
-0.1520605832338333,
-0.1826184242963791,
-0.44919517636299133,
-0.18072983622550964,
0.5125921964645386,
-0.12254289537668228,
0.1361888796... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.