text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I am accustomed to winform `TreeView` having a `Sorted` property which automatically manages nodes sorting.
I now have to alphabetically sort an ASP.NET `TreeView` and I'm surprised I cannot find any similar property or callback method.
Is there any way to automatically achieve this operation in ASP.NET or do I have t... | [
0.06620968878269196,
0.03214142471551895,
0.40643110871315,
-0.2588411569595337,
0.0210973359644413,
-0.170804962515831,
0.09195154160261154,
-0.08987545222043991,
-0.5979346036911011,
-0.5646924376487732,
-0.32730382680892944,
0.34985652565956116,
-0.27094191312789917,
0.25446292757987976... | |
Sort(this TreeView tv)
{
TreeNodeCollection T = tv.Nodes.Sort();
tv.Nodes.Clear();
tv.Nodes.AddRange(T);
}
public static void Sort(this TreeNode tn)
{
TreeNodeCollection T = tn.ChildNodes.Sort();
tn.ChildNodes.Clear();
tn.ChildNodes.AddRange(T);
}
```
The first link contains the rest of the ... | [
-0.1635153442621231,
-0.4850481152534485,
0.7549045085906982,
-0.2508804202079773,
0.4183884859085083,
0.0029175053350627422,
0.0652882307767868,
-0.0490543432533741,
-0.46551313996315,
-0.5737444758415222,
-0.40542271733283997,
0.31750816106796265,
-0.28205642104148865,
0.2561051547527313... | |
I want to open .avi file (preferably any video file), to work with that video as a sequence of bitmaps (arrays) and then display it on the screen or save it to the file.
What options do I have in .NET?
It turns out that [Splicer](http://www.codeplex.com/splicer) was the best option for me. It is open source wrapper ar... | [
0.6764793992042542,
-0.028425464406609535,
0.4534930884838104,
-0.048829324543476105,
-0.26238828897476196,
-0.11031334102153778,
-0.007922195829451084,
-0.06914500892162323,
-0.2055356353521347,
-0.6774781942367554,
0.10170385986566544,
0.45056912302970886,
-0.3231865465641022,
0.33201116... | |
I have this class:
```
public class GenericEventArgs<T> : EventArgs
{
public GenericEventArgs() : this(default(T)) {}
public GenericEventArgs(T value) { Value = value; }
public T Value { get; private set; }
}
```
And this event handler delegate for it:
```
public delegate void GenericEventHandler<T>(obj... | [
-0.12461782991886139,
-0.33985453844070435,
0.14816078543663025,
0.02561867982149124,
-0.293229341506958,
-0.20375734567642212,
0.370026171207428,
-0.14718016982078552,
-0.1557430475950241,
-0.6265493035316467,
-0.23614045977592468,
0.5784971714019775,
-0.2721273899078369,
0.50396138429641... | |
this `GenericEventHandler<T>` delegate that I am not sure where I should place. Should it have its own file? With just... that one line kind of? (and the namespace of course)
How do you usually do this?
Any reason for not using `EventHandler<TEventArgs>`? I thought there was an equivalent `EventArgs<T>` but I can't se... | [
0.038070641458034515,
-0.07600409537553787,
0.20832587778568268,
0.1925133615732193,
-0.2222144454717636,
-0.2229231745004654,
-0.0705496072769165,
0.12014784663915634,
-0.3451099693775177,
-0.5768386721611023,
-0.1403152197599411,
0.06125638261437416,
-0.09613761305809021,
0.2971739768981... | |
a file for a single declaration. | [
0.17958875000476837,
0.0834040492773056,
-0.07698863744735718,
0.41686931252479553,
-0.15278713405132294,
-0.021477337926626205,
-0.2172858864068985,
-0.29061272740364075,
-0.3100647032260895,
-0.21199767291545868,
-0.45928484201431274,
0.22493833303451538,
-0.2165789157152176,
0.112113952... | |
In a project that I'm working on I have to work with a rather weird data source. I can give it a "query" and it will return me a DataTable. But the query is not a traditional string. It's more like... a set of method calls that define the criteria that I want. Something along these lines:
```
var tbl = MySource.GetObj... | [
0.10405830293893814,
-0.03268086910247803,
0.4556982219219208,
0.0708981454372406,
-0.1368192881345749,
-0.004486705642193556,
0.26884835958480835,
-0.25556862354278564,
0.042280178517103195,
-0.48330461978912354,
-0.11072951555252075,
0.4252578616142273,
-0.6027024984359741,
0.05813353508... | |
a little parser that would parse a given expression (like `"Column1 = 123 AND Column2 < 456"`) and convert it to the above function calls. Also, it would be nice if I could add parameters there, so I would be protected against injection attacks. The last little piece of sugar on the top would be if it could cache the p... | [
-0.02150752581655979,
0.031064128503203392,
-0.01747586391866207,
0.3724357485771179,
-0.09685588628053665,
0.1877514272928238,
0.1698969006538391,
-0.11924193054437637,
-0.11828303337097168,
-0.35276925563812256,
0.47087016701698303,
0.48252737522125244,
-0.3642030656337738,
-0.0875977948... | |
expression parser? It's not too complicated, but if I can save myself two or three days of coding and a heapload of bugs to fix, it would be worth it.
Try out [Irony](http://irony.codeplex.com/). Though the documentation is lacking, the samples will get you up and running very quickly. Irony is a project for parsing co... | [
0.35896411538124084,
-0.0986190140247345,
0.14380024373531342,
0.30781692266464233,
-0.3247317969799042,
-0.027581343427300453,
0.33887046575546265,
-0.12757720053195953,
-0.08853419125080109,
-0.5835116505622864,
0.13666532933712006,
0.666304349899292,
-0.2759482264518738,
-0.402096599340... | |
and IronRuby). The two should make a good pair.
Oh, and they're both first-class .NET solutions and open source. | [
0.15984749794006348,
0.10131537169218063,
0.05523975193500519,
0.16417287290096283,
-0.05139818787574768,
-0.23969236016273499,
-0.07735060155391693,
0.3011508285999298,
-0.07395114749670029,
-0.5123732686042786,
-0.06230613961815834,
0.6226709485054016,
0.02548503316938877,
0.363593280315... | |
When Executing the following linq to sql statement:
```
var stuff = from l in _db.SqlLinks
select new
{
Link = l, | [
0.2879500687122345,
-0.08146374672651291,
0.5358586311340332,
-0.1810786873102188,
0.37838104367256165,
-0.29326242208480835,
0.25738897919654846,
-0.1513090878725052,
-0.13783834874629974,
-0.4496569335460663,
-0.3094020187854767,
0.2885183095932007,
-0.3736148476600647,
0.295665979385376... | |
Rating = (from v in l.SqlLinkVotes
where v.Tag == tagId | [
0.2598697543144226,
-0.37784916162490845,
0.7070415616035461,
0.22192583978176117,
-0.02888663485646248,
-0.3465963900089264,
0.06879158318042755,
-0.4739096760749817,
0.09666608273983002,
-0.3388611674308777,
0.014426475390791893,
0.4608059227466583,
0.0810563862323761,
0.2648505568504333... | |
&& v.VoteDate >= since
select v.Vote).Sum(),
NumberOfVotes = (from | [
0.11388575285673141,
-0.4148567318916321,
0.8179471492767334,
0.09736323356628418,
-0.025889217853546143,
0.3966577649116516,
0.1263592392206192,
-0.6616373658180237,
-0.2620293200016022,
-0.2070082575082779,
0.0035558496601879597,
0.24641446769237518,
-0.17007845640182495,
-0.244911268353... | |
v in l.SqlLinkVotes
where v.Tag == tagId | [
0.06062890589237213,
-0.5464833378791809,
0.7428317666053772,
-0.08778626471757889,
-0.05478912591934204,
-0.1062498539686203,
-0.21360604465007782,
-0.1810489296913147,
0.0549263171851635,
-0.5542953610420227,
0.05533958226442337,
0.32901886105537415,
-0.31781890988349915,
0.0798832327127... | |
&& v.VoteDate >= since
select v.Vote).Count(),
NumberOfComments = (from v in l.SqlLinkVotes | [
0.30130377411842346,
-0.3802012503147125,
0.7653569579124451,
-0.06324541568756104,
-0.013914164155721664,
0.1421082615852356,
0.1075362041592598,
-0.6359720826148987,
-0.17286695539951324,
-0.20188787579536438,
0.07326425611972809,
0.272816926240921,
-0.3111637532711029,
-0.05378099903464... | |
where v.Tag == tagId | [
-0.2662593722343445,
0.2699143588542938,
0.23458337783813477,
-0.1936160773038864,
0.17103084921836853,
-0.31823495030403137,
-0.1919482797384262,
0.1660836935043335,
-0.4541805386543274,
-0.17984814941883087,
-0.3131464421749115,
0.17638517916202545,
-0.3329387903213501,
0.162855565547943... | |
&& v.VoteDate >= since
&& v.Comment != "" | [
0.3616742193698883,
-0.1771865338087082,
0.6327905058860779,
0.11164392530918121,
-0.1515200287103653,
0.04552335664629936,
0.17169131338596344,
-0.24588382244110107,
-0.31181931495666504,
-0.1369505524635315,
-0.17382889986038208,
0.2133556455373764,
-0.33027589321136475,
-0.2977650761604... | |
select v.Vote).Count()
};
```
I get a System.InvalidOperationException (null value cannot be assigned to Int32).
Through debugging I've seen that this comes from the Rating property of the dynamic object.
When there are no SqlLinkVotes for a particular link the Sum() results in a null va... | [
0.15319129824638367,
-0.32306280732154846,
0.42899173498153687,
-0.038547541946172714,
-0.10970921814441681,
-0.21311229467391968,
0.35256505012512207,
-0.37702345848083496,
-0.14987632632255554,
-0.2998861074447632,
0.0038609718903899193,
0.41020360589027405,
-0.4936995208263397,
0.396425... | |
Sum() will result in an int, not a nullable int.
I could easily write a stored procedure to get around this, but I thought it was a good way for me to understand linq to sql more.
Please help!
There's a [Connect thread about this](https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=360365... | [
0.3065621256828308,
-0.261074423789978,
0.33266332745552063,
-0.10869141668081284,
-0.2774321436882019,
0.2751661241054535,
0.21599915623664856,
-0.5063232183456421,
-0.13044853508472443,
-0.25993844866752625,
0.08022750914096832,
0.1999700516462326,
-0.25062525272369385,
0.385257691144943... | |
v.Tag == tagId
&& v.VoteDate >=
select v.Vote).Sum()) ?? 0
```
It's worth a try, anyway. | [
0.2515200674533844,
-0.37601321935653687,
0.7164757251739502,
0.15501189231872559,
-0.06943552941083908,
-0.053660161793231964,
0.20321480929851532,
-0.49045923352241516,
-0.00031376464175991714,
-0.24679960310459137,
0.10185126960277557,
0.5622212886810303,
-0.0974951982498169,
-0.2068253... | |
I am trying to use std::for\_each to output the contents of vectors, which may contain different types. So I wrote a generic output function like so:
```
template<typename T> void output(const T& val)
{
cout << val << endl;
}
```
which I would like to use with:
```
std::for_each(vec_out.begin(), vec_out.end(), ... | [
0.2078775018453598,
0.08934806287288666,
0.25620755553245544,
-0.21571201086044312,
-0.22828081250190735,
0.14936001598834991,
0.1905454695224762,
-0.42554301023483276,
-0.06370046734809875,
-0.6323977112770081,
0.0286251250654459,
0.5238373279571533,
-0.712666392326355,
0.1595521867275238... | |
this doesn't work how can I get similar STL functionality without writing manual loops?
I am quite new to C++ and still learning the ropes :-)
Try:
```
std::for_each(vec_out.begin(), vec_out.end(), output<T>);
```
where `vec_out` is a container (`vector`) of type T.
Note: The [`for_each`](http://www.sgi.com/tech/s... | [
0.022985519841313362,
-0.00933544896543026,
0.4481334686279297,
-0.08639734238386154,
-0.2689579725265503,
-0.0901680439710617,
0.045212507247924805,
-0.10740181058645248,
-0.15758705139160156,
-0.39422211050987244,
-0.1299474984407425,
0.5530368089675903,
-0.5838471055030823,
0.1812771260... | |
Is there an AppDomain for every C# program even if we do not specifically create an AppDomain? Why is it required? I have read about third party assemblies crashing the entire application if we do not load them into separate AppDomain. I didn't get that point well. Can anyone explain this also.
`AppDomain` is pretty mu... | [
0.32956746220588684,
0.10882671177387238,
0.06522133946418762,
0.049209918826818466,
-0.002430801512673497,
-0.23769089579582214,
0.26191288232803345,
-0.04427599161863327,
-0.4830416142940521,
-0.4718230664730072,
-0.2508837580680847,
0.30757343769073486,
-0.5865845680236816,
0.0575826503... | |
them (like two separate processes) and malfunction in one will not affect the other. Application domains can be unloaded independently.
As an example, SQL Server use `AppDomain`s to load CLR assemblies safely in its process. | [
0.1198209598660469,
0.3578908443450928,
0.5606927871704102,
0.32261690497398376,
0.1045016199350357,
-0.11959296464920044,
0.043663546442985535,
-0.23172563314437866,
-0.3960045874118805,
-0.21770453453063965,
-0.5376752018928528,
0.39852553606033325,
-0.5157669186592102,
0.302252054214477... | |
I would like to write a script that takes one argument that might look like this:
```
abc(ag)de*
```
`a`, `b`, `c` are literal characters.
`(ag)` means "an 'a' or a 'g'".
`*` means any one letter or number.
I want the script to create an Array of all the possible strings the input could represent. (The purpose is... | [
0.1072743833065033,
0.20499663054943085,
-0.06275157630443573,
0.04909215867519379,
-0.2956070601940155,
0.352632075548172,
0.0428042858839035,
0.08745842427015305,
-0.03583797812461853,
-0.6049849390983582,
-0.22742892801761627,
0.25137758255004883,
-0.47805503010749817,
0.135661795735359... | |
['a', 'g'],
['d'],
['e'],
[
'a', 'b', 'c', 'd', 'e', 'f', 'g',
# etc...
]
]
```
This is where I get stuck. I don't know how to split it up into pieces like that.
Any suggestions on how to approach it?
Here's a pretty compact solution. It's in no way optimized for performance which puts some constrain... | [
-0.36823686957359314,
-0.011245448142290115,
-0.11735329777002335,
0.06437631696462631,
-0.20549781620502472,
0.29602333903312683,
0.21815447509288788,
-0.28460851311683655,
-0.36886727809906006,
-0.8027284741401672,
-0.304729163646698,
0.08135348558425903,
-0.5752285718917847,
0.083697229... | |
a }}.flatten
end
end
def generate_combinations(pattern)
combinations = [""]
pattern.scan(/\(([^)]+)\)|(\*)|(\w+)/) do |group,wildcard,other|
new_suffixes = case
when group : group.split('')
when wildcard : [*'a'..'z']
when other : other
else raise "Unknown match!"
end
co... | [
-0.0606314092874527,
-0.10603637993335724,
0.15679025650024414,
-0.2932802438735962,
0.024155540391802788,
0.18143829703330994,
0.20824165642261505,
-0.7825347185134888,
-0.22169652581214905,
-0.6499677300453186,
-0.4137279987335205,
0.21053095161914825,
-0.6339641213417053,
-0.08701486140... | |
"abcgdeg", "abcadeh",
"abcgdeh", "abcadei", "abcgdei", "abcadej", "abcgdej",
"abcadek", "abcgdek", "abcadel", "abcgdel", "abcadem",
"abcgdem", "abcaden", "abcgden", "abcadeo", "abcgdeo",
"abcadep", "abcgdep", "abcadeq", "abcgdeq", "abcader",
"abcgder", "abcades", "abcgdes", "abcadet", "abcgdet",
"abcadeu", ... | [
0.10512156784534454,
0.514201283454895,
-0.12896661460399628,
-0.20543569326400757,
-0.38474196195602417,
0.40170198678970337,
0.24441863596439362,
-0.17133818566799164,
0.039943404495716095,
-0.5946490168571472,
-0.4803999364376068,
0.2951262593269348,
-0.4926760196685791,
-0.088606297969... | |
What is the difficult part of software development that has major impact on final product/output? and How?
What I expect is, in which areas [like technology, requirements..etc] should I concentrate 'more' to develop better applications.
The difficult part of software development is communication: between you and your ... | [
0.3465934097766876,
0.3636031746864319,
-0.1727266162633896,
0.051949918270111084,
0.22795052826404572,
0.15824583172798157,
0.13588739931583405,
0.17764456570148468,
0.02104375697672367,
-0.6328005790710449,
-0.37961724400520325,
0.9469943046569824,
0.20038700103759766,
-0.133619397878646... | |
We can search for specific field on website in a few ways: based on css, name, id, structure, even any text found.
Which way have you decided to use?
What would be best practice for it?
*Edit: I'm asking from developer perspective:
How to write code that it will be easier to test with Selenium by **one** method (th... | [
0.7495535016059875,
0.2234681397676468,
-0.24140897393226624,
0.24635188281536102,
-0.0663628950715065,
-0.40543463826179504,
0.22177688777446747,
0.07407546788454056,
-0.012812402099370956,
-0.5780237913131714,
-0.01923522911965847,
0.1446266919374466,
0.051383860409259796,
0.051239285618... | |
don't want your tests to break because someone changes style from heading1 to heading2.
We have opted for a solution that is mainly based on id's. Sometimes we even instrument the HTML with id's just to be able to selenium test.
Additionally we also look for texts (application texts), but internationalization makes ... | [
0.7620903253555298,
-0.15004119277000427,
0.2815203070640564,
0.30185216665267944,
0.016428399831056595,
-0.41550812125205994,
0.4921696186065674,
0.17661665380001068,
-0.29556161165237427,
-0.5293958783149719,
0.13743674755096436,
-0.27646979689598083,
-0.20442232489585876,
-0.11480002105... | |
Need to testcase a complex webapp which does some interacting with a remote 3rd party cgi based webservices.
Iam planing to implement some of the 3rd party services in a dummy webserver, so that i have full controll about the testcases.
Looking for a simple python http webserver or framework to emulate the 3rd party i... | [
0.3330147862434387,
-0.0781269371509552,
-0.10269326716661453,
0.21746774017810822,
0.04451579973101616,
-0.13762372732162476,
0.28879204392433167,
0.008201506920158863,
0.39721107482910156,
-0.5988888144493103,
0.1884009689092636,
0.7495617270469666,
-0.2638760507106781,
-0.05717822909355... | |
`8080`!! Pretty easy huh? | [
0.2849401831626892,
0.3874521553516388,
0.150466188788414,
0.13721269369125366,
0.09566744416952133,
-0.43563514947891235,
0.3698628842830658,
0.3236587941646576,
-0.062020670622587204,
-0.3402550518512726,
0.18455111980438232,
0.9442803263664246,
-0.15539933741092682,
-0.39651262760162354... | |
Put simply a Soundex Algorithm changes a series of characters into a code. Characters that produce the same Soundex code are said to sound the same.
* The code is 4 characters wide
* The first character of the code is always the first character of the word
Each character in the alphabet belongs in a particular group ... | [
0.11135656386613846,
0.19554762542247772,
0.39641743898391724,
-0.2434929609298706,
-0.037843555212020874,
0.5076280236244202,
0.4319949746131897,
-0.31246912479400635,
0.07178780436515808,
-0.645733118057251,
-0.2909139394760132,
0.4103420078754425,
-0.10897672921419144,
0.115200825035572... | |
6
* Every other letter in the alphabet belongs to group 0.
Other notable rules include:
* All letters that belong to group 0 are ignored UNLESS you have run out of letters in the provided word, in which case the rest of the code is filled with 0's.
* The same number cannot be used twice or more consecutively, thus th... | [
0.3476909399032593,
0.2402818650007248,
0.3585193157196045,
-0.19852663576602936,
-0.06787537783384323,
0.11704237014055252,
0.7518120408058167,
-0.4093252420425415,
-0.12257339805364609,
-0.4469662308692932,
-0.38572928309440613,
0.32149219512939453,
-0.21196354925632477,
0.51717597246170... | |
y is apart of group 0 so it's ignored, there are no more characters so the 3 remaining characters in the code are 0).
I've created a function that has passed to it 1) a 128 character array which is used in create the Soundex code and 2) an empty 5 character array which will be used to store the Soundex code at the com... | [
0.1622704714536667,
0.1956445425748825,
0.3613516390323639,
0.03914160653948784,
0.019599847495555878,
0.3210681676864624,
0.10693974047899246,
-0.32967305183410645,
0.49070924520492554,
-0.5207863450050354,
0.2571421265602112,
0.6796088218688965,
-0.134877547621727,
0.3354191780090332,
... | |
I do not know why.
```
// CREATE A SOUNDEX CODE
// * Parameter list includes the string of characters that are to be converted to code and a variable to save the code respectively.
void SoundsAlike(const char input[], char scode[])
{
scode[0] = toupper(input[0]); // First character of the string is added to the co... | [
0.010294755920767784,
-0.09193681180477142,
0.6538223028182983,
-0.34749940037727356,
0.33163610100746155,
0.44556576013565063,
0.0815758928656578,
-0.5553662776947021,
0.3627609610557556,
-0.616431474685669,
-0.1352950483560562,
0.6153426170349121,
-0.18859243392944336,
0.2295493036508560... | |
|| (input[matchCount] == 'f')) && (scode[codeCount-1] != 1))
{
scode[codeCount] = 1;
codeCount++;
}
else if(((input[matchCount] == 'c') || (input[matchCount] == 'g') || (input[matchCount] == 'j') || (input[matchCount] == 'k') || (input[matchCount] == 'q') || (input[matchC... | [
-0.7988911271095276,
0.00040837080450728536,
0.6522071957588196,
-0.30638429522514343,
0.19247597455978394,
0.12380675971508026,
0.2379050999879837,
-0.7935536503791809,
0.24829238653182983,
-0.33347761631011963,
-0.6905170679092407,
0.46269741654396057,
-0.4352496862411499,
-0.15655606985... | |
{
scode[codeCount] = 2;
codeCount++;
}
else if(((input[matchCount] == 'd') || (input[matchCount] == 't')) && (scode[codeCount-1] != 3))
{
scode[codeCount] = 3;
codeCount++;
} | [
-0.5574575662612915,
-0.2994188666343689,
0.5767667889595032,
-0.373379647731781,
0.0383082740008831,
0.006541709415614605,
0.36440637707710266,
-0.8133803009986877,
0.19170069694519043,
-0.40987759828567505,
-0.46800968050956726,
0.395720511674881,
-0.3923678994178772,
-0.2628108561038971... | |
else if((input[matchCount] == 'l') && (scode[codeCount-1] != 4))
{
scode[codeCount] = 4;
codeCount++;
}
else if(((input[matchCount] == 'm') || (input[matchCount] == 'n')) && (scode[codeCount-1] != 5))
{
scode[codeCount] = 5; | [
-0.41818997263908386,
-0.23454806208610535,
0.43687888979911804,
-0.5360085964202881,
0.4348301589488983,
0.14141738414764404,
0.19201888144016266,
-0.6718152761459351,
0.1192033514380455,
-0.2703619599342346,
-0.6716705560684204,
0.6335628032684326,
-0.2470478117465973,
-0.309153378009796... | |
codeCount++;
}
else if((input[matchCount] == 'r') && (scode[codeCount-1] != 6))
{
scode[codeCount] = 6;
codeCount++;
}
matchCount++;
}
while(codeCount < 4)
{ | [
-0.3174707591533661,
-0.1457902044057846,
0.7661564350128174,
-0.4270274341106415,
0.07060781121253967,
0.20886322855949402,
0.2662385404109955,
-0.770361065864563,
0.07369203865528107,
-0.3144681453704834,
-0.40434762835502625,
0.5326473712921143,
-0.4160391688346863,
-0.11291667073965073... | |
scode[codeCount] = 0;
codeCount++;
}
scode[4] = '\0';
cout << scode << endl;
}
```
I'm not sure if it's because of my overuse of strlen, but for some reason while the program is running within the first while loop none of the characters are actually converted to code (i.e. none of the if statemen... | [
-0.18986207246780396,
0.12754687666893005,
0.2958761155605316,
-0.30122628808021545,
-0.0031526770908385515,
0.050916239619255066,
0.6708980202674866,
-0.14083828032016754,
-0.2255597710609436,
-0.3771819770336151,
-0.022593755275011063,
0.22270679473876953,
-0.26052621006965637,
0.0548869... | |
the first ascii character while the latter is the character '1'. | [
-0.3014252185821533,
-0.436630517244339,
-0.10782165825366974,
0.2725951671600342,
-0.2980063259601593,
0.12377363443374634,
-0.14716757833957672,
0.0662442073225975,
-0.1376756876707077,
-0.4578416645526886,
-0.7386637926101685,
0.10546831041574478,
-0.518065869808197,
0.25378212332725525... | |
From any kind of scalar, what regex could I use to match the first five lines of it and discard the rest?
Odd request, but this should do it:
```
#!/usr/bin/perl
use strict;
use warnings;
my $s = join '', map { "$_\n" } 1 .. 9;
my ($first) = $s =~ /^((?:.*\n){0,5})/;
my ($last) = $s =~ /((?:.*\n){0,5})$/;
print "f... | [
0.011426369659602642,
-0.016052545979619026,
0.5771809816360474,
-0.2761615514755249,
0.008928266353905201,
-0.22184932231903076,
0.5245567560195923,
-0.09717340767383575,
-0.23563933372497559,
-0.4065239727497101,
-0.2718362510204315,
0.3067080080509186,
-0.4732205271720886,
0.30818438529... | |
file: $!";
my @first;
while (my $line = <$fh>) {
push @first, $line;
last if $. == 5;
}
#rewind the file just in case the file has fewer than 10 lines
seek $fh, 0, 0;
my @last;
while (my $line = <$fh>) {
push @last, $line;
#remove the earliest line if we have to many
shift @last if @last == 6;
}
... | [
0.00541257718577981,
-0.39618632197380066,
1.0068215131759644,
-0.2933802306652069,
0.28471773862838745,
0.34279006719589233,
0.03110092505812645,
-0.08881291002035141,
-0.14876550436019897,
-0.5799747109413147,
-0.5503750443458557,
0.511908233165741,
-0.21830405294895172,
0.22569550573825... | |
We have a web part that uploads a document to a document library. The user uploading the document may not have access to the destination location, so the code adding the file executes within a [RunWithElevatedPrivileges](http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.a... | [
0.41366007924079895,
-0.04090236499905586,
0.7680850028991699,
0.16762641072273254,
0.1938137412071228,
-0.19604386389255524,
0.3126603662967682,
-0.4768587350845337,
-0.19061173498630524,
-0.5944931507110596,
-0.2810184359550476,
0.05257837846875191,
-0.32127097249031067,
0.37618690729141... | |
targetWeb.AllowUnsafeUpdates = true;
SPFile newFile = files.Add(filename, file);
SPListItem item = newFile.Item;
// TODO: Insert code to set Modified By
item.SystemUpdate();
}
}
}
```
The "Modified By" field needs to be set to the name of the current user ... | [
0.49512603878974915,
-0.29196274280548096,
0.6850382685661316,
-0.39731788635253906,
0.10212044417858124,
0.08280211687088013,
0.3661801517009735,
-0.2825316786766052,
0.02481379732489586,
-0.6257399320602417,
-0.14912563562393188,
0.3346324563026428,
-0.46198710799217224,
0.03336203098297... | |
above), but none of the following attempts have worked:
```
item["Modified By"] = SPContext.Current.Web.CurrentUser;
item["Author"] = SPContext.Current.Web.CurrentUser;
item["Modified By"] = new SPFieldUserValue(
SPContext.Current.Web, SPContext.Current.Web.CurrentUser.ID,
SPContext.Current.Web.CurrentUser.Name);
i... | [
0.11386249214410782,
0.17930620908737183,
0.7944216132164001,
-0.10788442939519882,
0.423910915851593,
-0.020403504371643066,
0.38317185640335083,
-0.43651893734931946,
-0.39293932914733887,
-0.4633961021900177,
-0.4255943298339844,
0.39804989099502563,
-0.47115206718444824,
0.614870727062... | |
up the current user and not the system account when running within SPSecurity.RunWithElevatedPrivileges. (Whether it should be used like this is another question.) | [
0.20984074473381042,
-0.1790732443332672,
0.6674694418907166,
0.059127047657966614,
0.08671428263187408,
-0.29738253355026245,
0.4013984501361847,
-0.08385128527879715,
-0.4080365002155304,
-0.4643280804157257,
-0.15400026738643646,
0.34548208117485046,
-0.14070551097393036,
0.175823614001... | |
In terms of performance, what would work faster? Is there a difference? Is it platform dependent?
```
//1. Using vector<string>::iterator:
vector<string> vs = GetVector();
for(vector<string>::iterator it = vs.begin(); it != vs.end(); ++it)
{
*it = "Am I faster?";
}
//2. Using size_t index:
for(size_t i = 0; i < ... | [
-0.1571546196937561,
-0.09761380404233932,
0.38068777322769165,
0.09038226306438446,
-0.1193271279335022,
0.34202125668525696,
0.2290026992559433,
-0.44917163252830505,
-0.43677636981010437,
-0.7569851279258728,
0.09455354511737823,
0.8583754301071167,
-0.2592771351337433,
-0.3761583268642... | |
slightly **slower** than the operator[] version, but probably not significantly so.
```
#include <vector>
#include <iostream>
#include <ctime>
using namespace std;
int main() {
const int BIG = 20000000;
vector <int> v;
for ( int i = 0; i < BIG; i++ ) {
v.push_back( i );
}
int now = time(0... | [
-0.008090199902653694,
-0.5068946480751038,
0.9023562073707581,
-0.5336532592773438,
0.2195182740688324,
0.4662253260612488,
0.14840812981128693,
-0.5463107824325562,
-0.4217163622379303,
-0.7121443748474121,
-0.2871568202972412,
0.44035616517066956,
-0.2566635310649872,
0.1333524435758590... | |
n += *it;
}
cout << time(0) - now << endl;
now = time(0);
for(size_t i = 0; i < v.size(); ++i) {
n += v[i];
}
cout << time(0) - now << endl;
return n != 0;
}
``` | [
0.11254261434078217,
-0.30235058069229126,
0.5425711274147034,
-0.5550317168235779,
0.46400773525238037,
0.2792399525642395,
0.17147007584571838,
-0.3984021246433258,
-0.27740421891212463,
-0.4573618769645691,
-0.3285409212112427,
0.47947630286216736,
-0.2505790591239929,
0.630111932754516... | |
I've made a simple http server using Twisted, which sends the Content-Type: multipart/x-mixed-replace header. I'm using this to test an http client which I want to set up to accept a long-term stream.
The problem that has arisen is that my client request hangs until the *http.Request* calls self.finish(), then it rece... | [
0.4105922281742096,
0.04904574528336525,
0.5069739818572998,
0.020605118945240974,
-0.2590596675872803,
-0.08938576281070709,
0.23262706398963928,
-0.34084904193878174,
-0.2541450560092926,
-0.7395617365837097,
0.01247911062091589,
0.33882394433021545,
-0.3051104247570038,
0.40914043784141... | |
writeBoundary(self):
self.write("--%s\n" % (self.BOUNDARY))
def writeStop(self):
self.write("--%s--\n" % (self.BOUNDARY))
def process(self):
self.setHeader('Connection', 'Keep-Alive')
self.setHeader('Content-Type', "multipart/x-mixed-replace;boundary=%s" % (self.BOUNDARY))
... | [
-0.19968654215335846,
0.29120227694511414,
0.6570297479629517,
-0.10022488236427307,
-0.07595333456993103,
0.034344397485256195,
0.3841039538383484,
-0.3642004728317261,
-0.31529563665390015,
-0.6181135773658752,
-0.2401326447725296,
0.32106438279151917,
-0.4864428639411926,
0.004217361565... | |
self.writeBoundary()
time.sleep(2)
self.write("Content-Type: text/html\n")
s = "<html>bar</html>\n"
self.write("Content-Length: %s\n\n" % (len(s)))
self.write(s)
self.writeBoundary()
time.sleep(2)
self.write("Content-Type: text/html\n")
s = "<htm... | [
0.002152013359591365,
0.34971335530281067,
0.5037091970443726,
-0.5357743501663208,
-0.2446102350950241,
0.06463497132062912,
0.25093013048171997,
-0.49094292521476746,
-0.17329467833042145,
-0.8744086623191833,
-0.030397949740290642,
0.7227085828781128,
-0.3687748610973358,
-0.10677354782... | |
self.write(s)
self.writeStop()
self.finish()
class StreamProtocol(http.HTTPChannel):
requestFactory = StreamHandler
class StreamFactory(http.HTTPFactory):
protocol = StreamProtocol
if __name__ == '__main__':
from twisted.internet import reactor
reactor.listenTCP(8800, StreamFactory(... | [
0.19943536818027496,
-0.15597006678581238,
0.6606295108795166,
-0.10893354564905167,
-0.12411294132471085,
-0.0049829441122710705,
0.4047825336456299,
-0.28785109519958496,
-0.10592511296272278,
-0.7889647483825684,
0.2104952484369278,
0.6722434759140015,
-0.11363189667463303,
0.2524480819... | |
python
import time
from twisted.web import http
from twisted.internet import protocol
from twisted.internet import reactor
from twisted.internet import defer
def wait(seconds, result=None):
"""Returns a deferred that will be fired later"""
d = defer.Deferred()
reactor.callLater(seconds, d.callback, resul... | [
-0.09612049162387848,
-0.27246153354644775,
0.22897616028785706,
-0.08795902878046036,
-0.2989216446876526,
0.3702121078968048,
0.41041961312294006,
-0.3302884101867676,
-0.316529244184494,
-0.21048736572265625,
-0.058460742235183716,
0.46979236602783203,
-0.4972504675388336,
-0.0023528153... | |
self.setHeader('Content-Type', "multipart/x-mixed-replace;boundary=%s" % (self.BOUNDARY))
self.writeBoundary()
self.write("Content-Type: text/html\n")
s = "<html>foo</html>\n"
self.write("Content-Length: %s\n\n" % (len(s)))
self.write(s)
self.writeBoundary()
yi... | [
-0.1730954945087433,
0.21689389646053314,
0.5080254673957825,
-0.3447290360927582,
-0.25736138224601746,
0.1610838919878006,
0.3685915768146515,
-0.5155400633811951,
-0.2468334287405014,
-0.398112952709198,
-0.028930099681019783,
0.7443976998329163,
-0.45494452118873596,
0.0030615802388638... | |
%s\n\n" % (len(s)))
self.write(s)
self.writeBoundary()
yield wait(2)
self.write("Content-Type: text/html\n")
s = "<html>baz</html>\n"
self.write("Content-Length: %s\n\n" % (len(s)))
self.write(s)
self.writeStop()
self.finish()
class StreamProt... | [
-0.2869197428226471,
-0.04073648527264595,
0.5207806825637817,
-0.21097677946090698,
0.05349714308977127,
0.08961457759141922,
0.2803323566913605,
-0.37463074922561646,
-0.10762736946344376,
-0.9852057695388794,
-0.35242965817451477,
0.547587513923645,
-0.2620205581188202,
0.19610896706581... | |
reactor.listenTCP(8800, StreamFactory())
reactor.run()
```
That works in firefox, I guess it answers your question correctly. | [
0.5336794853210449,
0.17433437705039978,
0.32324206829071045,
-0.02777446061372757,
0.1352088749408722,
-0.4627983272075653,
0.29004189372062683,
0.1648971140384674,
-0.12447348237037659,
-0.47903546690940857,
0.1427486687898636,
0.7739551663398743,
-0.2742682993412018,
0.22880826890468597... | |
It seems that in IE8,
if the page using https protocol needs to import a .js file,
the .js file also needs to use the https protocol.
```
<script type="text/javascript" src="http://xxx/yourjs.js"></script>
```
works in all browsers except IE8
```
<script type="text/javascript" src="https://xxx/yourjs.js"></scrip... | [
0.18109877407550812,
0.40068843960762024,
0.423200786113739,
-0.2578679025173187,
-0.15312425792217255,
-0.4270226061344147,
0.5207554697990417,
0.0469544343650341,
-0.1270224004983902,
-0.5953676700592041,
-0.28185394406318665,
0.43491286039352417,
-0.5908381342887878,
0.10461778938770294... | |
the user in all browsers - I'd expect IE8 to do the same but maybe it's a new "feature" to silently ignore it.
You should use the same protocol that the request is on, or failing that always HTTPS (though this will be slower for the user and put more load on your server).
You could specify the URL without the scheme ... | [
0.24454601109027863,
0.008890512399375439,
0.6050578355789185,
-0.18200735747814178,
-0.16023513674736023,
-0.23915454745292664,
0.4600139558315277,
-0.11868375539779663,
-0.09426158666610718,
-0.9271660447120667,
-0.20380106568336487,
0.39154669642448425,
-0.24673300981521606,
-0.16771951... | |
> A relative reference beginning with
> two slash characters is termed a
>
> network-path reference, as defined by
> in Section 3. Such
>
> references are rarely used. | [
0.0446196086704731,
-0.10498806089162827,
0.34453463554382324,
0.2117999643087387,
0.015987807884812355,
-0.02563866786658764,
0.12266626209020615,
0.2630760371685028,
0.01957755908370018,
-1.0135743618011475,
-0.2465778887271881,
0.22298410534858704,
-0.374731183052063,
0.2296756356954574... | |
I have an IE bug that I'm not sure how to fix.
Using jQuery I'm dynamically moving a menu to appear on an element on mouseover.
My code (simplified) looks something like this:
```
$j = jQuery.noConflict();
$j(document).ready(function()
{
//do something on the menu clicks
$j('div.ico').click(function() { ale... | [
0.04905979335308075,
-0.013640154153108597,
0.5831884145736694,
-0.48051688075065613,
0.30350083112716675,
0.09567217528820038,
0.2555789053440094,
-0.15159951150417328,
-0.16065768897533417,
-0.8046163320541382,
-0.10378870368003845,
0.6400235295295715,
-0.46882927417755127,
0.01409283559... | |
with all events from it's old
//parent to the end of this one.
$j(this).append($j(menuSelector).show());
});
}
```
This menu doesn't seem to register events correctly for the menu after it's been moved in IE7, IE8 and IE8-as-IE7 (yeah MS, that's really a 'new rendering engine' in IE8, we all belie... | [
0.1462317556142807,
-0.22205625474452972,
0.5185086727142334,
-0.05898597836494446,
0.1395586133003235,
-0.23721353709697723,
0.2652556300163269,
0.057995207607746124,
-0.4475209712982178,
-0.6905642151832581,
-0.004000591579824686,
0.32674306631088257,
-0.3179963231086731,
0.3916906118392... | |
with a CSS :hover selector). It works on the first mouseover but then persists.
2. The click event doesn’t fire – however with the dev tools you can manually call it and it is still subscribed.
You can see (2) in IE8's dev tools:
1. Open [page](http://keithhenry.googlepages.com/WeirdIEbug.htm) in IE8
2. Open dev tool... | [
0.3091835081577301,
-0.23125000298023224,
0.6026651263237,
0.08139587193727493,
-0.05040067434310913,
-0.4122171103954315,
0.46974125504493713,
-0.0194139052182436,
-0.14643803238868713,
-0.47249460220336914,
-0.02408739924430847,
0.3956717848777771,
-0.34726205468177795,
0.010163824073970... | |
because of IE's venerable engine)?
Is there a workaround?
Could it be something that I'm doing wrong that just happens to work as expected in everything else?
Strangely, although your click event isn't firing in IE, if you change it to either mousedown or mouse up it works as you'd expect although you still have your... | [
0.20298467576503754,
-0.10224206745624542,
0.5704135298728943,
-0.21814240515232086,
0.13190023601055145,
-0.23409053683280945,
0.7133587598800659,
-0.02185041271150112,
0.03474375233054161,
-0.8435654640197754,
-0.22114400565624237,
0.9577931761741638,
-0.4157799780368805,
-0.104123257100... | |
Is it worth extracting private methods for code that only gets called once in a class, or leaving the code in the parent method (maybe) with a comment that says what it does?
*It is always worth extracting methods if it clarifies the intent of the code.*
This is especially true for very long methods. While comments ar... | [
0.20124058425426483,
-0.24066221714019775,
-0.31032559275627136,
0.5971829891204834,
-0.07533163577318192,
-0.05820745974779129,
0.13113011419773102,
-0.07906564325094223,
-0.3576016426086426,
-0.3087804615497589,
0.107930488884449,
0.5358235239982605,
0.03952507674694061,
-0.4356518685817... | |
necessarily TDD), it will also be much, much easier to unit test smaller chunks of methods -- although you might have to make your methods public for that, depending on the testing framework you use.
The point is, you can't go wrong with smaller methods, especially if they have descriptive names. | [
0.5409053564071655,
-0.060247037559747696,
-0.2820035517215729,
0.6023843288421631,
-0.3508162200450897,
-0.436489075422287,
0.4112982153892517,
-0.23620356619358063,
-0.009269955568015575,
-0.26434385776519775,
-0.1565055251121521,
0.45138412714004517,
-0.029594849795103073,
0.00640629557... | |
I have a problem modernizing a Java WebStart application under Java 6 u 13 (the latest at this moment)
We desire to use the new mechanism to have several master configuration files each with their own configuration , which then "include" another jnlp file which is autogenerated to ensure that the jar list is accurate.... | [
0.273525595664978,
0.229417622089386,
0.08709768950939178,
-0.09747625142335892,
0.2038077712059021,
-0.395000696182251,
0.3671349287033081,
-0.03871355578303337,
-0.3279244899749756,
-0.7269021272659302,
0.00827464647591114,
0.5557293891906738,
-0.29651036858558655,
0.41558459401130676,
... | |
<vendor>...</vendor>
<description>...</description>
<description kind="short">...</description>
<homepage href="http://....jnlp"/>
<icon href="http://....gif"/>
<!-- <offline-allowed/> -->
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.... | [
-0.154591366648674,
-0.04866784065961838,
0.9287263751029968,
-0.35170572996139526,
-0.09226985275745392,
0.17760272324085236,
-0.2703142762184143,
-0.39149272441864014,
-0.6595600843429565,
-0.5756728649139404,
-0.6176480650901794,
0.4966578185558319,
-0.0998891144990921,
0.12715952098369... | |
<resources>
<jar href="A.jar" />
<jar href="B.jar" />
<jar href="logback-classic-0.9.14.jar" />
<jar href="logback-core-0.9.14.jar" />
<jar href="slf4j-api-1.5.6.jar" />
</resources>
<component-desc />
</jnlp>
```
I have tried putting the proprty in the extension.jnlp too. Did not help. The JV... | [
0.18711653351783752,
-0.011214643716812134,
0.45148083567619324,
-0.20980191230773926,
-0.1371067613363266,
0.0674867257475853,
0.379431813955307,
-0.4169142544269562,
-0.2141391634941101,
-0.6886935830116272,
-0.37366819381713867,
0.7559400200843811,
-0.06595597416162491,
0.24150343239307... | |
I have a treeview which when visible takes too much space on the web page. Hence the user is asked to click a button to make this visible :) But the issue here is that when that treeview ( located within a element ) is made visible it MOVES the other elements down but i would prefer if it OVERLAYS ( something like what... | [
0.18832314014434814,
-0.06576299667358398,
0.4809005558490753,
0.08740078657865524,
-0.0898372232913971,
-0.08824216574430466,
0.14348840713500977,
-0.07248233258724213,
-0.24072527885437012,
-0.5196675062179565,
-0.021987440064549446,
0.28119680285453796,
-0.22650226950645447,
-0.08321461... | |
:P as it would be too much load for just one Control !!!
You can use CSS to either position the element absolutely or float it, both of which remove it from the page flow.
Here is what the MDC says about the `float` property (see [here](https://developer.mozilla.org/En/CSS/Float)):
> The float property specifies that... | [
0.07304856181144714,
-0.04977421090006828,
0.5451073050498962,
0.04977627098560333,
0.20452187955379486,
-0.06512033194303513,
-0.3254294693470001,
-0.2959555983543396,
-0.024761205539107323,
-0.25167372822761536,
-0.43231311440467834,
0.25811663269996643,
-0.38764792680740356,
-0.10273867... | |
at a specified position relative to its closest positioned ancestor or to the initial containing block.
Steve | [
-0.28623825311660767,
0.03609005734324455,
-0.004051384516060352,
-0.01879042573273182,
0.09668467193841934,
0.2996850609779358,
0.11769255250692368,
0.4598715901374817,
-0.01470569521188736,
-0.4804610013961792,
-0.500113308429718,
-0.24308252334594727,
0.1277025192975998,
0.2150109559297... | |
I have a List that uses a custom ItemRenderer. Is there a way for the owner (List) to dispatch a custom event I have created, to all instances of it's ItemRenderer?
For example, I want to dispatch an event that will add text to a textbox within the item renderer. One or more item renderers will be able to respond to t... | [
0.2775018513202667,
0.022240983322262764,
0.4366435110569,
-0.024269122630357742,
-0.2479078620672226,
0.133964404463768,
0.1575932651758194,
-0.33683788776397705,
-0.5322244763374329,
-0.5811488032341003,
-0.04910967871546745,
0.6274730563163757,
-0.3368797302246094,
0.19606740772724152,
... | |
assume), you can still do it indirectly, e.g. through a delegate of the ItemRenderer's class object. Make an instance of a subclass of EventDispatcher a static property of the ItemRenderer class, and in your ItemRenderer constructor, register an event handler with it:
```
public class ItemRenderer {
public static ... | [
-0.2853810489177704,
-0.5616623163223267,
0.3441172242164612,
-0.15186452865600586,
0.19895793497562408,
0.1794474869966507,
0.07580344378948212,
-0.25062912702560425,
-0.41458508372306824,
-0.4595569372177124,
-0.3919927477836609,
0.6945803761482239,
-0.2394953817129135,
0.073709890246391... | |
you create theList (either in ActionScript or in the initialize event handler of your MXML component), make a new YourCustomEventDispatcher, give to it a reference to theList, and add it to ItemRenderer. YourCustomEventDispatcher registers a private event handler for YourCustomEvent with theList, and just redispatches ... | [
0.31907597184181213,
-0.4948880672454834,
0.7155061960220337,
0.3031621277332306,
0.206182062625885,
-0.05588408187031746,
0.006110735237598419,
-0.12652455270290375,
-0.35039860010147095,
-0.6263536810874939,
-0.22953835129737854,
0.3393338620662689,
-0.5406590104103088,
-0.05216106772422... | |
Let's say I have this base class:
```
abstract public class Base {
abstract public Map save();
abstract public void load(Map data);
}
```
to my surprise I could do this in a derived class:
```
public class Derived extends Base {
@Override
public Map<String, String> save() { //Works
...
... | [
0.22647757828235626,
-0.14854171872138977,
0.2143130600452423,
-0.14147014915943146,
-0.14850415289402008,
-0.18885383009910583,
0.05088423192501068,
-0.41624706983566284,
-0.01091412641108036,
-0.7164806127548218,
0.14145442843437195,
0.4801595211029053,
-0.16427625715732574,
0.0997842624... | |
data) { // Fails
...
}
...
}
```
What is happening here? Why can I use a specialized return type but not a specialized parameter type?
What's even more confusing is that if I keep the original declaration of `load`, I can just assign it to the more special type:
```
public class Derived ex... | [
0.15477986633777618,
-0.3652436137199402,
0.5653254985809326,
0.0013955839676782489,
0.13570217788219452,
-0.18537573516368866,
0.0983172133564949,
-0.5357524156570435,
-0.039146147668361664,
-0.6514275670051575,
-0.10964679718017578,
0.5506449937820435,
-0.37377575039863586,
0.35320875048... | |
// Works without further casting
...
}
...
}
```
There's an implicit conversion from the specialized type to the raw type - that's always "safe" because someone using the raw type can't make any assumptions. So someone expecting to get a raw `Map` back from a method doesn't mind if they get a `M... | [
-0.022081315517425537,
-0.022520199418067932,
-0.05134566128253937,
0.050936296582221985,
0.08940359205007553,
-0.10368602722883224,
0.19335947930812836,
-0.17379242181777954,
-0.012381155043840408,
-0.7938383221626282,
-0.1516655534505844,
0.5643351674079895,
-0.2688271701335907,
-0.07433... | |
and values. That's completely legal by the base type declaration of `load`.
Leaving generics aside, your methods are a bit like this:
```
public abstract class Base
{
public abstract Object save();
public abstract void load(Object x);
}
public class Derived extends Base
{
@Override
public String save... | [
0.5265865921974182,
-0.2218007743358612,
0.24595803022384644,
-0.01564372517168522,
-0.019158225506544113,
-0.2528062164783478,
0.04954756423830986,
-0.48825931549072266,
-0.1520911455154419,
-0.16691650450229645,
-0.061979275196790695,
0.6503181457519531,
-0.3385428190231323,
0.2833338975... | |
Fine - it might return a string
b.load (new Integer(0)); // Has to compile - but the override wouldn't work!
``` | [
0.4572873115539551,
0.1951763778924942,
0.29135286808013916,
-0.05662589892745018,
0.26589980721473694,
-0.399455726146698,
0.44625532627105713,
-0.5150241255760193,
-0.14725817739963531,
-0.10563310235738754,
-0.0008779501658864319,
0.8301116228103638,
-0.4494948387145996,
0.1194207519292... | |
I am trying to navigate between controllers using `ActionLink`. I will tell my problem with an example.
I am on Index view of Hat controller, and I am trying to use below code to create a link to Details action of Product controller.
```
<%= Html.ActionLink("Details", "Details", "Product", new { id=item.ID }) %>
```... | [
0.021274719387292862,
-0.13805656135082245,
0.8259222507476807,
0.046234868466854095,
-0.057997968047857285,
0.20646677911281586,
-0.1313154250383377,
-0.2608209252357483,
-0.26587390899658203,
-0.9004382491111755,
0.18607644736766815,
0.36854809522628784,
-0.30941450595855713,
0.206088781... | |
me to what I am doing wrong. Thanks
PS: I am using the default route setting that comes with MVC
```
routes.MapRoute("Default", "{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" } );
```
What you want is this overload :
```
//linkText, actionName, controllerNam... | [
-0.09025394171476364,
-0.06491440534591675,
0.6913207769393921,
0.10251016169786453,
-0.043717559427022934,
0.004640137776732445,
0.4260751008987427,
-0.07131652534008026,
-0.34915801882743835,
-0.8314837217330933,
-0.09716461598873138,
0.44033610820770264,
-0.37204110622406006,
0.13808466... | |
I'm passing View name as parameter in a Table Valued Function, and I want to fetch some data from that view by building a dynamic SQL and executing it by sp\_executesql().
when try to execute the function, I get the error:
Only functions and extended stored procedures can be executed from within a function.
DBMS: SQL ... | [
-0.22997233271598816,
-0.09889332205057144,
0.48566609621047974,
-0.23804393410682678,
-0.271323025226593,
0.05384528264403343,
0.447475403547287,
-0.5369154214859009,
-0.48939865827560425,
-0.4094748795032501,
-0.09598460793495178,
0.7389135360717773,
-0.2764286398887634,
0.04858348518610... | |
@Desc nvarchar(500) OUTPUT',
@Code = @Code,
@Desc=@Desc OUTPUT;
```
Well, you could wrap the dynamic SQL in an extended stored procedure. That would work, but I'd (strongly) advise against doing it.
SQL Server requires user-defined functions to be deterministic (with the exception of the aforementione... | [
0.08866037428379059,
-0.34532663226127625,
0.2309429943561554,
0.20665153861045837,
-0.15153783559799194,
-0.14961925148963928,
0.259236603975296,
-0.22026367485523224,
-0.2632337808609009,
-0.21990537643432617,
-0.07992684096097946,
0.8196443319320679,
-0.502282440662384,
0.11120305955410... | |
inside a function.
There are other approaches you can use, such as prepopulating a table variable with your data, modifying your schema, and so forth, that will depend on your performance requirements and how you have the schema set up. | [
0.1739514321088791,
-0.1670054793357849,
0.17634417116641998,
0.21572382748126984,
0.2803843915462494,
0.102874256670475,
0.025266243144869804,
-0.30115851759910583,
-0.08903200179338455,
-0.4453063905239105,
-0.23550768196582794,
0.5690078735351562,
-0.27926984429359436,
-0.17298598587512... | |
I am using D6 Professional and need to create a text file in a specific format from lots of small strings already in memory. For performance reasons, I am considering using a TMemoryStream to collate the file data, and then write it out to disk in one go via a TFileStream.
But I have a half forgotten memory (probably ... | [
-0.05595525726675987,
0.042801886796951294,
0.17040662467479706,
-0.04983345419168472,
-0.017758328467607498,
-0.1855769008398056,
0.5129693746566772,
0.1326627880334854,
0.020802533254027367,
-0.9002432823181152,
-0.27517935633659363,
0.4923458695411682,
-0.08686035871505737,
-0.092773370... | |
Classes.pas):
NewCapacity := (NewCapacity + (MemoryDelta - 1)) and not (MemoryDelta - 1);
(/OFFTOPIC)
Adding to my worry is that the conclusion of a related question
[Using MemoryStream to write out to XML](https://stackoverflow.com/questions/486843/using-memorystream-to-write-out-to-xml)
was **not** to use... | [
-0.22874335944652557,
-0.21046464145183563,
0.3416536748409271,
-0.0012286498676985502,
0.04131527617573738,
0.09783904999494553,
0.19314700365066528,
-0.03986086696386337,
-0.1313130408525467,
-0.6345696449279785,
-0.16908247768878937,
0.5457309484481812,
-0.11889424920082092,
-0.12444116... | |
overhead. | [
0.4765619933605194,
0.3789415657520294,
0.16439862549304962,
0.11328088492155075,
-0.0004577071813400835,
-0.33922892808914185,
-0.49966341257095337,
0.42665183544158936,
-0.4186174273490906,
-0.7258483171463013,
0.22921806573867798,
0.3068273663520813,
-0.1585681140422821,
0.2774399816989... | |
I was having a conversation last week with a coworker about architecture (real architecture, as in designing buildings). During our talk it came up that architectural blueprints give an architect, civil engineer, and contractor all the detail they need to build something. It got both of us thinking about the state of s... | [
0.5798167586326599,
0.3629342317581177,
0.011439092457294464,
0.4060436487197876,
0.25591611862182617,
0.2511560022830963,
-0.06546410173177719,
-0.038336772471666336,
-0.3073309659957886,
-0.5242881178855896,
0.258864164352417,
0.3787323832511902,
0.3021066188812256,
0.08401157706975937,
... | |
using elaborate UML diagrams?
Then again, is having a large set of software blueprints even useful? After all refactoring and rebuilding software is much cheaper than rebuilding a skyscraper. Are architectural blueprints the wrong analogy for software design? Is there a better analogy that you can think of?
Architectu... | [
0.6059951782226562,
-0.09039302170276642,
0.33297717571258545,
0.4485952854156494,
0.09288673847913742,
0.10203779488801956,
0.22984002530574799,
-0.10594036430120468,
-0.2655393183231354,
-0.7263110280036926,
0.10909344255924225,
0.16630038619041443,
0.09537043422460556,
0.056518536061048... | |
a given model(Say, OO) is how software should be, while in *reality*, software is always breaking those abstractions, because the models are not a good representation.
In a sense, this ties into a question of explanatory power and computability: a house blueprint is a fixed representation with a fixed expression, and ... | [
0.19788359105587006,
0.2602795958518982,
0.1324567347764969,
0.34081414341926575,
0.2595624029636383,
0.25009602308273315,
0.08513633161783218,
-0.06756869703531265,
-0.12842290103435516,
-0.6697186827659607,
-0.43743178248405457,
0.23875583708286285,
-0.3568659722805023,
0.374318540096282... | |
of software *vis-a-vis* a house is mathematically larger, meaning the representational techniques must be correspondingly more computationally powerful. And this is where UML *et al.* falls down - they are not homomorphic with real software. | [
-0.11139888316392899,
0.38367921113967896,
0.18008722364902496,
0.09754857420921326,
-0.027379358187317848,
-0.04472317546606064,
0.11058210581541061,
-0.2306794375181198,
-0.4268742501735687,
-0.7259315252304077,
-0.34141457080841064,
0.2894567847251892,
-0.12903925776481628,
0.3470559120... | |
Do you know any way to remove the border from a JComboBox in Java? I try the following code
```
public class ComboFrame extends JFrame {
public ComboFrame() {
JPanel container = new JPanel();
JComboBox cmb = new JComboBox(new String[] { "one", "two" });
cmb.setBorder(BorderFactory.createEm... | [
0.35171759128570557,
-0.21742339432239532,
0.4896499514579773,
-0.22727645933628082,
0.26721295714378357,
0.05079635605216026,
0.10347691923379898,
-0.34888756275177,
-0.30779221653938293,
-0.8157185912132263,
-0.03542960435152054,
0.18499340116977692,
-0.532525360584259,
0.211157009005546... | |
Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
EventQueue.invokeLater(new Runnable() {
public void run() {
new ComboFrame().setVisible(true);
}
});
}
```
Don't ask why would someone want to remove the border from a combobx... I guess it does no... | [
0.30893513560295105,
-0.38585323095321655,
0.46573370695114136,
-0.12328935414552689,
0.3771784007549286,
-0.1759004145860672,
0.6303527355194092,
-0.17609445750713348,
-0.3222511410713196,
-0.7825323343276978,
-0.09949791431427002,
0.3468394875526428,
-0.4459441900253296,
0.09058540314435... | |
with
```
cmb.setUI(new BasicComboBoxUI());
```
This makes the border go away, but alters the L&F, and I need to keep the Windows L&F if possible.
Thanks.
I did a bit of research and found [this bug](http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4515838)
I tried it for myself and it does seem to affect the bor... | [
-0.009734905324876308,
-0.11043127626180649,
0.6305731534957886,
-0.30202728509902954,
0.22447776794433594,
-0.036143556237220764,
0.47246095538139343,
-0.40317267179489136,
-0.3176570236682892,
-0.6127567887306213,
-0.09670030325651169,
0.5235109925270081,
-0.548801839351654,
-0.044360227... | |
((AbstractButton) combo.getComponent(i)).setBorderPainted(false);
}
}
```
It is important to note that at the bottom of the bug entry, you can read the following:
> The JButton maintains it's own border so JComponent **paintBorder()** and **paintComponent()** has no awareness of the JComboBox border.
Good luck,... | [
0.41313719749450684,
0.07009341567754745,
0.36851832270622253,
-0.4931979179382324,
0.3233376145362854,
0.0035906489938497543,
0.6848347187042236,
0.2912948429584503,
-0.28560227155685425,
-0.7882043123245239,
0.03724366053938866,
0.7026565074920654,
-0.35651102662086487,
0.053439743816852... | |
We are shopping for Business Rules Engines.
We want to make our core application customizable to different customers with slightly different requirements.
The people who would actually do the customizations are analysts. I.e. non-programmers who are technically skilled (usually have a degree in sciences).
What are the... | [
0.5700322389602661,
0.207753986120224,
0.1428547352552414,
0.21235936880111694,
0.11145615577697754,
-0.29702988266944885,
0.048606693744659424,
-0.1900044083595276,
-0.25948116183280945,
-0.48011359572410583,
-0.053699638694524765,
0.5933400392532349,
-0.3090786337852478,
-0.2708533406257... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.