text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
with the implementations in a child namespace
* If the consumer is to use both, have them in the same namespace.
* If the interface is for predominantly specialized use, like creating new implementations, consider having them in a child namespace such as Design or ComponentModel.
I'm sure there are other options as we... | [
0.576801598072052,
0.05296353995800018,
-0.19664151966571808,
0.24561050534248352,
-0.04343167692422867,
0.39202064275741577,
-0.12850508093833923,
-0.03796975687146187,
-0.058958057314157486,
-0.8665956258773804,
-0.08870605379343033,
0.46051183342933655,
-0.05552089214324951,
-0.13853497... | |
I'm running into an unusual problem in my unit tests. The class I'm testing creates a dependency property dynamically at runtime and the type of that dependency property can vary depending on the circumstances. While writing my unit tests, I need to create the dependency property with different types and that leads to ... | [
0.09492487460374832,
-0.11057335138320923,
0.05278516933321953,
0.28684210777282715,
-0.24663354456424713,
0.13183386623859406,
0.45307478308677673,
-0.3177696168422699,
-0.057686783373355865,
-0.6002063751220703,
0.13158980011940002,
0.6729695796966553,
-0.2780759036540985,
0.337679207324... | |
is a good idea and might work but seems more complicated than I really wanted to delve into for the sake of unit testing.
I never did find a way to unregister a dependency property so I punted and carefully reorganized my unit tests to avoid the issue. I'm getting a bit less test coverage, but since this problem would... | [
0.5618597269058228,
0.14304763078689575,
0.1309603452682495,
0.22942650318145752,
0.1205332800745964,
-0.024613099172711372,
0.46869686245918274,
-0.22695733606815338,
-0.06822258979082108,
-0.45712122321128845,
0.4047662615776062,
0.4319176971912384,
0.11787309497594833,
0.221966132521629... | |
was no real solution to unregister dependency properties. So I did some digging using [Red Gate .NET Reflector](http://www.red-gate.com/products/reflector/) to see what I could come up with.
Looking at the `DependencyProperty.Register` overloads, they all seemed to point to `DependencyProperty.RegisterCommon`. That me... | [
0.1061774268746376,
-0.07284660637378693,
0.5185050368309021,
-0.01458872202783823,
-0.003649128135293722,
0.007634429726749659,
0.3325042724609375,
-0.7453214526176453,
-0.053339894860982895,
-0.1267448514699936,
-0.09375128149986267,
0.6084128618240356,
-0.06358446180820465,
0.5576453804... | |
(Synchronized)
{
PropertyFromName[key] = dp;
}
```
Both pieces center around `DependencyProperty.PropertyFromName`, a HashTable. I also noticed the `DependencyProperty.RegisteredPropertyList`, an `ItemStructList<DependencyProperty>` but have not seen where it is used. However, for safety, I figured I'd try to remov... | [
0.23555207252502441,
-0.2803545296192169,
0.39377614855766296,
-0.06493934243917465,
0.19019460678100586,
-0.042775921523571014,
0.40372946858406067,
-0.5409433841705322,
-0.3281322419643402,
0.02259775996208191,
-0.11712461709976196,
0.5911197066307068,
-0.7288042902946472,
0.355313807725... | |
Console.WriteLine("Does not exist in list");
}
var propertyFromNameField = typeof(DependencyProperty).
GetField("PropertyFromName", BindingFlags.NonPublic | BindingFlags.Static);
var propertyFromName = (Hashtable)propertyFromNameField.GetValue(null);
object keyToRemove = null;
foreach (DictionaryEntry i... | [
-0.26967093348503113,
-0.03092310018837452,
0.7484347820281982,
-0.14551782608032227,
0.34492847323417664,
0.025724446401000023,
0.4935530126094818,
-0.3899293541908264,
0.20812231302261353,
-0.4972003698348999,
-0.28957217931747437,
0.7713063359260559,
-0.12926346063613892,
0.448944181203... | |
MSFT chose not to have a formal way to unregister a dependency property, and attempting to go against it is just asking for trouble. | [
0.22154445946216583,
-0.007366635370999575,
0.5600467324256897,
-0.13901670277118683,
0.06764522194862366,
-0.37385547161102295,
-0.10258205980062485,
0.046402182430028915,
-0.16884754598140717,
-0.12740539014339447,
-0.3331265151500702,
0.282961905002594,
-0.30528563261032104,
0.268893122... | |
I can't use the `Get*Profile` functions because I'm using an older version of the Windows CE platform SDK which doesn't have those. It doesn't have to be too general.
```
[section]
name = some string
```
I just need to open the file, check for the existence of "section", and the value associated with "name". Standar... | [
0.545302152633667,
0.1516827493906021,
0.35371553897857666,
-0.17266888916492462,
-0.055793192237615585,
-0.23492568731307983,
0.2782098352909088,
-0.21267683804035187,
-0.06815430521965027,
-0.7274045348167419,
-0.0969843938946724,
0.5074787139892578,
-0.27123013138771057,
0.2409985810518... | |
up with.
Looking at the `DependencyProperty.Register` overloads, they all seemed to point to `DependencyProperty.RegisterCommon`. That method has two portions:
First to check if the property is already registered
```
FromNameKey key = new FromNameKey(name, ownerType);
lock (Synchronized)
{
if (PropertyFromName.Con... | [
0.21591326594352722,
-0.005960250739008188,
0.797191858291626,
0.15179137885570526,
0.11630027741193771,
0.06908203661441803,
0.02715003862977028,
-1.0169111490249634,
-0.6293359994888306,
-0.5023566484451294,
-0.03380770981311798,
0.37667667865753174,
-0.284637987613678,
0.426222085952758... | |
is used. However, for safety, I figured I'd try to remove from that as well if possible.
So I wound up with the following code that allowed me to "unregister" a dependency property.
```
private void RemoveDependency(DependencyProperty prop)
{
var registeredPropertyField = typeof(DependencyProperty).
GetField("R... | [
0.073643259704113,
-0.1554933786392212,
0.6107718348503113,
-0.31122419238090515,
0.33475756645202637,
0.00009642876830184832,
0.6119379997253418,
-0.5849352478981018,
-0.039647988975048065,
-0.3593115508556366,
-0.22526948153972626,
0.6067789793014526,
-0.5079415440559387,
0.4668007493019... | |
propertyFromName = (Hashtable)propertyFromNameField.GetValue(null);
object keyToRemove = null;
foreach (DictionaryEntry item in propertyFromName)
{
if (item.Value == prop)
keyToRemove = item.Key;
}
if (keyToRemove != null)
propertyFromName.Remove(keyToRemove);
}
```
It worked well enough for me... | [
0.11746686697006226,
-0.034583382308483124,
0.4175996780395508,
-0.20102527737617493,
0.15474939346313477,
-0.19042488932609558,
0.4960751235485077,
-0.40907102823257446,
-0.046875618398189545,
-0.4196028709411621,
-0.22374144196510315,
0.7565682530403137,
-0.1153704896569252,
0.4267424643... | |
I am using virtual machines for development,but each time I need a new VM, I copy the file and create a new server, but I need a new name for the server to add it to our network.
After renaming the server, the Sharepoint sites have many errors and do not run.
I had similar issue just yesterday when trying to test my o... | [
0.6297042369842529,
0.1672169268131256,
0.4180086851119995,
-0.011758250184357166,
-0.07483398169279099,
0.03481154516339302,
0.17189648747444153,
-0.12205434590578079,
-0.11267610639333725,
-0.8566523194313049,
0.37973400950431824,
0.49241557717323303,
-0.15580964088439941,
0.570770919322... | |
the `DependencyProperty.Register` overloads, they all seemed to point to `DependencyProperty.RegisterCommon`. That method has two portions:
First to check if the property is already registered
```
FromNameKey key = new FromNameKey(name, ownerType);
lock (Synchronized)
{
if (PropertyFromName.Contains(key))
{
t... | [
0.006896888837218285,
0.025637755170464516,
0.673254132270813,
-0.03671716898679733,
0.17097404599189758,
0.12398801743984222,
0.17896032333374023,
-0.6225854158401489,
-0.21294961869716644,
-0.20181326568126678,
-0.24692577123641968,
0.5668033361434937,
-0.02509494684636593,
0.42790624499... | |
for safety, I figured I'd try to remove from that as well if possible.
So I wound up with the following code that allowed me to "unregister" a dependency property.
```
private void RemoveDependency(DependencyProperty prop)
{
var registeredPropertyField = typeof(DependencyProperty).
GetField("RegisteredPropertyL... | [
0.05549795553088188,
-0.13324375450611115,
0.5742825269699097,
-0.3242328464984894,
0.27896109223365784,
-0.0380239337682724,
0.7175107002258301,
-0.5945572853088379,
0.02857181616127491,
-0.3521329164505005,
-0.2832307517528534,
0.5623536109924316,
-0.516886293888092,
0.533255398273468,
... | |
object keyToRemove = null;
foreach (DictionaryEntry item in propertyFromName)
{
if (item.Value == prop)
keyToRemove = item.Key;
}
if (keyToRemove != null)
propertyFromName.Remove(keyToRemove);
}
```
It worked well enough for me to run my tests without getting an "AlreadyRegistered" exception. Howe... | [
0.09153823554515839,
-0.027371343225240707,
0.4337909519672394,
-0.1390971541404724,
0.029410945251584053,
-0.1691717505455017,
0.5450150966644287,
-0.10402058809995651,
0.0575646348297596,
-0.42095229029655457,
-0.19802623987197876,
0.7482070922851562,
-0.21399658918380737,
0.379535824060... | |
I'm using [TinyXML](http://www.grinninglizard.com/tinyxml/) to parse/build XML files. Now, according to [the documentation](http://www.grinninglizard.com/tinyxmldocs/) this library supports multibyte character sets through UTF-8. So far so good I think. But, the only API that the library provides (for getting/setting e... | [
0.2801887094974518,
0.2460014373064041,
0.2601597011089325,
-0.05608920007944107,
0.09235553443431854,
0.02252146601676941,
0.06027410179376602,
0.2711593508720398,
-0.4158191978931427,
-0.5198143720626831,
-0.13191671669483185,
0.3381307125091553,
-0.1738794595003128,
0.2761307954788208,
... | |
take a 16-bit code point and split it over 2 chars in a `std::string`, but that wouldn't transform the `std::string` to a 'Unicode' string, it would make it invalid for most purposes and would maybe accidentally work when written to a file and read in by another program.
So, can somebody explain to me how a library ca... | [
0.22654664516448975,
0.25698041915893555,
0.08360565453767776,
0.1739632487297058,
-0.061158012598752975,
0.08120986819267273,
0.09536880254745483,
0.11772620677947998,
-0.20475460588932037,
-0.34432166814804077,
-0.07040785253047943,
0.27937135100364685,
-0.5271003842353821,
0.05701968446... | |
superset of 7-bit ASCII (code points <= 127 always encoded in a single byte as themselves), it's furthermore careful that bytes with those values are never used as part of the encoding of the multibyte values for code points >= 128. So if you see a byte == 44, it's a '<' character, etc. All of the metachars in XML are ... | [
-0.13996988534927368,
0.08819707483053207,
0.30150106549263,
0.2711290419101715,
-0.25376322865486145,
-0.0800565779209137,
0.19837571680545807,
-0.19578170776367188,
-0.17117227613925934,
-0.423310786485672,
-0.5382118821144104,
0.18111221492290497,
-0.34110623598098755,
0.074454963207244... | |
though the parser didn't specifically know UTF-8.
Further (not specific to XML, but rather clever), even more complex things genrally just work (tm). For example, if you sort UTF-8 lexicographically by bytes, you get the same answer as sorting it lexicographically by code points, despite the variation in # of bytes us... | [
-0.13282227516174316,
-0.08682221174240112,
0.14229199290275574,
0.20897944271564484,
-0.26913487911224365,
-0.10137125104665756,
0.11898649483919144,
-0.20534318685531616,
-0.18451440334320068,
-0.5413305759429932,
-0.43289318680763245,
0.28070762753486633,
-0.08941704034805298,
-0.233855... | |
I am a firm believer in the idea that one of the most important things you get from learning a new language is not how to use a new language, but the knowledge of concepts that you get from it. I am not asking how important or useful you think Assembly is, nor do I care if I never use it in any of my real projects.
W... | [
0.6565197706222534,
0.45727935433387756,
-0.4690729081630707,
-0.08491449058055878,
-0.032983291894197464,
-0.015598814934492111,
0.43715396523475647,
0.3107199966907501,
-0.2760378420352936,
-0.3738563358783722,
0.0074414764530956745,
0.5653183460235596,
0.07171843945980072,
-0.0013269422... | |
can also be something that you feel the typical programmer who spends all their time in higher-level languages would not understand or takes for granted, such as the CPU cache.
I think assembly language can teach you lots of little things, as well as a few big concepts.
I'll list a few things I can think of here, but ... | [
0.17063836753368378,
0.2015557736158371,
-0.12809936702251434,
0.21217721700668335,
0.0783432126045227,
0.17406335473060608,
0.14453719556331635,
-0.05779805779457092,
-0.5074456334114075,
-0.579702615737915,
-0.09505573660135269,
0.3816990852355957,
0.12291491031646729,
-0.125334188342094... | |
integer-only approximation routine, right?
Nah. The math coprocessor (on x86 that is) has a **fsqrt** instruction. Converting to float, taking the square root, and converting to int again is faster than an all-integers algorithm.
Then there are things like accessing memory that you can follow, but not properly apprec... | [
-0.18928426504135132,
0.2518765330314636,
0.2587784230709076,
-0.10979484021663666,
-0.21013544499874115,
0.2457641065120697,
-0.07694905996322632,
0.19779710471630096,
-0.11338281631469727,
-0.4061807096004486,
0.18893079459667206,
0.7509526014328003,
-0.3384106457233429,
-0.0851617157459... | |
the list, then using that, load the variable (assuming you can't keep the address of the variable in a register between uses). If you instead stored the variable outside of the list, you only need a single load operation.
Of course saving a couple of cycles here and there is usually not important these days. But if yo... | [
0.4886213541030884,
-0.011009660549461842,
-0.035839542746543884,
0.27338868379592896,
-0.03190944716334343,
-0.19183102250099182,
0.05508798733353615,
-0.1773890256881714,
-0.4306045472621918,
-0.2738770842552185,
0.09991538524627686,
0.9136789441108704,
-0.39767220616340637,
-0.247204735... | |
the caller or callee clean up the stack? Do you even use the stack? You can pass values in registers - but due to the funny x86 instruction set, it's better to pass certain things in certain registers. And which registers will be preserved? One thing C compilers can't really optimise by themselves is calls.
There are ... | [
0.2016516923904419,
-0.08111020922660828,
0.15245147049427032,
0.12027227878570557,
-0.14113877713680267,
-0.15289822220802307,
0.4149840474128723,
-0.10623681545257568,
-0.2112424075603485,
-0.1358974426984787,
-0.10510095208883286,
0.5181244015693665,
-0.3003806471824646,
0.1268522739410... | |
you were ever to design a programming language with innovative features, you ought to know about funny things that the hardware is capable of.
A knowledge of assembly language teaches you architecture-specific things about computer security. How you might exploit buffer overflows, or break into kernel mode, and how to... | [
0.17609868943691254,
0.37480685114860535,
-0.1367434710264206,
0.32866185903549194,
0.050082653760910034,
-0.08088477700948715,
0.2692192494869232,
0.06764024496078491,
-0.40170687437057495,
-0.5318945646286011,
-0.2420405149459839,
0.6971668601036072,
-0.15445537865161896,
-0.008211754262... | |
...
}
```
to good use once you learn what it does, but would find it difficult to work out what it does by yourself, then assembly language is probably a waste of your time. | [
0.2661290466785431,
0.3357245922088623,
-0.1959453523159027,
-0.05525689944624901,
0.1448245346546173,
-0.185399129986763,
0.3226035237312317,
0.2969726026058197,
0.22307054698467255,
-0.7265095710754395,
-0.27353620529174805,
0.5019570589065552,
-0.1252160370349884,
-0.08018378913402557,
... | |
This is a bit of a weird one, and I could well be coding this completely wrong - hence why I've hit the same error twice in two days, in completely different parts of a script. The code I'm using is below:
```
public function findAll( $constraints = array() ) {
// Select all records
$SQL = 'SELEC... | [
0.04289626702666283,
0.11535466462373734,
0.16202768683433533,
-0.2578347325325012,
0.41694360971450806,
-0.2031194567680359,
0.003662607166916132,
-0.06690921634435654,
-0.27410170435905457,
-0.6779005527496338,
0.05551561340689659,
0.600005567073822,
-0.30826178193092346,
0.0339412689208... | |
count( $constraints ) > 0 ) {
$SQL .= ' WHERE ';
foreach( $constraints as $field => $value ) {
$SQL .= $field . ' = :' . $field . ' AND ';
}
}
// Remove the | [
-0.006816420704126358,
-0.12358768284320831,
0.5371589064598083,
-0.37011343240737915,
0.3193766474723816,
-0.06938541680574417,
0.05603588744997978,
-0.5385109782218933,
-0.0326482392847538,
-0.032172225415706635,
-0.2980884909629822,
0.40193942189216614,
-0.6650132536888123,
0.2522720694... | |
final AND and prepare the statement
$SQL = substr( $SQL, 0, -5 );
$PDOStatement = $this->PDO->prepare( $SQL );
// Loop through constraints and bind parameters
foreach( $constraints as $field => $value ) {
print 'Binding ' . $field . ' to ' . $value . '
'; | [
-0.058185726404190063,
0.046331316232681274,
0.44629010558128357,
-0.3077855408191681,
0.13172049820423126,
0.04535820335149765,
0.1754121035337448,
-0.6658989191055298,
0.2977171540260315,
-0.5708920359611511,
-0.5291829705238342,
0.3920213282108307,
-0.11986491084098816,
0.05591279268264... | |
$PDOStatement->bindParam( $field, $value );
}
$PDOStatement->execute();
var_dump($PDOStatement);
while ( $results = $PDOStatement->fetch( PDO::FETCH_ASSOC ) ) {
var_dump($results);
}
}
```
I'm pretty new to using PDO, but basically I'm attempting to... | [
-0.12415282428264618,
-0.33503785729408264,
0.6714398264884949,
-0.3956223428249359,
0.14953401684761047,
0.14112403988838196,
0.3323303461074829,
-0.5412041544914246,
-0.20947061479091644,
-0.6835185885429382,
-0.2599148154258728,
0.4662208557128906,
-0.49719876050949097,
-0.3447297513484... | |
=> 1, 'name' => 'James' )
```
and return all rows from the table
```
WHERE active = 1 AND name = 'James'
```
If I use this array, the SQL executed from the first
```
var_dump( )
```
is
```
SELECT * FROM {table} WHERE active = :active AND name = 'James'
```
- exactly as I expect. The bound parameters prints 'Bind... | [
-0.1023583710193634,
0.10978943854570389,
0.5627949833869934,
-0.46299973130226135,
0.0551082044839859,
0.06052467226982117,
0.2744167447090149,
-0.5525209307670593,
-0.1447976529598236,
-0.4820900559425354,
-0.2886851727962494,
0.47069692611694336,
-0.48619717359542847,
0.1985825300216674... | |
'active' => 1 )
```
, this works perfectly fine. It appears to be whenever multiple constraints are passed that it stops working.
That's because [`bindParam`](http://docs.php.net/manual/en/pdostatement.bindparam.php) works by binding to a variable, and you are re-using the variable (`$value`) for multiple values. Try w... | [
0.047998424619436264,
-0.2264339029788971,
0.5608426332473755,
-0.25668373703956604,
-0.0654585063457489,
-0.25829949975013733,
0.4847787916660309,
-0.2842143177986145,
-0.21453610062599182,
-0.37450742721557617,
-0.2071586698293686,
0.6108619570732117,
-0.5747467875480652,
0.0398776903748... | |
I often use the "top" command to see what is taking up resources. Mostly it comes up with a long list of Apache httpd processes, which is not very useful. Is there any way to see a similar list, but such that I could see which PHP scripts etc. those httpd processes are actually running?
If you're concerned about long r... | [
0.4709390699863434,
-0.13950516283512115,
0.1872817724943161,
0.17996445298194885,
-0.06476625800132751,
-0.3725505769252777,
0.15278640389442444,
-0.19350385665893555,
-0.5199099183082581,
-0.42258673906326294,
-0.21368254721164703,
0.5370875000953674,
0.04722548648715019,
0.0821052417159... | |
PHP, but applies to anything running inside an apache process.
Note that the www.apache.org status output is publicly available presumably for demonstration purposes -- you'd want to restrict access to yours so that not everyone can see it. | [
0.21592743694782257,
0.15665303170681,
0.09310746192932129,
0.13056296110153198,
-0.3370058536529541,
-0.43319785594940186,
0.41138407588005066,
-0.06957510113716125,
-0.265624463558197,
0.05130953714251518,
0.0004356240970082581,
-0.01848110556602478,
-0.18674197793006897,
0.0203400924801... | |
I have the following problem:
I have an HTML textbox (`<input type="text">`) whose contents are modified by a script I cannot touch (it is my page, but i'm using external components).
I want to be notified in my script every time the value of that textbox changes, so I can react to it.
I've tried this:
```
txtStart... | [
0.4351078271865845,
0.04779376462101936,
0.4475237727165222,
-0.3416040539741516,
-0.04530965909361839,
-0.1778079718351364,
0.679190456867218,
-0.26438620686531067,
-0.32388269901275635,
-0.6009613871574402,
-0.06755148619413376,
0.6872062683105469,
-0.46764692664146423,
-0.17860764265060... | |
to, that i'm not aware of?
I'm using the Prototype library, and in case it's relevant, the external component modifying the textbox value is Basic Date Picker (www.basicdatepicker.com)
As you've implied, change (and other events) only fire when the user takes some action. A script modifying things won't fire any event... | [
0.16474352777004242,
-0.11415650695562363,
0.33876869082450867,
-0.2117607295513153,
0.26212987303733826,
0.06250316649675369,
0.3864384889602661,
-0.3482803404331207,
-0.005501169711351395,
-0.23014916479587555,
-0.008550900034606457,
0.7040974497795105,
-0.3398093283176422,
0.05617001280... | |
of selecting a date, then you'll need to wrap those methods as well. | [
0.4463169276714325,
-0.05211032181978226,
0.2548041343688965,
0.2393653839826584,
0.30175265669822693,
-0.21345627307891846,
-0.11797429621219635,
-0.1921016424894333,
-0.22381974756717682,
-0.43576690554618835,
0.1252039670944214,
0.2257692962884903,
0.32619670033454895,
-0.18191702663898... | |
As you work in a legacy codebase what will have the greatest impact over time that will improve the quality of the codebase?
* Remove unused code
* Remove duplicated code
* Add unit tests to improve test coverage where coverage is low
* Create consistent formatting across files
* Update 3rd party software
* Reduce war... | [
0.5949142575263977,
0.30240440368652344,
0.01698429137468338,
-0.13555973768234253,
0.016607075929641724,
-0.25502854585647583,
0.3791820704936981,
-0.395514577627182,
-0.17582876980304718,
-0.62616366147995,
-0.3216620087623596,
0.42862454056739807,
0.08683959394693375,
-0.135857686400413... | |
GREAT book.
If you don't like that answer, then the best advice I can give would be:
* First, stop making new legacy code[1]
[1]: Legacy code = code without unit tests and therefore an unknown
Changing legacy code without an automated test suite in place is dangerous and irresponsible. Without good unit test cover... | [
0.36615416407585144,
0.016981733962893486,
-0.18073414266109467,
0.2980943024158478,
0.2696405351161957,
-0.47777020931243896,
0.2199079394340515,
-0.24670499563217163,
-0.2913628816604614,
-0.23606689274311066,
-0.13741061091423035,
0.3170505166053772,
-0.17922227084636688,
0.085584588348... | |
you need to stop everything and spend weeks writing tests for everything. Quite the contrary, just test around the areas you need to test and work out from there.
Jimmy Bogard and Ray Houston did an interesting screen cast on a subject very similar to this:
<http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/0... | [
0.14405030012130737,
-0.06933174282312393,
-0.26535579562187195,
0.37552788853645325,
0.40528249740600586,
-0.2990378737449646,
0.3280008137226105,
-0.08220811933279037,
-0.4384407103061676,
0.06234954670071602,
0.1610105186700821,
0.6161494851112366,
-0.2974154055118561,
0.079420208930969... | |
I would like to install SQLExpress2005 as an instance "SQLExpress"
and install SQLExpresss2008 as "SQLExpress2008" instance.
Is there any problem with doing this on the same machine?
As Long as you give them distinct names, there shouldn't be any problems. The binaries are stored in directories based on version, and y... | [
0.044144343584775925,
0.19177614152431488,
0.29160580039024353,
0.19298206269741058,
-0.07306881994009018,
-0.36205780506134033,
0.1209510937333107,
0.08732425421476364,
-0.3006100356578827,
-0.8358827829360962,
-0.002492922591045499,
0.32757022976875305,
-0.3755461871623993,
0.15261431038... | |
When you search in Google (i'm almost sure that Altavista did the same thing) it says "Results 1-10 of about xxxx"...
This has always amazed me... What does it mean "about"?
How can they count roughly?
I do understand why they can't come up with a precise figure in a reasonable time, but how do they even reach t... | [
0.2796758711338043,
0.12473880499601364,
0.42072656750679016,
0.26535388827323914,
-0.08842074871063232,
-0.147858664393425,
-0.022430209442973137,
0.16296501457691193,
-0.25541964173316956,
-0.4822867810726166,
0.24269022047519684,
0.17362116277217865,
0.23199017345905304,
0.1040330082178... | |
(known exactly as of the last time statistics were collected, but generally not up-to-date), multiplied by an estimated selectivity (usually based on a sort of statistical distribution model calculated by sampling some small subset of rows).
The PostgreSQL manual has a section on [statistics used by the planner](http:... | [
0.15640921890735626,
-0.2789115309715271,
0.3435084819793701,
0.4184092879295349,
-0.0750327929854393,
0.2235240340232849,
-0.13434718549251556,
0.2357713133096695,
-0.4344121217727661,
-0.38869592547416687,
0.18963736295700073,
0.2885732650756836,
-0.013489357195794582,
-0.261159479618072... | |
I'm writing some semi-portable code and want to be able to detect when I'm compiling for iPhone. So I want something like `#ifdef IPHONE_SDK...`.
Presumably Xcode defines something, but I can't see anything under project properties, and Google isn't much help.
It's in the SDK docs under "Compiling source code conditi... | [
0.3077224791049957,
0.14329637587070465,
0.2204384058713913,
-0.19139859080314636,
0.2488008290529251,
-0.08117097616195679,
0.40382298827171326,
-0.01425213273614645,
-0.09069428592920303,
-0.6662310361862183,
-0.2179185450077057,
0.34462520480155945,
-0.3602544665336609,
-0.4347343742847... | |
code if you are building for the device, then you should do
```
#if !(TARGET_OS_SIMULATOR)
...
#endif
``` | [
0.5590595602989197,
0.27598369121551514,
0.025009192526340485,
0.2236696481704712,
0.39906013011932373,
-0.4075373709201813,
0.3408469557762146,
-0.20429694652557373,
0.23698416352272034,
-0.8056632876396179,
-0.3584652245044708,
0.6951401233673096,
-0.33975934982299805,
0.0050899968482553... | |
When you create a new web user control in visual studio it by default adds the Page\_Load event. What is the advantage to using this rather than overriding the base `OnLoad` event on the control? Is it just that the `Page_Load` event fires before `OnLoad`?
The `OnLoad` method should be the place where the `Load` event ... | [
0.1636197417974472,
0.06466640532016754,
0.17084850370883942,
0.04015873745083809,
-0.2656102180480957,
-0.3386610448360443,
0.10617337375879288,
-0.15651670098304749,
-0.2694445848464966,
-0.6935338973999023,
-0.19282503426074982,
0.8719000816345215,
-0.24069415032863617,
-0.1668621599674... | |
I want to take html, including the text and images and turn it into one image containing everything. Is there a free way to do it?
This is using .net 3.5.
### See also:
[Server Generated web screenshots?](https://stackoverflow.com/questions/119116/server-generated-web-screenshots)
[What is the best way to create ... | [
0.6896459460258484,
0.0020665358752012253,
0.3786563575267792,
0.11977673321962357,
0.0018310117302462459,
-0.27691975235939026,
0.07134155929088593,
0.004329703748226166,
-0.32955387234687805,
-0.7277927994728088,
0.14479443430900574,
0.46593379974365234,
0.0679936632514,
0.04029084369540... | |
**Is there a better way of binding a list of base class to a UI other than downcasting e.g:**
```
static void Main(string[] args) {
List<Animal> list = new List<Animal>();
Pig p = new Pig(5);
Dog d = new Dog("/images/dog1.jpg");
list.Add(p);
list.Add(d);
foreach (Animal a in list)
... | [
0.12633109092712402,
-0.26248297095298767,
0.2422938346862793,
-0.4081466495990753,
-0.028083840385079384,
0.3457292914390564,
0.33888956904411316,
-0.4466779828071594,
-0.20073971152305603,
-0.5722867250442505,
-0.607540488243103,
0.44714152812957764,
-0.6134510636329651,
0.05391559004783... | |
DoDogStuff(a as Dog);
}
}
static void DoPigStuff(Pig p)
{
if (p != null)
{
label1.Text = String.Format("The pigs tail is {0}", p.TailLength);
}
}
static void DoDogStuff(Dog d) {
if (d != null)
{
Image1.src = d.Image;
}
}
class Animal {
public String Name {... | [
0.4734613001346588,
-0.2880241572856903,
0.047164738178253174,
-0.21902675926685333,
-0.142031729221344,
0.403395414352417,
0.17373822629451752,
-0.354269802570343,
-0.23828348517417908,
-0.4105316996574402,
-0.32804763317108154,
0.5740258693695068,
-0.7419057488441467,
-0.1169042065739631... | |
public int TailLength { get; set; }
public Pig(int tailLength)
{
Name = "Mr Pig";
TailLength = tailLength;
}
}
class Dog : Animal {
public String Image { get; set; }
public Dog(String image)
{
Name = "Mr Dog";
Image = image;
}
}
```
When faced with this ... | [
0.12359922379255295,
-0.2584054172039032,
0.28834235668182373,
-0.16877754032611847,
0.016324760392308235,
0.3437691032886505,
0.19294576346874237,
-0.22920198738574982,
-0.23590010404586792,
-0.5456215143203735,
-0.37259697914123535,
0.6671506762504578,
-0.7009357810020447,
0.094629898667... | |
follow the [visitor pattern](http://en.wikipedia.org/wiki/Visitor_pattern).
```
interface IVisitor
{
void DoPigStuff(Piggy p);
void DoDogStuff(Doggy d);
}
class GuiVisitor : IVisitor
{
void DoPigStuff(Piggy p)
{
label1.Text = String.Format("The pigs tail is {0}", p.TailLength);
}
void DoDogStuff(Dogg... | [
0.06675054132938385,
-0.24377405643463135,
0.584354043006897,
-0.24788735806941986,
-0.06562058627605438,
0.153311088681221,
0.17517197132110596,
-0.19897447526454926,
-0.46496903896331787,
-0.5416653752326965,
-0.4104820787906647,
0.6919787526130676,
-0.7053136825561523,
0.037180610001087... | |
Name = "Mr Pig";
TailLength = tailLength;
}
public void Visit(IVisitor visitor)
{
visitor.DoPigStuff(this);
}
}
class Doggy : Animal
{
public String Image { get; set; }
public Doggy(String image)
{
Name = "Mr Dog";
Image = image;
}
public void Visit(IVisitor... | [
0.02593698725104332,
-0.30917686223983765,
0.3348361849784851,
-0.4272540807723999,
0.1169741079211235,
0.21934181451797485,
0.3217693865299225,
-0.026489926502108574,
-0.46321526169776917,
-0.33485668897628784,
-0.3758125901222229,
0.7726972103118896,
-0.8439504504203796,
0.19029967486858... | |
static void Main(string[] args) {
List<Animal> list = new List<Animal>();
Pig p = new Pig(5);
Dog d = new Dog("/images/dog1.jpg");
list.Add(p);
list.Add(d);
IVisitor visitor = new GuiVisitor();
foreach (Animal a in list)
{
a.Visit(visitor);
}
}
}
```
Thus th... | [
-0.1728968471288681,
-0.38564199209213257,
0.18848635256290436,
-0.3180311322212219,
-0.11111346632242203,
0.2762543559074402,
0.28409427404403687,
-0.027374697849154472,
-0.5178377032279968,
-0.4846828877925873,
-0.4900236129760742,
0.5707908868789673,
-0.9389477372169495,
0.1464024484157... | |
C#, and C++.
The only advantage of this code over [jop](https://stackoverflow.com/questions/147129/c-downcasting-when-binding-to-and-interface#147383)'s is that the IVisitor interface can be implemented on a different class later when you need to add a new type of visitor (like a **XmlSerializeVisitor** or a **FeedAni... | [
-0.16910770535469055,
-0.5084223747253418,
0.6900912523269653,
-0.0944395661354065,
-0.21967685222625732,
-0.3266275227069855,
0.0506192147731781,
0.011387736536562443,
-0.42471200227737427,
-0.6303310394287109,
-0.24227963387966156,
0.6221086382865906,
-0.518252968788147,
0.07079436630010... | |
What is the benefit of referencing resources using globally-unique URIs (as REST does) versus using a proprietary id format?
For example:
1. <http://host.com/student/5>
2. <http://host.com/student?id=5>
In the first approach the entire URL is the ID. In the second approach only the 5 is the ID. What is the practical... | [
0.2270178198814392,
-0.03866448998451233,
0.5433376431465149,
0.3969965875148773,
-0.20416881144046783,
-0.05122056603431702,
-0.2076590657234192,
-0.13407209515571594,
0.03264129161834717,
-0.7282124757766724,
-0.18395105004310608,
0.29333144426345825,
0.1639472395181656,
0.34762522578239... | |
my own post.
I will answer my own question:
1) Why are URIs important?
I'll quote from **RESTful Web Services by Leonard Richardson and Sam Ruby (ISBN: 978-0-596-52926-0)**:
> Consider a real URI that names a resource in the genre “directory of resources about
> jellyfish”: <http://www.google.com/search?q=jellyfish... | [
0.06620816886425018,
0.25897645950317383,
0.20660299062728882,
0.17854158580303192,
-0.3384557366371155,
-0.09109306335449219,
0.20252525806427002,
0.4926777184009552,
0.002297056606039405,
-0.611004114151001,
0.02201813831925392,
0.08579395711421967,
-0.2999172508716583,
0.302141845226287... | |
search box, and click the ‘Google Search’ button.
>
>
> This isn’t an academic worry. Until the mid-1990s, when ftp:// URIs
> became popular for describing files on FTP sites, people had to write
> things like: “Start an anonymous FTP session on ftp.example.com. Then
> change to directory pub/files/ and download f... | [
-0.11334504187107086,
0.20208273828029633,
0.6678605675697327,
0.059857726097106934,
-0.25568920373916626,
-0.2899641990661621,
0.043692316859960556,
0.036490343511104584,
-0.5039952993392944,
-0.9170528650283813,
-0.22453048825263977,
0.49476176500320435,
-0.2553231418132782,
0.2241747826... | |
It makes it easy for
> clients to use web sites in ways the original designers never imagined.
2) What is the benefit of addressibility?
> It is far easier to follow server-provided URIs than construct them yourself. This is especially true as resource relationships become too complex to be expressed in simple rules... | [
-0.008341164328157902,
-0.1257811039686203,
0.32363471388816833,
0.6030516624450684,
-0.12499270588159561,
-0.10147504508495331,
0.03292038291692734,
-0.0494401752948761,
-0.22526517510414124,
-1.1218417882919312,
-0.11958443373441696,
0.3762403726577759,
-0.25424352288246155,
0.0649743303... | |
calculate relative tile positions would break.
3) What is the benefit of URIs over custom IDs?
> Custom IDs identify a resource uniquely. URIs go a step further by telling you where to find it. This simplifies the client logic. | [
0.10331999510526657,
-0.12240475416183472,
0.31510353088378906,
0.42755526304244995,
0.0011746932286769152,
-0.09108933061361313,
0.0655759871006012,
-0.2088693231344223,
-0.04021630436182022,
-0.9002533555030823,
0.15814661979675293,
0.4614383578300476,
-0.01950199156999588,
0.14275822043... | |
Is there a way to hide table rows without affecting the overall table width? I've got some javascript that shows/hides some table rows, but when the rows are set to `display: none;`, the table with shrinks to fit the contents of the visible rows.
If you are looking to preserve the overall width of the table, you can ch... | [
0.3407433331012726,
0.13918758928775787,
0.2869888246059418,
-0.14075741171836853,
0.05243461951613426,
-0.04121211916208267,
0.28744688630104065,
-0.16835080087184906,
-0.46139654517173767,
-0.6226926445960999,
0.04772632196545601,
0.6082740426063538,
-0.23016737401485443,
0.0256590731441... | |
by adding a style to your table:
```
table {
table-layout: fixed;
}
``` | [
0.014067900367081165,
0.2946537435054779,
0.34715643525123596,
-0.13805881142616272,
0.05301998183131218,
-0.05503460392355919,
-0.09635671228170395,
0.025209765881299973,
-0.44350945949554443,
-0.8851531147956848,
-0.293519526720047,
0.3945412337779999,
-0.26685982942581177,
-0.0591499879... | |
I have a T-SQL **table variable** (not a table) which has an auto incrementing identity column. I want to clear all data from this variable and reset the identity column value to 1. How can this be done?
If you're using a table variable, you can't do it. If it were a table, you could truncate it or use `DBCC CHECKIDENT... | [
0.4416874051094055,
0.1022595539689064,
0.16224859654903412,
-0.03621647134423256,
-0.03397919610142708,
0.06615272164344788,
0.22024373710155487,
-0.22240428626537323,
0.09497447311878204,
-0.477332204580307,
-0.013522569090127945,
0.5783228278160095,
-0.4731787145137787,
0.30806919932365... | |
nvarchar(50))
INSERT INTO @t (somevalue) VALUES( 'one')
INSERT INTO @t (somevalue) VALUES('twp')
INSERT INTO @t (somevalue) VALUES('three')
SELECT row_number() OVER (ORDER BY pkint), somevalue FROM @t
DELETE FROM @t
INSERT INTO @t (somevalue) VALUES('four')
SELECT row_number() OVER (ORDER BY pkint), somevalue FROM @t
... | [
-0.27517154812812805,
-0.07875550538301468,
0.36575716733932495,
-0.31426870822906494,
0.17984698712825775,
0.22788597643375397,
-0.060815129429101944,
-0.5382237434387207,
-0.08850326389074326,
-0.5714530944824219,
0.060566339641809464,
0.6330593228340149,
-0.08336693793535233,
-0.0191618... | |
```
('1' * N) !~ /^1?$|^(11+?)\1+$/
```
On the net, I found this piece of Ruby code that works for N >= 0 that determines whether or not N is a prime. From what I can tell, it looks like play with regex but I have no idea how it works. Could someone tell me how it works?
You can find a lengthy explanation of this cod... | [
0.43972188234329224,
0.26448336243629456,
-0.02506379969418049,
-0.2276587188243866,
0.10784080624580383,
-0.05520350858569145,
0.14246337115764618,
0.11298751831054688,
-0.3452712893486023,
-0.3013212978839874,
0.16007587313652039,
0.5362198948860168,
-0.4590784013271332,
0.13727872073650... | |
We're doing a complex bit of data accumulation. Our customer sends us some stuff that includes two dimensions (time and a business unit). Time is mostly year-month. The business unit dimension has just a few attributes: a name, and a few categories to which BU's can belong for reporting and analysis purposes.
The stuf... | [
0.3526325225830078,
0.13630037009716034,
0.6144545078277588,
0.3094710111618042,
0.2544075548648834,
0.2710799276828766,
-0.04541114345192909,
0.39239758253097534,
-0.23815599083900452,
-0.35946419835090637,
-0.07595454901456833,
-0.03432720527052879,
0.3558822274208069,
0.4622149765491485... | |
clearly additive facts. It includes currency and counts that have proper units.
Should I commingle this qualitative information in a single fact table with the additive facts? Or should I separate the qualitative stuff (which can only be used with counts) from the quantitative stuff (which can be used with sum)?
Only ... | [
0.21190600097179413,
0.20054443180561066,
-0.3308555483818054,
0.4347972571849823,
-0.1568630486726761,
0.07723116129636765,
-0.035952936857938766,
-0.10261029005050659,
-0.018451666459441185,
-0.32543376088142395,
0.12270573526620865,
0.3068203330039978,
-0.21231336891651154,
0.0109327165... | |
can always put these in what Kimball calls a "junk" dimension. All those codes can simply be lumped into a junk dimension. Most dates would go in the fact table as keys into your date dimension in a particular role (usually with a natural int key of the form YYYYMMDD - one of the only times we don't use a non-identity ... | [
0.5531263947486877,
0.20199348032474518,
0.2559719681739807,
0.2903386950492859,
0.1678180992603302,
-0.22751744091510773,
-0.16348834335803986,
0.29979968070983887,
-0.10855960100889206,
-0.014600555412471294,
0.056395359337329865,
0.18117710947990417,
0.05810284987092018,
0.3689718842506... | |
- remember, the star is not an ERD-style normalized OLTP database. | [
0.06303473562002182,
-0.101359523832798,
0.20616130530834198,
0.04972473531961441,
0.04385165870189667,
-0.4113209843635559,
0.09469356387853622,
0.3176269233226776,
0.10345718264579773,
-0.21683287620544434,
-0.1724247932434082,
0.2884737253189087,
-0.0855676457285881,
0.3892596960067749,... | |
Here's what I am trying to do:
```
typedef enum { ONE, TWO, THREE } Numbers;
```
I am trying to write a function that would do a switch case similar to the following:
```
char num_str[10];
int process_numbers_str(Numbers num) {
switch(num) {
case ONE:
case TWO:
case THREE:
{
strcpy(num_str... | [
0.10280600190162659,
0.033526983112096786,
0.15280289947986603,
-0.2824561893939972,
0.03715740516781807,
0.15407103300094604,
0.24053701758384705,
-0.26416581869125366,
-0.14488886296749115,
-0.5186425447463989,
-0.03685499355196953,
0.5255473256111145,
-0.39972710609436035,
0.16281603276... | |
case, is there a way to set it using the enum variable like I am trying to do above?
There's no built-in solution. The easiest way is with an array of `char*` where the enum's int value indexes to a string containing the descriptive name of that enum. If you have a sparse `enum` (one that doesn't start at 0 or has gaps... | [
-0.013014156371355057,
0.11841350793838501,
-0.022721292451024055,
0.08547907322645187,
-0.11423949897289276,
0.10356404632329941,
-0.10586591064929962,
-0.13737963140010834,
0.024599168449640274,
-0.6671943664550781,
0.040657300502061844,
0.335715115070343,
-0.21433299779891968,
0.1717757... | |
(MFC Question) What's the best way to determine the current displayed client area in a CScrollView? I only need the size of the visible portion, so GetClientRect() won't work here.
You do need to use GetClientRect(), but I think you're asking the wrong question. It is not so that in a scrolled view there is a very big ... | [
0.2093646228313446,
-0.30106309056282043,
0.9334437847137451,
0.2935837209224701,
0.028971025720238686,
-0.2108645886182785,
-0.0977773442864418,
-0.04305955022573471,
-0.4546816647052765,
-0.5543550252914429,
-0.05506270378828049,
0.5401877760887146,
-0.2796346843242645,
-0.01305275037884... | |
corner of the bottom right corner of the current viewport, you do need GetViewPortOrg() and GetViewportExt(). If these return the wrong values, something is wrong in your use of CScrollView. Did you call SetScrollSizes()? | [
0.3376930058002472,
-0.14579306542873383,
0.8610073328018188,
0.16508176922798157,
0.1290981024503708,
-0.33485934138298035,
0.09441158920526505,
-0.16861286759376526,
-0.16308483481407166,
-0.625839114189148,
-0.04980786144733429,
0.6860276460647583,
-0.306613564491272,
-0.295964866876602... | |
In one of my ASP.NET Web Applications, I am using a [BulkEditGridView](http://blogs.msdn.com/mattdotson/articles/490868.aspx) (a GridView which allows all rows to be edited at the same time) to implement an order form. In my grid, I have a column which calculates the total for each item (cost x quantity) and a grand to... | [
0.13675352931022644,
-0.12873266637325287,
0.4854878783226013,
0.014196189120411873,
-0.4169374406337738,
0.4046687185764313,
-0.0982554703950882,
-0.07357094436883926,
-0.47466519474983215,
-0.6276525855064392,
0.2062598615884781,
0.29584622383117676,
0.03070189245045185,
0.18679691851139... | |
to accomplish this, but the asynchronous post-backs interfere with the focus on the page. I imagine that a purely client-side solution exists, and I'm hopeful that someone in the community can share.
If your calculations can be reproduced in JavaScript the easiest method would be using jQuery to get all the items like ... | [
0.250019371509552,
0.04322971776127815,
0.4201204478740692,
0.08070638030767441,
0.13475079834461212,
-0.09411969035863876,
0.34766608476638794,
-0.06674663722515106,
-0.1658564954996109,
-0.9991613626480103,
-0.025908175855875015,
0.6886765360832214,
-0.15460216999053955,
-0.1504727602005... | |
int UpdateTotal(int currTotal, int changedValue){
// do stuff, then return
}
```
You'll need some JavaScript to invoke the webservice, you can do it either with jQuery or MS AJAX. I'll show a combo of both, just for fun:
```
$("#myGridView input[type='text']").each(function(){
this.change(function(){
Sys.Net... | [
0.0008350731804966927,
-0.29528680443763733,
0.7250004410743713,
-0.1860729455947876,
0.02177947200834751,
0.037060290575027466,
0.2686139941215515,
-0.14250294864177704,
0.03589076176285744,
-0.6362276077270508,
-0.49883562326431274,
1.1543439626693726,
-0.3714928925037384,
-0.33492094278... | |
<http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys.Net/WebServiceProxyClass/WebServiceProxyInvokeMethod.aspx> | [
-0.014490196481347084,
0.015519282780587673,
0.21487823128700256,
-0.04804939031600952,
0.01756107248365879,
-0.12781862914562225,
0.13344985246658325,
-0.09492596983909607,
-0.15336932241916656,
-0.5000354051589966,
-0.4625711739063263,
0.40645405650138855,
-0.054531607776880264,
-0.04278... | |
```
#include <vector>
std::vector<long int> as;
long int a(size_t n){
if(n==1) return 1;
if(n==2) return -2;
if(as.size()<n+1)
as.resize(n+1);
if(as[n]<=0)
{
as[n]=-4*a(n-1)-4*a(n-2);
}
return mod(as[n], 65535);
}
```
The above code sample using memoization to calculate a recursive formula base... | [
0.16009193658828735,
0.0978582501411438,
0.05959105119109154,
-0.32431870698928833,
-0.12238641828298569,
0.047917380928993225,
0.38956689834594727,
-0.7586084604263306,
-0.30279192328453064,
-0.47599995136260986,
-0.2831238806247711,
0.7317057847976685,
-0.6239721775054932,
0.013166075572... | |
that memoization is supposed to store each calculated value, so that instead of performing the same calculations over again, it can simply retrieve ones that have already been calculated.
My question is: how is this memoization, and how does it work? I can't seem to see in the code at which point it checks to see if ... | [
0.19536985456943512,
0.41990426182746887,
-0.05483116954565048,
0.2899988293647766,
0.029783813282847404,
0.013850556686520576,
0.040392715483903885,
0.00009681161463959143,
-0.022683212533593178,
-0.3473234176635742,
0.22183993458747864,
0.47818779945373535,
-0.013691960833966732,
0.31995... | |
it's actually a bit more simple than I was thinking it was.
I do not think the values in the sequence can ever be 0, so this should work for me, as I think n has to start at 1.
However, if zero was a viable number in my sequence, what is another way I could solve it? For example, what if five could never appear? Wou... | [
0.1401406079530716,
-0.17870256304740906,
-0.05088825523853302,
0.29472455382347107,
-0.12447312474250793,
0.17151732742786407,
0.10194498300552368,
0.008795477449893951,
-0.2539033889770508,
-0.3777773678302765,
0.4878791868686676,
0.3906528651714325,
0.08613979816436768,
0.24040997028350... | |
now.
`if (as[n] <= 0)` is the check. If valid values can be negative like you say, then you need a different sentinel to check against. Can valid values ever be zero? If not, then just make the test `if (as[n] == 0)`. This makes your code easier to write, because by default vectors of `int`s are filled with zeroes. | [
0.2748892903327942,
-0.05411457270383835,
-0.10633066296577454,
0.02976444736123085,
-0.03781246766448021,
-0.15225079655647278,
0.6168906688690186,
-0.22328230738639832,
-0.04899412393569946,
-0.4729194939136505,
0.14975188672542572,
0.6236299872398376,
-0.17551732063293457,
0.18516281247... | |
I have a self built JSP webapp and at the moment I'm using tomcats built in admin pannel to manage user accounts (that are stored in tomcats config xml files) but this is limited because i can not create new accounts from within the web-app (eg. I can not have a sign up website) and need to manually create the accounts... | [
0.2831130027770996,
0.1076846718788147,
0.7339465022087097,
-0.1444726586341858,
0.034286413341760635,
0.20011243224143982,
0.27663150429725647,
-0.11693737655878067,
-0.30884677171707153,
-0.5902660489082336,
0.09729737788438797,
0.40421241521835327,
-0.09601375460624695,
0.01343990396708... | |
a very simple CRUD web application, possibly combined with some confirmation emails. | [
0.3218895196914673,
0.1403438001871109,
0.41402578353881836,
0.37234070897102356,
0.06153709441423416,
-0.3893560469150543,
-0.08440343290567398,
0.19205956161022186,
-0.020936377346515656,
-0.56130450963974,
0.14255216717720032,
0.39672884345054626,
-0.09166176617145538,
-0.17225812375545... | |
Is it possible to include one CSS file in another?
Yes:
```
@import url("base.css");
```
Note:
* The [`@import`](https://developer.mozilla.org/en-US/docs/Web/CSS/@import) rule [must precede](https://drafts.csswg.org/css-cascade-3/#at-import) all other rules (except `@charset`).
* Additional `@import` statements req... | [
0.3884659707546234,
0.17445307970046997,
0.22243845462799072,
-0.11790443956851959,
-0.21862854063510895,
-0.2762710452079773,
0.05876273289322853,
-0.07717783004045486,
-0.3860938847064972,
-0.4504275918006897,
-0.3925756514072418,
0.20674382150173187,
-0.5435215830802917,
0.0194598622620... | |
In the markup shown below, I'm trying to get the content div to stretch all the way to the bottom of the page but it's only stretching if there's content to display. The reason I want to do this is so the vertical border still appears down the page even if there isn't any content to display.
Here is my **DEMO**:
```c... | [
0.1546679437160492,
0.015612184070050716,
0.6960636377334595,
0.06732327491044998,
-0.17317010462284088,
0.32833611965179443,
0.10902699083089828,
-0.122799813747406,
-0.20734162628650665,
-0.6855176687240601,
-0.46070075035095215,
0.19179773330688477,
0.08854497969150543,
-0.0001275281683... | |
100px 30px;
background: transparent url(site-style-images/sitelogo.jpg) no-repeat fixed 100px 30px;
height: 80px;
display: block;
}
#header, #menuwrapper {
background-repeat: repeat;
background-image: url(site-style-images/darkblue_background_color.jpg);
}
#menu #menuwrapper {
height:25px;
}
div... | [
-0.05923885107040405,
0.15346886217594147,
0.7188623547554016,
-0.26035210490226746,
-0.09569833427667618,
0.3499419391155243,
0.2120148241519928,
-0.2389744371175766,
-0.20881517231464386,
-0.48356562852859497,
-0.6194419860839844,
0.44954201579093933,
-0.08721674233675003,
-0.10818734765... | |
<div id="content">
</div>
</form>
```
Your problem is not that the div is not at 100% height, but that the container around it is not.This will help in the browser I suspect you are using:
```
html,body { height:100%; }
```
You may need to adjust padding and margins as well, but this will get you 90% of the way th... | [
0.4760577380657196,
0.028766246512532234,
0.5359291434288025,
0.0926968902349472,
-0.25273558497428894,
-0.2323317676782608,
0.15380650758743286,
-0.5239138603210449,
-0.11108171939849854,
-0.6915168166160583,
0.21439865231513977,
0.35676178336143494,
0.022127358242869377,
-0.1889480948448... | |
Are there any IDE's for developing HLSL code? The three key features I want are:
1) syntax highlighting
2) auto-complete
3) interaction debugging
Visual Studio doesn't do any of these things, and it doesn't seem that RenderMonkey or FX Composer do either.
Is there some IDE that I'm not aware of, or does one ... | [
0.16450528800487518,
-0.08108503371477127,
0.2755727171897888,
0.20417028665542603,
-0.4520648419857025,
-0.11532200872898102,
-0.026882752776145935,
0.03892868012189865,
-0.15444248914718628,
-0.5838737487792969,
-0.10693560540676117,
0.7907348275184631,
-0.2926928997039795,
-0.2975722253... | |
Visual Studio with some custom setting.
As for auto-completion, I don't think it's much needed as compare to our normal programming. It's because you won't be writing a very long code for your shader programming. Shader is quite critical in that it is run on every frame generated, and every instruction require 1 to a ... | [
0.5575093626976013,
-0.07432262599468231,
0.25720566511154175,
0.10924738645553589,
-0.23304806649684906,
-0.19659174978733063,
0.24855837225914001,
-0.11064761132001877,
-0.03238198161125183,
-0.6695412397384644,
0.17346598207950592,
0.7328503727912903,
-0.10441309213638306,
-0.0682161375... | |
the REF (software rendering) device can never cop up with even obsolete GPU, what more to say about emulating shader. | [
-0.04251306504011154,
0.17130129039287567,
0.7098550200462341,
0.27493807673454285,
-0.48192864656448364,
-0.11250583827495575,
0.20766745507717133,
-0.14347851276397705,
0.20442941784858704,
-0.6002458930015564,
0.06648708134889603,
0.646089494228363,
-0.003736557438969612,
0.015249435789... | |
I need to save a user's login information in encrypted form for this application I'm building, but I'm not sure of the best place to save the file. I don't want to save it into the program application folder as I want it per user.
So what is the best folder (or way) to save it into?
Edit: Using C++.
Seems like C:\Doc... | [
0.25126853585243225,
0.23985113203525543,
0.11759427934885025,
-0.028345869854092598,
0.27120304107666016,
0.11148808151483536,
0.21451573073863983,
0.12461625784635544,
-0.14857548475265503,
-0.8357124328613281,
-0.23433010280132294,
0.40531009435653687,
-0.1294911950826645,
0.00542994495... | |
in Vista it is C:\Users\%username% and that it shouldn't be hard-coded. Thanks. | [
-0.11489301174879074,
0.2275039404630661,
0.25227150321006775,
-0.00029303718474693596,
0.16717231273651123,
-0.4322728216648102,
0.23812484741210938,
0.4934433102607727,
0.0707617923617363,
-0.7546018958091736,
-0.21914471685886383,
0.5488172173500061,
-0.12929153442382812,
-0.10048130154... | |
What is the best way to detect if a user leaves a web page?
The `onunload` JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).
Creating one will probably be blocked by current browsers.
Try the `onbeforeunload` event: It is fired just before the pa... | [
0.0006624739617109299,
-0.14118359982967377,
0.2843528091907501,
-0.056334033608436584,
0.202768012881279,
-0.3755197525024414,
0.36531123518943787,
-0.128135547041893,
-0.40874016284942627,
-0.6445410847663879,
-0.2708113193511963,
0.49327343702316284,
-0.05565185099840164,
0.047271095216... | |
What would I do if I want to have a generic method that only accepts types that have overloaded an operator, for instance the subtraction operator. I tried using an interface as a constraint but interfaces can't have operator overloading.
What is the best way to achieve this?
There is no immediate answer; operators a... | [
0.027119988575577736,
-0.34854456782341003,
0.02861648239195347,
0.211044579744339,
-0.01840618997812271,
-0.053421515971422195,
0.15990717709064484,
-0.33681029081344604,
-0.020957691594958305,
-0.5207664966583252,
0.11702078580856323,
0.4404018223285675,
-0.5266626477241516,
-0.057523202... | |
together a library [here](http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html) that allows efficient and simple access to operators with generics - such as:
```
T result = Operator.Add(first, second); // implicit <T>; here
```
It can be downloaded as part of [MiscUtil](http://www.yoda.arachsys.c... | [
0.06262492388486862,
-0.2604010999202728,
0.13740120828151703,
-0.11096758395433426,
-0.3506098985671997,
-0.0031713556963950396,
0.13781733810901642,
-0.26858559250831604,
-0.36648765206336975,
-0.38043493032455444,
-0.11817033588886261,
0.4081107974052429,
-0.523603081703186,
0.126245245... | |
```
etc, but then you need to pass an `ICalc<T>;` through all the methods, which gets messy. | [
0.41190147399902344,
0.18159477412700653,
0.36207082867622375,
0.25796669721603394,
0.24175280332565308,
-0.610783576965332,
-0.014851927757263184,
-0.034580279141664505,
-0.006121114362031221,
-0.5460169315338135,
-0.40584632754325867,
0.4190044403076172,
-0.05220966041088104,
0.093296132... | |
I have Eclipse setup with PyDev and love being able to debug my scripts/apps. I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?
Create a new launch configuration (Python Run)
**Main tab**
Use paster-script.py as mai... | [
0.682736337184906,
0.18177863955497742,
0.06498733162879944,
-0.09842563420534134,
-0.3424030840396881,
-0.1374453753232956,
0.10473478585481644,
0.22796407341957092,
-0.1574237197637558,
-0.7838484048843384,
-0.020004982128739357,
0.5663177371025085,
-0.2546684443950653,
0.067165672779083... | |
app")
**Common Tab**
Check allocate console and launch in background | [
-0.0035126395523548126,
0.14609847962856293,
0.47490763664245605,
0.07198888063430786,
0.39159896969795227,
0.33442550897598267,
0.041829198598861694,
0.13038882613182068,
-0.010354215279221535,
-0.5889976024627686,
-0.4675242304801941,
0.7038376927375793,
-0.35486194491386414,
-0.15534062... | |
Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?
Use this:
```
{$IFDEF DEBUG}
...
{$ENDIF}
``` | [
0.14269964396953583,
-0.1434708535671234,
-0.05775731801986694,
-0.2564736604690552,
0.10374613106250763,
-0.5748726725578308,
-0.07231583446264267,
-0.012062901630997658,
0.22405509650707245,
-0.20523913204669952,
-0.2837728261947632,
0.7165660858154297,
-0.5010218620300293,
-0.1376668810... | |
In a text file, there is a string "I don't like this".
However, when I read it into a string, it becomes "I don\xe2\x80\x98t like this". I understand that \u2018 is the unicode representation of "'". I use
```
f1 = open (file1, "r")
text = f1.read()
```
command to do the reading.
Now, is it possible to read the s... | [
0.23437799513339996,
0.24867218732833862,
0.38202741742134094,
-0.2129749059677124,
-0.15349166095256805,
-0.09711045771837234,
0.3972000777721405,
0.2531817555427551,
-0.11201127618551254,
-0.5262867212295532,
-0.18089567124843597,
0.46010807156562805,
-0.5173523426055908,
0.5169606208801... | |
that does this kind of ANSI to unicode ( and vice versa) conversion?
Ref: <http://docs.python.org/howto/unicode>
*Reading Unicode from a file is therefore simple:*
```
import codecs
with codecs.open('unicode.rst', encoding='utf-8') as f:
for line in f:
print repr(line)
```
*It's also possible to open fi... | [
0.052483536303043365,
0.17008879780769348,
0.42730244994163513,
-0.2061164528131485,
-0.2288459688425064,
0.09674936532974243,
0.31114718317985535,
-0.339983195066452,
-0.13051378726959229,
-0.5979476571083069,
-0.5619150400161743,
0.5903294086456299,
-0.2585867941379547,
-0.48233976960182... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.