text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I was recently reading about the Arduino's [Hello World](http://arduino.cc/en/Tutorial/Blink) application, and I thought to myself, "I wonder if I can do that with hardware that I have right now."
Since I don't have an Arduino, I grabbed a usb flash drive that I had laying around and started googling around for inform... | [
0.17908048629760742,
0.07434023171663284,
0.33391472697257996,
0.1592380553483963,
0.05234076455235481,
-0.0345272570848465,
-0.11667299270629883,
0.6092859506607056,
-0.34747812151908875,
-0.6194401383399963,
0.41788458824157715,
0.43102407455444336,
-0.25885963439941406,
0.09769666194915... | |
this)?
Also, related to this subject - does anyone know what kind of commands USB drives use? For example, SCSI storage devices have a standardized command set; ATA devices have a similar protocol. How are things like simple read/write commands issued to a USB storage device?
While the USB protocol is fairly generic, ... | [
0.25042158365249634,
-0.17664289474487305,
0.34460535645484924,
0.6065826416015625,
0.07808253169059753,
-0.5790141820907593,
-0.43933314085006714,
0.03353630751371384,
-0.26087677478790283,
-0.4600825011730194,
0.04649835452437401,
0.740607738494873,
-0.25142133235931396,
0.25514760613441... | |
for every drive you plug into windows.
I'm pretty sure that the mass storage protocol does not have a "Turn LED on" message :)
And while the company that implemented the USB drive might actually have a special command to do that (maybe for debugging), I would doubt it would be published.
While I'm no guru on Windows,... | [
0.7846112251281738,
0.024958094581961632,
0.27584195137023926,
0.16199979186058044,
0.04216591641306877,
-0.4549241065979004,
-0.0811246782541275,
0.3913768231868744,
-0.2512340843677521,
-0.5883851647377014,
-0.07769817113876343,
1.062681794166565,
-0.24409028887748718,
0.2920426726341247... | |
USB device. | [
-0.18073001503944397,
-0.0010766235645860434,
0.3786795437335968,
0.3381889760494232,
0.2882353663444519,
-0.2318011224269867,
-0.642249584197998,
-0.15495365858078003,
-0.19982625544071198,
-0.4204908609390259,
-0.025056596845388412,
0.5415982604026794,
-0.26350343227386475,
-0.0256201624... | |
If you are developing a memory intensive application in C++ on Windows, do you opt to write your own custom memory manager to allocate memory from virtual address space or do you allow CRT to take control and do the memory management for you ? I am especially concerned about the fragmentation caused by the allocation a... | [
-0.06493619084358215,
0.12785744667053223,
-0.1436605006456375,
0.28088274598121643,
-0.07741469144821167,
-0.14959816634655,
-0.03144167363643646,
-0.040149662643671036,
-0.40452972054481506,
-0.6430485248565674,
-0.1399039328098297,
0.5502868890762329,
-0.2441900670528412,
0.136906981468... | |
memory in a way that damages the performance of your application. CRT, core OS, and STL guys spend a lot of time thinking about memory management.
There's a good chance that your code will perform quite fine under existing allocators with no changes needed. There's certainly a better chance of that, than there is of ... | [
0.050045788288116455,
0.32735171914100647,
-0.08222570270299911,
0.40115949511528015,
-0.005489157512784004,
-0.0555146262049675,
0.2876659631729126,
0.27419865131378174,
-0.2306114137172699,
-0.6332416534423828,
-0.05906714126467705,
0.5850582122802734,
0.013728434219956398,
0.17542676627... | |
shows it's a problem is that you will also know if you've actually fixed anything. That's the most important part of a performance fix.
As long as you're using standard collection classes an algorihtmns (such as STL/BOOST) it shouldn't be very hard to plug in a new allocator later on in the cycle to fix the portions ... | [
0.17215435206890106,
0.1414710432291031,
0.012662876397371292,
0.3216910660266876,
-0.17679241299629211,
-0.15185345709323883,
0.14551381766796112,
0.007274916861206293,
-0.33539387583732605,
-0.31143128871917725,
-0.23846474289894104,
0.5902053117752075,
-0.08202040195465088,
-0.227112680... | |
Ok my application does everything that is it suppeded to do and it does the same thing every time so its not as if testing was gone be that much trouble.
it crashes "somtimes" not always. it does this when i hover the mouse over a file in the open file dialog i have recently outputted. not instantly it waits about hal... | [
0.41869738698005676,
0.09174782782793045,
0.4738043546676636,
-0.008582699112594128,
-0.07305902242660522,
-0.34593677520751953,
0.442813515663147,
0.15593558549880981,
-0.3265831172466278,
-0.6445918679237366,
0.24623985588550568,
0.5205277800559998,
0.1526518315076828,
0.3052345812320709... | |
the "opendialog" and i didnt write this code so this error is not of my doing is it?????? if it is how,, if it is not how/what can i do to stop it..
the type of error is a "acces violation at address " bla...
the open file dialog has no filters and is exactly as it off compoent tray and it crashes after i call "opend... | [
0.18485134840011597,
0.29476526379585266,
0.8583004474639893,
0.07005950808525085,
-0.02661396935582161,
-0.3488602638244629,
0.6195961833000183,
0.16498184204101562,
-0.29930970072746277,
-0.5967085361480713,
-0.09430240094661713,
0.784751296043396,
-0.6875208020210266,
0.1409855484962463... | |
doesnt even happen 100% all the time,, and its not machine specific.. crashes on 3 different win xp pc's.
HELP!!
Additional; findings i can open and run the file and all is well as long as i dont make a hint box to pop up on a file i have created.
Drop an **TApplicationEvent**s component on your form and add an even... | [
0.19692842662334442,
0.14984603226184845,
0.3024984300136566,
0.36964675784111023,
-0.08775710314512253,
-0.3138919770717621,
0.7116422057151794,
-0.09418701380491257,
-0.0242164246737957,
-0.611524224281311,
-0.09503116458654404,
0.5965947508811951,
-0.09500433504581451,
-0.34919717907905... | |
you can compile with *debug DCU*'s and trace in and see what it is crashing on.
My guess is you still have a file handle with an *exclusive lock* on the file maybe. Check your file handles and make sure you are properly closing them. What happens if you try to *open one of those files from notepad* while the program i... | [
0.34128743410110474,
-0.01830741949379444,
0.25821420550346375,
0.46618008613586426,
0.31018391251564026,
-0.34418565034866333,
0.4885532557964325,
0.41694140434265137,
-0.5682976245880127,
-0.739957332611084,
0.07894742488861084,
0.6276937127113342,
0.03764628991484642,
0.1455799639225006... | |
Here is an example that a forum poster gave, I can't tell if this tail optimized. Also, could someone give a laymans description of how a tail optimized version would trump the normal version.
```
(defun mylength (s)
(labels ((mylength-inner (s x)
(if (car s) (mylength-inner (cdr s) (+ x 1)) x)))
... | [
-0.060734864324331284,
-0.40671879053115845,
0.5774945616722107,
0.03895341232419014,
0.0783306136727333,
-0.1294870525598526,
0.1633152961730957,
-0.2682957351207733,
-0.016586855053901672,
-0.2590830624103546,
-0.33288562297821045,
0.8811752200126648,
-0.4700053632259369,
-0.149461194872... | |
to itself or no call to itself. The function mylength-inner will return either `x` or `(mylength-inner (cdr s) (+ x 1))`, and so it can be tail-optimized.
This means the compiler can turn it into a loop instead of calling the function recursively. Either return x, or assign (cdr s) to s, increment x, and start again a... | [
-0.0759238600730896,
-0.11305025964975357,
0.42539167404174805,
-0.2194739729166031,
-0.15994787216186523,
-0.08593380451202393,
0.17165832221508026,
-0.06395239382982254,
-0.043837130069732666,
-0.18226361274719238,
-0.5029255151748657,
0.55378258228302,
-0.5701693296432495,
-0.1786041110... | |
l doesn't just return a call to l, but rather the result of a call to l with one added. This means it can't be directly turned into a loop, so all the function calls will have to be made.
Suppose the compiler wanted to turn l into a loop. There's no problem with the assignment of (rest s) to s, but where does it put ... | [
-0.06082582101225853,
-0.36187633872032166,
0.08535658568143845,
-0.32764294743537903,
-0.21474403142929077,
0.01036704983562231,
0.14675164222717285,
-0.25347596406936646,
-0.004891738295555115,
-0.30569443106651306,
-0.3346118927001953,
0.36646756529808044,
-0.5885676145553589,
-0.116694... | |
I'm working with PyGTK, trying to come up with a combination of widgets that will do the following:
* Let me add an endless number of widgets in a column
* Provide a vertical scrollbar to get to the ones that run off the bottom
* Make the widgets' width adjust to fill available horizontal space when the window is resi... | [
0.5672450065612793,
-0.15084274113178253,
0.656928539276123,
0.11960767209529877,
-0.22650004923343658,
0.19388467073440552,
0.0012978463200852275,
0.051974110305309296,
-0.42020383477211,
-0.9259541034698486,
0.19053801894187927,
0.5749691128730774,
0.03853515908122063,
0.0102315424010157... | |
least in Glade the defaults seem to mostly handle this (You will probably want to change the scrollbar policy of the ScrolledWindow).
Now for the trick. If you just do what I've listed above, the contents of the VBox will try to resize vertically as well as horizontally, and you won't get your scrollbar. The solution ... | [
-0.05888228490948677,
-0.4688110947608948,
0.9801121354103088,
0.03788033872842789,
-0.0841614156961441,
0.09791228920221329,
0.25888848304748535,
-0.023468362167477608,
-0.026973802596330643,
-0.9697897434234619,
0.12945742905139923,
0.8028138279914856,
-0.10422028601169586,
-0.1315634399... | |
There's no strongly typed View() method to return an ActionResult. So, suppose I have
```
class Edit : ViewPage<Frob>
```
In my FrobController, I will do something like "return View("Edit", someFrob);". There's no checking going on here, so I have to always manually synchronize the view and controller's use of it. ... | [
-0.30889958143234253,
-0.34210649132728577,
0.5076174139976501,
-0.22641243040561676,
-0.16095665097236633,
0.0461430661380291,
0.26976120471954346,
-0.15280024707317352,
-0.3411307632923126,
-0.4746849238872528,
-0.22521507740020752,
0.767177164554596,
-0.5215056538581848,
0.0981471985578... | |
view
> object that's never used is because,
> AFAIK, there's no way to get C#'s type
> inference to work otherwise. If I
> removed the view parameter, I'd need
> to specify V explicitly, which also
> means specifying M explicitly too...
> sigh.
So now, I can do this:
```
return ViewPage(new Views.Frob.Edit()... | [
-0.10650648176670074,
-0.03327673301100731,
0.6451718211174011,
-0.03998754173517227,
-0.06503419578075409,
-0.04567084461450577,
0.22062961757183075,
-0.27816683053970337,
0.07372789084911346,
-0.7879737019538879,
-0.02093900740146637,
0.8248266577720642,
-0.5047644376754761,
0.3065970838... | |
must be an exact match. So with a ViewPage>, I cannot pass in a List. I thought this might work:
```
public ActionResult ViewPage<V, M, T>(V view, T model)
where V : ViewPage<M>
where M : class
where T : M {
return View(typeof(V).Name, model);
}
```
But C#'s type inference ca... | [
0.005651288200169802,
-0.18570180237293243,
0.36239996552467346,
-0.07032342255115509,
-0.27455615997314453,
-0.04422643035650253,
0.15409615635871887,
-0.37100908160209656,
-0.11436721682548523,
-0.4064829349517822,
-0.07960473001003265,
0.7026947140693665,
-0.33292126655578613,
0.1296519... | |
not be the right name, as I think it can be overridden by attributes. But that's an easy fix if I run into it.
Questions:
1. How can I make this syntax cleaner?
2. What downsides am I missing here?
Edit: With respect to the Controller knowing about the View, it only slightly does. The only thing it gets from the vie... | [
0.326704204082489,
-0.11827944219112396,
0.34005147218704224,
0.1932922899723053,
-0.10525447875261307,
0.06087436154484749,
0.33419838547706604,
-0.013725713826715946,
-0.09588944911956787,
-0.40354979038238525,
-0.038535356521606445,
0.40579015016555786,
-0.2712332308292389,
0.1480213850... | |
a trick to get the compiler to catch errors.
The first problem I see is that you've now made your Controller aware of the View. That's a line you should never cross. | [
0.22690227627754211,
-0.027446996420621872,
0.12283812463283539,
0.13487812876701355,
0.08047564327716827,
-0.00434694392606616,
0.18355990946292877,
0.29941484332084656,
-0.2386995553970337,
-0.451290488243103,
0.1510544866323471,
0.579651415348053,
-0.024931075051426888,
0.26453635096549... | |
I'm making a simple navigation menu for a site. You create an `ul` with id `menu`, and should be pretty simple from there. I have some simple css to give all the `li`s the correct background image, then some jQuery to change the look of an `li` when the user mouses over. It works pretty well, but there's one problem. W... | [
0.3561449646949768,
0.1635030061006546,
0.4101678133010864,
-0.052277952432632446,
-0.07181911170482635,
0.07586599886417389,
-0.14828869700431824,
0.2958754897117615,
-0.02849261276423931,
-0.7889413237571716,
0.1870730072259903,
0.6086997389793396,
-0.37306442856788635,
0.275373935699462... | |
it's fine once the user mouses away. Does anyone know what may cause this strange behavior? (Note, every once in a while, mousing over causes a `li` to flicker, especially if it's one of the bottom two `li`s. I thought this was normal, but maybe it could be helpful in diagnosing the problem.)
```
<html>
<head>
<title>... | [
0.1771005541086197,
-0.2688365578651428,
0.929104208946228,
-0.21813394129276276,
-0.11942338943481445,
-0.07750523835420609,
0.31573885679244995,
-0.2921620309352875,
-0.18163001537322998,
-0.4232187569141388,
-0.24256384372711182,
0.5240342617034912,
-0.25399529933929443,
0.0202339496463... | |
})
$(".link").mouseout(function(){ //un-highlight on mouseout
$(this).css({background: "url('./link.png')"});
})
$(".link").click(function(){ //go to site on click, even if click isn't on link
window.location = $(this).find("a").attr("href");
})
})
</script>
</head>
<body>
<ul id="menu">
<li><h2>Menu</... | [
0.24732884764671326,
0.09407184273004532,
0.5184495449066162,
-0.2645066976547241,
-0.2480308562517166,
0.003044009441509843,
0.08033503592014313,
-0.5418789982795715,
-0.316828191280365,
-0.4570305347442627,
-0.4892875850200653,
0.3163977861404419,
-0.2868807315826416,
-0.2057993561029434... | |
Sometimes the overhead of creating a new model type is annoying. In these cases, I want to set ViewData, and the options seem to be:
1. Simply set viewdata with a string key, and cast it out. This has obvious problems.
2. Store the identifier (string key) somewhere (where? on the controller?) and cast it out on the vi... | [
0.23957593739032745,
-0.32159948348999023,
0.3503105640411377,
0.29883843660354614,
-0.19684487581253052,
-0.22139973938465118,
0.27389195561408997,
-0.2965824007987976,
0.012254542671144009,
-0.655096709728241,
0.13135620951652527,
0.695982038974762,
-0.4566575586795807,
0.177283570170402... | |
It also kills type inference and it's still pretty much just doing a cast, so I must manually sync up the view and controller.
So, instead I'm thinking of using a phantom type to combine both the type and key identifier. It'd be equivalent to this psuedo-C#:
```
class ViewDataKey<T> = string
```
This would let me c... | [
-0.09512030333280563,
-0.3389151990413666,
0.564813494682312,
0.056650903075933456,
-0.17027437686920166,
-0.25689682364463806,
0.2913955748081207,
-0.1760195791721344,
-0.05871303379535675,
-0.44436848163604736,
-0.17007231712341309,
0.8149449825286865,
-0.3378850221633911,
0.098437942564... | |
and type definitons are stored in one location.
Questions:
1. Where should the key be stored? For "global-ish" ViewData, some common class works fine. But for View/Controller specific data? Is there any downside to putting it on the controller? (Apart from the long name of the controller?)
2. Are there any easier way... | [
0.14849305152893066,
-0.16037088632583618,
0.2807672321796417,
0.22295279800891876,
0.014032338745892048,
-0.0034465051721781492,
-0.01603066176176071,
-0.004870219621807337,
-0.23613697290420532,
-0.46231338381767273,
0.08210689574480057,
0.4479948878288269,
-0.49089890718460083,
0.254107... | |
of line of code or something like that. You have to declare the existence of the variable, which you'd also do in the model class definition.
You don't get any significant advantage by doing so. | [
0.4070512056350708,
-0.14487414062023163,
0.02225915901362896,
0.3981334865093231,
0.07876721769571304,
-0.2329137623310089,
0.13651281595230103,
0.009412622079253197,
0.23439273238182068,
-0.18763986229896545,
-0.09339378774166107,
0.3831184208393097,
-0.27414411306381226,
0.3995774984359... | |
I have a SQL table like so:
Update: I'm changing the example table as the existing hierarchical nature of the original data (State, Cities, Schools) is overshadowing the fact that a simple relationship is needed between the items.
```
entities
id name
1 Apple
2 Orange
... | [
0.43729981780052185,
0.1169959232211113,
0.19864532351493835,
0.1984672099351883,
-0.169626384973526,
0.10278457403182983,
0.06897225975990295,
0.29781049489974976,
-0.46457165479660034,
-0.37860092520713806,
0.03850169852375984,
0.07041531801223755,
-0.2961651682853699,
0.1031454131007194... | |
4 Carrot
5 Mushroom
```
I want to define two-way relationships between these entities so a user viewing one entity can see a list of all related entities.
The relationships are defined by an end user.
What is the best way to represent these relationships in the database and subse... | [
0.5523748397827148,
0.1759054809808731,
0.5000356435775757,
-0.01765156351029873,
-0.11732868105173111,
0.15345391631126404,
-0.1556778848171234,
0.12981276214122772,
-0.15496724843978882,
-0.4060041606426239,
0.40597084164619446,
0.577152669429779,
-0.011474679224193096,
0.045376431196928... | |
a relationship table like so:
```
entity_entity
entity_id_a entity_id_b
1 2
5 1
4 1
5 4
1 3
```
That being the case, | [
-0.08386726677417755,
0.5018221735954285,
0.3776949346065521,
-0.08861483633518219,
0.008860568515956402,
-0.17849263548851013,
-0.2380039095878601,
-0.06016813963651657,
0.031828250735998154,
-0.2742846608161926,
-0.07281733304262161,
0.13861188292503357,
-0.24246051907539368,
0.165873363... | |
given a supplied entity\_id of 4, how would one get all related records, which would be 1 and 5?
Likewise a query of entity\_id = 1 should return 2, 3, 4, and 5.
Thanks for your time and let me know if I can clarify the question at all.
Define a constraint: `entity_id_a < entity_id_b`.
Create indexes:
```
CREATE UN... | [
0.03010479174554348,
0.26894304156303406,
0.4575042426586151,
0.3503444194793701,
-0.001337338238954544,
0.09258119761943817,
-0.17734748125076294,
-0.3094974756240845,
-0.15643835067749023,
-0.691519558429718,
-0.012994708493351936,
0.42591723799705505,
-0.45599037408828735,
0.38051766157... | |
as follows:
```
INSERT
INTO entity_entity (entity_id_a, entity_id_b)
VALUES (LEAST(@id1, @id2), GREATEST(@id1, @id2))
```
Then select:
```
SELECT entity_id_b
FROM entity_entity
WHERE entity_id_a = @id
UNION ALL
SELECT entity_id_a
FROM entity_entity
WHERE entity_id_b = @id
```
`UNION ALL` here lets you use above i... | [
-0.13682608306407928,
0.20711444318294525,
0.13423755764961243,
0.12042713910341263,
0.08838444203138351,
-0.07165772467851639,
-0.30699241161346436,
-0.4649548828601837,
0.04300495609641075,
-0.663082480430603,
-0.14160260558128357,
0.42464497685432434,
-0.38008856773376465,
0.31927624344... | |
Is there a way to limit the amount of memory Phusion Passenger uses when serving up your app?
My host comes by and kills the process after I get a bunch of traffic and so I end up serving up blank pages. Is there anything I can do to say "hey don't use any more than 100Mb and only spawn 3 processes no matter how over... | [
0.1467195451259613,
0.021421657875180244,
0.4730278253555298,
0.1705380082130432,
0.04196908697485924,
0.19134709239006042,
0.33329999446868896,
-0.1479521542787552,
-0.5043943524360657,
-0.6474422812461853,
0.2360941767692566,
0.6437545418739319,
-0.41931629180908203,
-0.01700064912438392... | |
how is the memory usage (that depends on the apps you are running).
Also, using [Ruby Enterprise Edition](http://www.rubyenterpriseedition.com/) may help. | [
0.25339680910110474,
0.05145080387592316,
-0.07002732157707214,
0.25021570920944214,
0.34741759300231934,
0.07896813005208969,
0.4658186435699463,
0.08029407262802124,
-0.48971033096313477,
-0.6294124722480774,
-0.1268032193183899,
0.45458292961120605,
-0.0358830988407135,
-0.2340818196535... | |
I know this question might sound a little cheesy but this is the first time I am implementing a "tagging" feature to one of my project sites and I want to make sure I do everything right.
Right now, I am using the very same tagging system as in SO.. space seperated, dash(-) combined multiple words. so when I am valida... | [
0.39293548464775085,
0.14040623605251312,
0.22987867891788483,
0.2503175437450409,
-0.21039344370365143,
-0.1760711371898651,
0.4786666929721832,
-0.17288152873516083,
0.003928524907678366,
-0.6599777340888977,
0.0009360978729091585,
0.2587285041809082,
-0.11276837438344955,
-0.09394293278... | |
split the string
5. for each splitted, insert into db
I am missing something here? or is this roughly ok?
I've never implemented a tagging system, but am likely to do so soon for a project I'm working on. I'm primarily a database guy and it occurs to me that for performance reasons it may be best to relate your tagged... | [
0.5297856330871582,
-0.26737576723098755,
0.21901299059391022,
0.23123720288276672,
-0.3728942573070526,
-0.020326150581240654,
0.0002556491526775062,
-0.31772512197494507,
-0.15698429942131042,
-0.7706083655357361,
-0.18436898291110992,
0.5942424535751343,
-0.31250107288360596,
0.16589130... | |
(indexed)
... you'd only add new Tag table entries when never-before-used tags were used. You'd re-associate previously provided tags via the TechQuestionTag table entry. And your query to pull TechQuestions related to a given tag would look like:
```
SELECT
q.TechQuestionID,
q.SubjectLine,
q.QuestionBody
FROM
Tag t ... | [
0.2988702952861786,
-0.17061886191368103,
0.6082292199134827,
0.08729338645935059,
0.017215708270668983,
-0.14874514937400818,
-0.24454697966575623,
-0.3221459686756134,
-0.18744416534900665,
-0.9285441637039185,
-0.3409268260002136,
0.6940808892250061,
-0.2540200352668762,
0.4072309732437... | |
Most solutions I've read here for supporting subdomain-per-user at the DNS level are to point everything to one IP using \*.domain.com.
It is an easy and simple solution, but what if I want to point first 1000 registered users to serverA, and next 1000 registered users to serverB? This is the preferred solution for us... | [
-0.2015191614627838,
-0.1443529576063156,
0.5865396857261658,
0.13083337247371674,
0.05766309052705765,
-0.3006138801574707,
0.270943820476532,
-0.29412180185317993,
-0.4703547954559326,
-0.8629037141799927,
-0.05433032289147377,
-0.23540006577968597,
-0.3069380223751068,
0.364297688007354... | |
to memory available.
However, my team is worried about the latency of getting the new subdoamin up and ready, since creating a new subdomain consist of inserting a new A-record & restarting DNS server.
Is performance of restarting DNS server something we should worry about?
Thank you in advance.
**UPDATE:**
See... | [
-0.15187256038188934,
0.030620822682976723,
0.4160183072090149,
-0.002871043747290969,
0.039840035140514374,
0.004454183392226696,
0.3863101303577423,
-0.13631534576416016,
-0.33469510078430176,
-0.47140347957611084,
-0.2881859838962555,
0.45145732164382935,
0.06216826289892197,
0.15126311... | |
the way to go with this. It's how big sites like LiveJournal work.
Note that this is not just a TCP layer load-balancer - there are plenty of solutions that'll examine the host part of the URL to figure out which back-end server to forward the query too. You can easily do it with Apache running on a low-spec server wi... | [
0.15825317800045013,
-0.015469939447939396,
0.21069535613059998,
0.25786465406417847,
-0.3819074332714081,
-0.27106600999832153,
0.4506586790084839,
0.11783237010240555,
-0.17917588353157043,
-0.45413675904273987,
0.15541228652000427,
0.3189431428909302,
-0.14159025251865387,
0.11372894793... | |
easy to run two or more front-end proxies in a redundant configuration (to avoid failure) or even to have them share the load (to avoid stress).
I'd also second John Sheehan's suggestion that the application just look at the left-hand part of the URL to determine which user's content to display.
If using Apache for t... | [
0.25297120213508606,
-0.1951453983783722,
-0.04221015423536301,
0.12417181581258774,
-0.028447968885302544,
-0.45211562514305115,
0.30874645709991455,
-0.05939045920968056,
-0.35659259557724,
-0.4829450845718384,
-0.3002210259437561,
0.6111804842948914,
-0.23265527188777924,
-0.39551579952... | |
I have a web app that only registered users can use, therefore I should have a valid e-mail address for the creator of the message.
One part of this web app will allow a user to create and send a e-mail message to an e-mail address that the user enters. My web server will be creating and sending the e-mail, however if... | [
0.8642542362213135,
0.3534000515937805,
0.46049055457115173,
0.005951844155788422,
-0.1452786773443222,
-0.06629595160484314,
0.2492028772830963,
0.2156009078025818,
-0.32826656103134155,
-0.4899492859840393,
0.16066290438175201,
0.06453024595975876,
-0.22175204753875732,
0.173250079154968... | |
and they can take the appropriate action.
Would setting the "return-path" attribute to the user's e-mail address handle this?
As [RFC2821](http://www.ietf.org/rfc/rfc2821.txt) says:
> The primary purpose of the Return-path is to designate the address to which messages indicating non-delivery or other mail system fail... | [
-0.018769487738609314,
0.026198914274573326,
0.324110746383667,
-0.007253830321133137,
0.045010045170784,
-0.14078010618686676,
0.327792227268219,
0.041780903935432434,
-0.20229867100715637,
-0.386125773191452,
-0.3642611503601074,
0.6465561985969543,
-0.34228765964508057,
-0.1058289259672... | |
I'm working on a resource management class and want to have the user provide a functor to a "ReleaseResource" method as part of the resource manager's constructor. From there when a resource is requested that functor will be provided as the deleter for the shared\_ptr that I will be returning so that the appropriate me... | [
0.3192417323589325,
0.055890344083309174,
-0.09469075500965118,
0.03728577122092247,
0.09359019249677658,
-0.24935105443000793,
-0.09973672032356262,
0.08859005570411682,
-0.049561746418476105,
-0.5262066125869751,
-0.10701640695333481,
0.685161292552948,
-0.4375781714916229,
0.24358959496... | |
MyFunctor> MyMethod(MyFunctor f) {
f();
}
```
Which is great if you intend to use the functor in the scope of that function, but since the template goes out of scope with the function I'm not sure how you would specify a variable of the appropriate type to store the functor for later use.
Can anyone point me in ... | [
-0.17118720710277557,
0.010879416018724442,
0.4790419638156891,
-0.19221103191375732,
-0.031051427125930786,
0.07640372961759567,
-0.1510218381881714,
-0.11516164243221283,
0.0657898560166359,
-0.36419016122817993,
-0.32652220129966736,
0.774716317653656,
-0.4661809206008911,
-0.0426350720... | |
a bool and a char. That said, if you want to construct the shared\_ptr right away, you don't need to store the functor somewhere (`boost::function` requires the `new` operator for that, even though for very small functors, it will use special tricks to only use stack allocation (small buffer optimization)):
```
templa... | [
-0.00024369994935113937,
-0.04147675633430481,
0.333530068397522,
-0.08672091364860535,
0.010192081332206726,
-0.1566726714372635,
-0.05910441279411316,
-0.35130560398101807,
-0.1327873170375824,
-0.403036504983902,
-0.30343863368034363,
0.5799627304077148,
-0.3923671841621399,
0.079072654... | |
}
boost::shared_ptr<Resource> allocate() {
...
return boost::shared_ptr<Resource>(resource, deleter);
}
private:
boost::function<void(Resource *)> deleter;
};
``` | [
-0.2469966858625412,
-0.2360207885503769,
0.2795793116092682,
-0.23870308697223663,
0.16678492724895477,
0.3953496813774109,
-0.017919618636369705,
-0.2349780797958374,
-0.16207602620124817,
-0.18711142241954803,
-0.35504603385925293,
0.9079194664955139,
-0.19295541942119598,
-0.1071241274... | |
I've come across the phrase 'sustaining software engineering' but don't know exactly what it means. There seems to be some DoD connection? Is it related to Agile Development?
I believe "sustaining" is another word for "maintenance": it's what happens after software is released, i.e. support, bug fixing, enhancements ..... | [
0.83182293176651,
0.06708548218011856,
-0.19069921970367432,
0.0442659966647625,
0.038654666393995285,
-0.13754905760288239,
0.26121464371681213,
0.1566201001405716,
-0.23135752975940704,
-0.06369969248771667,
-0.18959231674671173,
0.7554665207862854,
0.09985239803791046,
0.220399230718612... | |
I have a hierarchy of objects (objects A, B), each of which implements `INotifyPropertyChanged` such that...
A has a member of type B,
B has a member of C, C is of type bool
When C changes, its `PropertyChanged` event gets fired, however this does not fire B's property changed event. And therefore A does not react to... | [
-0.0050909812562167645,
0.36027228832244873,
0.20136216282844543,
-0.062470629811286926,
-0.1796187460422516,
0.14033301174640656,
0.41687607765197754,
-0.25742682814598083,
-0.29219889640808105,
-0.3943350315093994,
0.2455592006444931,
0.5132548213005066,
-0.28452277183532715,
0.416447520... | |
alert me that i didn't have permissions it simply told me that my changes were saved and proceeded to ignore them.
thanks to all those who answered though! | [
0.38041239976882935,
0.1549532562494278,
0.5296115875244141,
0.1338415890932083,
0.03921731188893318,
0.14818666875362396,
0.48373132944107056,
-0.10195561498403549,
-0.10286328941583633,
-0.19845344126224518,
0.04599076882004738,
0.34152305126190186,
0.022781461477279663,
0.02317116223275... | |
I'm looking for something similar to the [Proxy pattern](http://en.wikipedia.org/wiki/Proxy_pattern) or the [Dynamic Proxy Classes](http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html), only that I don't want to intercept method calls before they are invoked on the real object, but rather I'd like to intercep... | [
0.21750709414482117,
-0.17555348575115204,
0.3205256760120392,
-0.03721191734075546,
-0.17058174312114716,
-0.018424786627292633,
0.04167565330862999,
-0.04753101244568825,
-0.3216096758842468,
-0.6956021785736084,
0.32945990562438965,
0.40257981419563293,
-0.2636677324771881,
0.1202415302... | |
in the program, so the class can take care of creating regular persistent snapshots on disk for the purpose of checkpointing the application. This persistor object manages a "dirty" flag that signifies whether the list of values has changed since the last checkpoint and needs to lock the list while it's busy writing it... | [
-0.15373212099075317,
-0.21846139430999756,
0.3219166398048401,
0.21929201483726501,
0.3274931013584137,
-0.26522836089134216,
0.42327892780303955,
0.09487582743167877,
-0.45950236916542053,
-0.3238407075405121,
-0.3841457962989807,
0.351900190114975,
-0.10463717579841614,
0.44560787081718... | |
order to work with the objects they handed over to the persistor, I want them to receive a reference to a proxy object that looks as if it were the original one, but whenever they change some value on it, the persistor notices and acts accordingly, for example by marking the item or the list as dirty before actually se... | [
0.5353071093559265,
-0.08248338103294373,
0.17842155694961548,
0.16365832090377808,
-0.11587833613157272,
-0.3073098063468933,
0.4160153269767761,
0.018175603821873665,
-0.2648443877696991,
-0.4613904654979706,
-0.02903510443866253,
0.44294553995132446,
-0.2840004563331604,
0.2396608293056... | |
runtime?
If with "properties" you mean JavaBean properties, i.e. represented bay a getter and/or a setter method, then you can use a dynamic proxy to intercept the set method.
If you mean instance variables, then no can do - not on the Java level. Perhaps something could be done by [manipulations on the byte code leve... | [
0.2170702964067459,
-0.49941492080688477,
0.5460997223854065,
0.1802101880311966,
-0.14668531715869904,
-0.2943974733352661,
0.16436198353767395,
0.004946878645569086,
-0.2261427640914917,
-0.6641572117805481,
-0.08063556253910065,
0.6663640737533569,
-0.4946489632129669,
-0.33652365207672... | |
We have a MFC 8 application compiled with /CLR that contains a larger amount of Windows Forms UserControls which again contain WPF user controls using ElementHost. Due to the architecture of our software we can not use HwndHost directly. We observed an extremely strange behavior here that we can not make any sense of:
... | [
-0.03456663712859154,
0.08082026988267899,
0.4322458505630493,
0.2135220617055893,
0.11885663866996765,
-0.30917274951934814,
0.20893064141273499,
-0.25588560104370117,
-0.2888764441013336,
-0.5915797352790833,
-0.24628068506717682,
0.3004979193210602,
-0.41343000531196594,
0.1596730351448... | |
stay at some random value after startup. When I set a property that is not bound to anything the value is correctly stored in the dependency property (calling the getter returns the new value) but the visual representation never reflects that. I set the background to red but the background color does not change.
We te... | [
0.4526771605014801,
-0.2388211339712143,
0.5441851019859314,
0.12863706052303314,
0.1370030641555786,
0.008834751322865486,
0.13382571935653687,
0.013320651836693287,
-0.4698691964149475,
-0.22631928324699402,
-0.15270423889160156,
0.702018678188324,
-0.25681817531585693,
-0.01576367765665... | |
based on the property values. It is when I resize the ElementHost or when I hide and reshow the parent native control. As soon as I do this, properties that are bound to an animation pickup a new value and the visuals rerender based on the new property values - but just once - if I want to see another update I have to ... | [
0.48108071088790894,
-0.0024350080639123917,
0.4110882878303528,
0.32163113355636597,
-0.08268937468528748,
-0.07277743518352509,
0.20520104467868805,
-0.07520139962434769,
-0.1549554169178009,
-0.5288721919059753,
-0.007928580977022648,
0.4832618236541748,
-0.21778710186481476,
0.18468911... | |
can get more information about what WPF actually does or where WPF might have crashed? To me it currently seems like a bug in WPF itself since it only happens at high CPU load at startup.
There is no detail on how you load your data on startup... If you haven't done it yet, consider using `Dispatcher.BeginInvoke` (with... | [
0.29945242404937744,
-0.1949343979358673,
0.21811768412590027,
0.09586591273546219,
-0.12351005524396896,
-0.4773295819759369,
0.4092147648334503,
0.01092790812253952,
-0.6239654421806335,
-0.8094344139099121,
-0.13842888176441193,
0.4487132728099823,
-0.3018723726272583,
-0.08963140845298... | |
1) How important is it for the site to be accessible without javascript? I'm using a lot of ajax. I converted most of the site to be accessible without js, but the effort involved left me wondering if it was worth it.
2) What are the sort of scenarios (that occur fairly often) in which javascript might be turned off? ... | [
0.3681565523147583,
0.2398933619260788,
-0.06307526677846909,
0.04439816623926163,
-0.13042838871479034,
-0.1522304117679596,
0.3475694954395294,
0.41886523365974426,
-0.013942372053861618,
-0.7384270429611206,
-0.21956050395965576,
0.4358383119106293,
-0.09064284712076187,
-0.194789677858... | |
or mobiles etc.)
I see that even large sites like digg, reddit simply stop working when I turn off js, without any attempt to provide html only access. Even in SO, it isn't possible to vote or view comments without javascript (though there are some nice error messages shown)
Edit: SEO is not a major concern, since it... | [
0.5186989903450012,
0.3076651692390442,
0.22160905599594116,
0.03408601135015488,
-0.39161425828933716,
-0.4533550441265106,
0.4336582124233246,
0.4014788269996643,
-0.4715519845485687,
-0.453215628862381,
-0.2693513035774231,
0.466784805059433,
-0.5017740726470947,
-0.2607881426811218,
... | |
come to index the content. You need to be able to handle that if you want to be listed properly on search engines.
EDIT for your edit: Fair enough. It really depends on your site's features. If it's a primarily informational site, then requiring JS is absurd. If it's more of a web application, then not requiring makes... | [
0.32482486963272095,
-0.066155344247818,
0.29534822702407837,
0.39499059319496155,
-0.1269799917936325,
-0.3203161358833313,
-0.017816703766584396,
0.08532485365867615,
-0.07308929413557053,
-0.6549908518791199,
-0.2750571072101593,
0.5331959128379822,
-0.089500293135643,
-0.31802123785018... | |
I'm working on a project and I'm just starting to do all the work necessary to globalize the application. One thing that comes up quite often is whether to globalize the exception messages, but ensuring that string.Format uses CultureInfo.CurrentCulture instead of CultureInfo.InvariantCulture. Additionally this would m... | [
0.23329231142997742,
-0.18426434695720673,
0.2834579348564148,
0.3244951069355011,
-0.14994403719902039,
-0.2246282994747162,
0.1638164520263672,
0.4187694191932678,
-0.5394382476806641,
-0.5708923935890198,
-0.03580057621002197,
-0.28917962312698364,
-0.3091787099838257,
0.463711351156234... | |
the consumer for each string. Obviously pieces of text in the user interface need internationalizing, but if an exception message is *only* going to be seen by support (or is going to be visible to the user and then emailed to support when they click a button) then where's the benefit of translating it?
If you go too ... | [
0.41309767961502075,
-0.020193327218294144,
0.45950737595558167,
0.2684313952922821,
-0.03618006408214569,
0.09412083029747009,
0.37749481201171875,
0.08583858609199524,
-0.15334096550941467,
-0.33016595244407654,
-0.14411118626594543,
0.7172603607177734,
-0.18088899552822113,
-0.063019417... | |
translate them back to your native tongue.
It makes sense for Microsoft to internationalize *their* exception messages, because they will be read by *developers* from all over the world - but unless you're multinational with developers in multiple countries who don't share a common language, I wouldn't translate messa... | [
0.29447558522224426,
0.20837296545505524,
0.026374278590083122,
0.29615655541419983,
-0.1258130967617035,
-0.24394261837005615,
0.6947221755981445,
0.4429091811180115,
-0.08413204550743103,
-0.5934721231460571,
-0.47809550166130066,
0.19914941489696503,
-0.2808777689933777,
-0.288498491048... | |
I have an array in the form of '`int[][]`' that represents the co-ordinates of a small grid. Each co-ordinate has been assigned its own value. eg `array[0][4] = 28`......
I have two questions. Firstly, how do I iterate through all the stored values. Secondly, I want to be able to input a value and have its specific co... | [
0.06622640788555145,
0.1909264773130417,
0.1120634377002716,
-0.08941575139760971,
-0.10046617686748505,
0.299897700548172,
0.18790778517723083,
-0.30914339423179626,
-0.18144403398036957,
-0.7682591080665588,
0.07426820695400238,
0.2126004993915558,
-0.30832159519195557,
0.000832882476970... | |
{
int value = grid[row][col];
// Do stuff
}
}
```
or
```
// Note the different use of "row" as a variable name! This
// is the *whole* row, not the row *number*.
for (int[] row : grid)
{
for (int value : row)
{
// Do stuff
}
}
```
The first version would be the easiest solu... | [
-0.032532598823308945,
-0.22654324769973755,
0.18227232992649078,
-0.11468295007944107,
0.013453216291964054,
-0.41587552428245544,
-0.09683234989643097,
-0.24004462361335754,
-0.09857477992773056,
-0.51239413022995,
-0.10136990994215012,
0.49639084935188293,
-0.6378858089447021,
-0.152506... | |
inner loop is correct. | [
-0.11643898487091064,
-0.2566104531288147,
0.47676676511764526,
-0.004111305810511112,
0.15935835242271423,
-0.2032119482755661,
0.40360409021377563,
-0.3217885196208954,
-0.2068621963262558,
-0.4514891803264618,
-0.22673386335372925,
0.33984339237213135,
-0.30281496047973633,
0.0398432686... | |
I've used GetDate() in defaults for a long time.
What is the equivalent call, or logic in SQL 2005 for me to put in a default that will give me the current UTC time.
```
GETUTCDATE()
``` | [
0.35306522250175476,
-0.1006176695227623,
0.323464572429657,
-0.07723890990018845,
0.18799318373203278,
-0.24807383120059967,
0.1758594810962677,
0.12365366518497467,
0.027552861720323563,
-0.43456602096557617,
0.11379165202379227,
0.5674718618392944,
-0.20680153369903564,
-0.0545484013855... | |
I am trying to return the physical file path of a database's mdf/ldf files.
I have tried using the following code:
```
Server srv = new Server(connection);
Database database = new Database(srv, dbName);
string filePath = database.PrimaryFilePath;
```
However this throws an exception "'database.PrimaryFilePath' thr... | [
0.16050826013088226,
0.36626550555229187,
0.3280697464942932,
-0.2858065366744995,
-0.0701383501291275,
-0.07293174415826797,
0.47741928696632385,
-0.12525993585586548,
0.011469307355582714,
-0.831525981426239,
-0.015743108466267586,
0.397822767496109,
-0.2574036717414856,
0.35163885354995... | |
property. If no other default location has been specified the property will return an empty string.
So, this property brings back nothing (empty string) if you didn't set the default location.
A workaround is to check the DefaultFile property, if it returns an empty string use SMO to get the master database then use... | [
0.11119005084037781,
-0.4654613733291626,
0.5479902625083923,
0.0952896848320961,
0.18252459168434143,
-0.23434530198574066,
0.47257599234580994,
-0.09303183108568192,
-0.36362290382385254,
-0.8795589804649353,
0.016397487372159958,
0.5009368658065796,
-0.31287166476249695,
0.4065127372741... | |
Following on from this question:
[Run WCF ServiceHost with multiple contracts](https://stackoverflow.com/questions/334472/run-wcf-servicehost-with-multiple-contracts)
Are there any performance penalties from running multiple service hosts as suggested in one of the answers?
I am looking at implementing a solution wi... | [
0.6135532259941101,
-0.003573223715648055,
0.26263228058815,
0.027272673323750496,
0.007570377551019192,
0.07222955673933029,
0.27066653966903687,
-0.2118714153766632,
-0.5329897403717041,
-0.7236292958259583,
0.15575195848941803,
0.5059894323348999,
-0.22225336730480194,
0.111889339983463... | |
In almost all cases once the services spin up you are not going to see much performance difference between running them as one service or running them as independent services. | [
0.5627213716506958,
-0.36100339889526367,
0.19438903033733368,
0.08859476447105408,
0.12630826234817505,
0.1467909812927246,
0.26796311140060425,
0.10827244073152542,
-0.33593085408210754,
-0.3658756911754608,
-0.2784709930419922,
0.293785959482193,
0.16067731380462646,
0.26616719365119934... | |
Does anyone know of any libraries for .net that allow you to use graphics tablets?
specifically i am after the pressure sensitivity of the pen, but the 'eraser' and buttons on the pen would be useful too.
thanks
Have a look at the source for [Paint.NET](http://getpaint.net)
**EDIT**: There should also be a DLL there... | [
0.7364204525947571,
-0.15663006901741028,
0.08290166407823563,
0.24008534848690033,
0.02424631640315056,
0.08602874726057053,
-0.07532692700624466,
0.3977770507335663,
-0.02834428660571575,
-0.8948708772659302,
0.38656318187713623,
0.6744428277015686,
0.1035648062825203,
-0.150958240032196... | |
I'm monkey patching a package using a technique given at the beginning of ["How can I monkey-patch an instance method in Perl?"](https://stackoverflow.com/questions/449690/how-can-i-monkey-patch-an-instance-method-in-perl#449783). The problem that I'm running into is that the original subroutine used a package-level `m... | [
0.07094814628362656,
0.41201433539390564,
-0.06211355701088905,
-0.21701011061668396,
-0.23513947427272797,
0.02322470024228096,
0.581364631652832,
0.0833449587225914,
-0.3523792028427124,
-0.5677279233932495,
0.11111085116863251,
0.30482491850852966,
-0.5131332278251648,
0.036877471953630... | |
Windows Mobile 5 was based on CE 5.0.
Windows Mobile 6 was based on CE 5.2.
Does anyone know what version of CE is used by Windows Mobile 6.5?
This [source](http://forum.xda-developers.com/showthread.php?p=3204746) indicate that WM6.5 is also based on CE 5.2 (specifically 5.2.21139). | [
0.2493298351764679,
0.20217828452587128,
0.6954615712165833,
-0.17543156445026398,
-0.07633966207504272,
0.20592457056045532,
0.1490173488855362,
-0.10694966465234756,
-0.13453863561153412,
-0.49766212701797485,
-0.19777610898017883,
0.36292558908462524,
-0.20176836848258972,
0.24898162484... | |
In my application I have various styles and templates that are used in several classes. I've defined these in my so they are visible from all child objects.
However during design-time the WPF designer can't see these resources, complains they were 'not found' and demands the errors must be fixed before reloading the d... | [
0.5269724726676941,
0.22147136926651,
0.31355515122413635,
-0.09829532355070114,
0.045428190380334854,
0.06856826692819595,
0.3578363358974457,
-0.1408682018518448,
-0.18615958094596863,
-0.8120009899139404,
-0.10548242181539536,
0.14915992319583893,
-0.1670713871717453,
0.1105243489146232... | |
I am looking to convert pixes to inches and vice versa. I understand that I need DPI, but I am not sure how to get this information (e.g. I don't have the `Graphics` object, so that's not an option).
Is there a way?
On a video device, any answer to this question is typically not very accurate. The easiest example to u... | [
0.4418199062347412,
-0.3467017710208893,
0.8001310229301453,
0.31709471344947815,
-0.21961680054664612,
0.15223602950572968,
-0.2240317016839981,
-0.07612793147563934,
-0.40219834446907043,
-0.7422420978546143,
0.1220378428697586,
0.2398628443479538,
0.21849898993968964,
-0.078709423542022... | |
video device.
Presuming you still need an answer, regardless of the accuracy, and you don't have a Graphics object, you can create one from the screen with some P/Invoke and get the answer from it.
```
Single xDpi, yDpi;
IntPtr dc = GetDC(IntPtr.Zero);
using(Graphics g = Graphics.FromHdc(dc))
{
xDpi = g.DpiX;
... | [
0.27803146839141846,
-0.2761616110801697,
1.1636003255844116,
0.34678828716278076,
-0.09442434459924698,
0.02744259499013424,
-0.022336136549711227,
-0.34793347120285034,
-0.17949585616588593,
-0.46563640236854553,
-0.3799333870410919,
0.7932895421981812,
-0.44951334595680237,
0.4324786067... | |
I am involved in a venture that will port some communications, parsing, data handling functionality from Win32 to Linux and both will be supported. The problem domain is very sensitive to throughput and performance.
I have very little experience with performance characteristics of boost and ACE. Specifically we want ... | [
0.3501547574996948,
0.037951719015836716,
0.003011499298736453,
0.27580440044403076,
-0.07037065923213959,
-0.18802057206630707,
-0.021403789520263672,
0.2217353880405426,
-0.17539557814598083,
-0.7592210173606873,
0.04457297921180725,
0.5928083658218384,
-0.13363824784755707,
-0.048236716... | |
any overhead compared to using native OS threading facilities. You should be looking at which API is cleaner. In my opinion the boost thread API is significantly easier to use.
ACE tends to be more "classic OO", while boost tends to draw from the design of the C++ standard library. For example, launching a thread in A... | [
0.08671741187572479,
-0.05938255041837692,
0.289156973361969,
0.08994484692811966,
-0.02338304929435253,
-0.18745321035385132,
0.062047649174928665,
-0.0021344460546970367,
-0.25790032744407654,
-0.5771368741989136,
-0.40344807505607605,
0.5817674994468689,
-0.28270086646080017,
0.16660343... | |
I'm developing an ASP.NET 2.0 app using Visual Studio 2008.
If I want to run a really quick test on a method that's way in my back-end, is there a way for me to just call a main function in that class via command line?
Thanks
The answer is no, You cannot do that. You can only have one main function per assembly.
T... | [
0.45085886120796204,
-0.02304922230541706,
-0.22354626655578613,
0.005442005582153797,
-0.4390423893928528,
0.009561914950609207,
0.3339163362979889,
0.009799025021493435,
-0.25473952293395996,
-0.5099833607673645,
0.1253807693719864,
0.5637446641921997,
-0.2318563312292099,
-0.16171891987... | |
website or anything like that. That's the best way to test a method. Here are some links:
[NUnit](http://www.nunit.org/index.php)
[MSUnit](http://msdn.microsoft.com/en-us/library/ms243147.aspx) | [
0.25058019161224365,
-0.3158697485923767,
0.10893116891384125,
0.34154391288757324,
-0.14075374603271484,
-0.21911261975765228,
0.4257124364376068,
0.15992845594882965,
-0.6236066222190857,
-0.5765648484230042,
-0.2410334050655365,
0.13411103188991547,
0.08004837483167648,
0.05277687683701... | |
In Java, an array IS AN Object. My question is... is an Object constructor called when new arrays is being created? We would like to use this fact to instrument Object constructor with some extra bytecode which checks length of array being constructed. Would that work?
As far as the Java Language Specification is conce... | [
0.28727060556411743,
0.014812465757131577,
0.0018597499001771212,
-0.11972624063491821,
-0.29033365845680237,
-0.08836056292057037,
0.16784542798995972,
-0.5595926642417908,
-0.3447871804237366,
-0.31196197867393494,
-0.14606502652168274,
0.4344029128551483,
-0.47865068912506104,
-0.025158... | |
I'm looking for a good way to do a vertical wrap. My goal is to fit a list of checkboxes into a div. I have the checkboxes sorted alphabetically, and I want the list to flow from the top of the div to the bottom and then begin again in a new column when they reach the bottom. Right now, I can do this by breaking the li... | [
0.6033068299293518,
-0.12620174884796143,
0.4742501676082611,
-0.060953833162784576,
-0.0490141287446022,
0.08345288783311844,
-0.01615019328892231,
-0.019779637455940247,
-0.4455840289592743,
-0.7475581169128418,
0.054594866931438446,
0.15438063442707062,
-0.2522103190422058,
0.0949546173... | |
hoping to force it to scroll horizontally only. This is not so easy, since I'm holding each chunk in a floating div, so white-space:nowrap doesn't seem to cut it. Currently, I'm using javascript count the number of list chunks and extend the width of an intermediary container (inside the div that serves as the viewport... | [
0.17833536863327026,
-0.11597838997840881,
0.40357154607772827,
-0.10780662298202515,
-0.0728808045387268,
0.05817222222685814,
-0.06820737570524216,
-0.13879582285881042,
-0.41822004318237305,
-0.7525407075881958,
-0.05860918015241623,
0.3052872121334076,
-0.3940892815589905,
-0.104385845... | |
|
|__________________________|
|<|_____________|___||___|>|
```
So I guess I have two questions:
1. Is there a good way to vertically wrap a list?
2. Is there a good way to force horizontal scrolling when the data gets too large for the viewport?
I ended up using a little server-side preprocessing. This site, and th... | [
0.215438574552536,
0.212582528591156,
0.3974529504776001,
-0.1438368707895279,
0.07363816350698471,
0.11761815845966339,
0.1936713606119156,
-0.11688639223575592,
-0.7154520750045776,
-0.6186025738716125,
0.018158894032239914,
0.6070929169654846,
-0.2507377564907074,
-0.21153080463409424,
... | |
I am going to switching SSL onto a Rails site of mine pretty soon and was wondering if anyone has thoughts or suggestions as to who is the best provider?
Does anyone have any happy stories or horror regarding certain vendors??
Thanks
Kent
I've always used GoDaddy and never had an issue. Their support staff is great ... | [
0.5469205975532532,
-0.021389776840806007,
0.046098582446575165,
0.24249516427516937,
-0.2323576956987381,
0.16236157715320587,
0.4545128643512726,
0.8795285224914551,
0.03513987362384796,
-0.9227632880210876,
0.36321935057640076,
0.45402991771698,
0.4482845962047577,
0.2591363787651062,
... | |
ADDED: This question is now, I believe, subsumed by this one:
[Using GNU Screen completely transparently and automatically](https://stackoverflow.com/questions/1075947/can-i-use-gnu-screen)
See also this related question:
<https://superuser.com/questions/147873/ssh-sessions-in-xterms-freeze-for-many-minutes-whenev... | [
0.1597910374403,
-0.05987253412604332,
0.5806835889816284,
0.0955788716673851,
-0.13777907192707062,
-0.2332771271467209,
0.23924678564071655,
-0.2536222040653229,
-0.4957190155982971,
-0.8374308347702026,
-0.2151850014925003,
0.5376322269439697,
-0.17467449605464935,
0.014262002892792225,... | |
on server.com which is no good if you have a flaky connection and get disconnected a lot. You want to be able to resume with a simple "up-arrow enter" on the laptop. (Or perhaps make it even more automatic.)
I have a rihackulous solution to this problem which I'll post as an answer and hope it gets downvoted to oblivi... | [
0.4253201186656952,
0.19545450806617737,
0.42561811208724976,
-0.1665286123752594,
-0.21148721873760223,
-0.3384389579296112,
0.4055215120315552,
0.5444998145103455,
-0.36319002509117126,
-0.9267762303352356,
-0.07815166562795639,
0.598563015460968,
-0.25264957547187805,
0.0976646989583969... | |
foo`".
---
Mini screen tutorial, incorporating the answer to this question:
----------------------------------------------------------------
Login in to server.com and do
```
screen -S foo
```
and then never log out of that session again.
To reconnect to it from elsewhere, do
```
ssh -t server.com screen -dr f... | [
0.0932350903749466,
0.34907665848731995,
0.5859517455101013,
0.003225478110834956,
0.0971376970410347,
-0.1571265608072281,
0.42205190658569336,
0.14177292585372925,
-0.2789997458457947,
-0.40215784311294556,
-0.16838732361793518,
0.8183911442756653,
-0.1915372908115387,
-0.097697325050830... | |
-t Force pseudo-tty allocation. This can be used to execute arbi-
trary screen-based programs on a remote machine, which can be
very useful, e.g. when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.
```
So:
```
laptop> ... | [
0.13242550194263458,
-0.1425325572490692,
0.3136596977710724,
0.03584568575024605,
-0.2217230498790741,
0.2521992623806,
0.06567352265119553,
-0.09872572124004364,
-0.2699911594390869,
-0.6080551743507385,
-0.27376866340637207,
0.8171522617340088,
-0.38437843322753906,
-0.17443370819091797... | |
Using LINQ to SQL
```
db.Products.Where(c => c.ID == 1).Skip(1).Take(1).ToList();
```
executes
```
SELECT [t1].[ID], [t1].[CategoryID], [t1].[Name], [t1].[Price], [t1].[Descripti
n], [t1].[IsFeatured], [t1].[IsActive]
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY [t0].[ID], [t0].[CategoryID], [t0].[Name
, [t0].[Pri... | [
0.21455980837345123,
0.07485070824623108,
0.46587809920310974,
0.01483912207186222,
-0.0349789634346962,
0.3054612874984741,
-0.3025479018688202,
-0.5962463021278381,
0.027984315529465675,
-0.1918320208787918,
-0.3512924313545227,
0.5515691637992859,
-0.24964918196201324,
0.057621728628873... | |
(Size = 0; Prec = 0; Scale = 0) [1]
```
It's using ROW\_NUMBER for pagination... good.
Now, I'm trying to use relationships generated by LINQ to SQL to paginate data. Using the query...
```
var cat = db.Categories.Where(c => c.ID == 1).SingleOrDefault();
cat.Products.Where(c => c.ID == 1).Skip(1).Take(1).ToList();
... | [
-0.007946537807583809,
-0.06641150265932083,
0.6127187013626099,
-0.16803452372550964,
-0.3328090310096741,
0.33835214376449585,
0.03064536117017269,
-0.6407719254493713,
-0.47129008173942566,
-0.11451701819896698,
-0.0565757155418396,
0.4705754220485687,
-0.3767080307006836,
0.24764144420... | |
3.5.30729.1
```
Now the use of ROW\_NUMBER and pagination is gone... it's getting all Products where CategoryID = 1... why is it getting ALL rows?
I think its because the category is in memory. You are asking it, implicitly, to get the products of the category. This implicit request for data is for filled, and then i... | [
-0.30810731649398804,
-0.12335125356912613,
0.4927837550640106,
-0.26009851694107056,
-0.17193524539470673,
0.06535858660936356,
0.2168322205543518,
-0.5056207776069641,
-0.49536123871803284,
-0.49406468868255615,
-0.4152466356754303,
0.38995984196662903,
-0.6454054117202759,
0.25818592309... | |
of the collection could vary.
NOTE: Thanks for the headache :) | [
0.48066699504852295,
0.09690981358289719,
-0.06392485648393631,
0.14583927392959595,
0.08137495070695877,
-0.07499121874570847,
0.06450106203556061,
0.2215106040239334,
-0.41171467304229736,
-0.11150159686803818,
0.12646381556987762,
0.430737167596817,
0.18984553217887878,
0.12532663345336... | |
What would be the best way to detect what programming language is used in a snippet of code?
I think that the method used in spam filters would work very well. You split the snippet into words. Then you compare the occurences of these words with known snippets, and compute the probability that this snippet is written i... | [
0.5437564253807068,
-0.19995185732841492,
0.08538471162319183,
0.37702327966690063,
-0.09971657395362854,
0.05701478570699692,
0.377117782831192,
-0.14113368093967438,
-0.18870247900485992,
-0.49709099531173706,
0.17814981937408447,
0.47543030977249146,
-0.27943849563598633,
-0.14382997155... | |
it learns that "System" is likely to appear in C# snippets and "puts" in Ruby snippets.
I've actually used this method to add language detection to code snippets for forum software. It worked 100% of the time, except in ambiguous cases:
```
print "Hello"
```
Let me find the code.
I couldn't find the code so I made... | [
0.3191870152950287,
0.17790359258651733,
0.2556766867637634,
0.04366983473300934,
-0.04110898822546005,
-0.1089404821395874,
0.5485862493515015,
0.16007930040359497,
-0.22891740500926971,
-0.6173989176750183,
-0.0587209053337574,
0.3758028745651245,
-0.40709665417671204,
0.0151917962357401... | |
has a `def` keyword too. So if it has seen 1000x `def` in Python and 100x `def` in Ruby then it may still say Python even though `puts` and `end` is Ruby-specific. You could fix this by keeping track of the words seen per language and dividing by that somewhere (or by feeding it equal amounts of code in each language).... | [
0.5053631663322449,
-0.040450744330883026,
0.15665362775325775,
-0.1397620141506195,
-0.3431493639945984,
-0.014849255792796612,
0.5227412581443787,
-0.3900713622570038,
-0.23764626681804657,
-0.5043650269508362,
-0.20567826926708221,
0.2734726369380951,
-0.020439309999346733,
-0.049255613... | |
+= 1
@data[lang] ||= Hash.new(1)
words(code).each {|w| @data[lang][w] += 1 }
end
def classify(code)
ws = words(code)
@data.keys.max_by do |lang|
# We really want to multiply here but I use logs
# to avoid floating point underflow
# (adding logs is equivalent to multiplication)
... | [
-0.06545397639274597,
-0.1755334734916687,
0.2524537444114685,
0.13183292746543884,
-0.016176246106624603,
-0.004916988778859377,
0.3391314148902893,
-0.7742387056350708,
-0.1339176595211029,
-0.6479927897453308,
-0.14366789162158966,
0.006123038474470377,
-0.21717822551727295,
0.144563362... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.