text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
`point_userid` int(11) NOT NULL,
`point_points` int(11) NOT NULL,
`point_date` int(11) NOT NULL,
KEY `point_userid` (`point_userid`),
KEY `point_date` (`point_date`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```
This results in a very large number, thats equal to the sum of all points, multiplied by the number ... | [
-0.7399699091911316,
0.20505008101463318,
0.7745042443275452,
-0.1961408406496048,
0.012952437624335289,
0.22663477063179016,
-0.05594527721405029,
-0.07953348010778427,
-0.13750231266021729,
-0.6201793551445007,
-0.14643514156341553,
0.10995236039161682,
0.07076167315244675,
0.38260582089... | |
user_id = 1
GROUP BY user_id, user_name
``` | [
-0.07935629040002823,
0.6075377464294434,
0.2583867609500885,
-0.27233344316482544,
-0.2884346842765808,
-0.04304780066013336,
0.011046095751225948,
-0.17204220592975616,
-0.10523804277181625,
-0.4902242422103882,
-0.27572742104530334,
0.09615770727396011,
-0.46616798639297485,
0.291116386... | |
In C++, I have a class which contains an anonymous bitfield struct. I want to initialize it to zero without having to manually write out all fields.
I can imagine putting the initialization in three places:
1. Create a constructor in the bitfield
2. Zero out in the initializer list of the constructor for the containi... | [
0.08826605975627899,
0.03818688914179802,
0.15190322697162628,
-0.3238137364387512,
-0.14464692771434784,
-0.16864782571792603,
-0.051696810871362686,
-0.15577156841754913,
0.06569276750087738,
-0.23107729852199554,
-0.10451852530241013,
0.517206072807312,
-0.695490837097168,
-0.0232279803... | |
// Bitfield struct
struct bflag_struct {
unsigned int field1 : 1;
unsigned int field2 : 2;
unsigned int field3 : 1;
// ...
unsigned int field20 : 1; | [
0.06724060326814651,
-0.2134987711906433,
0.12670551240444183,
-0.600715160369873,
0.0694047063589096,
0.022211194038391113,
0.2321302592754364,
-0.3130916953086853,
0.19673389196395874,
0.05627576261758804,
-0.31631532311439514,
0.569148600101471,
-0.47055986523628235,
-0.4806698262691498... | |
// bflag_struct(); <--- Here?
} bflag;
unsigned int integer_member;
Big *pointer_member;
}
Big::Big()
: bflag(), // <--- Can I zero bflag here?
integer_member(0),
pointer_member(NULL)
{
// Or here?
}
```
Is one of these preferable? Or is there something else... | [
-0.2780400216579437,
-0.023704683408141136,
0.3468708097934723,
-0.3379532992839813,
-0.04354533180594444,
0.18879593908786774,
0.14500963687896729,
-0.3187621831893921,
-0.4012588858604431,
-0.05541098490357399,
-0.173817977309227,
0.29760274291038513,
-0.7308182716369629,
-0.011254364624... | |
settled on this solution:
```
class Big {
// ...
struct bflag_struct {
unsigned int field 1 : 1;
// ...
bflag_struct() { memset(this, 0, sizeof *this); };
}
// ...
}
```
You could always do this in your constructor:
```
memset(&bflag, 0, sizeof bflag);
``` | [
-0.366717666387558,
0.02932553179562092,
0.5491453409194946,
-0.12166716158390045,
0.16578276455402374,
-0.0019193404586985707,
0.27884864807128906,
-0.29802948236465454,
-0.4028445780277252,
-0.3578919470310211,
-0.36002910137176514,
0.28832611441612244,
-0.4321447014808655,
-0.1903629004... | |
What are the biggest problems that is being encountered with ASP.Net MVC and what have you done to work around them?
So far my biggest problems are:
Problem: Keeping up with the changes (RCx, beta, etc).
Workarounds: Compiling till it works.
Problem: Remembering and dealing with the Futures DLL.
Workaround: Downlo... | [
0.22065964341163635,
0.07801474630832672,
0.2878663241863251,
-0.034012459218502045,
-0.1025732085108757,
0.11504792422056198,
0.0829877182841301,
-0.090842105448246,
-0.5017549395561218,
-0.7659991383552551,
0.1390393078327179,
0.8374875783920288,
-0.2602847218513489,
-0.0648517981171608,... | |
binders and validators together so that you can get a fully working, validating CRUD page within seconds with minimal code.
I quite like the fluent validation
```
Rules(
Ensure(x => x.Date).IsLessThan(DateTime.Now),
Ensure(x => x.Telephone).HasMinimumLength(12),
Ensure(x => x.Email).IsValidEmailAddress()... | [
0.33070430159568787,
0.04467369243502617,
1.2310736179351807,
-0.08264101296663284,
0.22677290439605713,
-0.41202422976493835,
0.3790769875049591,
-0.35776376724243164,
-0.1522444188594818,
-0.5826432108879089,
-0.20521393418312073,
0.8178528547286987,
-0.17787568271160126,
0.0595200210809... | |
of date.
I think once its hit RMT things should get easier for beginners. | [
0.4306733310222626,
-0.09472130239009857,
0.5020105838775635,
0.1918431669473648,
0.4819060266017914,
-0.38198938965797424,
-0.2506565451622009,
0.47775253653526306,
0.3767063021659851,
-0.053510162979364395,
0.35847219824790955,
0.5583670139312744,
0.13773402571678162,
-0.1751665323972702... | |
I can understand this requirement for the old PPC RISC systems and even for x86-64, but for the old tried-and-true x86? In this case, the stack needs to be aligned on 4 byte boundaries only. Yes, some of the MMX/SSE instructions require 16byte alignments, but if that is a requirement of the callee, then it should ensur... | [
0.3521019220352173,
0.24182359874248505,
0.38501212000846863,
0.03005656786262989,
0.0852251797914505,
-0.14606888592243195,
0.30155888199806213,
-0.3881760239601135,
-0.5720297694206238,
-0.3035646677017212,
-0.17239737510681152,
0.6537302136421204,
-0.2779407799243927,
0.0296857710927724... | |
colleagues, I have some theories about this:
1. Consistency between the PPC, x86, and x64 version of the OS
2. It seems that the GCC codegen now consistently does a sub esp,xxx and then "mov"s the data onto the stack rather than simply doing a "push" instruction. This could actually be faster on some hardware.
3. Whil... | [
0.1872352659702301,
0.19514283537864685,
0.35995733737945557,
-0.17225372791290283,
-0.06576552242040634,
-0.4663960039615631,
0.2089831531047821,
-0.46906933188438416,
-0.24156886339187622,
-0.5628195405006409,
-0.12182507663965225,
0.7716747522354126,
-0.321153461933136,
0.12051349133253... | |
stack, the above requirements **really** "uglifies" the codegen. For instance, what some compiler decided to implement a faster register-based calling style for its own internal use (ie any code that isn't intended to be called from other languages or sources)? This stack-alignment thing could negate some of the perfor... | [
0.3422490060329437,
0.4090903401374817,
0.32396820187568665,
0.12971214950084686,
-0.08259234577417374,
-0.15303702652454376,
0.29796385765075684,
-0.25806716084480286,
-0.36060217022895813,
-0.28138208389282227,
0.08816057443618774,
0.7479941844940186,
-0.20412801206111908,
-0.21274469792... | |
reason then I respectfully suggest that is a bit naive for the developers to require it. They're ignoring nearly three decades of tools and support. Especially if they're expecting tools vendors to quickly and easily adapt their tools for their platform (maybe not... it **is** Apple...) without having to jump through s... | [
0.3331645131111145,
0.3211623430252075,
0.3317824602127075,
0.04237176850438118,
0.051926422864198685,
-0.13231077790260315,
0.07022357732057571,
-0.07875337451696396,
-0.40305012464523315,
-0.5459767580032349,
-0.026278624311089516,
0.4956762492656708,
-0.04487145319581032,
0.255937159061... | |
operands to be aligned to 16-byte boundaries. Unaligned data can cause significant performance penalties compared to aligned data."
From Appendix D:
"It is important to ensure that the stack frame is aligned to a 16-byte boundary upon function entry to keep local \_\_m128 data, parameters, and XMM register spill loca... | [
-0.10850851982831955,
-0.08350832015275955,
0.1779719591140747,
0.10096252709627151,
0.24624969065189362,
-0.10922233015298843,
0.0824984535574913,
-0.54926598072052,
-0.24729599058628082,
-0.15035055577754974,
-0.4746987223625183,
0.6777361631393433,
-0.37178072333335876,
-0.1194699779152... | |
If I have a table containing schedule information that implies particular dates, is there a SQL statement that can be written to convert that information into actual rows, using some sort of CROSS JOIN, perhaps?
Consider a payment schedule table with these columns:
* **StartDate** - the date the schedule begins (1st ... | [
-0.007622555363923311,
0.04368894174695015,
0.7213431596755981,
-0.06369015574455261,
0.02614152431488037,
-0.04502619057893753,
-0.3807651102542877,
-0.3096795380115509,
-0.40176495909690857,
-0.5137420892715454,
0.09164118766784668,
0.49614816904067993,
0.23268795013427734,
-0.0712311714... | |
12 1000.00
2 20-Dec-2008 42 6 25.00
```
Is there a single SQL statement to allow me to go from the above to the following?
```
Running
SchedID Payment Due Expected | [
0.027287570759654045,
0.2497653216123581,
0.3639172911643982,
0.01210096012800932,
-0.146185502409935,
-0.1872963309288025,
-0.03846299275755882,
-0.19376982748508453,
0.14639322459697723,
-0.46801912784576416,
0.09497921168804169,
0.673612117767334,
0.017180686816573143,
-0.07998749613761... | |
Num Date Total
--------------------------------------
1 1 05-Jan-2003 1000.00
1 2 05-Jan-2004 2000.00
1 3 05-Jan-2005 3000.00
1 4 05-Jan-2006 4000.00
1 5 | [
-0.3999723494052887,
-0.016175059601664543,
0.02475198172032833,
0.087962307035923,
-0.2888958752155304,
0.5390740036964417,
-0.28086066246032715,
0.4637816548347473,
-0.016132159158587456,
-0.42868179082870483,
0.06477692723274231,
0.04468707740306854,
0.5236389636993408,
0.53070181608200... | |
05-Jan-2007 5000.00
2 1 20-Dec-2008 25.00
2 2 20-Jun-2009 50.00
2 3 20-Dec-2009 75.00
2 4 20-Jun-2010 100.00
2 5 20-Dec-2010 125.00
2 6 | [
0.19053010642528534,
0.32216787338256836,
0.33201736211776733,
-0.1849440634250641,
-0.4548749029636383,
0.6086470484733582,
0.6946336030960083,
-0.1790795922279358,
-0.6453624367713928,
-0.5751878619194031,
-0.004938705358654261,
0.3526620864868164,
0.1610730141401291,
-0.0845294222235679... | |
20-Jun-2011 150.00
2 7 20-Dec-2011 175.00
```
I'm using MS SQL Server 2005 (no hope for an upgrade soon) and I can already do this using a table variable and while loop, but it seemed like some sort of CROSS JOIN would apply but I don't know how that might work.
Your thoughts are appreciated.
*EDIT: ... | [
0.26053929328918457,
0.28997939825057983,
0.6692380905151367,
-0.04037972539663315,
-0.30701661109924316,
-0.3604969382286072,
0.5906547904014587,
0.011810614727437496,
-0.2509223222732544,
-0.7212771773338318,
0.12220555543899536,
0.7142741680145264,
0.1266729235649109,
-0.007612029556185... | |
pinch of salt, but I think that something looking more or less like the following should answer the question:
```
with q(SchedId, PaymentNum, DueDate, RunningExpectedTotal) as
(select SchedId,
1 as PaymentNum,
StartDate as DueDate,
PaymentAmt as RunningExpectedTotal
from Pa... | [
-0.45633015036582947,
-0.10899877548217773,
0.654222309589386,
-0.3017803728580475,
-0.18219716846942902,
0.5162103772163391,
-0.26081833243370056,
-0.05869757756590843,
0.2142103910446167,
-0.326322078704834,
0.0002573420642875135,
0.42174243927001953,
0.12497123330831528,
0.3543036878108... | |
1 + q.PaymentNum as PaymentNum,
DATEADD(month, s.Frequency, q.DueDate) as DueDate,
q.RunningExpectedTotal + s.PaymentAmt as RunningExpectedTotal
from q
inner join PaymentScheduleTable s
on s.SchedId = q.SchedId
where q.PaymentNum <= s.Term / s.Frequency)
s... | [
-0.3453219532966614,
-0.42168253660202026,
0.9824057221412659,
-0.17893086373806,
-0.08133656531572342,
0.0728120282292366,
-0.03313073515892029,
-0.38020312786102295,
-0.06061060354113579,
-0.39795348048210144,
-0.40641918778419495,
0.3299942910671234,
0.04450371116399765,
0.2570132315158... | |
I have a requirement for an explicit logout button for users in a ASP.NET web app. I am using IIS6 with Basic Authentication (SSL). I can redirect to another web page but the browser keeps the session alive. I have googled around and found a way to do it by enabling an active x control to communicate with IIS and kill ... | [
0.38389143347740173,
0.05338965728878975,
0.4425552189350128,
-0.09131170064210892,
-0.09664221107959747,
-0.3653366267681122,
0.6653149127960205,
0.08055425435304642,
-0.16567035019397736,
-0.7209320664405823,
-0.011748477816581726,
0.4185170829296112,
-0.43715065717697144,
0.093240782618... | |
was afraid of. I have seen similar answers on the net and I was hoping someone would have a way of doing it. Thanks for your time though. I guess I can use javascript to prevent the back button like the history.back()
I was struggling with this myself for a few days.
Using the IE specific '`document.execCommand('Clear... | [
0.26991260051727295,
-0.10431519895792007,
0.28224295377731323,
-0.006647300440818071,
-0.16252486407756805,
-0.279519259929657,
0.8755814433097839,
0.008670423179864883,
-0.046646710485219955,
-0.7155243158340454,
0.20353420078754425,
0.5821033716201782,
-0.14700810611248016,
-0.100563108... | |
Default.aspx. This alone is not sufficient.
You need to explicitly tell the browser that the request which was made is not authorized. You can do this by using something like:
```
response.StatusCode = 401;
response.Status = "401 Unauthorized";
response.AddHeader("WWW-Authenticate", "BASIC Realm=my application name");... | [
0.10827324539422989,
0.034544043242931366,
0.5460721850395203,
-0.13497678935527802,
0.4061833918094635,
-0.2878081798553467,
0.5537271499633789,
-0.20151296257972717,
-0.3083602786064148,
-0.6078532934188843,
-0.28390535712242126,
0.750754714012146,
-0.3353652358055115,
-0.016474263742566... | |
unique 'realm'**. Then the browser does NOT resend the credentials in the case described above. I chose to spit out the current date and time.
```
response.StatusCode = 401;
response.Status = "401 Unauthorized";
string realm = "my application name";
response.AddHeader("WWW-Authenticate", string.Format(... | [
0.13967715203762054,
0.06610004603862762,
0.9036026000976562,
0.058700136840343475,
0.288541316986084,
-0.26088935136795044,
0.6750308871269226,
-0.38662171363830566,
-0.19500908255577087,
-0.7160831689834595,
-0.1393544226884842,
0.39873358607292175,
-0.16713447868824005,
0.34063899517059... | |
first presses escape (hides the basic login dialog) and then refresh (F5) or the browsers back button. | [
-0.33357369899749756,
-0.2906322777271271,
0.4537704586982727,
-0.08537086099386215,
0.3469447195529938,
0.04261050373315811,
0.6232004761695862,
-0.05674877390265465,
-0.1628548502922058,
-0.6294225454330444,
-0.8273202180862427,
0.7498584389686584,
-0.27763831615448,
-0.11516056209802628... | |
I've got four variables and I want to check if any one of them is null. I can do
```
if (null == a || null == b || null == c || null == d) {
...
}
```
but what I really want is
```
if (anyNull(a, b, c, d)) {
...
}
```
but I don't want to write it myself. Does this function exist in any common Java library... | [
0.05193338170647621,
0.2585969865322113,
0.3004376292228699,
-0.3761064112186432,
-0.05112053453922272,
-0.10383149981498718,
0.2567431628704071,
-0.11086463183164597,
-0.19196361303329468,
-0.35437482595443726,
0.09615436941385269,
0.6099368929862976,
-0.37444496154785156,
0.2229229509830... | |
c, d).contains(null)) {
``` | [
0.1162775382399559,
0.3510001301765442,
0.09729326516389847,
-0.09736761450767517,
0.4082147777080536,
-0.30109307169914246,
0.3467695415019989,
-0.39710742235183716,
0.08504941314458847,
-0.16689252853393555,
-0.6747515201568604,
0.5079796314239502,
-0.6382014751434326,
0.3852158486843109... | |
When writing TSQL stored procedures I find myself wanting to centralize / normalize some parts of the code. For example, if I have a query like this:
```
SELECT * FROM SomeTable WHERE SomeColumn IN (2, 4, 8)
```
For cases like this I would like to put (2,4,8) in some place outside of the procedure that I could reuse... | [
0.07554083317518234,
-0.059802427887916565,
-0.13250941038131714,
-0.08803049474954605,
-0.3132851719856262,
-0.40582138299942017,
0.14225204288959503,
-0.02382856234908104,
-0.18260373175144196,
-0.5748408436775208,
-0.14898239076137543,
0.07369972765445709,
-0.5366707444190979,
0.1706490... | |
but I doubt this is possible.
Thanks.
I've often wanted a similar thing but that specifically does not exist. Here are a couple of things you *can* do.
**Option 1**
What we have done is used User Defined Functions (UDF) to gather what you might call global variables.
You're able to call a UDF inline within your que... | [
0.146793395280838,
-0.08212006837129593,
0.09801843017339706,
0.002606108086183667,
-0.059899814426898956,
-0.2505829334259033,
-0.022155936807394028,
0.11812376976013184,
-0.38587266206741333,
-0.785540759563446,
0.09275983273983002,
0.3916359543800354,
-0.4265999495983124,
0.243709847331... | |
out. Keep your values in a lookup table and reference it by an ID. The ID wouldn't change but the value it refers to might. Using the sample example as above but for this option:
```
Table: Servers
Columns: ServerID, ServerName
declare @serverName varchar(50)
select @serverName = ServerName from Servers where ServerI... | [
0.10577137023210526,
0.021827174350619316,
0.33438611030578613,
-0.030001793056726456,
-0.04380956292152405,
-0.10358010232448578,
0.06965183466672897,
-0.5229445099830627,
-0.2287411391735077,
-0.42109984159469604,
0.005613177083432674,
0.279598206281662,
-0.39723411202430725,
0.190927132... | |
I've been nesting my viewdata classes inside my controllers and, as their numbers grow, I'm starting to ask myself if this is a good idea. Then again, something about polluting the /Views and /Controllers directories with these things seems off.
Is there a convention I'm missing here? Maybe a /ViewData directory? idk,... | [
0.6170596480369568,
0.10479441285133362,
0.19977478682994843,
0.2803170382976532,
0.12016325443983078,
-0.14452368021011353,
-0.015135698951780796,
0.22418786585330963,
-0.11625803261995316,
-0.8119650483131409,
0.299871027469635,
0.31494227051734924,
-0.16314418613910675,
0.46300458908081... | |
does. | [
0.34225478768348694,
0.070599764585495,
0.5695845484733582,
0.6306264996528625,
0.6578930616378784,
-0.6461849212646484,
0.12087888270616531,
-0.0730644166469574,
0.5497491359710693,
-0.45363181829452515,
-0.5274719595909119,
0.19422690570354462,
0.0970555767416954,
0.08975620567798615,
... | |
So, it seems in the SharePoint blogosphere that everybody just copies and pastes the same bullet points from other blogs. One bullet point I've seen is that SharePoint site templates are less efficient than site definitions because site definitions are stored on the file system. Is that true?
It seems odd that site te... | [
0.7809233069419861,
0.3410782814025879,
0.0713505744934082,
0.34209001064300537,
-0.04580466449260712,
-0.2642657458782196,
0.10516872256994247,
0.26836520433425903,
-0.1714264154434204,
-0.5764597058296204,
0.29130440950393677,
0.4036232829093933,
-0.26039937138557434,
0.188404381275177,
... | |
created using a site template or not.
So, what is an architectural reason why a site template would be less efficient than a site definition?
---
Edit: Links to the blogs that say there is a performance difference:
* From [MSDN](http://msdn.microsoft.com/en-us/library/ms916803.aspx): Because it is slow to store tem... | [
0.4023834764957428,
0.02016911841928959,
0.11612026393413544,
0.20350244641304016,
-0.06429911404848099,
-0.08275411278009415,
0.263894647359848,
-0.3008030652999878,
-0.22074846923351288,
-1.004676342010498,
-0.15479980409145355,
0.24667459726333618,
-0.25373968482017517,
0.16851803660392... | |
templates in and retrieve them from the database, site templates can result in slower performance. Templates in the database are compiled and executed every time a page is rendered.
* From [Branding SharePoint](http://www.brandingsharepoint.com/Lists/Posts/Post.aspx?ID=17):Custom site definitions hold the following adv... | [
0.972658634185791,
0.12848882377147675,
0.31392601132392883,
0.03595002740621567,
-0.19879259169101715,
-0.11707976460456848,
0.16660721600055695,
-0.47354787588119507,
0.038295868784189224,
-0.8001542687416077,
0.07099540531635284,
0.3956719934940338,
0.0541427917778492,
0.018251894041895... | |
Site Definitions is generally overstated.
Why?
Well, lets take this example:
1. You take a Team Site site definition.
2. You save it as a new Site Template
3. You then create a new sub web based on this new site template.
What have you got? Well, the important thing to remember is that "Ghosting" happens at the PA... | [
0.5655024647712708,
-0.2257375866174698,
0.3920072615146637,
0.3388407528400421,
-0.11302900314331055,
-0.35535356402397156,
0.40358009934425354,
-0.01565767265856266,
-0.5095635056495667,
-0.6953375935554504,
0.015547599643468857,
0.15712867677211761,
-0.31867972016334534,
0.1393241137266... | |
original Site Definition.
2. Check your site template, notice you see the modification.
3. Its still "Ghosted" to the filesystem
**Second Test**
1. Create a new site definition.
2. Create a new site based on this new Site Definition.
3. Create a new Site Template
4. Send the site template to a mate with SharePoint an... | [
0.691316545009613,
-0.10972101986408234,
0.3548848330974579,
0.05553855746984482,
-0.008606947027146816,
-0.11883513629436493,
0.3572092354297638,
-0.4788268506526947,
-0.15144436061382294,
-0.786405086517334,
-0.05619984120130539,
0.3579806685447693,
-0.5004401803016663,
0.253832697868347... | |
in your decision to use a Site Definition or a Site Template, the functional objective you have should be". Now it get controversial, but for me, there are very very few reasons to opt for a Site Definition over creating Features.
As far as "Ghosting" goes. Yup, when customised your page will be stored in the Database... | [
0.6031744480133057,
-0.05766230449080467,
0.47164812684059143,
0.07388551533222198,
-0.04248071834445,
-0.3425906002521515,
0.23267889022827148,
0.646304726600647,
-0.41106364130973816,
-0.29062891006469727,
0.15763795375823975,
0.05817759409546852,
-0.11765589565038681,
0.3702916800975799... | |
2003 (probably in STS before that, dont remember) and I have never seen official guidance on the performance impact it has, nor anyone speculating beyond the "it is slower" comments.
This leads me to believe that it just isn't really worrying about. The bigger worry with "Ghosted" pages is the difficulty that comes w... | [
-0.2742125988006592,
0.037165768444538116,
0.7837544083595276,
0.2038295418024063,
-0.2637726366519928,
-0.39903807640075684,
0.19931355118751526,
0.3581864535808563,
-0.5869332551956177,
-0.3423125445842743,
0.43839284777641296,
0.23289726674556732,
0.29434934258461,
-0.07304264605045319,... | |
I'm trying to write a Greasemonkey script that works with Gmail. I know how to create javascript that reacts to the user clicking on the Inbox link or the the Refresh link. My problem is that Gmail periodically refreshes the inbox with new conversations and I have no way of capturing this event. Is there any way to cap... | [
0.23385700583457947,
0.1411186158657074,
0.3530972898006439,
-0.0900154784321785,
-0.26328548789024353,
-0.15510179102420807,
0.12078765779733658,
0.3651359975337982,
-0.4163471758365631,
-0.7197325229644775,
0.4097929000854492,
0.7058167457580566,
-0.2286439836025238,
-0.2502647638320923,... | |
SVN made branching much easier by making branches really cheap, but merges remain a real problem in SVN - one that Git supposedly solves.
Does Git achieve this, and how?
(disclaimer: All I know about Git is based on the Linus lecture - total git noob here)
Git will not prevent conflict in merges but can reconcile his... | [
0.0888160839676857,
-0.19600744545459747,
0.3333437740802765,
0.22362247109413147,
-0.26103928685188293,
-0.190968319773674,
0.5086407661437988,
0.07180286943912506,
-0.3842252194881439,
-0.5521254539489746,
-0.05286286398768425,
0.23856565356254578,
-0.11374840140342712,
0.218689456582069... | |
have a glimpse on "how merges have been thought through", you [can start by turning to Linus himself](http://wincent.com/a/about/wincent/weblog/archives/2007/07/a_look_back_bra.php), and realize this issue is not so much about "algorithm":
> *Linus*: Me *personally*, I want to have something that is very repeatable an... | [
0.4786297678947449,
0.10084480047225952,
-0.08194711804389954,
0.23083901405334473,
0.0844082310795784,
-0.0932120606303215,
0.08163507282733917,
-0.1929730921983719,
-0.23429115116596222,
-0.8178969621658325,
-0.023623188957571983,
0.1888006329536438,
-0.15588884055614471,
0.0218951534479... | |
they are at all interesting), but that it should meld the history together right so that you have a new solid base for future merges.**
>
>
> In other words, the important part is the *trivial* part: the naming of the parents, and keeping track of their relationship. Not the clashes.
>
>
> And it looks like 99% of ... | [
0.3639651834964752,
0.06425361335277557,
0.2428382933139801,
0.10575496405363083,
0.30780544877052307,
-0.16610665619373322,
0.06258925050497055,
0.37632569670677185,
-0.2890433967113495,
-0.4875022768974304,
-0.19166100025177002,
0.08658325672149658,
0.07030991464853287,
0.124448932707309... | |
>
> **The only thing you need to store is the state of the tree before and after each change.**
>
>
> What files were renamed? Which ones were copied? Which ones were deleted? What lines were added? Which ones were removed? Which lines had changes made inside them? Which slabs of text were copied from one file to a... | [
0.4174998998641968,
0.26073864102363586,
0.42472222447395325,
0.1837994009256363,
-0.14941026270389557,
0.21244856715202332,
0.4143431782722473,
-0.0004627665039151907,
-0.5466787219047546,
-0.5543385148048401,
-0.21568189561367035,
0.10760007053613663,
-0.19693569839000702,
0.140912264585... | |
renames, edits etc) are implicitly encoded in the delta between the two states of the tree**; you just ***track*** what is the ***content***.
>
>
> **Absolutely everything can (and should) be inferred**.
>
>
> Git breaks the mould because it thinks about content, not files.
>
> It doesn't track renames, it trac... | [
0.20248956978321075,
-0.07365625351667404,
0.2199546992778778,
0.20540037751197815,
-0.09696318954229355,
-0.41740190982818604,
0.25604474544525146,
0.16587980091571808,
-0.09337776899337769,
-0.8597429990768433,
-0.1906435638666153,
0.33180391788482666,
-0.2952967882156372,
0.350094467401... | |
>
> When you perform a diff you are comparing two trees, not two files.
>
>
> The other fundamentally smart design decision is how Git does merges.
>
> **The merging algorithms are smart but they don't try to be too smart. Unambiguous decisions are made automatically, but when there's doubt it's up to the user t... | [
0.3276468813419342,
-0.10874612629413605,
0.035001348704099655,
0.2863404452800751,
-0.1723310500383377,
0.1377662867307663,
-0.05142737552523613,
-0.09205875545740128,
-0.14751528203487396,
-0.9452295899391174,
0.02310371771454811,
0.41484707593917847,
-0.2702473998069763,
-0.037730179727... | |
merging: while every other version control system is trying to get smarter, Git is happily self-described as the "stupid content manager", and it's better for it. | [
0.023561879992485046,
-0.03193308040499687,
0.329330176115036,
0.17064598202705383,
-0.0917845070362091,
-0.5399851202964783,
0.2069220244884491,
0.5561314821243286,
-0.0637652724981308,
-0.7255557179450989,
-0.35073208808898926,
0.2858735918998718,
-0.2629939317703247,
0.21709147095680237... | |
**UPDATE** this issue does not exist in the release bits of ASP.NET MVC
I have an ASP.NET MVC RC app which runs fine under the debugger running from <http://localhost:9002/> But when I publish it to <http://localhost/Zot/> the calls to Url.Content are returning incorrect values.
I have script tags like
```
<script s... | [
0.1153128445148468,
0.41783544421195984,
0.3839164972305298,
-0.09156825393438339,
-0.16002757847309113,
-0.12190739810466766,
0.44246965646743774,
-0.17774836719036102,
-0.33046478033065796,
-0.42910492420196533,
-0.17828476428985596,
0.7151275873184204,
-0.3470035791397095,
-0.0494698919... | |
static string RegisterJS(this System.Web.Mvc.HtmlHelper helper, string scriptLib) {
//get the directory where the scripts are
string scriptRoot = VirtualPathUtility.ToAbsolute("~/Scripts");
string scriptFormat="<script src=\"{0}/{1}\" type=\"text/javascript\"></script>\r\n";
return string.Format(scriptFormat,sc... | [
-0.13386757671833038,
-0.32590314745903015,
0.658404529094696,
-0.059540022164583206,
-0.012369662523269653,
0.06778189539909363,
0.29854658246040344,
0.01546830777078867,
-0.11284374445676804,
-0.672372043132782,
-0.29004740715026855,
0.4794934093952179,
-0.42919090390205383,
0.0643871873... | |
> Microsoft Visual Studio
>
>
> Unable to start program 'theprogram.exe'.
>
>
> This application has failed to start
> because the application configuration
> is incorrect. Review the manifest file
> for possible errors. Reinstalling the
> application may fix this problem. For
> more details, please see the
> ... | [
0.41551291942596436,
0.30865478515625,
0.5695477724075317,
-0.1279935985803604,
-0.024819787591695786,
0.04073641449213028,
0.44022855162620544,
-0.042933277785778046,
0.09254410117864609,
-0.515131413936615,
-0.3845464885234833,
0.6177494525909424,
-0.40761327743530273,
0.0950021594762802... | |
attached to the debugger that I can't kill.
The manifest files for debug build:
```
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.DebugCR... | [
0.3248629570007324,
0.1451367735862732,
0.4662048816680908,
-0.23534612357616425,
-0.175096333026886,
0.22932589054107666,
0.17775429785251617,
-0.6141870617866516,
0.17651309072971344,
-0.3938004672527313,
-0.048050832003355026,
0.6271966099739075,
-0.5915889739990234,
0.26462799310684204... | |
name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>
```
and Release build:
```
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1... | [
-0.18721622228622437,
0.1726370006799698,
0.5025529861450195,
-0.12280281633138657,
0.29825061559677124,
0.20158228278160095,
0.5474380254745483,
-0.39549535512924194,
-0.07431654632091522,
-0.26958614587783813,
-0.34623464941978455,
0.5932032465934753,
-0.3013862073421478,
0.3252084553241... | |
or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresol... | [
-0.5072104930877686,
-0.2622930407524109,
0.5607107281684875,
0.19910940527915955,
-0.4396681487560272,
0.3332287669181824,
0.49379825592041016,
-0.5858213901519775,
-0.26665443181991577,
-0.6056033372879028,
-0.4903911054134369,
0.45301344990730286,
-0.5719391703605652,
0.2387894541025161... | |
against both debug and release runtimes which would be a very bad thing -- you haven't included either in the list of libraries you're linking against -- might be worth checking though
Edit:
Might also be worth checking for any `#pragma comment (lib...)` statements which can force the linker to include an additional l... | [
0.3602558672428131,
-0.05621914193034172,
-0.03089895285665989,
0.08406481146812439,
-0.12428099662065506,
-0.3165765702724457,
0.5089443922042847,
-0.03487277403473854,
-0.31068581342697144,
-0.3915102779865265,
-0.3546455502510071,
0.4657718539237976,
-0.5486366748809814,
0.2756628990173... | |
We work in email marketing, creating HTML/TEXT emails for clients. In essence we design HTML email templates for our clients. Clients then post us content (via a form) to populate these templates before we send them out. Right now we do this manually, basically cutting and pasting the content from their submitted form ... | [
1.0765143632888794,
0.18655610084533691,
0.253765344619751,
-0.052372757345438004,
0.00827603880316019,
0.0113248685374856,
-0.1231488436460495,
0.1587291955947876,
-0.03184958174824715,
-0.4976964592933655,
-0.002169170184060931,
0.5771303176879883,
0.037131477147340775,
-0.06703819334506... | |
populate a locked down version of the template, entering text where necessary, before submitting to us. This is our most basic requirement, and a friend of mine kindly demo'd a proof of concept here:
<http://advantageone.co.uk/mbe/>
Note: If you click on a text area in the body of the template, an editor pop ups.
... | [
0.6608731746673584,
0.03089129365980625,
0.6835534572601318,
0.10272692888975143,
0.009969374164938927,
-0.03000492975115776,
-0.12469102442264557,
-0.05925790220499039,
-0.2233666181564331,
-0.530267596244812,
0.01703472249209881,
0.15044540166854858,
-0.25800594687461853,
-0.295354366302... | |
to their user/client id), perhaps being able to add new rows to the template.
* And have these HTML templates locked down so they can only edit what they're allowed too (like in the demo above), and perhaps make some areas required.
* Perhaps have a simple workflow or approval built in
* Allow us to lock submitted camp... | [
0.3888300657272339,
0.03970002382993698,
0.5580667853355408,
0.18375563621520996,
-0.21080483496189117,
-0.083681620657444,
0.06392694264650345,
-0.2143353968858719,
-0.3201906681060791,
-0.6021466255187988,
-0.14033274352550507,
0.24774886667728424,
-0.13677570223808289,
-0.34706974029541... | |
an email, rather than publishing onto the web.
Now to the actual dilemma: we're looking for something really simple, and the above sounds like a CMS. But we haven't been able to find anything that already does, or can be easily adapted to do this. Everything is either too complex, or simple and inflexible. We're sure ... | [
0.5397870540618896,
0.049701254814863205,
0.03904544189572334,
0.4766814708709717,
0.2775500416755676,
-0.01771671511232853,
0.16243477165699005,
0.2770916521549225,
-0.22392062842845917,
-0.44744133949279785,
0.09552427381277084,
0.26808586716651917,
-0.15695397555828094,
-0.1120889037847... | |
tweaking?
Forgive me if this is a little disjointed, if I'm being incredibly dopey and there is something out there please let me know!
Looks like the debug build is linked against both debug and release runtimes which would be a very bad thing -- you haven't included either in the list of libraries you're linking aga... | [
0.6046623587608337,
-0.13488566875457764,
-0.17489953339099884,
0.05754127353429794,
-0.22676683962345123,
-0.17490841448307037,
0.5413923263549805,
0.17095986008644104,
-0.14685839414596558,
-0.29967573285102844,
0.13914306461811066,
0.4584643244743347,
-0.5608605742454529,
0.405267715454... | |
Over the years, "regex" pattern matching has been getting more and more powerful to the point where I wonder: is it really just context-sensitive-grammar matching? Is it a variation/extension of context-free-grammar matching? Where is it right now and why don't we just call it that instead of the old, restrictive "regu... | [
0.2579135596752167,
-0.3361418545246124,
0.2947157621383667,
0.20755061507225037,
-0.2756503224372864,
-0.015347292646765709,
0.05974932760000229,
0.26208165287971497,
-0.21978823840618134,
-0.5850500464439392,
-0.12588578462600708,
0.5136741995811462,
-0.5267421007156372,
0.01608049310743... | |
I have tried:
```
grep -c "\|" *.*
```
But it didn't work, since it gives an incorrect count of consecutive pipes.
How can I accomplish this?
Another option, using Perl, is:
```
perl -e 'while(<>){$c+=tr/|/|/};print "$c\n"' *
```
In non-one-liner format that's:
```
while(<>){
$c += tr/|/|/
}
print "$c\n"
... | [
0.19455435872077942,
-0.12333783507347107,
0.6521559357643127,
-0.09321819990873337,
-0.16785399615764618,
0.2652156352996826,
0.23252345621585846,
-0.09066025167703629,
-0.16356705129146576,
-0.41079989075660706,
0.019990520551800728,
0.41367068886756897,
-0.28218889236450195,
0.421177059... | |
putting my results in a global variable called `$c`. (In a full program, it's best to declare it a lexical variable with `my $c = 0;` outside the loop.) The `+=` operator adds the result of the `tr` command (the number of pipe characters in this case) to the current value of `$c`.
Just using `tr(1)` is clearly a simpl... | [
0.30219870805740356,
0.16608887910842896,
0.3710656762123108,
-0.10650841891765594,
0.020365003496408463,
0.23526424169540405,
0.25455552339553833,
-0.3721267580986023,
0.1823653131723404,
-0.40416526794433594,
0.039348430931568146,
0.6201015710830688,
-0.14944085478782654,
0.1619701832532... | |
| perl -e 'while(<>){$c+=tr/|/|/};print "$c\n"'
9
``` | [
-0.12424125522375107,
0.10570269823074341,
0.5401617884635925,
-0.23165389895439148,
0.30619746446609497,
0.1503967046737671,
0.05742273107171059,
-0.13829270005226135,
-0.1544947475194931,
-0.01275584101676941,
-0.43211954832077026,
0.6192368268966675,
-0.6164934039115906,
0.2740701138973... | |
In C# 3.0 you can create anonymous class with the following syntax
```
var o = new { Id = 1, Name = "Foo" };
```
Is there a way to add these anonymous class to a generic list?
Example:
```
var o = new { Id = 1, Name = "Foo" };
var o1 = new { Id = 2, Name = "Bar" };
List<var> list = new List<var>();
list.Add(o);
l... | [
0.4097372591495514,
0.042395275086164474,
0.6296424269676208,
-0.43171581625938416,
-0.06661088019609451,
0.02537163347005844,
0.2761138677597046,
-0.1980494260787964,
-0.12116990238428116,
-0.5475429892539978,
-0.04637960344552994,
0.9288318753242493,
-0.6764361262321472,
-0.1399975121021... | |
this cat, but basically they'll all use type inference somewhere - which means you've got to be calling a generic method (possibly as an extension method). Another example might be:
```
public static List<T> CreateList<T>(params T[] elements)
{
return new List<T>(elements);
}
var list = CreateList(o, o1);
```
... | [
0.1984349638223648,
-0.25343799591064453,
0.103340283036232,
0.06949328631162643,
-0.15740837156772614,
0.027305657044053078,
0.2846696972846985,
-0.44908854365348816,
-0.5096699595451355,
-0.35476556420326233,
-0.1371462345123291,
0.2753656804561615,
-0.7057788372039795,
0.272162944078445... | |
Ok, let's leave the debate of whether friendship breaks encapsulation, and actually try elegantly come up with a coherent design. It is a two fold function:
1) General question on how to implement:
```
public class A
{
friend class B;
}
```
2) Why do I need this functionality? Some of my classes impl... | [
0.0725981816649437,
0.215071439743042,
-0.05011549964547157,
-0.03015238605439663,
0.018375694751739502,
-0.2729913592338562,
0.3313840329647064,
-0.17716823518276215,
-0.15052859485149384,
-0.41367802023887634,
-0.0009950152598321438,
0.6432169079780579,
-0.3239721357822418,
0.09775419533... | |
What is the General way to solve this problem in C#?
Note: I am using friendship as defined in the current C++ standard.
Thanks
Leaving the `InternalsVisibleTo` stuff to one side, you only have two choices when it comes to implementing interfaces:
* Implement them with public methods
* Implement them using explicit ... | [
0.046754103153944016,
0.04012572392821312,
0.09055744856595993,
-0.012992216274142265,
-0.2601013481616974,
-0.17222853004932404,
0.29200950264930725,
0.06252271682024002,
-0.20603153109550476,
-0.4883304834365845,
0.2410046011209488,
0.7110174298286438,
-0.33658045530319214,
-0.0643382146... | |
Just picking up Objective-C 2.0 and wanted to know if there is any advantage in using the dot operator for accessing properties instead of the "old" way. Short example of what I mean.
"old" way:
```
[myFraction setNumerator: 1];
[myFraction setDenominator: 3];
```
"new" way:
```
myFraction.numerator = 1;
myFra... | [
-0.0737403854727745,
-0.02229800634086132,
0.6142615675926208,
0.0929294005036354,
-0.24245932698249817,
0.05942721664905548,
0.03252768889069557,
-0.07732453942298889,
-0.06943197548389435,
-0.29088538885116577,
0.14100663363933563,
0.6187324523925781,
0.00960161630064249,
-0.212996453046... | |
I know it lets visual studio to separate WinForms UI code from the UI events, etc. But are there any practical uses for it?
The partial keyword is typically used in code generation utilities to allow developers to add additional functionality to the generated code without the fear of that code being erased if the code ... | [
0.5934039950370789,
-0.08577798306941986,
0.3203619420528412,
0.19776971638202667,
-0.027232754975557327,
-0.4192577004432678,
-0.019143901765346527,
0.017835749313235283,
0.12929192185401917,
-0.47990477085113525,
-0.009073504246771336,
0.09882921725511551,
-0.06545253843069077,
0.3830039... | |
classes that the framework will call if implemented. The benefit here is that the C# compiler will completely remove unimplemented partial methods, so there is no performance hit *at all* for not implementing them.
Partial classes can also be used to organize very large classes into separate code files, although this ... | [
0.19672493636608124,
-0.20640893280506134,
-0.2585422396659851,
0.29424795508384705,
-0.3121735453605652,
-0.1831737607717514,
0.3272733688354492,
-0.06867862492799759,
-0.15697790682315826,
-0.3685707449913025,
-0.4617706537246704,
0.258623868227005,
-0.36831754446029663,
-0.1057798266410... | |
The question header is clear, i want to know why its different and why, when to select it for my project?
[I wrote a blog post on this a while ago](http://blogs.teamb.com/craigstuntz/2008/07/17/37825/ "The ADO.NET Entity Framework vs. NHibernate and Other ORMs"). In short, it takes a fundamentally different approach to... | [
0.18425598740577698,
-0.07304352521896362,
0.13390031456947327,
0.016334177926182747,
-0.4336145520210266,
-0.35905081033706665,
-0.018719598650932312,
-0.2636125087738037,
-0.13904286921024323,
-0.39188140630722046,
0.3760070502758026,
0.3675251603126526,
-0.12882517278194427,
0.103935688... | |
strongly recommend reading [this technical paper](http://portal.acm.org/citation.cfm?id=1412331.1412334 "Compiling mappings to bridge applications and databases") and [this interview](http://queue.acm.org/detail.cfm?id=1394137) in ACM Queue. | [
-0.05643800273537636,
0.021433724090456963,
0.3499753773212433,
0.17369534075260162,
-0.2531469464302063,
-0.21095789968967438,
-0.12568631768226624,
-0.07244960963726044,
-0.2702256143093109,
-0.624337911605835,
0.09732476621866226,
0.4098452925682068,
0.14913472533226013,
0.0193090233951... | |
I have a developer on my staff that chronically overshoots deadlines, and estimates. On several projects the last week or two everyday I hear "It should be done by the end of the day". This developer does good work.
I have already spoke to him about his problems. He seems genuinely frustrated, and miffed about what to... | [
0.4475650489330292,
0.05590574070811272,
-0.09207871556282043,
0.23727189004421234,
-0.07840622216463089,
0.0928012877702713,
0.4723350405693054,
-0.33697181940078735,
-0.11517073959112167,
-0.6518446803092957,
0.3264032304286957,
0.343155175447464,
-0.2635403871536255,
-0.0355873554944992... | |
bad idea.
2. It is natural for an employee to be unable to fix estimating problems without intervention.
3. Don't make deadlines unless there's company consequences (lost contract) for not being done by then.
4. Utilize available methods (Agile, Joel's checklist) to help the developer estimate better.
Thanks for the l... | [
0.2194281369447708,
0.1470913290977478,
0.07187774032354355,
0.2984222173690796,
0.11148171126842499,
-0.09843931347131729,
0.49422287940979004,
0.11924640089273453,
-0.0928109735250473,
-0.6276657581329346,
0.13055188953876495,
0.26928362250328064,
-0.08652844280004501,
0.1033357307314872... | |
long it actually took him to complete the task. Eventually, this journal will become a sort of guide for him to create better estimates. Once he becomes better at estimating, he shouldn't feel as rushed or harried. | [
0.37142831087112427,
-0.04836693033576012,
0.21848152577877045,
0.15568941831588745,
0.1882251799106598,
-0.23956327140331268,
0.23117659986019135,
-0.1147419661283493,
-0.14025239646434784,
-0.6678992509841919,
0.1815924346446991,
0.30824950337409973,
0.5345863103866577,
0.051924515515565... | |
I have a that looks like this:
```
I, [2009-03-04T15:03:25.502546 #17925] INFO -- : [8541, 931, 0, 0]
I, [2009-03-04T15:03:26.094855 #17925] INFO -- : [8545, 6678, 0, 0]
I, [2009-03-04T15:03:26.353079 #17925] INFO -- : [5448, 1598, 185, 0]
I, [2009-03-04T15:03:26.360148 #17925] INFO -- : [8555, 1747, 0, 0]
I, [200... | [
-0.07290581613779068,
0.48493021726608276,
0.31059345602989197,
-0.06495539844036102,
-0.12336498498916626,
0.4562666118144989,
0.5884450674057007,
0.1160678043961525,
-0.13954158127307892,
-0.1945064663887024,
0.05385240539908409,
0.34980881214141846,
-0.09494320303201675,
0.4200899004936... | |
INFO -- : [7252, 4928, 0, 0]
I, [2009-03-04T15:03:30.974251 #17925] INFO -- : [8561, 4883, 1, 0]
I, [2009-03-04T15:03:31.230426 #17925] INFO -- : [8563, 3866, 250, 0]
I, [2009-03-04T15:03:31.236830 #17925] INFO -- : [8567, 4122, 0, 0]
I, [2009-03-04T15:03:32.056901 #17925] INFO -- : [5696, 5902, 526, 1]
I, [2009-03... | [
-0.3800983130931854,
0.28474581241607666,
0.06659246981143951,
0.09848693013191223,
0.07679272443056107,
0.26024219393730164,
0.3290908634662628,
-0.18256212770938873,
0.20972785353660583,
-0.5559793710708618,
-0.04430230334401131,
0.8341965675354004,
-0.2079310566186905,
-0.38055336475372... | |
last example). An even tougher question: is it possible to get the average of the 3rd field only when the last one is not `0`?
I know I could use `Ruby` or another language to create a script, but I'd like to do it in `Bash`. Any good suggestions on resources or hints in how to create such a script would help.
Posting... | [
0.1388557404279709,
0.1431647390127182,
0.37482234835624695,
-0.13287611305713654,
-0.19998490810394287,
-0.085110142827034,
0.4583408832550049,
-0.1819314956665039,
-0.4010878801345825,
-0.5352924466133118,
-0.0914081335067749,
0.6614326238632202,
-0.3242091238498688,
-0.2244112342596054,... | |
$total/$n }; chomp; $total+= $_; $n++' < log
``` | [
-0.04957515001296997,
-0.00005041264012106694,
0.2331627905368805,
-0.24169668555259705,
0.3940579891204834,
0.23392866551876068,
0.285582959651947,
0.009456939063966274,
-0.5944444537162781,
-0.08638401329517365,
-0.2206004559993744,
0.529700517654419,
-0.5749576091766357,
0.1660083830356... | |
I'd like to incorporate OpenSSH support into a Windows application and I am looking for a library (preferably .Net or something easily integrated into .Net) that can provide this functionality. I'm more interested in ssh client software than server software, but both functions would be even better.
**Edit**: I'd pref... | [
0.28073620796203613,
0.07821536064147949,
0.25253257155418396,
0.0781240165233612,
-0.24513481557369232,
-0.3644801080226898,
0.1725480556488037,
0.1318107694387436,
-0.18754689395427704,
-0.7841402888298035,
-0.30912455916404724,
0.5286962389945984,
-0.0060000233352184296,
0.1913200616836... | |
How can I handle the Keyboard.KeyDown event without using code-behind? We are trying to use the MVVM pattern and avoid writing an event handler in code-behind file.
A little late, but here goes.
Microsoft's WPF Team recently released an early version of their [WPF MVVM Toolkit](http://blogs.msdn.com/ivo_manolov/archiv... | [
0.0008015731582418084,
-0.1656561642885208,
0.22090551257133484,
0.03774276375770569,
0.011814868077635765,
-0.1663769781589508,
0.2934936583042145,
-0.37940359115600586,
-0.18423224985599518,
-0.5850409865379333,
0.021121017634868622,
0.46297353506088257,
-0.010169007815420628,
0.10224386... | |
```
//creates memory leak
self.editMyObject = [[MyObject alloc] init];
//does not create memory leak
MyObject *temp = [[MyObject alloc] init];
self.editMyObject = temp;
[temp release];
```
The first line of code creates a memory leak, even if you do [self.editMyObject release] in the class's dealloc method. ... | [
0.14069993793964386,
0.03572160378098488,
0.2141583263874054,
-0.07247865200042725,
0.08065588772296906,
-0.2447994500398636,
0.4482960104942322,
-0.2466253787279129,
-0.08702848851680756,
-0.4205312430858612,
-0.3676830232143402,
0.7554279565811157,
-0.2936495840549469,
0.1056081205606460... | |
```
@property (copy) id editMyObject;
```
then assignment via `self.editMyObject =` retains or copies the assigned object. Since `[[MyObject alloc] init]` returns a retained object, that you as the caller own, you have an extra retain of the MyObject instance and it will therefore leak unless it there is a matching r... | [
0.1588461697101593,
0.33971601724624634,
0.44091159105300903,
-0.16140364110469818,
-0.01771668531000614,
-0.4502752423286438,
0.14235226809978485,
-0.36706048250198364,
-0.2683250606060028,
-0.3566044270992279,
-0.3487037718296051,
0.8164157271385193,
-0.26247042417526245,
0.2881846129894... | |
`editMyObject`). Calling the accessor (via `self.editMyObject` is safe for @synthesized accessors, but if an overriden accessor relies on object state (which may not be valid at the calling location in `-dealloc` or causes other side-effects, you have a bug by calling the accessor.
[2] Object ownership rules in Cocoa ... | [
-0.0841687023639679,
0.23703397810459137,
0.2425585389137268,
-0.07140092551708221,
0.01335575245320797,
-0.6044654846191406,
-0.07562848925590515,
-0.13234706223011017,
-0.41936156153678894,
-0.28049135208129883,
-0.455797404050827,
0.6796325445175171,
-0.39075031876564026,
0.276933610439... | |
do not own the object returned from a method. If you want to keep it, you must take ownership with a `retain`, and later release ownership with a `release`. | [
0.4570196270942688,
0.12395502626895905,
0.17420171201229095,
0.2854282259941101,
0.1397222876548767,
-0.5755525231361389,
0.21920880675315857,
-0.12113527953624725,
-0.22073069214820862,
0.17746096849441528,
-0.441043883562088,
0.4621916711330414,
0.11793282628059387,
0.4706650972366333,
... | |
On windows applications are typically packaged as MSI, on Redhat Linux as RPM, what would be a best open source packaging method that could be used to deploy applications to all platforms including different flavors of unix and windows?
Contents would include exes, unix binaries, java jar files, user data, even databa... | [
0.31886252760887146,
0.08869887888431549,
0.32761237025260925,
0.15880677103996277,
-0.07418752461671829,
-0.029814666137099266,
-0.21133193373680115,
0.018590111285448074,
-0.3895110487937927,
-0.7423416972160339,
-0.20704837143421173,
0.40833285450935364,
-0.08470436185598373,
0.21163947... | |
different users and permissions for different directories, however I recognize supporting this feature multiplatform may be very difficult.
I have a client that uses IzPack to create a single installer (it's Java-based) that installs their app on Windows, OS X and Linux.
<http://izpack.org/> | [
0.5447521209716797,
0.04770282283425331,
0.23495936393737793,
-0.13409200310707092,
-0.033254072070121765,
-0.08042919635772705,
0.14331381022930145,
-0.053129058331251144,
-0.4041318893432617,
-0.7954006195068359,
-0.19911101460456848,
0.5080195665359497,
-0.3718065917491913,
-0.101382330... | |
How can I make the following one liner print every file through Python?
```
python -c "import sys;print '>>',sys.argv[1:]" | dir *.*
```
Specifically would like to know how to pipe into a python -c.
DOS or Cygwin responses accepted.
You can read data piped **into** a Python script by reading sys.stdin. For example:
... | [
0.5803630948066711,
0.04714412987232208,
0.06791626662015915,
0.012364580295979977,
-0.1311911791563034,
-0.33162811398506165,
0.41705673933029175,
-0.25281354784965515,
-0.06685439497232437,
-0.682095468044281,
0.043727148324251175,
0.6615893244743347,
-0.36854636669158936,
0.037418209016... | |
I am trying to replace a character - say `;` - with a new line using `replace-string` and/or `replace-regexp` in Emacs.
I have tried the following commands:
* `M-x` `replace-string` `RET` `;` `RET` `\n`
This will replace `;` with two characters: `\n`.
* `M-x` `replace-regex` `RET` `;` `RET` `\n`
This results in the... | [
0.07867079973220825,
0.33659347891807556,
0.43408632278442383,
-0.21399720013141632,
0.0030943909659981728,
0.29597803950309753,
0.5164712071418762,
-0.029205001890659332,
0.06118851527571678,
-0.779109001159668,
-0.2035994529724121,
0.6865569353103638,
-0.21135176718235016,
0.123287379741... | |
When using MySQL MyISAM tables, and issuing an ALTER TABLE statement to add a column, MySQL creates a temporary table and copies all the data into the new table before overwriting the original table.
If that table has a lot of data, this process can be very slow (especially when rebuilding indexes), and requires you ... | [
0.005930506624281406,
0.2642289102077484,
0.16733187437057495,
0.19843296706676483,
-0.12062317132949829,
-0.0734243243932724,
0.04735345393419266,
0.00977277010679245,
-0.31156811118125916,
-0.5165960788726807,
0.06006636098027229,
0.17804615199565887,
-0.47850826382637024,
-0.00217707757... | |
of downtime. We are always adding new features to our software which require schema changes with every release. Any advice is appreciated...
Adding a column with no data to a large table in Oracle is generally very fast. There is no temporary copy of the data and no need to rebuild indexes. Slowness will generally aris... | [
0.07408987730741501,
0.35350608825683594,
0.27483317255973816,
0.23409289121627808,
0.22479736804962158,
-0.16321760416030884,
0.2465888112783432,
0.09140963852405548,
-0.2818146347999573,
-0.45254549384117126,
-0.2308456301689148,
0.30679598450660706,
-0.4771602153778076,
0.23071831464767... | |
over time. If you have a block that is 80% full with 4 rows and you add columns that will grow the size of each row 30% over time, you'll eventually reach a point where Oracle has to move one of the 4 rows to a different block. It does this by leaving a pointer to the new block in the old block, which causes reads on t... | [
0.2000456601381302,
0.16674546897411346,
0.39225053787231445,
-0.017128588631749153,
0.33591216802597046,
0.030677884817123413,
0.22831250727176666,
-0.3244673013687134,
-0.22851194441318512,
-0.6723524332046509,
-0.19046612083911896,
0.2863818407058716,
-0.017729587852954865,
0.1851676255... | |
easier if you have a bit of downtime. But row migration is something that you generally only have to worry about well down the road. If you know that certain tables are likely to have their row size increase substantially in the future, you can mitigate problems in advance by specifying a larger PCTFREE setting for the... | [
-0.007455046288669109,
0.06146113947033882,
0.4341256618499756,
-0.16689927875995636,
0.46775150299072266,
0.0900769978761673,
-0.25758254528045654,
0.014723324216902256,
-0.7178911566734314,
-0.9945260882377625,
-0.2290235161781311,
0.4925784468650818,
-0.0019446748774498701,
-0.044612284... | |
I have certain objects in my domain which are not aggregate roots/entities, yet I still need to retrieve them from a database. I don't want to confuse things by creating repositories for these things. So, what are alternative data access patterns? Would you simply create a DAO for them, while still of course separating... | [
0.2778489291667938,
0.1553177684545517,
0.07668261975049973,
0.28910350799560547,
0.0352274514734745,
0.2404273897409439,
-0.016786668449640274,
-0.079839788377285,
-0.07294557988643646,
-0.7524767518043518,
0.1351233869791031,
0.17425623536109924,
0.04261888563632965,
-0.03394689038395881... | |
For example:
ABCD1
ABCD2
ABCD3
So, I'm keeping a table with one row, one column to store the number in question. Now, I don't want to consider this number an entity and create a repository for it - that's overkill. I just need a way of retrieving the number, adding 1 to it, and saving it. I know there are myriad ways... | [
0.18937060236930847,
0.24048495292663574,
0.06570561230182648,
-0.24648046493530273,
-0.3214786648750305,
0.2586320638656616,
-0.021945999935269356,
-0.23839591443538666,
-0.39277178049087524,
-0.8660871982574463,
0.2222699522972107,
-0.1269802451133728,
-0.33831074833869934,
0.27144688367... | |
I'm trying to build an efficient string matching algorithm. This will execute in a high-volume environment, so performance is critical.
Here are my requirements:
* Given a domain name, i.e. www.example.com, determine if it "matches" one in a list of entries.
* Entries may be absolute matches, i.e. www.example.com.
* ... | [
0.3310651183128357,
0.11025159060955048,
0.23732227087020874,
0.19385789334774017,
0.035529229789972305,
-0.14018478989601135,
0.08447851240634918,
-0.229562908411026,
-0.16050487756729126,
-0.567841649055481,
-0.016109971329569817,
0.2480594366788864,
-0.25583237409591675,
0.1505585312843... | |
through the arrays. While accurate, it feels slow.
I've considered Regex, but am concerned about accurately representing the list of entries as regular expressions.
My question: what's an efficient way of finding if a string, in the form of a domain name, matches any one in a list of strings, given the description li... | [
0.4200911819934845,
0.13217191398143768,
0.29607754945755005,
0.05011202022433281,
-0.3525637984275818,
-0.018721118569374084,
0.1619337499141693,
-0.25764206051826477,
-0.40783292055130005,
-0.4564175009727478,
0.07537388056516647,
0.08410082012414932,
-0.08821632713079453,
0.115642018616... | |
Any tokenized implementation would still have to do string matching on the full set of characters anyway, so you may as well do it all in one shot.
The only differences between this and a regular spell-checking tree are:
1. The matching needs to be done in reverse
- You have to take into account the wildcards
To add... | [
0.021474942564964294,
-0.4336475431919098,
0.09468601644039154,
-0.10714983940124512,
-0.12869687378406525,
-0.13652403652668,
0.0029096747748553753,
-0.28092464804649353,
-0.22040246427059174,
-0.40265747904777527,
0.07887208461761475,
0.009415761567652225,
-0.14660851657390594,
-0.359726... | |
\
-> n -> n -> c -> . -> w -> w -> w
```
Checking www.blog.fark.com would involve tracing through the tree up to the first `"*"`. Because the traversal ended on a `"*"`, there is a match.
Checking www.cern.com would fail on the second "n" of n,n,c,...
Checking dev.www.cnn.com would also fail, since... | [
0.10874481499195099,
0.07838460803031921,
0.4800855219364166,
0.06845489889383316,
0.18884748220443726,
-0.059099651873111725,
0.20771907269954681,
-0.056456226855516434,
-0.1955859363079071,
-0.590829610824585,
-0.2586863040924072,
0.10365303605794907,
-0.17835639417171478,
0.220932051539... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.