text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
but I would much prefer the "search" table to be temporary (it can be several orders of magnitude smaller if it isn't a normal table) but that gives me a very annoying error: `Can't reopen table`
Some research leads me to [this bug report](http://bugs.mysql.com/bug.php?id=10327) but the folks over at MySQL don't seem ... | [
-0.038469310849905014,
0.42257168889045715,
0.38309383392333984,
-0.0947631224989891,
0.27187228202819824,
-0.12397032231092453,
0.39367562532424927,
0.38226982951164246,
-0.8155513405799866,
-0.6959822773933411,
-0.03472974896430969,
0.22995685040950775,
-0.2331458479166031,
0.31476897001... | |
or make me maintain a huge table with all the data in it?
Kind regards, Kris
[additional]
The GROUP\_CONCAT answer does not work in my situation because my conditions are multiple columns in specific order, it would make ORs out of what I need to be ANDs. However, It did help me solve an earlier problem so now the t... | [
-0.06645525246858597,
-0.3481888771057129,
0.30132558941841125,
0.05115709826350212,
-0.16860368847846985,
-0.14353927969932556,
0.4167202115058899,
-0.2401181012392044,
-0.19383534789085388,
-0.5423203706741333,
0.12421077489852905,
0.2791706621646881,
-0.2812124490737915,
0.0807596817612... | |
of MySQL) is feasible -- this annoyance is fixed there as of version 10.2.1: <https://jira.mariadb.org/browse/MDEV-5535>. | [
-0.3625313937664032,
-0.03221508860588074,
0.60052889585495,
0.09851102530956268,
0.07981278002262115,
-0.22930298745632172,
0.6807191967964172,
0.05655684322118759,
-0.04983241856098175,
-0.4989277124404907,
-0.19226336479187012,
0.5796472430229187,
-0.48846158385276794,
0.020305827260017... | |
### ANSWER:
If you ever see these lines and are mistified like I was, here's what they mean.
`Thread[AWT-EventQueue-0] (Suspended (exception NullPointerException))`
`EventDispatchTread.run() line: not available [local variables unavailable]`
It's not that the variables are unavailable because they are lurking behin... | [
0.4027767479419708,
-0.006864745169878006,
0.2009453922510147,
0.2720249891281128,
-0.0959576815366745,
-0.19143815338611603,
0.673315703868866,
0.3495643436908722,
-0.33450591564178467,
-0.29901912808418274,
-0.10608407855033875,
-0.0006845738389529288,
-0.3113422989845276,
0.434578508138... | |
I wouldn't normally understand how to do with the code that I do understand, on the other hand because I don't completely understand them, they sometimes throw a wrench in code that is otherwise working fine! It's because I don't understand the errors that can occur when using these libraries, because I didn't write th... | [
0.4905695617198944,
0.1250872015953064,
-0.08741272240877151,
0.015245598740875721,
-0.26931634545326233,
-0.256683886051178,
0.24018171429634094,
0.058581817895174026,
-0.18885864317417145,
-0.6505818367004395,
0.21146085858345032,
0.8315985202789307,
-0.214398592710495,
0.038781989365816... | |
I use one of the buttons I've made. The error is:
`Thread[AWT-EventQueue-0] (Suspended (exception NullPointerException))`
`EventDispatchTread.run() line: not available [local variables unavailable]`
What does this mean? What could be causing it? I'm embarrassed to post code, but if you can stand to try to decipher m... | [
0.2027575671672821,
-0.10886040329933167,
0.42056626081466675,
-0.27092084288597107,
0.21761348843574524,
0.10169066488742828,
0.5191687345504761,
-0.08419609814882278,
-0.3087954521179199,
-0.5991034507751465,
-0.1522027850151062,
0.5724207758903503,
-0.4870472848415375,
0.357738673686981... | |
if(card != null) {
if(rules.zoneHasCard(card, rules.hand)) {
display.updateStatusMessage(rules.play(card));
field.setText("");
display.updateHand(rules.zoneList("hand"));
display.updateDiscard(rules.zoneList("Discard")); // This is the error he... | [
-0.30220314860343933,
-0.143382266163826,
0.5812527537345886,
-0.26721569895744324,
0.46340933442115784,
-0.3413322865962982,
0.36269432306289673,
-0.4373281002044678,
-0.35638827085494995,
-0.4120831787586212,
-0.3030112385749817,
0.3843309283256531,
-0.2550780177116394,
-0.04007892310619... | |
}
else {
field.setText("You do not have " + card.getName());
field.selectAll();
}
}
else {
field.setText("That cardname | [
-0.12873315811157227,
-0.4530182480812073,
0.45083382725715637,
-0.06654411554336548,
0.5198927521705627,
-0.34648850560188293,
-0.009715942665934563,
-0.2480953335762024,
-0.16111378371715546,
-0.3157625198364258,
-0.4691121280193329,
0.648222804069519,
-0.19921280443668365,
-0.0730920061... | |
is unused");
field.selectAll();
}
}
}
```
Welcome to the complexity of writing GUI code.
When you run a Swing program, a background thread called the Event Dispatch Thread is created. When the user clicks on a JButton, for example, JButton creates and fires an event using this Event Dispatch T... | [
0.17236162722110748,
-0.2699775993824005,
0.35981178283691406,
-0.15517951548099518,
0.08420083671808243,
0.021639658138155937,
0.06437085568904877,
-0.2998432517051697,
-0.5515210628509521,
-0.3961111307144165,
-0.4521726667881012,
0.6203068494796753,
-0.5125318169593811,
-0.0455279834568... | |
String name;
// more code...
}
```
is called by this Event Dispatch Thread, so your code can handle the event.
Somewhere within your code you are trying to do something with a variable that is currently equal to null. The error message is telling you, "hey while running some code on the event dispatch thread, I enc... | [
0.13210181891918182,
-0.16687780618667603,
0.038698576390743256,
-0.16007861495018005,
-0.19692900776863098,
-0.12602739036083221,
0.3727806806564331,
-0.19311626255512238,
-0.28746357560157776,
-0.5658050775527954,
0.02556750923395157,
0.6120124459266663,
-0.43845877051353455,
0.117939718... | |
" + display);
```
See if this shows you any nulls.
Even if the NullPointerException comes from a library, the stack trace will show which line of your code called that library. But only if you've configured Eclipse to generate debugging info.
In the longer term, work through the Sun's Swing Tutorial to learn more a... | [
0.47300422191619873,
-0.057073939591646194,
0.18738242983818054,
0.09146401286125183,
-0.21020124852657318,
-0.31554916501045227,
0.22114945948123932,
-0.16012685000896454,
-0.07632940262556076,
-0.5915632247924805,
-0.058012258261442184,
0.4808540642261505,
-0.2805730700492859,
-0.2835303... | |
I need a portable C/C++ solution, so I'm looking for a C/C++ client library for Memcached that work on both Windows and Unix. Any suggestions?
There's libmemcached in C. Should be most portable :) | [
0.04999614506959915,
0.015677200630307198,
0.15769457817077637,
0.23286044597625732,
0.13519202172756195,
-0.14766767621040344,
-0.09159129858016968,
0.1552315056324005,
-0.27699077129364014,
-0.6628435254096985,
0.020443547517061234,
0.7846744060516357,
-0.1293950229883194,
0.052155323326... | |
To do DataBinding of the `Document` in a WPF `RichtextBox`, I saw 2 solutions so far, which are to derive from the `RichtextBox` and add a `DependencyProperty`, and also the solution with a "proxy".
Neither the first or the second are satisfactory. Does somebody know another solution, or instead, a commercial RTF cont... | [
0.052229829132556915,
0.11358541995286942,
0.2067311704158783,
0.17929190397262573,
-0.0722392201423645,
-0.26849475502967834,
0.057259853929281235,
-0.2501509189605713,
-0.02075274847447872,
-0.5405862927436829,
-0.07315683364868164,
0.5722992420196533,
-0.3503466248512268,
-0.00670285429... | |
is a string property in your data model:
```
<TextBox Text="{Binding FirstName}" />
<TextBox Text="{Binding LastName}" />
<RichTextBox local:RichTextBoxHelper.DocumentXaml="{Binding Autobiography}" />
```
Voila! Fully bindable `RichTextBox` data!
The implementation of this property is quite simple: When the propert... | [
-0.09133650362491608,
0.1537325531244278,
0.6676783561706543,
-0.026019401848316193,
0.20921243727207184,
-0.23732075095176697,
0.13966578245162964,
-0.34384775161743164,
-0.15007418394088745,
-0.6104285717010498,
-0.44532155990600586,
0.7110904455184937,
-0.3230316638946533,
0.21409279108... | |
{
obj.SetValue(DocumentXamlProperty, value);
}
public static readonly DependencyProperty DocumentXamlProperty =
DependencyProperty.RegisterAttached(
"DocumentXaml",
typeof(string),
typeof(RichTextBoxHelper),
new FrameworkPropertyMetadata
... | [
-0.2512219250202179,
-0.1411859542131424,
0.6682270169258118,
-0.06691090762615204,
0.34995850920677185,
0.20464016497135162,
0.40037256479263306,
-0.26724833250045776,
-0.0227517019957304,
-0.6174813508987427,
-0.3937235474586487,
0.5476316213607788,
-0.5784525275230408,
0.267789185047149... | |
BindsTwoWayByDefault = true,
PropertyChangedCallback = (obj, e) =>
{
var richTextBox = (RichTextBox)obj;
// Parse the XAML to a document (or use XamlReader.Parse()) | [
-0.007396566681563854,
0.11980374902486801,
0.7296342849731445,
-0.16602589190006256,
0.08249648660421371,
-0.19074992835521698,
0.6173617839813232,
-0.9311088919639587,
-0.26316481828689575,
-0.4590601325035095,
-0.29492825269699097,
0.31404775381088257,
-0.6721944212913513,
0.21301105618... | |
var xaml = GetDocumentXaml(richTextBox);
var doc = new FlowDocument();
var range = new TextRange(doc.ContentStart, doc.ContentEnd);
range.Load(new MemoryStream(Encoding.UTF8.GetBytes(xaml)), | [
-0.15978272259235382,
-0.19620759785175323,
0.8742765188217163,
-0.23370489478111267,
0.1368234008550644,
0.3545759618282318,
0.23942209780216217,
-0.2988681495189667,
-0.08860577642917633,
-0.5275183916091919,
-0.5935441851615906,
0.5687628984451294,
-0.45008715987205505,
0.14038138091564... | |
DataFormats.Xaml);
// Set the document
richTextBox.Document = doc;
// When the document changes update the source | [
0.1366346776485443,
-0.017302999272942543,
0.7362244129180908,
-0.015346921049058437,
0.23507219552993774,
-0.2708105146884918,
0.1269441843032837,
-0.1383713036775589,
-0.08020676672458649,
-0.684199333190918,
-0.6308237314224243,
0.47742536664009094,
-0.4163566827774048,
0.23281821608543... | |
range.Changed += (obj2, e2) =>
{
if (richTextBox.Document == doc)
{ | [
0.23790708184242249,
-0.3454158902168274,
0.6975246071815491,
-0.19729042053222656,
0.331678569316864,
0.0798589363694191,
0.21642549335956573,
-0.47599485516548157,
0.12881529331207275,
-0.5664018988609314,
-0.3971731960773468,
0.7666673064231873,
-0.4345559775829315,
0.026102617383003235... | |
MemoryStream buffer = new MemoryStream();
range.Save(buffer, DataFormats.Xaml);
SetDocumentXaml(richTextBox, | [
-0.14660413563251495,
-0.41274434328079224,
0.6038686633110046,
-0.14244461059570312,
0.4528391361236572,
0.0328666977584362,
0.059188421815633774,
-0.12488594651222229,
-0.0346362367272377,
-0.6050209403038025,
-0.3780350089073181,
0.37654292583465576,
-0.46215060353279114,
0.204070553183... | |
Encoding.UTF8.GetString(buffer.ToArray()));
}
};
}
});
}
```
The same code could be used for TextFormats.RTF or TextFormats.XamlPackage. For XamlPackage you would have a property of type `byte[]` instead of | [
0.19007350504398346,
-0.10324002802371979,
0.39449530839920044,
-0.18187768757343292,
-0.07143286615610123,
0.05292555317282677,
0.13789896667003632,
-0.3134176433086395,
-0.2362893670797348,
-0.6617504358291626,
-0.2827564775943756,
0.38892412185668945,
-0.5601989030838013,
0.228672802448... | |
`string`.
The XamlPackage format has several advantages over plain XAML, especially the ability to include resources such as images, and it is more flexible and easier to work with than RTF.
It is hard to believe this question sat for 15 months without anyone pointing out the easy way to do this. | [
0.284720778465271,
-0.07853981852531433,
0.37156209349632263,
0.06239192560315132,
-0.13146285712718964,
-0.4451284408569336,
0.14524070918560028,
-0.3090428411960602,
-0.07813232392072678,
-0.2857080101966858,
-0.4176161289215088,
0.4292994439601898,
-0.18203362822532654,
0.08050744235515... | |
I want to develop a very simple 2D game in Python. Pygame is the most popular library for game development in Python, but I'm already quite familiar with wxPython and feel comfortable using it. I've even written a [Tetris clone](http://eli.thegreenplace.net/2008/05/31/a-tetris-clone-in-python-wxpython/) in it, and it w... | [
0.32794204354286194,
0.10423707216978073,
0.005369304679334164,
0.027046216651797295,
-0.12217918038368225,
0.06728409975767136,
-0.15096881985664368,
0.17818334698677063,
-0.014475466683506966,
-0.6818533539772034,
0.18873293697834015,
0.8111346364021301,
-0.12072372436523438,
0.060200016... | |
is nothing you can do with Pygame that you can't with wxPython. The point is not what but how. In my opinion, it's easier to write a game with PyGame becasue:
* It's faster. Pygame is based on SDL which is a C library specifically designed for games, it has been developed with speed in mind. When you develop games, yo... | [
0.24460038542747498,
-0.1583230048418045,
0.2885972559452057,
0.34955573081970215,
-0.4366951286792755,
0.03806489333510399,
-0.13791418075561523,
0.11180386692285538,
-0.3583388030529022,
-0.8027050495147705,
-0.06684660911560059,
0.21500030159950256,
-0.05789978429675102,
-0.044788736850... | |
etc.
* There are [thousands of games](http://pygame.org/tags/) and examples made with it. It will be easier for you to discover how to do any trick.
* There are a lot of [libraries](http://pygame.org/tags/libraries) with effects and utilities you could reuse. You want an isometric game, there is a library, you want a p... | [
0.525638997554779,
-0.0925203487277031,
0.3012877404689789,
0.5249656438827515,
-0.039147697389125824,
-0.24919115006923676,
-0.19019104540348053,
0.009900943376123905,
-0.4020406901836395,
-0.39880356192588806,
0.03897241875529289,
0.4840447008609772,
-0.03207457810640335,
-0.052860550582... | |
believe me, you will want something like PyGame. | [
0.4234519898891449,
-0.2388789802789688,
0.2082807421684265,
0.4666406512260437,
0.1155034750699997,
0.16938897967338562,
-0.5945110321044922,
0.5703303813934326,
-0.13053646683692932,
-0.4834902286529541,
-0.1367739588022232,
0.3929542601108551,
0.03677169233560562,
0.07899070531129837,
... | |
I'm looking for a *SimpleGrepSedPerlOrPythonOneLiner* that outputs all quotations in a text.
---
Example 1:
```
echo “HAL,” noted Frank, “said that everything was going extremely well.” | SimpleGrepSedPerlOrPythonOneLiner
```
stdout:
```
"HAL,"
"said that everything was going extremely well.”
```
---
Example 2... | [
0.16668422520160675,
0.4101605713367462,
0.5488661527633667,
-0.16356615722179413,
0.058655936270952225,
-0.08870582282543182,
0.4875636100769043,
-0.051211126148700714,
-0.11307388544082642,
-0.3425866961479187,
-0.4056980311870575,
0.6488839983940125,
-0.3005967438220978,
-0.108839012682... | |
(?> # prevent backtracking once the alternation has been
# satisfied. It either agrees or it does not. This expression
# only needs one direction, or we fail out of the branch
[^"\\] # a character that is not a dquote | [
-0.17896603047847748,
-0.18519273400306702,
0.38585165143013,
-0.11999164521694183,
-0.10147155076265335,
0.006099896505475044,
0.36318227648735046,
-0.1251986026763916,
0.3105379343032837,
-0.3572794795036316,
-0.3177776634693146,
0.5021560192108154,
-0.20679692924022675,
-0.2044336199760... | |
or a backslash
| \\+ # OR if a backslash, then any number of backslashes followed by
[^"] # something that is not a quote
| \\ # OR again a backslash
(?>\\\\)* # followed by any number of *pairs* of backslashes (as units)
" | [
0.3844347894191742,
-0.009204392321407795,
0.5423015356063843,
-0.1284363716840744,
0.05403069779276848,
0.04507395997643471,
0.3385676145553589,
-0.0049804640002548695,
-0.3169060945510864,
-0.22812092304229736,
-0.6557388305664062,
0.42750096321105957,
-0.3621075749397278,
0.117624677717... | |
# and a quote
)* # any number of *set* qualifying phrases
) # all batched up together
" # Ended by a literal quote
}x;
```
If you don't need that much power--say it's only likely to be dialog and not structured quotes, then
```
/"([^"]*)"/
```
probably works | [
0.4133692681789398,
0.2206820249557495,
0.5455043911933899,
0.15063892304897308,
-0.0070214890874922276,
-0.07350975275039673,
0.2842877507209778,
-0.24360151588916779,
0.14617373049259186,
-0.39310169219970703,
-0.42885974049568176,
0.5853080153465271,
-0.2510319948196411,
-0.186751514673... | |
about as well as anything else. | [
0.14510539174079895,
0.11589066684246063,
-0.004857477732002735,
0.07485584914684296,
0.15607811510562897,
0.0560852512717247,
0.04876184090971947,
0.1197810247540474,
-0.06717214733362198,
0.08597512543201447,
0.12962566316127777,
0.29309260845184326,
0.11876007169485092,
0.07055526971817... | |
I have just branched our Common Business Layer projects from the main to a new branch, and included them in a new solution. Everything compiles but when I run the unit tests I get the following error for every single test...
> Unit Test Adapter threw exception: Unable to load one or more of the requested types. Retrie... | [
0.36876100301742554,
0.19082479178905487,
0.08348310738801956,
0.12046568095684052,
0.09039060771465302,
0.0065358770079910755,
0.6288715600967407,
-0.3292063772678375,
-0.084058478474617,
-0.5416454672813416,
-0.03735753893852234,
0.7372444868087769,
-0.043616026639938354,
0.2563335895538... | |
solution and trying again.
Also try clicking on the link that appears in yellow bar of the Test Results window, this sometimes gives more information about why tests cannot be run. | [
0.1095498651266098,
-0.11239790171384811,
0.09968890994787216,
0.36775505542755127,
0.20912261307239532,
-0.15012040734291077,
0.5797973871231079,
0.08441638201475143,
-0.08621564507484436,
-0.7040870785713196,
-0.19058018922805786,
0.19905425608158112,
-0.15408654510974884,
0.288898587226... | |
If I pass a ClientID to a javascript function as a parameter without including the single quotes around it, it gets passed as a reference to the control itself which can then be used without first calling getElementByID.
I can't find this behaviour documented anywhere, is this a browser specific thing or a .net thing ... | [
0.10418311506509781,
-0.11975497752428055,
0.7249014377593994,
-0.19975145161151886,
0.0864887610077858,
-0.14378909766674042,
0.2471681535243988,
-0.2839287221431732,
0.16073544323444366,
-0.6379942297935486,
-0.2623954713344574,
0.5498501658439636,
-0.49264758825302124,
0.248608604073524... | |
}
```
My concern is that this may not work in older versions of IE.
Thanks.
Add quotes around your ID value when you generate the JS code e.g:
string.Format("showvalue(**'**{0}**'**)", TextBox1.ClientID)
Without quotes, showValue gets an instance of the global variable with your ClientID name that usually is the DOM... | [
0.17866744101047516,
0.11269576102495193,
0.49760767817497253,
-0.20532487332820892,
-0.07558771222829819,
-0.2645018696784973,
0.2779822051525116,
0.17539963126182556,
0.09261699765920639,
-0.5205702781677246,
-0.06367595493793488,
0.6368664503097534,
-0.436249703168869,
0.065178781747818... | |
I'm interested in hearing what technique(s) you're using to validate the internal state of an object during an operation that, from it's own point of view, only can fail because of bad internal state or invariant breach.
My primary focus is on C++, since in C# the official and prevalent way is to throw an exception, a... | [
0.22895173728466034,
0.1333157867193222,
-0.17507976293563843,
0.252594918012619,
-0.3110123574733734,
-0.10659105330705643,
-0.11640803515911102,
-0.014300771988928318,
-0.3785179853439331,
-0.2750170826911926,
-0.16461017727851868,
0.6205111742019653,
0.05002177506685257,
-0.129198998212... | |
`Queue` a print job asynchronously. To the user of `Printer`, that operation can only succeed, because an asynchronous queue result with arrive at another time. So, there's no relevant error code to convey to the caller.
But to the `Printer` object, this operation can fail if the internal state is bad, i.e., the class... | [
0.12568841874599457,
0.1507011204957962,
0.518733561038971,
-0.008911742828786373,
0.04457128047943115,
0.1338280439376831,
0.44080737233161926,
0.12837620079517365,
-0.47984328866004944,
-0.3496078848838806,
-0.03558976575732231,
0.3497242033481598,
-0.4859371781349182,
0.2150029689073562... | |
is absolutely the worst. I'd like to hear your views on these and also that you share any of your own experiences and thoughts on this matter.
The first style I use - better fail in a controllable way than corrupt data:
```
void Printer::Queue(const PrintJob& job)
{
// Validate the state in both release and debug... | [
0.12339708209037781,
0.15557995438575745,
0.38291317224502563,
-0.09880141913890839,
0.19390928745269775,
-0.10978822410106659,
0.5894845724105835,
0.06493058800697327,
-0.1889166682958603,
-0.5105316042900085,
-0.1910679191350937,
0.663794994354248,
-0.3394022285938263,
0.3273091912269592... | |
etc.
// Internal state is guaranteed to be good.
}
```
The second style I use - better crash uncontrollable than corrupt data:
```
void Printer::Queue(const PrintJob& job)
{
// Validate the state in debug builds only.
// Break into the debugger in debug builds.
// Always proceed with the queuing, als... | [
-0.06410537660121918,
0.27778080105781555,
0.31594353914260864,
-0.27149611711502075,
0.21035809814929962,
-0.15248587727546692,
0.7992187142372131,
-0.0911443829536438,
-0.2768964171409607,
-0.5098767280578613,
-0.3664347231388092,
0.7078725099563599,
-0.3699522912502289,
0.23627753555774... | |
access violation when
// a NULL pointer is dereferenced, or something similar, and that crash will
// generate a dump file that can be used to find the error cause during
// testing before shipping the product.
}
```
The third style I use - better silently and defensively bail out than corrupt data:
```
... | [
0.09480777382850647,
0.3946891725063324,
0.1842791885137558,
-0.04838168993592262,
0.0468745082616806,
-0.25330477952957153,
0.5572566390037537,
-0.05894269421696663,
-0.2513256072998047,
-0.42730945348739624,
-0.3755861818790436,
0.5161911845207214,
-0.3755335807800293,
0.3958733677864074... | |
// This object will likely never again succeed in queuing anything.
if(!IsValidState())
{
DebugBreak();
return;
}
// Continue with defenestration.
// Internal state is guaranteed to be good.
}
```
My comments to the styles:
1. I think I prefer the second style, where the failure ... | [
-0.01934509165585041,
0.1905847042798996,
0.20603516697883606,
-0.12804865837097168,
-0.01944746822118759,
-0.22646033763885498,
0.6862233877182007,
0.010902618989348412,
-0.03779898211359978,
-0.6642228960990906,
-0.2213013619184494,
0.7492818832397461,
-0.27762702107429504,
0.25114071369... | |
towards the first style.
3. I really dislike the third style, since it will hide lots of bugs, but I know people that prefers it in production code, because it creates the illusion of a robust software that doesn't crash (features will just stop to function, as in the queuing on the broken `Printer` object).
Do you pr... | [
-0.061719443649053574,
0.11091159284114838,
0.3831747770309448,
0.11499253660440445,
-0.47090381383895874,
-0.07944504171609879,
0.17871209979057312,
-0.3317657709121704,
-0.2251890003681183,
-0.59904545545578,
0.21635465323925018,
0.740206241607666,
-0.32017624378204346,
0.143979385495185... | |
be. Builds for testing during development can be made to stop dead and output diagnostics.
It can be appropriate to add defensive code, rather like your style 3: your `DebugBreak` would dump diagnostics in test builds, but just be a break point for developers. This makes less likely the situation where a developer is ... | [
0.6358834505081177,
-0.031782105565071106,
-0.29605868458747864,
0.07311467081308365,
-0.27012795209884644,
-0.12482836097478867,
0.4745003283023834,
-0.06958667933940887,
0.1772337555885315,
-0.6007357835769653,
-0.023629190400242805,
0.6841973662376404,
-0.28124237060546875,
0.0591224692... | |
I am looking to refactor a c# method into a c function in an attempt to gain some speed, and then call the c dll in c# to allow my program to use the functionality.
Currently the c# method takes a list of integers and returns a list of lists of integers. The method calculated the power set of the integers so an input ... | [
0.11535459011793137,
0.20844531059265137,
0.42917710542678833,
-0.13596805930137634,
-0.059988364577293396,
0.2942052483558655,
-0.0749412328004837,
-0.3976964056491852,
-0.35197025537490845,
-0.35967394709587097,
0.20906485617160797,
0.3654997944831848,
-0.4370560348033905,
0.129707872867... | |
indicates the index (with an offset of 1) of the first list, not the value. So 1,2 indicates that the element at index 0 and 1 are an element of the power set.
I am unfamiliar with c, so what are my best options for data structures that will allow the c# to access the returned data?
Thanks in advance
**Update**
Tha... | [
0.3589611351490021,
-0.021417194977402687,
0.16698679327964783,
0.09882703423500061,
-0.171544149518013,
0.06377062946557999,
-0.09728289395570755,
-0.3059743046760559,
-0.06083193048834801,
-0.2928171157836914,
0.036714889109134674,
0.6006380915641785,
-0.196263387799263,
-0.1720497161149... | |
is all there is to it really. It just get called..a lot (in fact billions of times if the size of the set is big enough).
My thoughs around using c (c++ as people have pointed out) are that it gives more scope for performance tuning. A direct port may not offer any increase, but it opens the way for more involved meth... | [
0.4369334280490875,
-0.03268011286854744,
0.28249847888946533,
-0.016329074278473854,
-0.05793626606464386,
-0.13350801169872284,
0.13982746005058289,
0.00788742583245039,
-0.24612466990947723,
-0.3787929117679596,
0.05527934059500694,
0.6993620991706848,
-0.23602518439292908,
-0.010538998... | |
over time (with help from everyone here at SO).
**Update 2**
Another fair point from jalf, I dont have to use list or equivelent. If there is a better way then I am open to suggestions. The only reason for the list was that each set of results is not the same size.
**The code so far...**
```
public List<List<int>> ... | [
0.1123700886964798,
-0.21297790110111237,
0.3670791685581207,
-0.017394093796610832,
-0.12778319418430328,
-0.058114293962717056,
0.1712615042924881,
-0.4707850515842438,
-0.423965185880661,
-0.6754934191703796,
0.11023464798927307,
0.5110898613929749,
-0.2138337641954422,
0.00167518842499... | |
for (int i = 0; i < max; i++)
{
_currentSet = new List<int>();
//inner loop
for (int j = 0; j < count; j++)
{
if ((i & (1 << j)) == 0) | [
0.11197724938392639,
-0.7125176787376404,
0.44466716051101685,
-0.2869666516780853,
0.28215646743774414,
0.09932021796703339,
0.5831391215324402,
-0.6697196364402771,
-0.11513277143239975,
-0.1442815065383911,
0.06034962832927704,
0.2862635552883148,
-0.5526007413864136,
-0.102013528347015... | |
{
_currentSetList.Add(_currentGroupList.ElementAt(j));
}
}
outputList.Add(_currentSetList);
}
return outputList;
}
```
As you can see, not a lot to it. It just goes round and | [
0.11877971887588501,
-0.3196398913860321,
0.8213335275650024,
-0.24175812304019928,
0.13752518594264984,
-0.25284770131111145,
0.11096344143152237,
-0.32588499784469604,
-0.42541709542274475,
-0.25873997807502747,
0.17661435902118683,
0.00474235974252224,
-0.4286823570728302,
0.19140332937... | |
round a lot!
I accept that the creating and building of lists may not be the most efficient way, but I need some way of providing the results back in a manageable way.
**Update 2**
Thanks for all the input and implementation work. Just to clarify a couple of points raised: I dont need the output to be in 'natural or... | [
0.28704220056533813,
0.0014820973156020045,
0.48266369104385376,
-0.005136450286954641,
-0.5597445964813232,
-0.14023777842521667,
0.2576516568660736,
-0.3145822286605835,
-0.3829113841056824,
-0.4377176761627197,
-0.054785799235105515,
0.6010982990264893,
0.09239453822374344,
-0.172994956... | |
limitiations will apply long before running time becomes a real issue.
Partly because of this, I think I can get away with using bytes instead of integers, giving more potential storage.
The question really is then: Have we reached the maximum speed for this calcualtion in C#? Does the option of unmanaged code provide... | [
-0.153636634349823,
-0.12928149104118347,
0.523521363735199,
0.048486605286598206,
0.14512167870998383,
-0.1085444912314415,
0.0250261053442955,
-0.4023100733757019,
-0.25136488676071167,
-0.3987923562526703,
0.07848546653985977,
0.6034682393074036,
-0.40538614988327026,
-0.174467712640762... | |
It works for powersets of over 32 elements. If you need fewer than 32, you can change long to int. It is pretty fast -- faster than my previous algorithm and faster than (my modified to use yield return version of) P Daddy's code.
```
static class PowerSet4<T>
{
static public IEnumerable<IList<T>> powerset(T[] cur... | [
0.07844992727041245,
-0.6856911778450012,
0.7777227759361267,
-0.12078280001878738,
0.1760743260383606,
0.12064990401268005,
0.18488122522830963,
-0.5418346524238586,
0.05866546928882599,
-0.7324586510658264,
-0.11233977973461151,
0.7001379132270813,
-0.3552852272987366,
-0.118046499788761... | |
for (int i = 0; i < count; i++)
{
powerToIndex[mask] = currentGroupList[i];
mask <<= 1;
}
Dictionary<long, T> result = new Dictionary<long, T>();
yield return result.Values.ToArray();
long max = 1L << count;
for (long | [
-0.00511895352974534,
-0.7569360733032227,
0.7324177026748657,
-0.29124706983566284,
0.247991144657135,
0.3341039717197418,
0.3980540931224823,
-0.6274387836456299,
0.1046891063451767,
-0.41663166880607605,
-0.18839973211288452,
0.6871577501296997,
-0.1912432610988617,
-0.01861712522804737... | |
i = 1L; i < max; i++)
{
long key = i & -i;
if (result.ContainsKey(key))
result.Remove(key);
else
result[key] = powerToIndex[key]; | [
-0.06457231193780899,
-0.6662383675575256,
0.7218654155731201,
-0.47781902551651,
0.38746461272239685,
-0.03746568411588669,
0.3778889775276184,
-0.8749526143074036,
0.1575227677822113,
-0.18722982704639435,
-0.5501885414123535,
0.522251546382904,
-0.221334308385849,
0.28633564710617065,
... | |
yield return result.Values.ToArray();
}
}
}
```
You can download all the fastest versions I have tested [here](http://www.iwebthereforeiam.com/files/TestYieldReturn.zip).
I really think that using yield return is the change that makes calculating large powersets possible. Allocating large amounts of memo... | [
0.10259775817394257,
-0.2776024639606476,
0.30573636293411255,
0.09063465893268585,
-0.11764992028474808,
-0.07804196327924728,
0.22615289688110352,
-0.37685978412628174,
0.08125818520784378,
-0.660957396030426,
0.11413771659135818,
0.7248070240020752,
0.0774020403623581,
-0.15571385622024... | |
I'm using SVN right now, and I've used CVS and VSS in the past. SVN is the current favourite in my books, but I've been hearing a lot about git. Of the people that have used git, what are the pros and cons from your experience?
I don't have a *lot* of experience with git, but:
Pros:
* It's really quick
* Local commit... | [
0.49646762013435364,
0.06532590836286545,
0.13869598507881165,
0.15870334208011627,
-0.21054573357105255,
-0.4219891130924225,
0.24875415861606598,
0.3932873010635376,
-0.17643670737743378,
-0.9033244252204895,
-0.11839007586240768,
0.8670620322227478,
0.014216985553503036,
0.2186642736196... | |
is still lagging behind, I believe - and you can't just use it from a normal command prompt
* Lack of IDE and Explorer integration
* It took me a while to find a [good introductory text](http://book.git-scm.com/) along the lines of the redbean book.
* The fact that "adding" a changed file only adds the contents at that... | [
0.27741503715515137,
-0.13931623101234436,
0.18943879008293152,
-0.03474615141749382,
0.052878960967063904,
-0.06775281578302383,
0.05348430573940277,
-0.0778333991765976,
-0.3894942104816437,
-0.5415431261062622,
0.15808844566345215,
0.46989208459854126,
0.024685317650437355,
-0.215579837... | |
Is it possible to close parent window in Firefox 2.0 using JavaScript. I have a parent page which opens another window, i need to close the parent window after say 10 seconds.
I have tried Firefox tweaks "dom.allow\_scripts\_to\_close\_windows", tried delay but nothing seems to work.
Any help will be really appreciate... | [
-0.1107943132519722,
0.1913028210401535,
0.7236018180847168,
-0.28747281432151794,
0.021225787699222565,
-0.28652170300483704,
0.5778430700302124,
-0.13953812420368195,
-0.22011226415634155,
-0.7248099446296692,
-0.3819814622402191,
0.3994850218296051,
-0.18835832178592682,
-0.145037740468... | |
on Mac, Mozilla, Opera and OmniWeb, but not in Explorer on Windows, Netscape 4 and lower and iCab. In these browsers the user is asked to confirm the closing of the window. As to Safari, it does absolutely nothing.
Rather to my surprise it's very easy to get around this confirm box in Explorer 5.5 and 6 on Windows. Ex... | [
0.14020133018493652,
0.3125457465648651,
0.5568088889122009,
-0.16473421454429626,
-0.053941428661346436,
-0.44511377811431885,
0.25599536299705505,
0.11667487770318985,
-0.1970825493335724,
-0.5154359936714172,
-0.3156912922859192,
0.4442683756351471,
-0.2576754093170166,
0.14075994491577... | |
has an opener:
```
opener.opener = top; // or whatever, as long as opener.opener has a value;
opener.close()
```
This trick doesn't work in Netscape 4 and lower and iCab, these browsers have more sophisticated ways to determine whether a window has been opened by JavaScript. | [
-0.11858849972486496,
0.11681465059518814,
0.46827754378318787,
-0.38890403509140015,
-0.35297247767448425,
-0.3045753538608551,
0.3341221809387207,
-0.12462149560451508,
0.03452867642045021,
-0.7886996865272522,
-0.539203941822052,
0.536020040512085,
-0.35499101877212524,
0.07318869978189... | |
So I've just recently made the step from ad hoc debugging with `dump`, `print_r` and `echo` to some more sophisticated methods and I'm having a struggle.
I work with Zend Framework, Aptana and Zend Debugger.
At this moment I'm trying to debug a custom controller and whatever I try I don't get to my breakpoint which ... | [
0.3741210997104645,
0.3258407711982727,
0.00885066669434309,
0.17237026989459991,
0.022554364055395126,
-0.27521824836730957,
0.3776179552078247,
-0.10012215375900269,
-0.08539946377277374,
-0.5011383295059204,
-0.12625204026699066,
0.34693604707717896,
-0.22477000951766968,
0.208359763026... | |
Zend Framework with MVC?
You want to change the current user's authentication details mid-way through a request?
I don't think this is possible. Zend Debugger is pretty much a read-only tool. Even if it were, you're assuming that whatever framework you're using can handle this. That would mean it would have to consta... | [
0.43354374170303345,
0.010558269917964935,
0.13054507970809937,
0.061209775507450104,
-0.25316745042800903,
-0.44363656640052795,
0.2906636595726013,
-0.38846489787101746,
-0.05332735925912857,
-0.311940461397171,
0.09846539795398712,
0.6982756853103638,
-0.4355669915676117,
-0.00364656816... | |
user session.
Zend Debugger has a browser toolbar (<http://files.zend.com/help/Zend-Studio-Eclipse-Help/zend_debugger_toolbar.htm>) that allows you to start a the debugger for your current page; the debugger will have all information that the browser would have sent: cookies, post data, etc. There's even a "debug next... | [
0.5603490471839905,
-0.11260535567998886,
-0.018089324235916138,
-0.022482041269540787,
-0.31732043623924255,
-0.527766227722168,
0.37298357486724854,
-0.04184393957257271,
-0.06359762698411942,
-0.7621850371360779,
-0.25472721457481384,
0.597370982170105,
-0.018459515646100044,
0.01340811... | |
CAML is hard to learn, and dificult to use, is there a better way to get results from MOSS, besides using CAML queries? And not referring to the Web Services, which are slower, or the object model, which again is slower.
Essentially, yes, you need to at least be able to read and understand CAML. However you can probabl... | [
-0.06420241296291351,
0.2125086486339569,
0.10225197672843933,
-0.0015077382558956742,
-0.23615215718746185,
0.039714060723781586,
0.03997552767395973,
0.013589058071374893,
-0.18005195260047913,
-0.22419089078903198,
0.2082740217447281,
0.7648155689239502,
0.06361787021160126,
-0.25760379... | |
When I try to execute the following code in IE:
```
<script type="text/javascript">
google.load("jquery", 1);
google.load("jqueryui", "1.5.3");
$(document).ready(function()
{
$("#main-dialog").draggable();
});
</script>
<div id="main-dialog">
This ... | [
0.2846505641937256,
0.07116402685642242,
0.5917877554893494,
-0.12757815420627594,
-0.06454168260097504,
-0.2295994609594345,
0.5317540168762207,
0.006779726129025221,
0.17467154562473297,
-0.7584862112998962,
-0.21971485018730164,
0.556164026260376,
-0.4681289792060852,
0.1114274114370346... | |
am I getting this error?
Essentially, yes, you need to at least be able to read and understand CAML. However you can probably get out of writing it. I've used these tools:
U2U CAML Query Builder by U2U - [download](http://www.u2u.be/res/Tools/CamlQueryBuilder.aspx) and [online](http://www.u2u.be/res/Tools/SharePointCa... | [
0.19105076789855957,
0.47661492228507996,
0.31130775809288025,
0.06997162848711014,
-0.10486411303281784,
-0.18961437046527863,
0.1896062046289444,
-0.006506586913019419,
-0.014300447888672352,
-0.38064613938331604,
0.29403528571128845,
0.849384605884552,
0.12549357116222382,
-0.2420961707... | |
Currently I'm doing something like this in markup
```
<input type="text" ONKEYPRESS="InputNumeric(event);" id="txtNumber" />
```
But I want to use the jQuery bind method instead for all the obvious reasons.
```
jQuery(function($)
{
$("#txtNumber").bind("keyup", InputNumeric(event));
});
```
But when I try th... | [
-0.04875341057777405,
-0.01652655377984047,
0.5999862551689148,
-0.24932722747325897,
0.0682724118232727,
-0.08231187611818314,
0.49993661046028137,
-0.1976490318775177,
-0.06406013667583466,
-0.7805630564689636,
-0.30222728848457336,
0.7703235149383545,
-0.2551001012325287,
0.127344027161... | |
I'm exploring the possibility of running a Java app on a machine with very large amounts of RAM (anywhere from 300GB to 15TB, probably on an SGI Altix 4700 machine), and I'm curious as to how Java's GC is likely to perform in this scenario.
I've heard that IBM's or JRockit's JVMs may be better suited to this than Sun'... | [
0.2251245379447937,
-0.047299981117248535,
0.171651229262352,
0.014876602217555046,
-0.32865428924560547,
-0.130226731300354,
0.2229820340871811,
-0.0349528007209301,
-0.4517594873905182,
-0.5917780995368958,
-0.011555271223187447,
0.4490937292575836,
-0.30005815625190735,
0.03750864416360... | |
the default GC algorithm almost completely, at the cost of a little bit more overhead.
The advise to use more than on VM on such a machine is IMHO outdated.
In real world applications you often have enough shared data so that the performance with the CMS and one JVM is better. | [
-0.18960191309452057,
-0.022069348022341728,
0.24364618957042694,
0.2509191334247589,
-0.05420658364892006,
-0.414139986038208,
-0.07974451035261154,
0.12667052447795868,
-0.24653126299381256,
-0.6265130043029785,
-0.27901691198349,
0.4770357608795166,
-0.5033871531486511,
-0.1192355677485... | |
I've got a service that has a very slow memory leak. If I analyze the .NET CLR Loading counters, I see that the *Current Classes Loaded* counter is constantly increasing and matches *Total Classes Loaded* counter at all times. This gives me the impression that the memory leak is related to resources not being freed (Th... | [
0.15579620003700256,
0.04889839515089989,
0.2135733962059021,
0.18690624833106995,
0.047324296087026596,
-0.06330381333827972,
0.4835648834705353,
0.2416507750749588,
-0.47526586055755615,
-0.700165331363678,
0.10830006003379822,
0.314405232667923,
-0.13211888074874878,
0.3387509286403656,... | |
anyone could walk me through the steps to enumerate these *Loaded* classes.
I do have the source code so I can obtain the symbol files if necessary. Thanks in advance for any help!
I believe that the issue was actually caused by a series of un-disposed FileSystemWatcher instances that were nested way down inside the R... | [
0.46112900972366333,
0.2136634737253189,
0.02032277174293995,
0.4528587758541107,
-0.3229178488254547,
-0.10749359428882599,
0.515166699886322,
0.4178580939769745,
-0.5597179532051086,
-0.5436219573020935,
0.04289712756872177,
0.4744977653026581,
0.2494933009147644,
0.15867914259433746,
... | |
I need to store large amounts of data on-disk in approximately 1k blocks. I will be accessing these objects in a way that is hard to predict, but where patterns probably exist.
Is there an algorithm or heuristic I can use that will rearrange the objects on disk based on my access patterns to try to maximize sequential... | [
0.18219241499900818,
0.11219540238380432,
-0.10486198961734772,
0.4503203332424164,
0.21892668306827545,
0.09204551577568054,
0.034540895372629166,
-0.20650331676006317,
-0.3553987443447113,
-0.7188628911972046,
0.12733924388885498,
0.4408628046512604,
-0.1254412829875946,
0.21683549880981... | |
use [binary search](http://en.wikipedia.org/wiki/Binary_search) for O(log n) efficiency.
If you seek on different block fields, consider storing an external index for each field. A [b-tree](http://en.wikipedia.org/wiki/B-tree) gives you O(log n) efficiency. When you seek, grab the appropriate index, search it for your... | [
-0.07960450649261475,
-0.08760868012905121,
-0.26052579283714294,
0.29269859194755554,
-0.06188342347741127,
0.20568238198757172,
0.03868427500128746,
-0.527193009853363,
-0.4000965654850006,
-0.7150524258613586,
-0.2872598469257355,
0.31213417649269104,
-0.3075380027294159,
-0.11121164262... | |
The bossman wants to know how to delete a user in Sharepoint. We've got him convinced that deleting a user is too difficult because of traces of that user through the system, so now he wants to be able to change the username to all Xs or somesuch. I've poked around the DB and found a couple of UserInfo tables, one in `... | [
0.15895549952983856,
0.13569405674934387,
0.28652727603912354,
0.09323696047067642,
0.15059806406497955,
-0.004244524519890547,
0.10236436873674393,
0.07947207242250443,
-0.2809046506881714,
-0.5743697285652161,
-0.1600668579339981,
0.33689913153648376,
-0.5923023223876953,
0.4587449729442... | |
in the respective membership provider: AD, aspnetsqlmembershipprovider, etc.
The process for removing a user from SharePoint's environment is to first go to your membership provider and delete the user there. After you have done this, you have a choice.
1. You can leave the user's artifacts for legacy information. I... | [
0.23806306719779968,
0.17578630149364471,
0.2829361855983734,
0.1299208104610443,
0.17938973009586334,
-0.40181753039360046,
0.23816320300102234,
-0.06853806972503662,
-0.11733358353376389,
-0.6292073130607605,
-0.21513062715530396,
0.10193649679422379,
-0.21033167839050293,
0.423887550830... | |
site collection. Any documents the user created will now be owned by the system administrator (I believe). An example of using this option is when the user account was misspelled and you want to remove all traces before creating the correct account. | [
0.4099551737308502,
-0.05725041776895523,
0.24080857634544373,
0.23668429255485535,
0.2520220875740051,
-0.6804326772689819,
0.33434051275253296,
-0.020239155739545822,
-0.7038637399673462,
-0.39279964566230774,
-0.17959217727184296,
0.33278408646583557,
-0.024842729791998863,
0.0977183729... | |
I'm using Turbo Delphi 2006.
The DLL will be called from within Excel as part of a VBA/DLL combination.
The first part of the problem is trying to find out how to pass to the DLL a reference to the current Excel session. Most other code I've seen was that it launched a separate instance of Excel apart from the one y... | [
0.3606502413749695,
-0.08919266611337662,
0.10311582684516907,
-0.06295283883810043,
-0.3569369912147522,
-0.14348363876342773,
0.03216177225112915,
0.016339071094989777,
-0.06782117486000061,
-0.5843130350112915,
0.08543630689382553,
0.8722841739654541,
-0.4779070317745209,
-0.09141545742... | |
to create an automation DLL and implement the [`IDTExtensibility2`](http://msdn.microsoft.com/en-us/library/aa155640(office.10).aspx#comaddins_idtextens2) interface. You will then receive the Excel `Application` interface as a parameter to the `OnConnection` method.
You will also need to [register](http://msdn.microso... | [
-0.15283556282520294,
-0.03464401885867119,
0.6665077805519104,
0.2022145837545395,
-0.17576177418231964,
-0.11491257697343826,
-0.0030953697860240936,
-0.28074491024017334,
-0.04857932776212692,
-0.46338701248168945,
-0.28081950545310974,
0.45588356256484985,
-0.348474383354187,
0.0634096... | |
**UPDATE:**
Obviously, you'd want to do this using templates or a base class rather than macros. Unfortunately for various reasons I can't use templates, or a base class.
---
At the moment I am using a macro to define a bunch of fields and methods on various classes, like this:
```
class Example
{
// Use FIELDS_AN... | [
0.1526675820350647,
-0.01559037622064352,
-0.07550536841154099,
0.03578026220202446,
0.06353438645601273,
-0.04500061646103859,
-0.2604684829711914,
-0.013572325929999352,
-0.2642359733581543,
-0.7006893157958984,
0.09108434617519379,
0.6278981566429138,
-0.4491903483867645,
-0.07884854823... | |
the macro.
#define TYPE_NAME Example
#include "FieldsNMethods.h"
};
```
Here I #define the name of the class (previously the parameter to the macro), and the `FieldsNMethods.h` file contains the content of the original macro. However, because I'm #including I can step into the code at runtime, when debugging.
Ho... | [
0.1447048932313919,
0.06294874101877213,
0.21328933537006378,
-0.4252800941467285,
0.3398515284061432,
-0.13045814633369446,
0.032045163214206696,
-0.28239521384239197,
-0.10096893459558487,
-0.4741498529911041,
-0.08281517773866653,
0.8044021725654602,
-0.5997161269187927,
-0.008999557234... | |
can't use the stringizing and token-pasting operators directly, because I'm not in a macro definition.
This cries out for a template.
```
class Example<class T>
{
...class definition...
};
```
The direct answer to the last part of your question - "given that I'm not in a macro definition any more, how do I get p... | [
0.5238196849822998,
0.03519076481461525,
-0.10096133500337601,
0.06402980536222458,
0.267087459564209,
-0.07545293867588043,
0.332264244556427,
-0.19629037380218506,
-0.21137511730194092,
-0.43242591619491577,
-0.23669682443141937,
0.6281620264053345,
-0.28468039631843567,
0.06931870430707... | |
pre-standard, pre-template way, and does so causing much pain and grief. Using templates would avoid that pain -- though there'd be a conversion operation.
@mackenir asked "is there a way to make things work with macros?" Yes, you can, but you should use templates - they are more reliable and maintainable. To make it ... | [
0.5656580328941345,
0.12706676125526428,
-0.07370080053806305,
-0.0676470696926117,
0.023208608850836754,
0.08640985935926437,
0.2498834878206253,
-0.32386165857315063,
-0.2243564873933792,
-0.6783247590065002,
0.08143926411867142,
0.5950707197189331,
-0.6031420826911926,
-0.03674293309450... | |
_function_suffix)(void) { ... }
```
This level of indirection is an often necessary idiom for both tokenizing and stringizing operators.
---
Additional comments from @mackenir indicate continued problems. Let's make it concrete.
> At the moment I am using a macro to define a bunch of fields and methods on various ... | [
0.21132458746433258,
0.021676070988178253,
-0.021822961047291756,
-0.04267413169145584,
-0.06580298393964767,
-0.008077657781541348,
-0.052346255630254745,
-0.1215696781873703,
-0.22747357189655304,
-0.5598829388618469,
0.14495056867599487,
0.5255991816520691,
-0.3216336965560913,
0.036033... | |
TYPE_NAME preprocessor symbol
// defined, to achieve the same result as the macro.
#define TYPE_NAME Example
#include "FieldsNMethods.h"
};
```
OK. To make this concrete, we need a `FIELDS_AND_METHODS(type)` macro that is multi-line and uses token-pasting (I'm not going to deal with stringizing - the same... | [
-0.17542438209056854,
-0.10110708326101303,
0.2960721254348755,
-0.2661438286304474,
0.23555217683315277,
-0.0895327627658844,
-0.05300129950046539,
-0.20338954031467438,
-0.11116812378168106,
-0.4818877577781677,
-0.11796902120113373,
0.5282895565032959,
-0.5912569761276245,
-0.0473613627... | |
for that type, and a method (Example\_next in this case) that returns that pointer.
So, this might be the macro - and we need to replace it such that the '#include' does the equivalent job.
The content of fieldsNmethods.h becomes:
```
#ifndef TYPE_NAME
#error TYPE_NAME not defined
#endif
#define FNM_PASTE_NAME(x, y)... | [
-0.04024902358651161,
0.04752371087670326,
0.21569454669952393,
-0.28662267327308655,
0.25487250089645386,
0.0029264006298035383,
0.010052313096821308,
-0.41398802399635315,
-0.329781174659729,
-0.539490818977356,
-0.269385427236557,
0.3245166838169098,
-0.5980411767959595,
0.1176643967628... | |
since the redefinitions would be identical, they're 'benign' and wouldn't cause an error), and I prefixed them with `FNM_` as a primitive namespace control on the macros. This generates the code I'd expect from the C pre-processor. and G++ doesn't witter but produces an empty object file (because the types declared are... | [
0.47051072120666504,
0.2113635241985321,
0.26160696148872375,
-0.1496826857328415,
-0.026990102604031563,
-0.15569083392620087,
0.33818769454956055,
-0.30472323298454285,
-0.015890182927250862,
-0.2545933127403259,
-0.054271504282951355,
0.7818021178245544,
-0.3322104215621948,
0.161738365... | |
// Include FieldsNMethods.h, with TYPE_NAME preprocessor symbol
// defined, to achieve the same result as the macro.
#include "FieldsNMethods.h"
};
``` | [
0.22556030750274658,
0.04900965839624405,
-0.05395127460360527,
-0.25974127650260925,
0.3909149169921875,
-0.09892380237579346,
0.0022037590388208628,
-0.17807112634181976,
-0.19176770746707916,
-0.3642933964729309,
-0.3894846737384796,
0.6752987504005432,
-0.4963923394680023,
-0.060169231... | |
The UI for web apps is constructed differently from the UI of desktop apps. I'm interested to know what are actually the major differences in building UI between the two styles of applications in the following areas:
1.Technology used
2.Techniques used
3.Controls used
4.Screen changing behavior
A big design dif... | [
0.33410367369651794,
0.03962795063853264,
0.6519708037376404,
0.2732474207878113,
-0.0893293172121048,
0.07230941951274872,
0.2391909807920456,
0.1239689439535141,
-0.17571134865283966,
-1.1067817211151123,
-0.005116721149533987,
0.4122801423072815,
-0.08549255132675171,
0.0317001380026340... | |
bars are generally very bad practice for non-tabular/list data. Where more space is needed, the information is generally split into either new windows or sub-window panes/tabs.
* A web app, on the other hand, has essentially infinite vertical height, as most people are used to scrolling in their web browser. The scroll... | [
0.2380892038345337,
-0.0410333089530468,
0.6241634488105774,
0.08660285919904709,
-0.03084653615951538,
-0.022625399753451347,
0.2836841940879822,
0.2994990646839142,
-0.3146303594112396,
-0.7647021412849426,
-0.6103693842887878,
0.03350694477558136,
-0.0736309364438057,
0.1174633279442787... | |
and re-loading identical data (styles, menus, etc. yes, there's a cache, but it's not as fast as not loading a single page). More loads are always slower, and cause feelings of discontinuity. Sometimes they're inescapable, but you should almost never constrain your app to only the visible size of the browser window.
* ... | [
0.42046013474464417,
0.12023134529590607,
0.1985369175672531,
0.27419766783714294,
0.013049077242612839,
0.11282385140657425,
0.4292386472225189,
0.06210630014538765,
-0.6650200486183167,
-0.6194949746131897,
-0.012506878934800625,
0.6473756432533264,
-0.10533905774354935,
-0.0603451579809... | |
app (and you know that some will). It may seem like you're just copying the big players, but consistency is much more important than it immediately seems.
* Columns of text shouldn't be super-wide, because the wider a line gets, the harder it is to jump to the next line to continue reading. Stick to something similar t... | [
0.5008410811424255,
0.04007071256637573,
0.2457696944475174,
0.18752993643283844,
-0.04980778321623802,
0.03470021113753319,
0.21294766664505005,
0.18705913424491882,
-0.70262211561203,
-0.8298666477203369,
-0.15275467932224274,
0.34667691588401794,
-0.27040258049964905,
-0.240685984492301... | |
this reply without any spaces, new lines, or bullets.
A pet peeve of mine are text links that perform frequent actions. Unless you're actually 'linking' to a separate page, *do not make it look like a link*. Make it a control, or an image, or *something*. Links are for *moving* in websites, buttons *do* things. Most p... | [
0.43187180161476135,
-0.032763607800006866,
0.14056281745433807,
0.3662415146827698,
-0.2318621277809143,
-0.10601501166820526,
0.4755620062351227,
0.39416587352752686,
-0.2869565486907959,
-0.8101834654808044,
-0.20998984575271606,
-0.07711175084114075,
-0.4886851906776428,
0.001300731557... | |
used extensively.
A lot of web apps that I've seen that have generally failed try to duplicate a desktop app in a browser window... which is fitting a round peg into a square hole. It can be done, but they are *not* the same thing, and should not be treated as such under almost any circumstance.
A partial exception... | [
0.4902871251106262,
0.18300049006938934,
-0.09802646934986115,
0.3955622613430023,
0.23648914694786072,
-0.013604538515210152,
0.05377289280295372,
0.012511533685028553,
-0.40129661560058594,
-0.6416110992431641,
-0.1254069060087204,
0.5344895124435425,
-0.3333379328250885,
-0.050578311085... | |
help people transition.
Most people use programs on their desktop to *do* something. Most people use their browsers to *see* something (read, watch, etc). Of course, there's crossover, but think about most people's daily habits, and remember that *other* people will be using something you design; it's not just you (an... | [
0.5564978122711182,
-0.0929953083395958,
0.014937945641577244,
0.3075094521045685,
0.17932799458503723,
-0.25919249653816223,
0.6220880150794983,
0.2559191882610321,
-0.3319092094898224,
-0.9690778255462646,
-0.30056264996528625,
0.49047553539276123,
-0.22621573507785797,
-0.05319043248891... | |
annoys them so much (myself included)). | [
0.5931448340415955,
0.3765442967414856,
0.10672890394926071,
-0.014481511898338795,
-0.2466375082731247,
-0.18114551901817322,
0.4609420597553253,
0.3041474223136902,
0.053936220705509186,
-0.21158790588378906,
-0.04552017152309418,
0.50742107629776,
0.2621189057826996,
0.13056005537509918... | |
I have a table like so:
```
keyA keyB data
```
keyA and keyB together are unique, are the primary key of my table and make up a clustered index.
There are 5 possible values of keyB but an unlimited number of possible values of keyA,. keyB generally increments.
For example, the following data can be ordered in 2 wa... | [
-0.016997672617435455,
0.23269887268543243,
0.4838641285896301,
-0.09021161496639252,
-0.055819056928157806,
0.040242839604616165,
-0.08263475447893143,
-0.3191527724266052,
-0.17125844955444336,
-0.3800647258758545,
-0.17015986144542694,
0.036640897393226624,
-0.14015348255634308,
0.44257... | |
X
B 5 X
A 7 X
B 7 X
```
or
```
keyA keyB data
A 1 X
A 3 X
A 5 X
A 7 X
B 1 X
B 3 X
B 5 X
B 7 X
```
Do I need to tell the clustered | [
0.08252748847007751,
0.25677093863487244,
0.26676443219184875,
-0.30662256479263306,
0.13368253409862518,
-0.20630018413066864,
0.11961018294095993,
0.03945997729897499,
0.01046387292444706,
-0.18240876495838165,
-0.15427428483963013,
0.34282705187797546,
-0.2647578716278076,
0.23453851044... | |
index which of the key columns has fewer possible values to allow it to order the data by that value first? Or does it not matter in terms of performance which is ordered first?
You should order your composite clustered index with the most selective column first. This means the column with the most distinct values comp... | [
0.08323834836483002,
-0.12274375557899475,
0.11935834586620331,
0.13963563740253448,
-0.2914440333843231,
0.18715430796146393,
-0.20625963807106018,
-0.16001282632350922,
-0.2533474564552307,
-0.3442291021347046,
0.029205435886979103,
0.2506251633167267,
-0.3647513687610626,
0.109818436205... | |
creating a composite index that contains all the fields - it will not have to access the base table, but will instead pull data from the index.
ligget78's comment on making sure to mention the first column in a composite index is important to remember. | [
-0.21643370389938354,
0.04984765127301216,
0.24987217783927917,
-0.05215836688876152,
-0.10348712652921677,
-0.0634332150220871,
0.052266694605350494,
-0.154450923204422,
-0.19763147830963135,
-0.3833581209182739,
-0.21724297106266022,
0.10164644569158554,
-0.7012924551963806,
-0.104825489... | |
Good day,
we just moved from asp.net 1.1 to asp.net 2.0. We are using ajax update panels.
In an Apress book (Pro asp.net 2008) , I've read that when you use the updatepanel, you don't reduce the acount of bandwidth sent, because the entire page is still sent.
That in mind, I've also read on many websites that it is... | [
0.13346931338310242,
-0.042398739606142044,
0.5278322100639343,
-0.050342023372650146,
-0.6362930536270142,
-0.13483113050460815,
0.13389159739017487,
0.29922372102737427,
-0.25705575942993164,
-1.0393402576446533,
0.2401144802570343,
0.5832089185714722,
-0.14866375923156738,
-0.4630051553... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.