text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
connection = new SqlConnection(_connect);
DataContext dc = new DataContext(connection);
Table<NodeRoleEntity> siteMapTable = dc.GetTable<NodeRoleEntity>();
var rootQuery = from ne in siteMapTable
where ne.ParentID == null
select ne;
foreach (NodeRoleEntity rootNode in rootQuery)
{
Si... | [
-0.18885745108127594,
-0.2166244089603424,
0.6443685293197632,
-0.14062657952308655,
0.19542349874973297,
0.2687181830406189,
0.3363611698150635,
-0.07650768756866455,
-0.2595428228378296,
-0.7271281480789185,
-0.3687952160835266,
0.1570885330438614,
-0.13090567290782928,
0.513302147388458... | |
(from SiteMapNode cr in _provider.RootNode.ChildNodes
where cr.Description == cultureToken
select cr).First();
int menuCount = 0;
foreach (SiteMapNode node in cultureRoot.ChildNodes)
{
_RenderMenu(node, menuCount.ToString(), writer);
menuCount++;
}
```
It is the nodes in `cultureRoot.Ch... | [
-0.21153248846530914,
0.09083780646324158,
0.7103297710418701,
-0.17755675315856934,
0.6608642935752869,
0.3227614462375641,
0.13247007131576538,
-0.0892971083521843,
-0.023238956928253174,
-0.8434818387031555,
-0.30763882398605347,
0.22117777168750763,
-0.05869239196181297,
0.476191997528... | |
== cultureToken
orderby cr.DisplayOrder
select cr
).First();
``` | [
0.21247121691703796,
0.2904711067676544,
0.7891819477081299,
-0.07482387870550156,
0.18625034391880035,
0.05967147648334503,
0.0765591636300087,
-0.1855374574661255,
-0.05023853853344917,
-0.48718422651290894,
-0.5809118747711182,
0.2643554210662842,
0.10282205045223236,
0.5029230117797852... | |
Let's suppose I have this object:
```
[Serializable]
public class MyClass
{
public int Age { get; set; }
public int MyClassB { get; set; }
}
[Serializable]
public class MyClassB
{
public int RandomNumber { get; set; }
}
```
The XmlSerializer will serialize the object like that:
```
<MyClass>
<Age>0<... | [
-0.07820092141628265,
0.1993986815214157,
0.25998300313949585,
-0.13673165440559387,
0.15330548584461212,
-0.17130564153194427,
0.02389605902135372,
0.029905328527092934,
-0.33024126291275024,
-0.757629930973053,
-0.15973521769046783,
0.15478141605854034,
-0.12063123285770416,
0.6840946674... | |
d5p1:nil="true" />
<MyClassB>
<RandomNumber>4234</RandomNumber>
</MyClassB>
</MyClass>
```
By reading the MSDN documentation I found this:
> You cannot apply the IsNullable property to a member typed as a value type because a value type cannot contain nullNothingnullptra null reference (Nothing i... | [
0.029266810044646263,
-0.08476636558771133,
0.36842238903045654,
-0.13354822993278503,
-0.20009861886501312,
-0.13407723605632782,
0.33388686180114746,
-0.3270987570285797,
-0.0844697430729866,
-0.5838756561279297,
-0.08048432320356369,
0.40299803018569946,
-0.08393025398254395,
0.22607035... | |
is always set to something. The serialization can't make the decision to serialize it or not based on it's current value.
I tried with the attributes, but it didn't work out. I tried creating an agecontainer object and manipulate it's serialization with attributes, but it didn't work out.
What I really want is:
```
... | [
0.22229181230068207,
-0.018252216279506683,
0.2019227147102356,
0.09089954942464828,
0.257107675075531,
-0.14845290780067444,
-0.000741023919545114,
0.1114746555685997,
-0.37455376982688904,
-0.6570618748664856,
-0.026598190888762474,
0.17374135553836823,
-0.1577121913433075,
0.54706835746... | |
much more complex, and I would like to not handle the serialization myself.
I just discovered this. `XmlSerialier` looks for a `XXXSpecified` boolean property to determine if it should be included. This should solve the problem nicely.
```
[Serializable]
public class MyClass
{
public int Age { get; set; }
[XmlIgno... | [
0.19418582320213318,
0.0184689499437809,
0.4752667546272278,
-0.2771029770374298,
0.19680318236351013,
-0.003014250425621867,
0.20084507763385773,
-0.18846438825130463,
-0.3801887035369873,
-0.6553251147270203,
-0.2471136599779129,
0.421055406332016,
-0.11560093611478806,
0.587637424468994... | |
StringWriter(builder))
{
serializer.Serialize(writer, obj);
return builder.ToString();
}
}
static void Main(string[] args)
{
var withoutAge = new MyClass() { Age = -1 };
var withAge = new MyClass() { Age = 20 };
Serialize(withoutAge); // = <MyClass><MyClassB>0</MyClassB></MyClass>
Serialize(withAg... | [
0.19740307331085205,
-0.1048838272690773,
0.7306030988693237,
-0.3917636573314667,
0.2443082183599472,
0.04167446121573448,
0.3422011733055115,
-0.3581726849079132,
-0.2190176546573639,
-0.6034771203994751,
-0.1423916518688202,
0.455341100692749,
0.013787397183477879,
0.31668713688850403,
... | |
is a field named "MyFirstName" you would also create a field named "MyFirstNameSpecified" that instructs the XmlSerializer whether to generate the XML element named "MyFirstName". | [
-0.03555947169661522,
-0.03711681440472603,
0.3506777584552765,
0.10881944000720978,
-0.15211820602416992,
-0.38385170698165894,
-0.11854060739278793,
0.15845665335655212,
0.24185918271541595,
-0.6006893515586853,
-0.2561241388320923,
0.3666403889656067,
-0.006376347038894892,
0.0173316709... | |
I'm coding an interactive applet with [Piccolo](http://code.google.com/p/piccolo2d/) and I need to include a Gaussian curve (aka [Normal distribution chart](http://en.wikipedia.org/wiki/Normal_distribution)) inside it.
I imagine any kind of Java implementation would be enough, but I can't find any. Ideally, I'd like t... | [
0.4829811751842499,
0.016828028485178947,
0.3009015917778015,
0.2074822038412094,
-0.14284060895442963,
0.2448292374610901,
-0.17075511813163757,
0.07827159017324448,
-0.41896435618400574,
-0.6403955817222595,
0.19462883472442627,
0.2954694628715515,
0.02301768958568573,
-0.397007018327713... | |
works, but Google threw up [this code to plot a Gaussian distribution](http://vase.essex.ac.uk/software/JavaPlot/code/ac/essex/graphing/charts/continuous/Gaussian.java.html).
The home page for this project is [here](http://vase.essex.ac.uk/software/JavaPlot/).
If Piccolo doesn't perform the plotting for you, I would... | [
0.36264029145240784,
-0.2520584166049957,
0.6108094453811646,
0.060881610959768295,
-0.0909666121006012,
-0.1729760468006134,
0.10498560965061188,
-0.14295148849487305,
-0.21667377650737762,
-0.4022133946418762,
0.11969613283872604,
0.33576077222824097,
-0.11450479924678802,
-0.34914952516... | |
I have something like the following in a string:
```
blah blah
BEGINIGNORE
this stuff should get stripped out
ENDIGNORE
more stuff here
```
I would like to do this (perl syntax): s/BEGINIGNORE.\*ENDIGNORE//s -- namely, strip out everything between BEGINIGNORE and ENDIGNORE, inclusive.
You would think the follow... | [
-0.12136223167181015,
0.06343372911214828,
0.5112268328666687,
0.013575198128819466,
-0.06330689042806625,
-0.30575984716415405,
0.28025153279304504,
0.18795807659626007,
-0.21427448093891144,
-0.4280796945095062,
-0.42418503761291504,
0.5758116841316223,
-0.41217029094696045,
-0.105419710... | |
long string](https://stackoverflow.com/questions/2257884/bug-in-mathematica-regular-expression-applied-to-very-long-string/2261807#2261807) | [
-0.3838416039943695,
-0.12237001955509186,
0.3940852880477905,
0.0606851652264595,
0.10514171421527863,
-0.16928540170192719,
0.13041774928569794,
-0.06206163391470909,
-0.3104116916656494,
0.29114410281181335,
-0.3049691319465637,
0.4951905310153961,
-0.5323943495750427,
0.220312684774398... | |
Is there any way to detect a change in the Text property of a TextBlock element using events?
(I'm trying to provide an animation for highlighting the TextBlocks whose Text property change within a DataGrid)
As far as I can understand there isn't any textchanged event in TextBlock. Looking at your requirement, I feel ... | [
-0.24202142655849457,
-0.2785232663154602,
0.44861385226249695,
0.1046750620007515,
-0.05523807182908058,
-0.0662001296877861,
0.31036993861198425,
-0.2983730733394623,
-0.42996540665626526,
-0.47997039556503296,
-0.27424851059913635,
0.6307874917984009,
-0.23135598003864288,
-0.1324918270... | |
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0″
To="1.0″ />
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:2″
From="1.0″ To="0.0″ BeginTime="0:0:5″ />
</Storyboard>
... | [
0.23115043342113495,
-0.33114323019981384,
0.1596718430519104,
-0.07155870646238327,
0.19269320368766785,
0.42517152428627014,
0.017516029998660088,
-0.1611713469028473,
-0.3055189847946167,
-0.5260401964187622,
-0.1754092425107956,
0.2778611183166504,
0.0713806226849556,
-0.08807411789894... | |
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
``` | [
-0.3289877474308014,
-0.11079832166433334,
0.06746824830770493,
-0.15405617654323578,
-0.06145375594496727,
-0.290600061416626,
0.13763904571533203,
-0.0314156673848629,
-0.2752527892589569,
-0.46373897790908813,
-0.511993944644928,
0.43384596705436707,
-0.23157352209091187,
-0.11865191161... | |
I'm quite familiar with the System.Diagnostics.Process class. But, I'm wondering about how I can monitor a specific process (i.e. Check to see if it's running every XX mins/secs). I need to be able to checking whether a process is running and if it is, continue with initialising the rest of the program.
Thanks,
-Za... | [
0.300753653049469,
0.24048104882240295,
0.4620109498500824,
0.21181881427764893,
0.18852628767490387,
-0.28739479184150696,
0.19827812910079956,
-0.07896076142787933,
-0.3573695719242096,
-0.6921042203903198,
-0.3797054588794708,
0.5067740082740784,
0.1006358191370964,
0.22683878242969513,... | |
you set [`EnableRaisingEvents`](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.enableraisingevents.aspx) you can listen to its events (including [`Exited`](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited.aspx)). | [
0.12510666251182556,
-0.1889050304889679,
0.4814772307872772,
-0.03804636746644974,
0.3147105872631073,
-0.14947859942913055,
0.210857093334198,
-0.07918927073478699,
-0.042060062289237976,
-0.7428554892539978,
-0.26083850860595703,
0.5593572854995728,
-0.007126167882233858,
-0.17461165785... | |
I want to be able to add or remove IP Security Policies on Windows Server 2003 programmatically with C#.
Normally you'd manipulate these policies manaully through the gpedit.msc snap-in (under Windows Settings -> Local Policies -> IP Security Policies on Local Computer). But I need to be able to add IP filter policies... | [
0.09987148642539978,
-0.30504509806632996,
0.47713130712509155,
0.01121288537979126,
-0.1861298382282257,
-0.33369043469429016,
0.09942298382520676,
0.0019472470739856362,
-0.5009540319442749,
-0.676318347454071,
0.07953421026468277,
0.8829099535942078,
-0.2973048686981201,
0.1013569459319... | |
am doing myself). This is all done through the Win32\_NetworkAdapterConfiguration class. Here's a link to the question I asked about this, with my response to it awhile later after researching it:
[Methods of programatically altering ipsec rules with C#?](https://stackoverflow.com/questions/1609882/methods-of-programa... | [
0.5466110110282898,
-0.04957473278045654,
0.4901706278324127,
0.03075881116092205,
-0.035709530115127563,
-0.5053805112838745,
0.23517711460590363,
-0.42226526141166687,
-0.29899919033050537,
-0.47088623046875,
0.022795433178544044,
0.4780014157295227,
-0.20887979865074158,
0.1584153622388... | |
cmdlet to do IPSec changes.
[Is there a cmdlet in PowerShell 2 to handle ipsec changes?](https://stackoverflow.com/questions/1703205/is-there-a-cmdlet-in-powershell-2-to-handle-ipsec-changes)
Wrapping netsh ipsec THROUGH a powershell pipeline called through System.Management.Automation.PowerShell is what I ended up d... | [
0.034238871186971664,
-0.15229400992393494,
0.64876389503479,
0.02173542231321335,
-0.15397930145263672,
-0.2782745361328125,
0.235214501619339,
-0.09232103079557419,
-0.5502628087997437,
-0.9440031051635742,
-0.19219675660133362,
0.2689143717288971,
-0.43527752161026,
0.1646588295698166,
... | |
Visual studio type library
I'm trying from Delphi to open up Visual Studio (for editing SSRS reports), and load up a particular projectitem from a solution file I have autogenerated.
I have imported the visual studio type library, and can create the object,
and drill through the solution until I have the right Projec... | [
0.2697570323944092,
-0.052408136427402496,
0.3750837445259094,
-0.1530122309923172,
-0.22347263991832733,
-0.08357986062765121,
0.15255680680274963,
-0.10633691400289536,
-0.051307313144207,
-0.8148252367973328,
0.037402551621198654,
0.5658061504364014,
-0.4295528531074524,
0.0467403456568... | |
this type library from in order to use this constant in the ProjectItem.Open method?
```
ProjectItem = interface(IDispatch)
['{0B48100A-473E-433C-AB8F-66B9739AB620}']
.... etc
function Open(const ViewKind: WideString): Window; safecall;
.... etc
```
Thanks!
vsViewKindDesigner = {7651A702-06E5-11D1-8... | [
-0.09444127976894379,
-0.20304936170578003,
0.6080548763275146,
0.03579575940966606,
0.07364759594202042,
-0.048922739923000336,
0.2649749517440796,
-0.18315725028514862,
-0.0867067202925682,
-0.8201775550842285,
-0.15976549685001373,
0.5584553480148315,
-0.44265878200531006,
0.28103443980... | |
I'm writing a console utility to do some processing on files specified on the commandline, but I've run into a problem I can't solve through Google/Stack Overflow. If a full path, including drive letter, is specified, how do I reformat that path to be relative to the current working directory?
There must be something... | [
-0.059283290058374405,
-0.1735076606273651,
0.553438127040863,
-0.016540778800845146,
0.21787837147712708,
0.28555166721343994,
0.16376712918281555,
0.012116101570427418,
-0.28996774554252625,
-0.7199699878692627,
0.1437527984380722,
0.6274409294128418,
-0.36848336458206177,
0.352596580982... | |
.ToString()
.Replace('/', Path.DirectorySeparatorChar)
);
```
As a function/method:
---------------------
```
string GetRelativePath(string filespec, string folder)
{
Uri pathUri = new Uri(filespec);
// Folders must end in a slash
if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString()))
... | [
-0.25673148036003113,
-0.2930089831352234,
0.8601624965667725,
-0.16983087360858917,
0.19007961452007294,
0.26233187317848206,
0.19312965869903564,
-0.10483743995428085,
-0.29194778203964233,
-0.8741046786308289,
-0.39611759781837463,
0.45731469988822937,
-0.4036082923412323,
0.44605234265... | |
This is probably a simple issue for some subclipse guru. My decorator colors don't work in eclipse. I'm guessing that some plugin I have is interfering with it somehow. I'm on the current public release of ganymede. Going to the fonts and colors option area lets me change the decorator text color, but I get no effect i... | [
0.30447667837142944,
0.04537687823176384,
0.3027307093143463,
0.11825194209814072,
0.06199491396546364,
-0.03213730826973915,
-0.11764008551836014,
0.1415584534406662,
-0.25296592712402344,
-0.8224602937698364,
0.14065179228782654,
0.7502893805503845,
0.08377814292907715,
0.117635212838649... | |
other. | [
0.08541025221347809,
0.2802821695804596,
-0.09922865033149719,
0.31537821888923645,
-0.0842428207397461,
0.20834240317344666,
-0.38026177883148193,
-0.15100084245204926,
-0.13669131696224213,
-0.7985894083976746,
-0.1549464762210846,
0.470626562833786,
-0.2068614661693573,
0.38316774368286... | |
I have been interested in learning Rails for some time now and feel now is as good as time as ever to dip in and actually get my hands dirty. I've spent the past week reading every free ebook on Ruby and Ruby on Rails I can find. I just finished reading Ruby Essentials. I have also been playing with <http://tryruby.hob... | [
0.5208937525749207,
0.1646970808506012,
0.06700031459331512,
0.18448705971240997,
-0.19334378838539124,
-0.17892126739025116,
0.3996041715145111,
0.3824487328529358,
-0.03774821385741234,
-0.803238034248352,
0.3185536861419678,
0.6224185824394226,
0.19362647831439972,
0.22516626119613647,
... | |
is a fairly basic Rails app that is a little more in depth than Hello World but not quite up to par with say a forum or blog.
I find its much easier to learn how something works when I can play with already made code and do some trial and error changes.
What I am really looking for is that 'Ohhh, I totally understand... | [
0.2819685637950897,
-0.027423501014709473,
-0.056718599051237106,
0.16284357011318207,
0.04583391174674034,
-0.2439310997724533,
0.29073667526245117,
0.2338513880968094,
-0.15453782677650452,
-0.6021491289138794,
0.25664404034614563,
0.2024015337228775,
0.4260793626308441,
0.38314029574394... | |
they have been exactly what I was looking for when learning rails. They start simple and keep adding more and more functionality. The commentators move at a good pace and subscribing to the lessons is free. | [
0.5426315665245056,
-0.05015289783477783,
0.010649677366018295,
0.3134140968322754,
-0.14106613397598267,
-0.08367109298706055,
0.4127434492111206,
0.31504637002944946,
-0.10505270957946777,
-0.6978623867034912,
0.17936532199382782,
0.7394714951515198,
0.522133469581604,
-0.164714410901069... | |
When using Vim is there a way that `:grep` or `:vimgrep` will color the patterns returned to the buffer?
If you search for the pattern after you've :vimgrep'd it, Vim will highlight it. Just edit the `:vimgrep pattern files` into `:g/pattern/`.
For a richer solution, try [this script](http://vim.wikia.com/wiki/Highlig... | [
0.26433631777763367,
-0.480663001537323,
0.12079020589590073,
0.03601933270692825,
-0.04726673662662506,
-0.040042463690042496,
0.3447316884994507,
0.018257230520248413,
-0.5207719802856445,
-0.7873008847236633,
-0.040765438228845596,
0.43292444944381714,
-0.5500699281692505,
0.03450477123... | |
I'm using Blowfish.NET newest version,but there is one problem.
```
responce = new byte[6]
{
0x00, 0x80 ,0x01, 0x61, 0x00, 0x00
};
byte[] encrypted = new byte[responce.Length];
blowfish.Encrypt(responce, 2, encrypted, 2, input.Length - 2);
```
I called it the right way,I want it to start read/write from the thi... | [
0.015826357528567314,
0.05292060226202011,
0.31719163060188293,
-0.20444880425930023,
0.10380066931247711,
-0.1843147724866867,
0.534670889377594,
-0.042194914072752,
-0.143055722117424,
-0.8319046497344971,
-0.05374406650662422,
0.6237568855285645,
-0.35015928745269775,
0.2799265682697296... | |
int posOut,
int count)
{
uint[] sbox1 = this.sbox1;
uint[] sbox2 = this.sbox2;
uint[] sbox3 = this.sbox3;
uint[] sbox4 = this.sbox4;
uint[] pbox = this.pbox;
uint pbox00 = pbox[ 0];
uint pbox01 = pbox[ 1]; | [
-0.5193873047828674,
-0.203417107462883,
0.3818795382976532,
-0.4702391028404236,
-0.07931525260210037,
0.5016334056854248,
0.31343716382980347,
-0.6488730907440186,
-0.15295545756816864,
-0.4908515512943268,
-0.5521357655525208,
0.05890354886651039,
-0.657142698764801,
-0.671320378780365,... | |
uint pbox02 = pbox[ 2];
uint pbox03 = pbox[ 3];
uint pbox04 = pbox[ 4];
uint pbox05 = pbox[ 5];
uint pbox06 = pbox[ 6];
uint pbox07 = pbox[ 7];
uint pbox08 = pbox[ 8];
uint pbox09 = pbox[ 9]; | [
-0.595095157623291,
-0.24561786651611328,
0.4389488399028778,
-0.2635284662246704,
-0.07008226960897446,
0.23469164967536926,
0.23093900084495544,
-0.2420329600572586,
0.15426912903785706,
-0.5612737536430359,
-0.7521176934242249,
0.053057711571455,
-0.5110986828804016,
-0.4142161905765533... | |
uint pbox10 = pbox[10];
uint pbox11 = pbox[11];
uint pbox12 = pbox[12];
uint pbox13 = pbox[13];
uint pbox14 = pbox[14];
uint pbox15 = pbox[15];
uint pbox16 = pbox[16];
uint pbox17 = pbox[17]; // till this line count is 4
count &= ~(BLOCK_SIZE - | [
-0.1887023001909256,
-0.23483990132808685,
0.5998151302337646,
-0.06674955785274506,
0.06348657608032227,
0.29050275683403015,
0.5669217705726624,
-0.4324822723865509,
0.04531154781579971,
-0.4705047309398651,
-0.5826912522315979,
0.03560277819633484,
-0.3208206295967102,
-0.23555374145507... | |
1); //count becomes 0 after that calc :((
int end = posIn + count; // 2 + 0 = 2
while (posIn < end) //no loop :[
{
uint hi = (((uint)dataIn[posIn + 3]) << 24) |
(((uint)dataIn[posIn + 2]) << 16) | | [
-0.22006168961524963,
-0.25940367579460144,
0.7394474744796753,
-0.5112520456314087,
0.13762015104293823,
0.0084250308573246,
0.3236541450023651,
-0.7864448428153992,
-0.0401146300137043,
-0.2188376486301422,
-0.4252758324146271,
0.26600778102874756,
-0.557435154914856,
-0.2266407310962677... | |
(((uint)dataIn[posIn + 1]) << 8) |
dataIn[posIn ];
uint lo = (((uint)dataIn[posIn + 7]) << 24) |
(((uint)dataIn[posIn | [
-0.16714166104793549,
-0.24509339034557343,
0.7013239860534668,
-0.3668801188468933,
0.4614451825618744,
0.39620697498321533,
-0.05480309575796127,
-0.32120177149772644,
-0.35462895035743713,
-0.38977867364883423,
-0.6742514967918396,
0.4455452561378479,
-0.5138148069381714,
-0.54001706838... | |
+ 6]) << 16) |
(((uint)dataIn[posIn + 5]) << 8) |
dataIn[posIn + 4];
posIn += 8;
hi ^= pbox00; | [
-0.5155918598175049,
-0.328060120344162,
0.9140045046806335,
-0.3569904863834381,
0.007324410602450371,
0.14510248601436615,
0.16440579295158386,
-0.6287477612495422,
-0.020585857331752777,
-0.3294999599456787,
-0.5277721285820007,
0.25713980197906494,
-0.6485574245452881,
-0.1288271993398... | |
lo ^= (((sbox1[(int)(hi >> 24)] + sbox2[(int)((hi >> 16) & 0x0ff)]) ^ sbox3[(int)((hi >> 8) & 0x0ff)]) + sbox4[(int)(hi & 0x0ff)]) ^ pbox01;
hi ^= (((sbox1[(int)(lo >> 24)] + sbox2[(int)((lo >> 16) & 0x0ff)]) ^ sbox3[(int)((lo >> 8) & 0x0ff)]) + sbox4[(int)(lo & 0x0ff)]) ^ pbox02;
lo ^= (((sbox1... | [
-0.09461060166358948,
-0.37579524517059326,
0.576347291469574,
-0.44929492473602295,
0.06535989791154861,
0.6669121384620667,
0.12153739482164383,
-0.9871435761451721,
-0.014706075191497803,
-0.3333963453769684,
-0.5467796325683594,
0.513053297996521,
-0.6282123923301697,
-0.44513273239135... | |
hi ^= (((sbox1[(int)(lo >> 24)] + sbox2[(int)((lo >> 16) & 0x0ff)]) ^ sbox3[(int)((lo >> 8) & 0x0ff)]) + sbox4[(int)(lo & 0x0ff)]) ^ pbox04;
lo ^= (((sbox1[(int)(hi >> 24)] + sbox2[(int)((hi >> 16) & 0x0ff)]) ^ sbox3[(int)((hi >> 8) & 0x0ff)]) + sbox4[(int)(hi & 0x0ff)]) ^ pbox05;
hi ^= (((sbox1... | [
-0.27193501591682434,
-0.3632257282733917,
0.7440434098243713,
-0.3389780819416046,
0.016207199543714523,
0.5329827666282654,
0.2957828938961029,
-1.1261662244796753,
0.026364799588918686,
-0.4450582265853882,
-0.41885459423065186,
0.40016642212867737,
-0.6449014544487,
-0.2810964584350586... | |
lo ^= (((sbox1[(int)(hi >> 24)] + sbox2[(int)((hi >> 16) & 0x0ff)]) ^ sbox3[(int)((hi >> 8) & 0x0ff)]) + sbox4[(int)(hi & 0x0ff)]) ^ pbox07;
hi ^= (((sbox1[(int)(lo >> 24)] + sbox2[(int)((lo >> 16) & 0x0ff)]) ^ sbox3[(int)((lo >> 8) & 0x0ff)]) + sbox4[(int)(lo & 0x0ff)]) ^ pbox08;
lo ^= (((sbox1... | [
-0.09300507605075836,
-0.3932010233402252,
0.5915080308914185,
-0.4136061668395996,
0.11668592691421509,
0.6841073036193848,
0.1037663072347641,
-0.9525869488716125,
-0.031247425824403763,
-0.3300485908985138,
-0.5198317766189575,
0.5341304540634155,
-0.6142520308494568,
-0.434318602085113... | |
hi ^= (((sbox1[(int)(lo >> 24)] + sbox2[(int)((lo >> 16) & 0x0ff)]) ^ sbox3[(int)((lo >> 8) & 0x0ff)]) + sbox4[(int)(lo & 0x0ff)]) ^ pbox10;
lo ^= (((sbox1[(int)(hi >> 24)] + sbox2[(int)((hi >> 16) & 0x0ff)]) ^ sbox3[(int)((hi >> 8) & 0x0ff)]) + sbox4[(int)(hi & 0x0ff)]) ^ pbox11;
hi ^= (((sbox1... | [
-0.2509787678718567,
-0.3227407932281494,
0.8081371784210205,
-0.2644713819026947,
0.027599073946475983,
0.490013986825943,
0.29575058817863464,
-1.1087032556533813,
0.031714726239442825,
-0.4686635434627533,
-0.36660999059677124,
0.35762473940849304,
-0.6017476916313171,
-0.31239798665046... | |
^ pbox12;
lo ^= (((sbox1[(int)(hi >> 24)] + sbox2[(int)((hi >> 16) & 0x0ff)]) ^ sbox3[(int)((hi >> 8) & 0x0ff)]) + sbox4[(int)(hi & 0x0ff)]) ^ pbox13;
hi ^= (((sbox1[(int)(lo >> 24)] + sbox2[(int)((lo >> 16) & 0x0ff)]) ^ sbox3[(int)((lo >> 8) & 0x0ff)]) + sbox4[(int)(lo & 0x0ff)]) ^ pbox14;
... | [
-0.18958121538162231,
-0.27204999327659607,
0.5023391246795654,
-0.3203572630882263,
-0.10111597925424576,
0.6608954668045044,
0.2687995433807373,
-1.0050417184829712,
-0.13085758686065674,
-0.4392826557159424,
-0.42364785075187683,
0.3748917281627655,
-0.5200673341751099,
-0.4945139586925... | |
& 0x0ff)]) ^ pbox15;
hi ^= (((sbox1[(int)(lo >> 24)] + sbox2[(int)((lo >> 16) & 0x0ff)]) ^ sbox3[(int)((lo >> 8) & 0x0ff)]) + sbox4[(int)(lo & 0x0ff)]) ^ pbox16;
lo ^= pbox17;
dataOut[posOut + 3] = (byte)(lo >> 24);
dataOut[posOut + 2] = (byte)(lo >> 16);
da... | [
-0.4375890791416168,
-0.28265804052352905,
0.7039344906806946,
-0.25913164019584656,
0.16272304952144623,
0.46319785714149475,
0.015649203211069107,
-0.8675083518028259,
-0.18499651551246643,
-0.5394278764724731,
-0.5296878218650818,
0.3432964086532593,
-0.48604482412338257,
-0.51724195480... | |
+ 1] = (byte)(lo >> 8);
dataOut[posOut ] = (byte) lo;
dataOut[posOut + 7] = (byte)(hi >> 24);
dataOut[posOut + 6] = (byte)(hi >> 16);
dataOut[posOut + 5] = (byte)(hi >> 8);
dataOut[posOut + 4] = (byte) hi; | [
-0.3653534948825836,
-0.36642125248908997,
0.5398682951927185,
-0.13063569366931915,
0.04726394638419151,
0.2268083095550537,
-0.20021364092826843,
-0.6939616799354553,
-0.3099689185619354,
-0.37080469727516174,
-0.8539419770240784,
0.189712256193161,
-0.44426095485687256,
-0.3334964811801... | |
posOut += 8;
}
return count;
}
```
The blowfish works fine if i pass longer data,but I need to encrypt this one.We've found the problem,but my question is:How to fix it?!
I'm not super familiar with the Blowfish algorithm or, for that matter, the library you're using. But, in general, I'd say tha... | [
0.08371847867965698,
0.1512276828289032,
0.25616103410720825,
-0.08861948549747467,
0.24594466388225555,
-0.16076435148715973,
0.043284039944410324,
-0.04846109077334404,
-0.2679969370365143,
-0.6246128678321838,
-0.15011663734912872,
0.5432512164115906,
-0.43325451016426086,
-0.1878136545... | |
isn't long enough, add a bunch of zeros (or some other character if zeros hold special meaning to you) to the beginning or end of the data before you encrypt it. Then, when you decrypt it, trim the padding characters. | [
0.11903872340917587,
-0.26270395517349243,
-0.05411209911108017,
0.4837624132633209,
0.3497428596019745,
-0.12102515995502472,
-0.032033827155828476,
0.16533246636390686,
0.1155412569642067,
-0.39349398016929626,
-0.29551368951797485,
0.11923173069953918,
0.005418320652097464,
0.0255205202... | |
I'm trying to edit a textbox's text in a Page\_Load form on an ASP.NET page, but when I try to edit TextBox1.Text it throws a NullReferenceException because the TextBox has not yet been instantiated. Specifically what I'm trying to implement is this: <http://www.codeproject.com/KB/user-controls/popupcalendarcontrol.asp... | [
0.11090866476297379,
-0.11487550288438797,
0.30810925364494324,
-0.09754295647144318,
-0.10464900732040405,
-0.12697240710258484,
0.15133783221244812,
-0.016576291993260384,
-0.24019551277160645,
-0.7459832429885864,
0.008802993223071098,
0.24637474119663239,
-0.5353900790214539,
0.0774574... | |
to but it sounds like the page isn't loading the controls properly because they should be available by that point. You can take a look at the [ASP.NET Page Life Cycle](http://msdn.microsoft.com/en-us/library/ms178472.aspx) for more information. | [
0.25115981698036194,
-0.24710120260715485,
0.5116370916366577,
0.20500439405441284,
0.07508248090744019,
-0.21140798926353455,
0.41912347078323364,
0.1507238894701004,
-0.3412531614303589,
-0.22318288683891296,
-0.29566967487335205,
0.578166663646698,
-0.2877523899078369,
0.189776584506034... | |
If I have the following domain object:
```
public class Customer
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual ISet<Order> Orders { get; set; }
public Customer()
{
Orders = new HashedSet<Order>();
}
public virtual void AddOrder(Orde... | [
-0.1848367601633072,
-0.16657443344593048,
0.4811475872993469,
-0.33020561933517456,
0.16020719707012177,
0.2626017928123474,
-0.05340810492634773,
-0.09716983884572983,
-0.0871746838092804,
-0.5483838319778442,
-0.34926050901412964,
0.5232553482055664,
-0.16559520363807678,
0.494824111461... | |
the following NHibernate mapping:
```
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Examples" assembly="Examples">
<class name="Customer">
<id name="Id">
<generator class="guid.comb" />
</id>
<property name="Name" length="50"/>
<set name="Orders" table="CustomerOrde... | [
-0.25383976101875305,
-0.019077902659773827,
0.404965877532959,
-0.09275020658969879,
-0.23926296830177307,
0.2687568962574005,
0.02226521261036396,
-0.6283963322639465,
-0.0009177099564112723,
-0.6528981924057007,
-0.045659422874450684,
0.489053338766098,
-0.31641703844070435,
0.166520088... | |
_repo.Save(c);
var actual = _repo.Find(expected.Id);
Assert.AreEqual(expected.Name, actual.Name);
}
```
Do folks commonly test their persistence layer like this? Making sure that each field is persisted individually? I'm honestly not sure what best practice is for something like this. I can see testing someth... | [
0.47814080119132996,
0.12249691039323807,
0.26821404695510864,
0.00920015387237072,
-0.03313455358147621,
-0.0043215760961174965,
0.29128435254096985,
0.0748477354645729,
-0.3502883017063141,
-0.1742389053106308,
0.24174541234970093,
0.691048800945282,
-0.08623671531677246,
0.2817901968955... | |
it to save. What if someone forgets to map a field, or they have a bogus string length in the mapping?
Are there any tools to automatically generate these kinds of tests in .NET? Or is that "bad"?
if you make sure that you are saving and fetching data in a different sessions then you can effectively make sure that you... | [
0.0491940937936306,
-0.24906262755393982,
-0.23963207006454468,
0.40316224098205566,
-0.29440075159072876,
0.16541709005832672,
0.35211774706840515,
-0.0739818662405014,
-0.029492434114217758,
-0.6431967616081238,
0.399422824382782,
0.5357706546783447,
-0.007349039427936077,
0.013207919895... | |
different sessions. | [
0.5172922611236572,
-0.05950101092457771,
-0.04785699024796486,
0.08296611160039902,
-0.13307175040245056,
0.13972355425357819,
0.1994231790304184,
-0.24886257946491241,
-0.3308836817741394,
-0.36278316378593445,
0.18861603736877441,
0.34019920229911804,
-0.01028558798134327,
-0.0839378163... | |
The implementation used where I work uses about 10 columns in the table: CUSTOMFIELD1, CUSTOMFIELD2 etc. And every time I look at it, I think there must be a better way.
Not everyone will use all 10, some will use 0 and so there these empty columns just staring back at me, begging to be used.
So if there is a better ... | [
0.4736229181289673,
-0.008725473657250404,
0.2495424449443817,
-0.09887733310461044,
-0.111587755382061,
0.4186699688434601,
-0.032143279910087585,
-0.29782137274742126,
-0.45206329226493835,
-0.730828583240509,
0.17926666140556335,
0.49894580245018005,
-0.2099684476852417,
0.0279706083238... | |
I'm thinking of having a column named CUSTOM\_FIELDS, which will store a path to a file containing the custom fields' descriptions, names, types etc. in a format like XML, JSON or YAML which I could transform back into an object. And that's just the custom field's definiton, there's the whole matter of how I save conte... | [
0.672483503818512,
0.21896803379058838,
0.3495728075504303,
0.1035965159535408,
-0.04121631383895874,
0.18894964456558228,
0.01601901464164257,
0.31455567479133606,
-0.40331530570983887,
-0.5670586824417114,
0.10486805438995361,
0.5779512524604797,
-0.23751766979694366,
0.07651220262050629... | |
luxury & other times defining an extra 2 custom fields just works.
Create a separate table - CustomerFields with columns:
* customer\_id (int),
* field (varchar),
* value (varchar),
* datatype (varchar)
Now by finding all entries with customer\_id='CustomerID' in CustomerFields table you can assign as many variables ... | [
0.14971652626991272,
-0.0711197555065155,
0.4978298246860504,
0.15307751297950745,
-0.051203034818172455,
0.33171939849853516,
-0.14623859524726868,
-0.2170536071062088,
-0.14675861597061157,
-0.35782748460769653,
0.21423354744911194,
0.9605311155319214,
0.14226409792900085,
-0.02656579948... | |
Is there any way to get ASP.Net to compile different folders independently?
I have a Web app that uses some commercial software. The admin UI for this software is in a single folder -- there are about a 1,000 files in there, all told. (I've looked through it -- it ain't the greatest code ever written...)
This folder ... | [
0.6504949331283569,
0.1496872901916504,
0.3515097498893738,
0.14409607648849487,
-0.2198830097913742,
0.08634311705827713,
0.3534858524799347,
-0.04935850575566292,
-0.29520174860954285,
-0.9029480218887329,
0.10106020420789719,
0.31338876485824585,
0.1729409098625183,
-0.12667204439640045... | |
on a simple code change.
Sometimes it just gets stuck -- I'll be waiting and waiting and I'll just hit F5 for giggles, and -- bam! -- there it is. It apparently compiled sometime in the last 10 minutes but forgot to tell the browser about it...
How do I get this folder out of the general compilation? I never change a... | [
0.337907612323761,
0.148085817694664,
0.05623010918498039,
0.16820897161960602,
0.01135615911334753,
0.04324810951948166,
0.13612306118011475,
0.2770599126815796,
-0.6251422166824341,
-0.5605905652046204,
0.018454918637871742,
0.12048539519309998,
-0.2025240808725357,
0.2147074192762375,
... | |
then use a robot (eg. [pywikipediabot](http://pywikipediabot.sourceforge.net/) is easy to use) to get rid of all the internal links. | [
-0.007680980954319239,
-0.014892159029841423,
0.4351462423801422,
0.4347244203090668,
0.1311502605676651,
-0.28900694847106934,
0.4516351521015167,
0.08238262683153152,
-0.2815801501274109,
-0.6690564751625061,
-0.5596659779548645,
0.28383761644363403,
-0.1463555097579956,
0.20052622258663... | |
I'm currently working on a project that behaves differently depending on whether it is a public holiday or not (amongst other constraints, obviously). To this end, I'm trying to create a table that contains the date and what day of the week it is (considering 'holiday' to be an eighth 'day of the week').
I have a tabl... | [
0.3621214032173157,
0.09703437238931656,
0.507864773273468,
0.170124813914299,
-0.1382347047328949,
0.19093452394008636,
0.23789574205875397,
0.15884040296077728,
-0.3339516222476959,
-0.2548796236515045,
-0.052275095134973526,
0.020473381504416466,
-0.16355159878730774,
0.371349036693573,... | |
I have it at the moment, while I'm testing.
```
INSERT INTO holiday
(holidaydate)
SELECT sysdate FROM dual;
SELECT sysdate,
(
CASE
WHEN sysdate IN
(SELECT h.holidaydate FROM holiday h)
THEN 'holiday'
ELSE TO_CHAR(sysdate , 'day')
END)
FROM dual;
```
Unfortunately, it currently... | [
0.18629318475723267,
0.12259979546070099,
0.6332659125328064,
0.031198568642139435,
-0.31702920794487,
0.19935141503810883,
0.43796026706695557,
0.19348187744617462,
-0.26141268014907837,
-0.2758219242095947,
-0.38568148016929626,
0.32768547534942627,
0.10150333493947983,
0.309451878070831... | |
a few variations and they don't seem to have worked thus far.
Any suggestions?
I think your problem is that it will almost never reach this case:
```
CASE
WHEN sysdate IN
(SELECT h.holidaydate FROM holiday h)
```
Because, when you insert **SYSDATE** into the **holiday** table, it gets inserted with date... | [
0.32301485538482666,
0.20076441764831543,
0.7028869986534119,
0.16699182987213135,
0.014247524552047253,
0.10314184427261353,
0.3797834813594818,
-0.10086475312709808,
-0.3689629137516022,
-0.5693578720092773,
-0.42130377888679504,
0.1936269998550415,
-0.02347503788769245,
0.03833735734224... | |
I need to gain access to the files and directories that the current IPrincipal has access to via the Directory.GetDirectories() and Directory.GetFiles() methods, without listing the other files. The process itself is running as NETWORK SERVICE, so it must change the principal to the current user (via IPrincipal) for th... | [
0.2283519208431244,
-0.01557154394686222,
0.5467321872711182,
0.3534693419933319,
0.2850911319255829,
-0.27967822551727295,
0.28050556778907776,
0.18394039571285248,
-0.2681209146976471,
-0.4376572072505951,
-0.07622895389795303,
0.6045641303062439,
-0.12413212656974792,
0.4370179772377014... | |
user token. This token can then be used to obtain a WindowsIdentity, which is then used to generate an impersonation context. Within this context scope, you can then access the file system *as* the impersonated user.
Of course, you will need to store the user name and password for this approach to work.
First, define... | [
-0.009508793242275715,
-0.0015213681617751718,
0.5078959465026855,
-0.06996917724609375,
0.12491478770971298,
0.12303110957145691,
0.2268909364938736,
-0.1578587144613266,
0.10460187494754791,
-0.7604191899299622,
-0.2546437978744507,
0.3170669376850128,
-0.3669900894165039,
0.156811475753... | |
public static extern bool LogonUser( String lpszUsername,
String lpszDomain, String lpszPassword,
int dwLogonType, int dwLogonProvider, ref IntPtr phToken
);
[DllImport( "kernel32.dll", CharSet = CharSet.Auto )]
public extern static bool CloseHandle( IntPtr handle );
}
```
Then, use the... | [
-0.2216867208480835,
-0.0746302530169487,
0.730495274066925,
0.008750797249376774,
0.23256079852581024,
0.12225710600614548,
0.06766550242900848,
-0.03954672813415527,
-0.009296697564423084,
-0.4207736551761627,
-0.47824257612228394,
0.744239330291748,
-0.46807774901390076,
0.1859591305255... | |
password,
WindowsAPI.LOGON32_LOGON_INTERACTIVE, WindowsAPI.LOGON32_PROVIDER_DEFAULT,
ref _userToken
) )
{
int errorCode = Marshal.GetLastWin32Error();
throw new System.ComponentModel.Win32Exception( errorCode );
}
return new WindowsIdentity( _userToken );
}
```
And fin... | [
-0.031864233314991,
0.060267820954322815,
0.4863893389701843,
0.12418131530284882,
0.2998204827308655,
-0.040146101266145706,
0.5439543128013611,
-0.13043133914470673,
-0.10690822452306747,
-0.5047116875648499,
-0.3938296139240265,
0.6320510506629944,
-0.3237883448600769,
0.289855837821960... | |
var directories = new List<string>();
var di = new DirectoryInfo( searchPath );
directories.AddRange( di.GetDirectories().Select( d => d.FullName ) );
return directories;
}
}
```
Finally it is important to clean up the windows handle using the IDisposable pattern, using the stored \_user... | [
-0.3035939633846283,
-0.048546720296144485,
0.6442852020263672,
-0.10471342504024506,
0.19658733904361725,
-0.07272159308195114,
0.4915440082550049,
-0.19337931275367737,
-0.22856679558753967,
-0.5890820026397705,
-0.384611576795578,
0.4683464467525482,
-0.2911466062068939,
0.3042216598987... | |
I have a 2GB text file on my linux box that I'm trying to import into my database.
The problem I'm having is that the script that is processing this rdf file is choking on one line:
```
mismatched tag at line 25462599, column 2, byte 1455502679:
<link r:resource="http://www.epuron.de/"/>
<link r:resource="http://www.... | [
-0.04026443883776665,
0.3313230276107788,
0.3293059468269348,
-0.03780105710029602,
-0.10339172184467316,
0.23401032388210297,
0.211215540766716,
0.10808475315570831,
-0.3648751378059387,
-0.706479012966156,
-0.0932716354727745,
0.48651188611984253,
-0.34051451086997986,
0.0715225115418434... | |
Hi I seem to be having an issue trying to align an H1 tag to the left. I know it is something in my template.css file but I can't work out what.
[Have a look >](http://www.digiflipconcepts.com/smokinhot/index.php?page=shop.product_details&product_id=19&flypage=flypage_smokin.tpl&pop=0&option=com_virtuemart&Itemid=5)
... | [
0.16174475848674774,
-0.0077811349183321,
0.8095461130142212,
0.08029771596193314,
-0.22373172640800476,
-0.203725203871727,
0.3258816599845886,
-0.32688820362091064,
0.04150101915001869,
-0.4144653379917145,
0.04019041359424591,
0.4795931577682495,
-0.1064271628856659,
0.07682188600301743... | |
I need JavaScript working almost perfectly in my application that should be able to access web content and let user take a control of it. However, webbrowser component pops new windows in separate instance / application of Internet Explorer and dotBrowser doesn't work with JavaScript properly.
Please, give me some adv... | [
0.32272714376449585,
0.24465477466583252,
0.21109358966350555,
0.12166965007781982,
-0.2615499198436737,
-0.29567405581474304,
0.17188718914985657,
0.02760341390967369,
-0.008950572460889816,
-0.7647843956947327,
0.03926233947277069,
0.6498885750770569,
-0.37329739332199097,
-0.01908758655... | |
We've [already learned how to switch which branch points to what](https://stackoverflow.com/questions/21848/switch-branch-names-in-git) using `git branch -m`. If I do this, is it going to make life difficult for the other people pulling from my repository?
Say I do a bunch of stuff on a branch `topic1` and then do a
... | [
0.5508162975311279,
-0.06701109558343887,
0.45364120602607727,
0.04786033183336258,
0.2954908013343811,
-0.16551882028579712,
0.17511644959449768,
-0.15441375970840454,
-0.4321291446685791,
-0.2981097400188446,
-0.14187489449977875,
0.29567450284957886,
0.03828463330864906,
0.4489897787570... | |
commits after pushing them and leaving other developers with dangling objects?
I'm not exactly sure what your repo looks like but here's the worst-case scenario.
Suppose your `origin` repository looks like this
```
origin:
o---o---A---B---C master
```
And your local repository looks like this,
```
JimPuls:
o---... | [
0.004409887362271547,
-0.08321055769920349,
0.3846680521965027,
-0.21016159653663635,
-0.041493870317935944,
-0.0980425626039505,
0.2812281548976898,
0.029139302670955658,
-0.6384439468383789,
-0.47772958874702454,
-0.4752333462238312,
0.5462159514427185,
-0.48192298412323,
0.2919281721115... | |
that'll be a non-fast-forward update. After the push, the `origin` repository will look like this:
```
origin:
o---o---A...B...C (B & C are orphaned commits)
\
D---E---F master
```
This can be cruel to your friends who may have done commits on top of `C`. For example, if Sally was working with y... | [
0.2734100818634033,
0.033508721739053726,
0.17299127578735352,
0.22582082450389862,
0.3136560618877411,
-0.07952890545129776,
-0.19555041193962097,
0.03159864991903305,
-0.3578772246837616,
-0.49195489287376404,
0.019972063601017,
0.6077964901924133,
0.0793844610452652,
0.5002754330635071,... | |
G---H---I master
```
Now, if you do your non-fast-forward push and Sally does a `fetch` her repository will look like this:
```
Sally:
D---E---F origin/master
/
o---o---A---B---C
\
G---H---I master
```
Now Sally has to figure out how to get her work (G, H,... | [
-0.2408200204372406,
-0.0021095392294228077,
0.5997416377067566,
0.16448910534381866,
0.060216765850782394,
0.15573422610759735,
-0.2772082984447479,
-0.1592257171869278,
-0.43760454654693604,
-0.3360998332500458,
-0.2671908438205719,
0.37429946660995483,
0.027509169653058052,
0.5648082494... | |
into the repository. If she simply does a merge with `origin/master` then the changes in B and C will be back in the repository (oops!). Instead, she'll have to `cherry-pick` or `rebase` her G-H-I changes onto `origin/master`.
It's cool that Git lets you do that but it's kind of asking for trouble. You're really hopi... | [
0.3853541910648346,
-0.21013040840625763,
0.2014082819223404,
0.26192325353622437,
0.014554796740412712,
-0.1362759917974472,
0.13952888548374176,
0.35394206643104553,
-0.382889062166214,
-0.4244101941585541,
-0.35640376806259155,
0.25491487979888916,
0.16573147475719452,
0.545063734054565... | |
*is* a fast-forward and there are no problems. | [
0.20508524775505066,
-0.09112381190061569,
0.3870776295661926,
0.25795868039131165,
-0.2102201282978058,
-0.09343007206916809,
0.07228784263134003,
0.15169626474380493,
-0.0797761008143425,
-0.6280087828636169,
-0.18186821043491364,
0.254177063703537,
-0.13714177906513214,
-0.1355550289154... | |
The title speaks for itself ....
Does choice of container affects the speed of the default std::sort algorithm somehow or not? For example, if I use list, does the sorting algorithm just switch the node pointers or does it switch the whole data in the nodes?
I don't think `std::sort` works on lists as it requires a r... | [
0.1833672672510147,
0.09433694928884506,
0.14462122321128845,
0.28459376096725464,
-0.1985563039779663,
-0.3852613866329193,
0.05593156814575195,
0.09537017345428467,
-0.2731676697731018,
-0.3409201204776764,
-0.12780119478702545,
0.39358654618263245,
-0.0557481087744236,
0.457366913557052... | |
uses the iterators you provide to move elements around. The faster those iterators work in terms of accessing and assigning an element, the faster the `std::sort` would work. | [
0.10059314966201782,
-0.09235740453004837,
0.05129999294877052,
0.15647409856319427,
0.2512942850589752,
-0.013446102850139141,
-0.20868439972400665,
-0.2747563421726227,
-0.35194292664527893,
-0.5489037036895752,
-0.32076945900917053,
0.12022558599710464,
-0.37676599621772766,
-0.27411493... | |
The winform ListView doesn't seem to have an easy way to cancel the SelectedIndexChanged event. I don't see a SelectedIndexChanging event either.
The code is my attempt. However the hightlight is gone and I was wondering if I need to color the selection also or if there's a better way to cancel. \_prevSelectedIndex is... | [
-0.04449808970093727,
-0.3385689854621887,
0.5562142729759216,
-0.05300119146704674,
-0.338718056678772,
-0.21504069864749908,
0.14420464634895325,
-0.09302803128957748,
-0.22540317475795746,
-0.4311177134513855,
-0.1877889335155487,
0.6481715440750122,
-0.20010000467300415,
0.329398214817... | |
that `list<>` provides a `sort` method but it's completely separate from `std::sort`.
The choice of container does matter. STL's `std::sort` relies on iterators to abstract away the way a container stores data. It just uses the iterators you provide to move elements around. The faster those iterators work in terms of ... | [
-0.10222496837377548,
-0.15172772109508514,
0.16137143969535828,
0.15751393139362335,
-0.13620907068252563,
-0.11727278679609299,
-0.30799710750579834,
-0.0963495522737503,
-0.33111414313316345,
-0.3898349106311798,
-0.14918704330921173,
0.13096366822719574,
-0.33282068371772766,
0.0146983... | |
I have a class hierarchy looks like this:
```
class Post < ActiveRecord::Base; end
class Project < Post; end
class ProjectDesignWall < Project; end
```
There's a controller that fetches data like so:
```
@projects = Project.find(:all, :include => [:project_image_photos,:user])
```
In `development`, this runs the ... | [
0.19749116897583008,
-0.12565068900585175,
0.2824755609035492,
0.05156863480806351,
-0.019815457984805107,
-0.18079118430614471,
0.0958375409245491,
-0.2185433954000473,
-0.04703907668590546,
-0.698699414730072,
0.029898088425397873,
0.23992161452770233,
-0.2545163333415985,
0.559905529022... | |
happening, and is there any way to get it to at least behave consistantly, if not outright fix the problem?
There is an open ticket for this bug here:
<https://rails.lighthouseapp.com/projects/8994/tickets/188-single-table-inheritance-bug-only-in-production-environment>
The solution is listed at the bottom of this tic... | [
0.11999370157718658,
0.0021152144763618708,
0.27796950936317444,
-0.10657401382923126,
0.11928223818540573,
-0.23051026463508606,
0.6748085021972656,
0.19139204919338226,
-0.40026503801345825,
-0.5580398440361023,
-0.03841414302587509,
0.37348780035972595,
-0.6454493999481201,
0.1307989805... | |
Rails have decided not to use it in their own projects and therefore do not put time into making sure that it is well supported. Here's a blurb that briefly explains why you should not use it and suggests an alternative: <http://www.matthewpaulmoore.com/ruby-on-rails-code-quality-checklist#sti>
My own personal experie... | [
0.3714609146118164,
-0.1657687872648239,
-0.10020533949136734,
0.12617675960063934,
-0.1423400491476059,
-0.16185054183006287,
0.5414206981658936,
0.423612117767334,
-0.24119047820568085,
-0.4001580476760864,
0.24203982949256897,
0.10053717344999313,
-0.03609001636505127,
0.256390810012817... | |
I have BS in Computer Science, and thus have experience developing software that runs at the command line or with a basic GUI. However, I have no experience making real, functional, websites. It has become apparent to me that I need to expand my skills to encompass web development. I have been using Ruby to develop app... | [
0.7740026712417603,
0.7286784648895264,
-0.2105351835489273,
-0.15471148490905762,
0.1247352734208107,
-0.2907521724700928,
0.49693092703819275,
0.5285640954971313,
-0.2738153636455536,
-0.5384877324104309,
0.06886907666921616,
0.6626655459403992,
0.17237116396427155,
-0.07620669156312943,... | |
to leverage my skills with programming languages to create a website containing pictures, audio clips, a dynamic calendar, a scheduling request tool, and other features common to band websites.
What kind of resources are available for a competent desktop programmer to learn the entire process for developing a website?... | [
0.6767784953117371,
0.4183664619922638,
-0.008365822024643421,
0.10023059695959091,
0.16542640328407288,
-0.11055810749530792,
0.4663565158843994,
0.044324036687612534,
0.04129266366362572,
-0.7175748944282532,
0.37971562147140503,
0.720110297203064,
-0.02814348042011261,
0.050310913473367... | |
for this project is to come up to speed on current web design technology, and actually understand the entire process for building a website.
If it's as much a learning exercise as anything then take an iterative approach. Build revise. Build revise. My (very) rough guideline below:
**Client**
1. Start with the struc... | [
0.5569331645965576,
0.21378912031650543,
0.07019764184951782,
-0.17796775698661804,
0.010829846374690533,
-0.3411453366279602,
0.41320785880088806,
-0.06172093003988266,
-0.3151734173297882,
-0.8571878671646118,
0.20884239673614502,
0.6581431031227112,
-0.02261626161634922,
-0.253282070159... | |
selections\etc). Learn about how to import and link to Javascript and CSS files.... and how these files are treated re:caching etc.
3. Try to learn up to the limits of what you can do on the client (generally). Factor in the nuances of 3-4 browsers (Firefox/IE6/IE8/Chrome) re:DOM and client side eventing.
**Server**
... | [
0.16917571425437927,
-0.3278687298297882,
0.5797548890113831,
0.13394592702388763,
-0.016585642471909523,
0.08220602571964264,
0.002910689450800419,
-0.5386331081390381,
-0.4339400827884674,
-0.8215574622154236,
-0.2017195075750351,
0.6680938601493835,
-0.0016077032778412104,
-0.0026619806... | |
technology but the real nuts and bolts of it. One of your single greatest assets as a web developer is understanding the state model(s) of the technology you're using.
6. Then go for a deep dive on the web server technology of choice (and in general). Understand the full request pipeline from client to server and back.... | [
0.41014835238456726,
-0.22076356410980225,
0.5034250020980835,
0.3677849769592285,
0.14225344359874725,
-0.2096032351255417,
0.03627512976527214,
-0.09750816226005554,
-0.2702037990093231,
-0.7354966402053833,
-0.13776147365570068,
0.7826296091079712,
-0.11868330836296082,
-0.0276829674839... | |
components in your web pages.
8. Databases, caching, performance and diagnostics.
9. Then get into into all the fun stuff like ajax, etc. Replace your javascript with jQuery, etc.
10. Then you got the whole Webservices\XML\JSON\etc side of things to discover.
**Resources**
Well the web obviously. For client side stuf... | [
0.4666852355003357,
-0.09367411583662033,
0.40397393703460693,
0.47119101881980896,
-0.1861906796693802,
-0.15734809637069702,
0.15207594633102417,
0.11817383766174316,
-0.37720629572868347,
-0.7440512180328369,
0.08615978062152863,
0.7117331624031067,
-0.20338523387908936,
-0.050311230123... | |
that will give you good (under the hood) info.
Once you hit server side, I'd go for white paper type learning from your vendor of choice for your technologies.i.e. webservers/frameworks/etc. Again find a 3rd party howto/evangelist site (I used to use a lot of "4 guys from Rolla" for example) that will demonstrate how ... | [
0.7965030670166016,
0.12979254126548767,
0.015549041330814362,
0.12791183590888977,
-0.015561438165605068,
-0.10117095708847046,
0.5931875109672546,
0.5641992688179016,
-0.08982358872890472,
-0.5909134745597839,
0.21874311566352844,
0.603484570980072,
0.41880741715431213,
-0.27179086208343... | |
In my project I would like to select records from my database and then group them together by those that occurred at a similar time to the latest record within a certain time range.
For example, with a 1 hour time range. If a user created 3 posts between 4:30pm and 5:15pm, 2 posts between 1:15pm and 1:30pm, and 1 post... | [
0.39675259590148926,
0.1370055377483368,
0.6847836971282959,
0.014566630125045776,
-0.0042965346947312355,
0.2630787789821625,
0.27617788314819336,
-0.39063942432403564,
-0.34310290217399597,
-0.8409242630004883,
0.1419815570116043,
-0.07761606574058533,
-0.14092406630516052,
0.32038861513... | |
31 1:30pm, [post3,post2]]
[Tue March 31 10:00am, [post1]]
]
```
Any thoughts on the best algorithm to do this? Pseudocode is fine too if you don't know Ruby.
Edit:
Thanks Joel. Here's the code I ended up using (feeds instead of posts):
```
def aggregate(feeds, timeLimit)
return [] if feeds.blank?
result ... | [
0.16364702582359314,
-0.13445208966732025,
0.6624037027359009,
-0.004565442446619272,
-0.19756591320037842,
0.14933457970619202,
0.5221738219261169,
-0.2278229296207428,
-0.0654161125421524,
-0.9513744115829468,
-0.066651351749897,
0.6363536715507507,
-0.42453083395957947,
-0.0319681987166... | |
bin << feed
else
result << [bin_time, bin]
bin_time = feed.created_at
bin = [feed]
end
end
result << [bin_time, bin]
result
end
```
The basic concept is pretty simple, accumulate posts into bins, then when a time is outside the range, start a new bin. Here is a Python ... | [
0.371393620967865,
-0.30634620785713196,
0.3014129102230072,
0.044099751859903336,
0.0016271333443000913,
-0.05231562629342079,
0.07145234942436218,
-0.4426317811012268,
-0.05131573975086212,
-0.6801267862319946,
0.14543846249580383,
0.02814628556370735,
-0.37083783745765686,
0.24298539757... | |
('post3', 1330), ('post2', 1315), ('post1', 1000)
]
rslt = []
bin = []
binTime = 1 << 31
for postData, postTime in posts:
if (postTime >= binTime - 100):
bin.append(postData)
else:
if bin:
rslt.append([binTime, bin])
binTime = postTime
bin = [postData]
if bin:
... | [
-0.0195553507655859,
-0.5244864225387573,
0.8241488337516785,
-0.19434754550457,
-0.052099354565143585,
0.347769170999527,
0.38246119022369385,
-0.4586510956287384,
-0.303667813539505,
-0.7546631693840027,
-0.5406707525253296,
0.021232718601822853,
-0.37202998995780945,
0.10120805352926254... | |
I have a txt file and each line has a set of random strings, I need to select only the lines that contains only the characters: 1234567890qwertyuiopasdfghjklzxcvbnm-.\_~
I'm reading line by line and verifying char by char, I don't think it's the best way to do that, and I think a RegEx would be perfect.
So can anybod... | [
0.18920159339904785,
0.21643024682998657,
0.37585365772247314,
0.0028508061077445745,
0.0698675811290741,
0.23727047443389893,
0.4253113567829132,
0.2103242576122284,
-0.13620275259017944,
-0.6623082756996155,
-0.006085674744099379,
0.4858856499195099,
-0.24604235589504242,
-0.015272272750... | |
contained characters
- :: dash has a special meaning in character classes, so to avoid having it interpreted for its special meaning, list it first
0-9 :: shorthand for 0123456789 in a character class
a-z :: shorthand for abcdefghijklmnopqrstuvwxyz in a character class
._~ :: means exactly these c... | [
-0.1547909528017044,
0.00670107826590538,
0.14786864817142487,
0.2988206148147583,
-0.2532014846801758,
-0.024074064567685127,
0.46035975217819214,
-0.11098156869411469,
-0.010926458984613419,
-0.23523688316345215,
-0.5115953087806702,
-0.01591373048722744,
-0.10993252694606781,
0.20201250... | |
atom (in this case, the character class)
$ :: matches the end of a string/end of a line
``` | [
0.2289174199104309,
-0.14060692489147186,
-0.15957894921302795,
0.019964924082159996,
0.03504975885152817,
-0.1522020399570465,
0.23877152800559998,
-0.1024533361196518,
0.3358463943004608,
-0.5109734535217285,
-0.16760440170764923,
0.009179860353469849,
-0.5381439924240112,
0.056628301739... | |
What is the advantage of adding XML files to a visual studio 2008 project (windows form app project for example).
Once added to the project, how could I refer to this XML to use it in a class in the same project? In this case, I would be sending it as a query to a web service.
If you want to use the XML in some form, ... | [
0.23482581973075867,
-0.1876833587884903,
0.25943782925605774,
-0.06620757281780243,
-0.17841003835201263,
-0.08411849290132523,
0.1327962428331375,
-0.35775026679039,
-0.10401259362697601,
-0.6737744808197021,
-0.04836192727088928,
0.4526222348213196,
-0.30870920419692993,
0.1456408649682... | |
!= null)
{
String xmlContents = new StreamReader(s).ReadToEnd();
}
}
```
Once you're done, you have the XML file's contents in "xmlContents", if all goes well.
Marc | [
0.3093221187591553,
-0.10519900172948837,
0.5745404958724976,
-0.16365763545036316,
0.19295735657215118,
-0.2558479607105255,
0.24933481216430664,
0.1385200321674347,
-0.19052714109420776,
-0.7868916392326355,
-0.6048183441162109,
0.6451805830001831,
-0.006410275585949421,
0.29324629902839... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.