text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I know the possibilities of basic leak detection for Win32 using the *crtdbg.h* header, but this header is unavailable in the CE CRT library headers (i'm using the lastest SDK v6.1).
Anyone knows how I can automatically detect leaks in a WinCE/ARMV4I configuration with VC 9.0? I don't want to override new/delete for ... | [
0.2870238125324249,
0.30679747462272644,
0.202638640999794,
-0.07318518310785294,
-0.1098875179886818,
-0.2034999132156372,
0.11753036081790924,
0.04491600766777992,
-0.10505024343729019,
-0.8907734155654907,
0.24581871926784515,
0.6582772135734558,
0.025038547813892365,
0.3270364105701446... | |
simple modifications you could adapt it to use on your platform.
Basically it doesn't override new and delete, but instead uses the preprocessor to add extra reporting to it. Then once the program exits it generates an output file of memory leaks. | [
0.34832820296287537,
0.06427167356014252,
0.20347216725349426,
0.3545783758163452,
0.3195994198322296,
-0.18013028800487518,
0.09866374731063843,
-0.31005802750587463,
-0.3062320053577423,
-0.5552043318748474,
-0.08298205584287643,
0.4733758270740509,
-0.1870591938495636,
0.072690062224864... | |
I am new to the REST architecural design, however I think I have the basics of it covered.
I have a problem with returning objects from a RESTful call. If I make a request such as <http://localhost/>{type A}/{id} I will return an instance of A from the database with the specified id.
My question is what happens when ... | [
0.24790059030056,
0.11630856990814209,
0.36383143067359924,
-0.1390865594148636,
-0.337614506483078,
-0.15619641542434692,
0.3103073239326477,
0.08831971883773804,
-0.01870204322040081,
-0.7719770073890686,
-0.07141812145709991,
0.42002183198928833,
-0.1474173665046692,
0.4652417004108429,... | |
end up being a quite complicated object graph.
I can't be 100% sure but this feels to be against the RESTful principles, the XML for A should return the fields etc. for A as well as a collection of URI's to the collection of B's that it owns.
Sorry if this is a bit confusing, I can try to elaborate more. This seems ... | [
0.12110298126935959,
-0.018868260085582733,
0.4517989158630371,
0.2639184892177582,
-0.0910784974694252,
-0.09105606377124786,
0.3866659104824066,
0.1497551053762436,
0.09398091584444046,
-0.872344970703125,
-0.03589858114719391,
0.5184870958328247,
-0.20704923570156097,
0.1498073339462280... | |
I flatten the graph and link everything with simple IDs (you could even use your database IDs, although the idea is that you want you don't want to expose your PKs to the world).
Your object universe inside your app is not necessarily the same one you expose to the world. Let A have children and let B have children, ... | [
0.4948652982711792,
0.010974920354783535,
0.32089340686798096,
0.38541001081466675,
-0.08927210420370102,
0.14949336647987366,
-0.11624772846698761,
0.09235507249832153,
-0.2219243049621582,
-0.5431821942329407,
0.006106104236096144,
0.3178424835205078,
-0.13377776741981506,
0.379638761281... | |
better than all that, the request URIs don't change when the object hierarchy changes (object 37252 is always the same, even when it's been reclassed).
**Edit: Well, you asked for it...** Here's the architecture I ended up using:
package: server - contains the superclasses that are shared between the front-end server ... | [
0.15296243131160736,
-0.16343723237514496,
0.4152199625968933,
-0.025395948439836502,
-0.4291697144508362,
0.044220034033060074,
0.1985880583524704,
-0.13119839131832123,
-0.08172650635242462,
-0.9528219103813171,
0.13063208758831024,
0.6533640027046204,
-0.18056754767894745,
0.14978599548... | |
all the implementations for the frontEnd classes that will be tossed to the client, and **all the logic for the interaction between classes except how to talk to the client**.
package: backEndServer - contains a Server interface which the back-end server will adhere to. An example of a Server implementation would be o... | [
0.1704224795103073,
-0.020514529198408127,
0.35959458351135254,
0.12297898530960083,
-0.4645698368549347,
-0.1930016279220581,
0.13807493448257446,
-0.15952308475971222,
0.10752842575311661,
-0.7282419800758362,
-0.33316805958747864,
0.5314422845840454,
-0.41309553384780884,
-0.22832468152... | |
persistence.**
then you have implementation packages for each of these... which include stuff like how to persist for the backend and how to talk to the client for the front end. The front-end implementation package might know, for instance, that a user has logged in, whereas the frontEndServer just knows that it has ... | [
0.20511344075202942,
0.14717015624046326,
0.3261140286922455,
0.03813950717449188,
-0.09893587976694107,
-0.2859540581703186,
0.44656407833099365,
0.142933189868927,
-0.32022085785865784,
-0.6654025912284851,
0.31359681487083435,
0.8608934879302979,
-0.2385803461074829,
-0.0334014892578125... | |
I was reading the [jQuery source](http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js) and I was wondering why the entire source file was wrapped in an anonomous function.
```
(function(){
...
})();
```
Is this something which helps not to pollute the global namespace? Why is it there and how does it work?... | [
0.03168458491563797,
-0.08562837541103363,
0.4001936912536621,
-0.018205737695097923,
-0.12844157218933105,
-0.23999300599098206,
0.4461151659488678,
0.2417217642068863,
-0.07582627236843109,
-0.48269498348236084,
-0.1688748449087143,
0.40070807933807373,
-0.5126796960830688,
0.15709069371... | |
by introducing other code (or another library)
```
someConstantValue = someOtherValue; // this won't change the behaviour of myCoolFunction
``` | [
0.1794920712709427,
0.16442513465881348,
0.24746274948120117,
-0.12406361848115921,
0.033321790397167206,
-0.3505178391933441,
0.33096984028816223,
0.2415611743927002,
0.02898482047021389,
-0.4868227541446686,
-0.3176691234111786,
0.43576234579086304,
-0.2736731171607971,
0.064976185560226... | |
While dabbling in Clojure I've written a very basic program to echo whatever the user types into it. However, it doesn't run in a way that I'm perceiving to be natural. Here's the code:
```
(defn goo []
(print "echo> ")
(def resp (read-line))
(print resp)
)
```
I would expect the code to run like this (for me ... | [
0.10736376792192459,
0.12218645215034485,
0.3146296441555023,
-0.43154820799827576,
0.050556574016809464,
0.0033267997205257416,
0.48776471614837646,
-0.2526649534702301,
-0.13925454020500183,
-0.10955110192298889,
0.06009353697299957,
0.5603443384170532,
-0.5589678287506104,
-0.2290106117... | |
(flush)
(def resp (read-line))
(print resp)
(flush)
)
```
Also, the flushes aren't necessary if you use `println` instead of `print`.
I know nothing of clojure but this sounds like a case of buffers not getting flushed. Figure out how to flush standard out after the print. The println function probably flushes ... | [
0.11066808551549911,
-0.2265825718641281,
0.4702122211456299,
-0.27414342761039734,
0.31638970971107483,
-0.13972064852714539,
0.4911181628704071,
-0.40188440680503845,
-0.3575539290904999,
-0.33748164772987366,
-0.31487059593200684,
0.914570689201355,
-0.34298476576805115,
-0.253185689449... | |
On the topic of Release Management, I'm investigating my options for software that will essentially perform the features WSUS offers as far as I'm aware (remote installation, version querying, per-machine/group settings, etc) but for my custom software. It also needs to be able to run third-party executables (e.g. a gr... | [
0.34962454438209534,
0.15141260623931885,
0.12976334989070892,
-0.09929273277521133,
-0.23376065492630005,
-0.2975490391254425,
0.07826726883649826,
0.07993634790182114,
-0.38352108001708984,
-0.5791144967079163,
-0.4144831895828247,
0.8617537021636963,
-0.21944501996040344,
-0.00473301764... | |
NSIS installer building script, or are there hybrid administration/management/installation tools? I'm currently looking at NSIS/WiX as my main contenders with some sort of scripting for filling in the gaps (advice on language for that, too? Windows PowerShell?).
Calculate the route using your points and road network. T... | [
0.11264786869287491,
0.09905034303665161,
0.2850301265716553,
0.2654241919517517,
-0.07310820370912552,
0.16375534236431122,
0.3625118136405945,
0.05691828206181526,
-0.13363789021968842,
-1.1720565557479858,
0.036868564784526825,
0.49605169892311096,
0.0027612834237515926,
-0.200137436389... | |
road.
Alternatively, you can compare the resulting "directions" and check for deviations there--particuarly using street names. This saves you from checking every road segment. If you have any deviations in road names, then check the individual road segments of each section. | [
0.47358542680740356,
0.17012524604797363,
0.572253942489624,
0.35614874958992004,
-0.17282016575336456,
0.03512506186962128,
0.39174237847328186,
0.12595927715301514,
-0.3274526298046112,
-0.7687840461730957,
-0.07372348755598068,
0.4140681326389313,
0.17302270233631134,
0.1248561590909957... | |
Is there a way to tidy-up the following code, rather than a series of nested try/except statements?
```
try:
import simplejson as json
except ImportError:
try:
import json
except ImportError:
try:
from django.utils import simplejson as json
except:
raise "Req... | [
-0.10696809738874435,
0.39839810132980347,
0.2945104241371155,
-0.4200758635997772,
-0.293133944272995,
-0.1359347403049469,
0.27191632986068726,
-0.47127050161361694,
-0.29919007420539856,
-0.1412690430879593,
-0.3330281674861908,
0.5407055616378784,
-0.4830878674983978,
-0.56287062168121... | |
<http://mail.python.org/pipermail/python-list/2007-May/441896.html>. It seems to work quite well, and I'm pretty sure the way its importing won't stomp on any existing imports you might already have.
```
def module_exists(module_name):
try:
mod = __import__(module_name)
except ImportError:
retu... | [
0.20960885286331177,
0.13640516996383667,
0.6986889839172363,
-0.44075754284858704,
-0.16537903249263763,
-0.08825745433568954,
0.3521675169467926,
-0.6475049257278442,
-0.24133533239364624,
-0.4002619981765747,
-0.3683255612850189,
0.6346714496612549,
-0.4340020418167114,
-0.2281638979911... | |
or django.utils')
```
I know this seems like more code, but the function is reusable elsewhere if you're doing a lot of this. | [
0.32105904817581177,
0.48434925079345703,
0.03546449914574623,
-0.13139958679676056,
0.08074228465557098,
-0.35401034355163574,
-0.041971080005168915,
0.16463278234004974,
-0.12794944643974304,
-0.43065130710601807,
-0.10533015429973602,
0.8074054718017578,
-0.3330549895763397,
-0.19699440... | |
I have been building enterprise software for the last 10 years. In this time we have seen enterprise applications move from client server to thin clients. We have also seen the move to hosted solutions, albeit under a few names (asp, SaaS, cloud computing). With all these changes the impetuous has been mainly from driv... | [
0.27877694368362427,
0.31610408425331116,
0.2738656997680664,
0.04296288639307022,
0.18755894899368286,
0.13664628565311432,
0.055752918124198914,
0.24061331152915955,
-0.3767109513282776,
-0.521092414855957,
-0.020596923306584358,
0.374927282333374,
-0.012251385487616062,
0.52412343025207... | |
rich experience while still satisfying the crotchety IT department. The first was by the industry leader Microsoft in the form of the ActiveX control. The guys from Sun then followed suit with the applet and then more recently java webstart. All of these solutions seemed to scratch the itch but never gained wide expect... | [
0.3107372522354126,
-0.2658885419368744,
0.3291949927806854,
0.4207381308078766,
0.007009458728134632,
-0.2084471583366394,
-0.5067952275276184,
0.32414767146110535,
-0.43776270747184753,
-0.5376535058021545,
-0.044467899948358536,
0.5746806263923645,
-0.18171018362045288,
0.06715148687362... | |
all users of the main browsers on the main platforms already have installed the only runtime component required for Flex; which is the Flash player. The Flash player has already demonstrated that it isn't a vector for Bad Stuff; it runs in its own sandbox in the browser, isolated from the hardware and the OS. So no new... | [
0.06778167188167572,
-0.01796395517885685,
0.3869798481464386,
0.11788211762905121,
-0.013930737972259521,
-0.35836437344551086,
0.04955627769231796,
0.09559569507837296,
-0.18931187689304352,
-0.7610767483711243,
-0.276650607585907,
0.7078732848167419,
-0.241024449467659,
-0.4835376739501... | |
a RUI.
(Activex is Windows-0nly; Anything in java is perceived as destabilizing and too heavy; and java hasn't managed to wangle its way into ubiquity, nor will it probably ever do so. So both generally get installed by edict, rather than user choice. This in spite of the fact that Adobe is probably the most disruptiv... | [
0.0105932941660285,
-0.1731235682964325,
0.4990203380584717,
-0.04665866494178772,
-0.18775776028633118,
-0.19630125164985657,
0.052368633449077606,
-0.20030103623867035,
0.09217996895313263,
-0.3493066430091858,
-0.07814064621925354,
0.3858987092971802,
-0.41413936018943787,
-0.0364941284... | |
quite a way in the future; and MS hasn't proven to have the political smarts to appear harmless yet. But don't count it out. I think they've moved a step back by switching to .NET languages (with a limited CLR) for development; this seems to me to be the same strategy that has deoxygenated their WinCE strategy; but aga... | [
0.22630763053894043,
-0.03857627511024475,
0.43973928689956665,
0.15446563065052032,
-0.028816943988204002,
-0.23590655624866486,
0.34155842661857605,
0.5869756937026978,
-0.17281198501586914,
-0.6166883707046509,
-0.01110917329788208,
0.5818098187446594,
-0.03809887543320656,
0.2460813522... | |
there's no perfect answer in sight yet, but at least there is competition for hearts and minds. I think the most encouraging signs come from Microsoft's strong move into platform-neutral stuff like MVC, Iron Stuff, and increasingly unpolluted code streams to the browser. | [
0.4886470139026642,
0.16923853754997253,
0.14675624668598175,
0.2506132125854492,
0.05512811243534088,
-0.021046781912446022,
0.12838751077651978,
0.6164063215255737,
0.07314178347587585,
-0.3526449203491211,
-0.04977539926767349,
0.18552756309509277,
0.34282973408699036,
0.057060170918703... | |
I've been looking for a while how to play sound on the iphone, and I think it's something along the lines of:
```
[[NSSound soundNamed:@"cat.mp3"] play];
```
But the NSSound is on the AppKit ... any suggestions ? I know there is a really simple answer to this, but today my searches are not rendering any result ...
t... | [
0.05882146209478378,
0.1571454554796219,
0.6093252897262573,
-0.19147957861423492,
0.030899276956915855,
-0.06593948602676392,
0.19850146770477295,
-0.2759576141834259,
-0.12635505199432373,
-0.7920588254928589,
-0.16498717665672302,
1.1768745183944702,
-0.3428020179271698,
0.0051609575748... | |
Is there a way to set the default buffer size for JSPs in Tomcat? I know I can set them on every page, but am hoping there's a global option somewhere.
Short answer: No.
Long answer: Perhaps, with some hacking...
* You'd have to build Tomcat yourself after editing this class: [Jasper constants](http://tomcat.apache.o... | [
0.0496060773730278,
-0.005742833949625492,
0.639548659324646,
-0.07309942692518234,
-0.016876177862286568,
0.30439361929893494,
0.23717999458312988,
0.03438680246472359,
-0.3910242021083832,
-0.20102240145206451,
-0.23893055319786072,
0.8213930726051331,
-0.4445878863334656,
-0.17392300069... | |
your directives are inconsistent with the above, e.g. more/less whitespace, please use more regexp magic to make it work)
Your problem elsewhere on the web: <http://www.theserverside.com/discussions/thread.tss?thread_id=24768>
HTH | [
0.3350563943386078,
0.02971312589943409,
0.4743034243583679,
0.13211242854595184,
-0.013353070244193077,
-0.2784382998943329,
0.41782256960868835,
-0.16543623805046082,
-0.6473526358604431,
-0.51874840259552,
-0.0855541005730629,
0.4702375829219818,
-0.34190621972084045,
0.2070651203393936... | |
I have a page with this HTML:
```
<p>
<img src="images/ih01.jpg" width="80" height="110" align="left" />
This course overs basic human anatomy and physiology, including the major
body systems and their functions. When you have completed this course you
will be able to identify major body components and... | [
0.5752891302108765,
0.14792832732200623,
0.5812715291976929,
-0.06663544476032257,
-0.04546312242746353,
-0.12338826805353165,
0.23368209600448608,
-0.2681529223918915,
0.016079340130090714,
-0.8231129050254822,
0.17608582973480225,
0.6935939788818359,
-0.10071001946926117,
-0.290071785449... | |
src="images/ih01.jpg" style="float: left; height: 110px; width: 80px; " >
```
instead of align. The align attribute is [deprecated](http://www.w3schools.com/tags/tag_IMG.asp). | [
0.012078647501766682,
-0.08249121159315109,
0.7122711539268494,
-0.06402909755706787,
-0.11410793662071228,
-0.0604623518884182,
0.11986492574214935,
-0.6155966520309448,
-0.2545636296272278,
-0.1272859126329422,
-0.09300204366445541,
0.32353636622428894,
-0.07829903066158295,
0.1527289748... | |
Let's say I have the following code:
```
IBOutlet UITextField* nameTextField;
IBOutlet UILabel* greetingLabel;
```
I'd like the `greetingLabel` to read "Hello [nameTextField]" as soon as the user presses any key.
What I need basically is the iPhone equivalent of the Cocoa delegate method `controlTextDidChange`.
Th... | [
-0.3736414909362793,
0.22485560178756714,
0.6821185350418091,
-0.25294291973114014,
-0.020297715440392494,
0.07035275548696518,
0.1890694797039032,
-0.16154465079307556,
0.18345005810260773,
-0.4311419427394867,
-0.32316794991493225,
0.7276711463928223,
-0.13724952936172485,
0.047205913811... | |
remains blank however.
What am I missing here? (I'd like `nameTextField` to reflect the exact string that the user has entered so far).
It turns out, the easiest way to do this is using Interface Builder:
* Add a IBAction (to the ViewController, say, as in this case)
* Ctrl-Click (or right click) on the UITextField ... | [
-0.09810978919267654,
-0.1274702250957489,
0.6861530542373657,
0.05616388097405434,
-0.08020147681236267,
-0.06691666692495346,
0.18068774044513702,
0.10780048370361328,
-0.27097728848457336,
-0.8068562746047974,
-0.06381330639123917,
0.5831324458122253,
-0.04631190747022629,
0.11942477524... | |
this seems so silly - i must be missing something obvious. I have the following code (just as a test):
```
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void page_load(object o, EventArgs... | [
0.017765222117304802,
-0.0786263719201088,
0.786770224571228,
-0.417138010263443,
-0.24580352008342743,
0.13535267114639282,
0.10487924516201019,
-0.550715446472168,
-0.21722032129764557,
-0.6736822128295898,
-0.24472127854824066,
0.38640278577804565,
-0.18075911700725555,
-0.0361559949815... | |
Response.Flush();
System.Threading.Thread.Sleep(500);
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
main div
</div>
</form>
</body>
</html>
```
when i test this... | [
-0.10303966701030731,
-0.5194984674453735,
0.6293819546699524,
-0.14995716512203217,
-0.09781080484390259,
0.3688790500164032,
-0.06667590886354446,
-0.41882559657096863,
-0.324577659368515,
-0.9144406914710999,
-0.16799674928188324,
0.42980125546455383,
-0.24401924014091492,
-0.0234189648... | |
dev server (2003, iis6) it just buffers it all and sends it all at once. is there something obvious i'm missing?? I've also tried putting buffer=false at the top but that also doesn't change this behaviour.
to further clarify, i've done a test with fiddler to compare two servers. the first server is a local server on ... | [
-0.17516778409481049,
-0.22974930703639984,
0.4742530584335327,
0.09762060642242432,
-0.7154101133346558,
0.046180397272109985,
0.3303167223930359,
-0.06057969853281975,
-0.3347654342651367,
-0.4942993223667145,
0.1514555960893631,
0.34354066848754883,
-0.4894420802593231,
0.06704176217317... | |
happened. i can also confirm this behaviour happens in both firefox and ie.
I put my 2 cents on that when you access the public site, you are running through a web proxy, and that is where the content is being cached. | [
0.7005698084831238,
0.2524217367172241,
0.34179753065109253,
-0.06272668391466141,
0.11076941341161728,
-0.4740457534790039,
0.6742295026779175,
0.55458003282547,
-0.1113622635602951,
-0.5576318502426147,
-0.03623813018202782,
0.30736634135246277,
-0.2252328097820282,
0.3188166320323944,
... | |
Is there any way to change Visual Studio Auto formatting options? Like VS by default uses close bracket format for Javascripts.
Tools -> Options -> Text Editor -> JavaScript | [
0.5669873952865601,
-0.16935542225837708,
0.29954931139945984,
0.19866251945495605,
-0.2232992798089981,
-0.08798001706600189,
0.08151482790708542,
-0.17856226861476898,
-0.06312596797943115,
-0.5830907821655273,
0.058305416256189346,
0.8828821182250977,
-0.14414776861667633,
-0.1595872938... | |
Python, C++, Scheme, and others all let you define functions that take a variable number of arguments at the end of the argument list...
```
def function(a, b, *args):
#etc...
```
...that can be called as followed:
```
function(1, 2)
function(1, 2, 5, 6, 7, 8)
```
etc... Are there any languages that allow you... | [
-0.005985055584460497,
0.020288627594709396,
0.1574130803346634,
-0.24054718017578125,
-0.18016378581523895,
0.18401440978050232,
0.11118265241384506,
-0.18436819314956665,
-0.15794187784194946,
-0.05733148753643036,
-0.24170458316802979,
0.8298228979110718,
-0.3920322358608246,
-0.2994595... | |
b=undefined/null/something, d=[]
function(1,2,3) //a=1, b=2, c=3,d=[]
function(1,2,3,4,5) //a=1, b=2, c=3, d=[4,5]
```
Future versions of Ruby (1.9 and up, Ruby 1.9 is scheduled to released at the end of January, 2009) can do this.
It is however not always obvious which value gets bound to which parameter.
This is w... | [
0.24607877433300018,
-0.22501017153263092,
0.330711305141449,
-0.38415342569351196,
-0.24551962316036224,
-0.03221763297915459,
0.4896436333656311,
-0.12865197658538818,
-0.04625289514660835,
-0.13626262545585632,
-0.45346692204475403,
0.6415793895721436,
-0.7029329538345337,
-0.1062824204... | |
s << "#{arg} = #{(eval arg).inspect}, "
}.gsub /, $/, ''
end
meth :arg1, :a2, :a3
# => mand1 = :arg1, opt1 = :def1, o2 = :d2, m2 = :a2, args = [], m3 = :a3
meth :arg1, :a2, :a3, :a4
# => mand1 = :arg1, opt1 = :a2, o2 = :d2, m2 = :a3, args = [], m3 = :a4
meth :arg1, :a2, :a3, :a4, :a5
# => mand1 = :arg1, opt1 = :a2, ... | [
-0.2984682023525238,
0.013361233286559582,
0.3840930461883545,
-0.24981291592121124,
0.05870387703180313,
1.0210750102996826,
0.5305436253547668,
-0.45926040410995483,
-0.3924505114555359,
-0.6721582412719727,
-0.21473008394241333,
0.4004051387310028,
-0.28658440709114075,
-0.1241144090890... | |
:a5, args = [:a4], m3 = :a6
meth :arg1, :a2, :a3, :a4, :a5, :a6, :a7
# => mand1 = :arg1, opt1 = :a2, o2 = :a3, m2 = :a6, args = [:a4, :a5], m3 = :a7
```
As you can see, mandatory arguments are bound first, from both the left and the right. Then optional arguments get bound and if any arguments are left over, they get... | [
-0.38450807332992554,
0.03198690712451935,
0.09154113382101059,
-0.1933058798313141,
-0.09843961149454117,
0.555992066860199,
0.3142613172531128,
-0.5497298836708069,
-0.13863526284694672,
-0.20384769141674042,
-0.5878497958183289,
0.5633886456489563,
-0.3827487528324127,
-0.27520164847373... | |
I'm trying to code what I think is a fairly routine AJAX pattern using TreeViews and UpdatePanels. My situation is this:
I have a TreeView within an UpdatePanel. I have a Literal within another UpdatePanel. When the user clicks on a node within the TreeView, the contents of the Literal are updated. Now, since the whol... | [
0.2818068265914917,
0.12483096122741699,
0.22975441813468933,
-0.10323837399482727,
-0.0919036716222763,
-0.28119146823883057,
0.2566976547241211,
0.3844035267829895,
0.02975941263139248,
-0.7985967993736267,
-0.023237476125359535,
0.5807915329933167,
-0.21652576327323914,
0.09550351649522... | |
have to stare at the old contents while the new text is getting loaded asynchronously.
I can't seem to figure out an easy way to accomplish (2). I've been reading up on client side callbacks and using GetCallbackEventReference, but it seems like a very complicated approach to what is seemingly a simple problem.
Ideal... | [
0.24066881835460663,
0.14824967086315155,
0.23271365463733673,
0.13917823135852814,
-0.11307670176029205,
-0.383344441652298,
0.22981113195419312,
0.10541646927595139,
-0.1095033809542656,
-0.5658882856369019,
-0.18770185112953186,
0.5227798819541931,
-0.1324940174818039,
0.123987406492233... | |
about with its normal operation.
Is this possible? Or are client call backs my only option?
You'll be wanting to play with the `PageRequestManager` from the ASP.NET AJAX library. Here's the MSDN reference for the PRM - <http://msdn.microsoft.com/en-us/library/bb311028.aspx>.
Just be for warned Microsoft have stated t... | [
0.3012531101703644,
-0.04956468194723129,
0.2517648935317993,
0.13842889666557312,
0.0006158294854685664,
-0.4329395294189453,
0.3315379023551941,
-0.08014743775129318,
-0.2689110338687897,
-0.7224422097206116,
-0.1493523269891739,
0.961188793182373,
-0.0567818284034729,
-0.290861278772354... | |
a `BeginRequest` event handler which will then clear your literal and can even show a Loading (I'm not a fan of the UpdateProgress, I prefer much more granular control I get from doing it myself)
* Use the `EndRequest` event to ensure that the Loading component vanises
You could also make the TreeView a `AsyncPostback... | [
-0.2428082823753357,
-0.33110201358795166,
0.38071492314338684,
0.046797435730695724,
-0.1949305534362793,
-0.4794411361217499,
0.3811669647693634,
-0.11007276922464371,
0.07700066268444061,
-0.5758454203605652,
-0.4790074825286865,
0.6671371459960938,
-0.0400671623647213,
-0.1759543865919... | |
I hear a lot about map/reduce, especially in the context of Google's massively parallel compute system. What exactly is it?
From the abstract of Google's [MapReduce](http://research.google.com/archive/mapreduce.html) research publication page:
> MapReduce is a programming model and
> an associated implementation for
... | [
0.019237404689192772,
-0.12623897194862366,
0.28090301156044006,
0.2582033574581146,
-0.15753011405467987,
-0.004212188068777323,
-0.39267608523368835,
-0.26039448380470276,
-0.03224724158644676,
-0.9066201448440552,
0.22663888335227966,
0.39142343401908875,
-0.35847240686416626,
0.0510826... | |
processing nodes (multiple servers) so it is a system that can scale very well.
Since it's based from the [functional programming](http://en.wikipedia.org/wiki/Functional_programming) model, the `map` and `reduce` steps each do not have any side-effects (the state and results from each subsection of a `map` process d... | [
-0.3456425368785858,
-0.3507312536239624,
0.18577443063259125,
0.29254263639450073,
-0.35689017176628113,
0.20602641999721527,
-0.04241178184747696,
-0.13655667006969452,
-0.15059861540794373,
-0.5846083760261536,
0.005380093585699797,
0.31458964943885803,
0.028896402567625046,
0.077081806... | |
functional programming and how it allows scalable code.
See also: [Wikipedia: MapReduce](http://en.wikipedia.org/wiki/MapReduce)
Related question: [Please explain mapreduce simply](https://stackoverflow.com/questions/28982/please-explain-mapreduce-simply) | [
0.051543235778808594,
0.04689406603574753,
0.03434529900550842,
0.18811245262622833,
-0.1835280805826187,
-0.23925469815731049,
-0.07042443007230759,
-0.25549617409706116,
-0.35734644532203674,
-0.5193549394607544,
-0.3914458155632019,
0.575778067111969,
-0.2667134702205658,
-0.19680263102... | |
I am working on an application that allows users to input Japanese language characters. I am trying to come up with a way to determine whether the user's input is a Japanese kana (hiragana, katakana, or kanji).
There are certain fields in the application where entering Latin text would be inappropriate and I need a wa... | [
0.2591295838356018,
0.1722586750984192,
0.002088311593979597,
-0.056830789893865585,
-0.22257614135742188,
0.3879837989807129,
0.04696334898471832,
-0.025715099647641182,
-0.026790451258420944,
-0.7786630988121033,
-0.10228218138217926,
0.17448210716247559,
0.05896921083331108,
-0.04177295... | |
a good starting point.
If you're using .NET, my [MiscUtil](http://pobox.com/~skeet/csharp/miscutil) library has some Unicode range support - it's primitive, but it should do the job. I don't have the source to hand right now, but will update this post with an example later if it would be helpful. | [
0.07122747600078583,
0.18893051147460938,
0.09675760567188263,
0.19801872968673706,
0.004640455357730389,
-0.0684519112110138,
-0.060042303055524826,
0.3173023462295532,
-0.0849129781126976,
-0.8416966199874878,
-0.018923185765743256,
0.11231043189764023,
0.08686874061822891,
-0.1767805665... | |
I'm trying to POST to the HTTP gateway of an SMS provider (Sybase 365) using CURL from a Linux shell script.
I need to pass the following data (note the [ ] and LF characters)
```
[MSISDN]
List=+12345678
[MESSAGE]
Text=Hello
[END]
```
If I submit a file using the -F parameter, CURL removes the LF e.g.
```
curl -F ... | [
0.33367228507995605,
0.33192452788352966,
0.4946025311946869,
-0.26029759645462036,
-0.06870642304420471,
0.057790372520685196,
0.3381801247596741,
-0.02491210401058197,
0.0316910594701767,
-0.6630745530128479,
-0.050335559993982315,
0.39651015400886536,
-0.4296463131904602,
-0.22203271090... | |
"[MSISDN]\nList=$number\n[MESSAGE]\nText=$message\n[END]\n"`
response=`curl -s -u $username:$password -d "$request" http://www.sybase.com/...`
```
Curiously, if I use -d @myfile (where myfile contains LF separated text), it doesn't work.
I also tried --data-binary without success. | [
0.04604046046733856,
0.034457553178071976,
0.3769167363643646,
-0.24411210417747498,
0.01607268489897251,
-0.06504615396261215,
0.13289056718349457,
0.10873539745807648,
-0.19826024770736694,
-0.8009141683578491,
-0.360068678855896,
0.4576752185821533,
-0.3272126317024231,
0.31817948818206... | |
Is it necessary to use "Nothing" keyword to initialize a DataSet in VB.NET?
Well if you set the variable to "Nothing" then you're not initialising an actual DataSet object at all - you're just setting the value of the variable to a null reference.
For an instance or static variable, Nothing will be the default value. ... | [
0.34217286109924316,
-0.15349140763282776,
-0.021270889788866043,
-0.059529416263103485,
-0.16181501746177673,
-0.4253890812397003,
0.1882757991552353,
0.01677062176167965,
-0.30862265825271606,
-0.16448888182640076,
-0.38527604937553406,
0.41346484422683716,
-0.4742620587348938,
0.0388738... | |
you use an unassigned variable, the value will be Nothing by default. | [
0.16153058409690857,
-0.05176091194152832,
-0.009790829382836819,
0.18405896425247192,
0.12085941433906555,
-0.14727967977523804,
0.14675597846508026,
0.2197638750076294,
-0.2533172070980072,
-0.15310868620872498,
-0.27352043986320496,
0.7424578666687012,
-0.29932838678359985,
0.3694930672... | |
I am writing a JSR-168 portlet that can be added to a container multiple times. Each container (Liferay, JBoss, etc.) has its own internal way of differentiating between multiple instantiations of the same portlet.
I, however, would like to uniquely identify my portlet instance inside the `doView()` method itself.
Is... | [
0.16500939428806305,
-0.14186643064022064,
0.6812821626663208,
-0.23923452198505402,
-0.23880623281002045,
-0.10852453857660294,
0.24080361425876617,
-0.2969023287296295,
-0.2959041893482208,
-0.5658641457557678,
-0.2116233855485916,
0.4265480041503906,
-0.48761317133903503,
-0.11104954034... | |
unique per portlet instance.
From spec: **PLT.12.3.4 Namespace encoding**:
> The getNamespace method must provide
> the portlet with a mechanism that
> ensures the uniqueness of the returned
> string in the whole portal page. For
> example, the getNamespace method would
> return a unique string that could be
> ... | [
-0.21644361317157745,
0.12830813229084015,
0.4420967102050781,
0.023035580292344093,
-0.35126399993896484,
-0.02284984290599823,
0.06638455390930176,
-0.23310363292694092,
-0.18807145953178406,
-0.8535284399986267,
-0.132030189037323,
0.07345620542764664,
-0.2729392349720001,
0.47770729660... | |
you'll probably want to store it in the session or as an *actionURL* parameter.
If upgrading is an option, Portlet 2.0 (286) changes the underlying *PortletResponse* interface to provide the *getNamespace()* method and also adds a *PortletRequest.getWindowID()* method which might be of some use to you. | [
0.01077720895409584,
-0.4203066825866699,
0.6290527582168579,
-0.05871640145778656,
0.04509395733475685,
0.00195009121671319,
0.32915642857551575,
-0.09064021706581116,
-0.2584965229034424,
-0.7657786011695862,
-0.2860851287841797,
0.9189801812171936,
-0.25607144832611084,
0.05248231813311... | |
Im a newbie programmer in Delphi. I need help, I have a small project which I need to display all kind of image format.
Please suggest what should I do or any component in delphi that support all image format? thanks for the help in advance.
I found a Library that suites my need. It called [vampyre library](http://ima... | [
0.7986397743225098,
0.08187046647071838,
0.3149399161338806,
0.13862285017967224,
-0.23804821074008942,
-0.34354928135871887,
-0.2463623434305191,
0.03942639380693436,
-0.012738341465592384,
-0.8709893822669983,
0.10479473322629929,
0.5081973671913147,
-0.1337602585554123,
-0.0302578732371... | |
How do i unset a already set flag using fcntl?
For e.g. I can set the socket to nonblocking mode using
```
fcntl(sockfd, F_SETFL, flags | O_NONBLOCK)
```
Now, i want to unset the O\_NONBLOCK flag.
I tried fcntl(sockfd, F\_SETFL, flags | ~O\_NONBLOCK). It gave me error EINVAL
```
int oldfl;
oldfl = fcntl(sockfd, F... | [
0.00663265073671937,
0.046256233006715775,
0.42540934681892395,
-0.34035933017730713,
0.1542101353406906,
0.05668216943740845,
0.6792250871658325,
-0.27669757604599,
0.041357386857271194,
-0.7495198249816895,
-0.3152013421058655,
0.7059358954429626,
-0.42795172333717346,
-0.019148936495184... | |
Java 5 introduced generics, and they were added to many interfaces in the `java.lang` package. However, `Cloneable` did not get generics. I wonder why?
---
**Edit:** In reply to the answers of @Jon and @litb, and the comment of @Earwicker, I was thinking `Cloneable` might be:
```
public interface Cloneable<T> {
... | [
0.010450989007949829,
0.04943077638745308,
0.17803135514259338,
-0.2633862793445587,
-0.1773567646741867,
-0.318632572889328,
0.45796999335289,
-0.05109742656350136,
-0.09311329573392868,
-0.6857510209083557,
0.0521354116499424,
0.4098915457725525,
-0.6735734343528748,
0.3828613758087158,
... | |
it in the interface would force all implementers to provide a `public` implementation, which class designers might not want to (i.e. they might opt to keep it `protected`).
The Cloneable interface doesn't contain any members. What would be the point of making it generic?
(If Cloneable contained the clone() method, it ... | [
0.16746388375759125,
-0.2914176881313324,
0.17001304030418396,
-0.05369440093636513,
0.11375463008880615,
-0.39878419041633606,
0.07755868881940842,
0.028400558978319168,
-0.10102986544370651,
-0.7887048721313477,
-0.09585306793451309,
0.2983611524105072,
-0.5730866193771362,
0.28517991304... | |
don't know why that design wasn't chosen.
(In .NET, [ICloneable](http://msdn.microsoft.com/en-us/library/system.icloneable.aspx) isn't generic because it existed before generics - the different nature of .NET generics prevents a previously non-generic type from becoming generic.)
In both Java and .NET, however, the "... | [
0.17080824077129364,
-0.07179993391036987,
0.007783804088830948,
0.1435452252626419,
-0.007699775043874979,
-0.31119900941848755,
0.0809694156050682,
0.1885031908750534,
-0.25132885575294495,
-0.3778347969055176,
-0.1300448626279831,
0.12898865342140198,
-0.5911165475845337,
0.433584451675... | |
I'd like to display splash screen while the application is loading. However some 3rd party components block main thread during initilization for several seconds, which causes all forms not to update. Is it possible to have splash screen with own thread so it would update also when main thread is busy?
The application ... | [
0.12524369359016418,
-0.16741624474525452,
0.7346678972244263,
-0.17491497099399567,
-0.13912120461463928,
-0.11181958019733429,
0.143258199095726,
-0.07047341018915176,
-0.24122917652130127,
-0.9601566791534424,
0.12997791171073914,
0.49688658118247986,
-0.3062446117401123,
0.176951363682... | |
will need to use raw Windows API calls or a third-party library (like [Key Objects Library](http://kolmck.net/)) that implements VCL-like classes. Do however not access VCL stuff from splash thread.
If you go that route (which I don't think you should, as it is a lot of work for little gain), be sure to observe the ru... | [
0.35710659623146057,
-0.13080120086669922,
0.44827815890312195,
0.18258452415466309,
-0.2414376139640808,
-0.47591137886047363,
-0.03791213035583496,
0.2079339176416397,
-0.4028562605381012,
-0.7881396412849426,
0.17302310466766357,
0.6107141971588135,
-0.28571751713752747,
0.0788744240999... | |
be easy to have the splash screen in a different thread, but the warning against VCL access from secondary threads remains. | [
0.29836326837539673,
-0.50776606798172,
0.46862542629241943,
-0.00668991357088089,
0.07570232450962067,
-0.4481043815612793,
0.14130818843841553,
0.12753510475158691,
-0.609466016292572,
-0.5734385848045349,
-0.11672352254390717,
0.4460188150405884,
-0.12569476664066315,
0.0603898875415325... | |
We are trying to get different SharePoint web applications to authenticate against different sub-domains.
We have three web applications:
- <http://customers.xyz.com>
- <http://internal.xyz.com>
- <http://partners.xyz.com>
and we have three sub-domains in our active directory.
Now we want the three web-applicati... | [
0.43819326162338257,
0.12588006258010864,
0.38491424918174744,
0.3583323657512665,
-0.10824329406023026,
0.11584245413541794,
0.27241963148117065,
-0.19372260570526123,
-0.16020317375659943,
-0.4536648988723755,
0.0504794642329216,
0.5945423245429993,
-0.09355276823043823,
0.21907733380794... | |
When transmitting data, the Hamming code apparently allows you to recreate data that has been corrupted over the wire (an error correcting code).
How does this work and what are its limitations, if any?
Are there any better solutions for error correction (as opposed to retransmission)? Are there circumstances where r... | [
0.33369696140289307,
-0.052262261509895325,
0.44505250453948975,
0.33264899253845215,
-0.07647339254617691,
0.17345350980758667,
0.3582325279712677,
-0.2299415022134781,
-0.2568851113319397,
-0.14226889610290527,
0.07808370888233185,
0.4627027213573456,
-0.25388529896736145,
0.235251501202... | |
| | |
| | | |
010-|-------011 |
\| \|
110---------111
```
Each defect (for example 101 is read as 100) results in a shift on a line on the cube.
If we use two bits for the data and the third for a parity check (say for example even parity). We lose 4 datapoints. But it has the advant... | [
0.016769571229815483,
0.3014257550239563,
0.30626675486564636,
0.06624799221754074,
-0.05396012216806412,
0.4644218683242798,
0.3817365765571594,
-0.46845152974128723,
-0.3044499456882477,
-0.4701937437057495,
-0.17799851298332214,
0.13031087815761566,
-0.19595931470394135,
0.0887035131454... | |
of 1's into an odd count of ones).
The odd numbers are marked with a \*. And we see that each odd (wrongly transmitted) word is cornered by even (rightfully transmitted) words. So if we receive 100, we can be sure it is wrong.
But (with a single bit failure) the correct representation could have been 000, 101 or 110.... | [
-0.1631624698638916,
0.0016689487965777516,
0.39952102303504944,
-0.021131668239831924,
-0.06244773790240288,
0.5757992267608643,
0.3156326413154602,
-0.17913474142551422,
-0.1708826720714569,
-0.6574821472167969,
-0.12311871349811554,
0.24126996099948883,
-0.24102124571800232,
0.059164848... | |
| |
| | | |
*010-|-------011 |
\| \|
110--------*111
```
This is called a one bit error detecting code.
If we use another bit for checking and thus remove one for the data. We are left with 1 databit and 2 "check bits".
In this case, lets assume 000 and 111 are valid data representation... | [
0.13599613308906555,
0.043539341539144516,
0.16622477769851685,
0.2047094702720642,
0.06617050617933273,
0.37607213854789734,
0.1667771339416504,
-0.37308186292648315,
-0.24322791397571564,
-0.520697832107544,
-0.061685990542173386,
0.11023622006177902,
-0.3247760236263275,
0.2188076376914... | |
we send 000 and receive 010, we see that 010 has one valid neighbor (000) and two invalid ones (110 and 011). So now we know that we intended to send 000 and are able to correct that:
```
000 -------*001
| \ | \
|*100--------*101
| | | |
| | | |
*010-|------*011 |
\| \| | [
-0.07388336211442947,
0.4269022047519684,
0.6603560447692871,
0.14088962972164154,
-0.21229252219200134,
0.6030161380767822,
0.18962892889976501,
-0.33836469054222107,
0.161764457821846,
-0.6285271644592285,
0.14989864826202393,
-0.009402873925864697,
0.0963381677865982,
0.0034302487038075... | |
*110---------111
```
This is called a one bit error correcting code.
Please note that a one bit error correcting code is also a two bit error detecting code.
And to put it more generally.
If you have n check bits, you have a n bit error detecting code.
If you have 2n check bits, you have a n bit error correcting c... | [
0.4569493532180786,
0.5343326926231384,
0.1386774331331253,
-0.012544270604848862,
-0.0898328348994255,
0.032506342977285385,
0.29469549655914307,
-0.19514119625091553,
-0.1311284750699997,
-0.6657827496528625,
-0.026538675650954247,
0.4236482083797455,
-0.33282357454299927,
-0.09667633473... | |
I need to write a .NET application that listens to a SMS message , and then react to it.
I assume i need a SMS gateway to interface between my application and the sender of the SMS.
How could i implement this . Would the listening program need to be a web service or something else ?
Please give me your ideas.
Than... | [
0.24813780188560486,
0.24556301534175873,
0.12886697053909302,
0.16223551332950592,
-0.09748077392578125,
0.1252092570066452,
0.3983429968357086,
0.0042241420596838,
-0.06773654371500015,
-0.7478950023651123,
0.07971268892288208,
0.38283905386924744,
-0.14686466753482819,
-0.33425140380859... | |
can use a Windows Mobile phone and use the [MessageInterceptor](http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.pocketoutlook.messageinterception.messageinterceptor.aspx) class with .NET Compact Framework. Then, when you have your message, use whatever method you want to forward it to your app (sockets,... | [
0.05526153743267059,
-0.12934119999408722,
0.6058967113494873,
0.09363359957933426,
0.2917618453502655,
0.1285877674818039,
0.2678225040435791,
0.2007586658000946,
-0.20212869346141815,
-0.8874423503875732,
-0.4162875711917877,
0.3354303538799286,
0.0504615381360054,
0.09265654534101486,
... | |
**Are there any object similar to ms-access forms in VB, .NET or other microsoft technologies?**
We have been now using Access for developping client interfaces with some success for the last 2 years. We are using a serie of development tools making the best use of a metamodel (we have tables for forms, local queries,... | [
0.43507906794548035,
0.12151115387678146,
0.24196839332580566,
0.1915193647146225,
-0.12735514342784882,
-0.1004055067896843,
0.10123584419488907,
0.005560377612709999,
-0.35919755697250366,
-0.8639090657234192,
0.0021104165352880955,
0.4538115859031677,
-0.00396515429019928,
0.15721000730... | |
controls depending on their types (this has already been briefly exposed [here](https://stackoverflow.com/questions/47400/best-way-to-test-a-ms-access-application#70572)).
With the exception of these forms, all the other objects we use can be in a way or another taken out of Access/mdb files: local tables can be saved... | [
0.20400293171405792,
-0.032171208411455154,
0.576822817325592,
0.44608697295188904,
0.22072173655033112,
-0.20960265398025513,
-0.1584347039461136,
-0.32669350504875183,
-0.24141986668109894,
-0.5058373808860779,
-0.008639541454613209,
0.5579350590705872,
-0.3600161373615265,
-0.0100130131... | |
combination of an .mdb file and the ms-access runtime.
One easy way to do it (if it fits your architecture) is to just simply use a mobile phone and have code on it that intercepts the message and the forwards it to your application.
If you want to use .net, you can use a Windows Mobile phone and use the [MessageInter... | [
0.06338397413492203,
-0.28190717101097107,
0.5475142598152161,
0.056863050907850266,
0.12785163521766663,
-0.10926418006420135,
0.008003603667020798,
-0.03127778321504593,
-0.38633987307548523,
-1.0614961385726929,
-0.11277982592582703,
0.20152616500854492,
-0.2751891314983368,
0.055586423... | |
I have a multi-browser page that shows vertical text.
As an ugly hack to get text to render vertically in all browsers I've created a custom page handler that returns a PNG with the text drawn vertically.
Here's my basic code (C#3, but small changes to any other version down to 1):
```
Font f = GetSystemConfiguredFo... | [
0.27587801218032837,
0.007469560019671917,
1.077019453048706,
-0.3541823625564575,
-0.17728134989738464,
0.2923699915409088,
0.12981277704238892,
-0.41349756717681885,
-0.28259801864624023,
-0.7019423842430115,
0.207240492105484,
0.5715637803077698,
-0.15678754448890686,
-0.007152881007641... | |
Bitmap( 1000, 1000 ) )
size = Graphics.FromImage( imageg ).
MeasureString( text, f, 25, stringFormat );
using ( Bitmap image = new Bitmap( (int) size.Width, (int) size.Height ) )
{
Graphics g = Graphics.FromImage( (Image) image );
g.FillRectangle( Brushes.White, 0f, 0f, image.Width, image.Height );... | [
0.0938081219792366,
-0.4709970951080322,
1.0537333488464355,
-0.15304598212242126,
-0.227113276720047,
0.44830432534217834,
0.10376328229904175,
-0.795165479183197,
-0.16811662912368774,
-0.5838110446929932,
-0.1809825301170349,
0.6998149156570435,
-0.3102973401546478,
-0.05691311508417129... | |
//make be background transparent - this will be an index (rather than an alpha) transparency
image.MakeTransparent( Color.White );
//note that this image has to be a PNG, as GDI+'s gif handling renders any transparency as black.
context.Response.AddHeader( "ContentType", "image/png" );
using ( MemorySt... | [
0.4898855686187744,
-0.3127274811267853,
0.4556274712085724,
-0.23557749390602112,
0.2374703586101532,
0.3269873559474945,
0.36428332328796387,
-0.21284250915050507,
0.10018498450517654,
-0.6570727825164795,
-0.16638383269309998,
0.622771143913269,
-0.595014214515686,
-0.055305156856775284... | |
to, except that the transparency is index based. As I'm returning a PNG it could support a proper alpha transparency.
Is there any way to do this in .net?
---
Thanks to Vlix (see comments) I've made some changes, though it still isn't right:
```
using ( Bitmap image = new Bitmap( (int) size.Width, (int) size.Height... | [
0.2595825493335724,
-0.309521347284317,
0.8003908395767212,
-0.1617039144039154,
-0.25928163528442383,
0.13090495765209198,
0.19068074226379395,
-0.38884663581848145,
-0.022130776196718216,
-0.7739490866661072,
-0.0883275642991066,
0.8308858275413513,
-0.4644034206867218,
-0.00968161784112... | |
Brushes.Black, 0f, 0f, stringFormat );
//note that this image has to be a PNG, as GDI+'s gif handling renders any transparency as black.
context.Response.AddHeader( "ContentType", "image/png" );
using ( MemoryStream memStream = new MemoryStream() )
{
//note that context.Response.OutputStream do... | [
0.0556647963821888,
-0.46541711688041687,
0.62470543384552,
-0.37905049324035645,
-0.11192832887172699,
0.1662416309118271,
0.2789050042629242,
-0.5296359658241272,
0.013152781873941422,
-0.6287222504615784,
0.2251448929309845,
0.6908029317855835,
-0.5460246205329895,
0.03491567075252533,
... | |
blocky - as if it still has the jaggie edges but against a black background.
Is this some bug with .Net/GDI+? I've already found that it fails for even index transparencies for gifs, so I don't have much confidence it it.
This image shows the two ways this goes wrong:
 image );
``` | [
0.03277094289660454,
-0.16231316328048706,
0.2892189025878906,
-0.27444711327552795,
0.16657720506191254,
0.14803694188594818,
0.46651169657707214,
-0.11279644072055817,
-0.12526488304138184,
-0.5509618520736694,
-0.23143237829208374,
0.6545181274414062,
-0.5615049600601196,
-0.07653334736... | |
I have a method which is given the parameter "bool sortAscending". Now I want to use LINQ to create sorted list depending on this parameter. I got then this:
```
var ascendingQuery = from data in dataList
orderby data.Property ascending
select data;
var descendingQuery = fr... | [
-0.37487438321113586,
-0.09602019190788269,
0.6233487725257874,
-0.21895530819892883,
-0.14942479133605957,
0.018642932176589966,
-0.11549000442028046,
-0.41093888878822327,
-0.5060421228408813,
-0.5405668020248413,
-0.07383386045694351,
0.1199270710349083,
-0.34710463881492615,
0.41447865... | |
orderby data.Property descending
select data;
```
As you can see, both queries differ only in "ascending" resp. "descending". I'd like to merge both queries, but I don't know how. Does anyone have the answer?
You can easily create your own extension method on IEnumerable or IQueryable:
```
publ... | [
-0.3055805265903473,
-0.18461650609970093,
0.662172257900238,
0.11275257170200348,
0.11379505693912506,
0.10143999010324478,
0.15375879406929016,
-0.0896158218383789,
-0.24828262627124786,
-0.6466057300567627,
-0.13743644952774048,
0.433680921792984,
-0.15819966793060303,
0.407261222600936... | |
? source.OrderByDescending(keySelector)
: source.OrderBy(keySelector);
}
public static IOrderedQueryable<TSource> OrderByWithDirection<TSource,TKey>
(this IQueryable<TSource> source,
Expression<Func<TSource, TKey>> keySelector,
bool descending)
{
return descending ? source.Order... | [
-0.5229958891868591,
0.07682295888662338,
0.5729604363441467,
0.041911181062459946,
-0.006210625637322664,
0.051215000450611115,
0.395988404750824,
0.014199985191226006,
-0.17411160469055176,
-0.46427300572395325,
-0.24672193825244904,
0.703762948513031,
-0.3782864809036255,
0.158733025193... | |
anyway in this case. Query expressions are great for complex things, but if you're only doing a single operation it's simpler to just put that one operation:
```
var query = dataList.OrderByWithDirection(x => x.Property, direction);
``` | [
0.06332526355981827,
-0.022358836606144905,
0.29211220145225525,
0.006298570893704891,
-0.004708581604063511,
-0.04686949774622917,
0.17027027904987335,
-0.21125102043151855,
-0.22791102528572083,
-0.40492695569992065,
-0.2242479771375656,
0.42201659083366394,
-0.29695451259613037,
0.06484... | |
Is there a tool that can generate sequence diagrams from running .NET code?
[Enterprise Architect](http://www.sparxsystems.com/) will generate sequence diagrams from running code. You set break points where you want your diagramming to begin and end and then run the code and it will give you a sequence diagram of the c... | [
0.45868587493896484,
0.021808728575706482,
0.22186487913131714,
0.13510076701641083,
0.1272885948419571,
0.00396603811532259,
-0.057207439094781876,
-0.14680832624435425,
-0.3304557204246521,
-0.6810104846954346,
0.008842701092362404,
0.4994058310985565,
-0.20398661494255066,
0.06924344599... | |
I have a relationship between two tables, authors and styles.
Every author is associated with a style, with the special case where an author doesn't have a style (IS NULL).
There's no problem in setting the reference to NULL, but there's a problem doing a query to select the authors and styles.
For example, the query... | [
0.26687249541282654,
0.21200089156627655,
0.33141183853149414,
0.13857239484786987,
-0.15150988101959229,
-0.08610499650239944,
-0.07564561069011688,
-0.1471148580312729,
0.01976342685520649,
-0.6199249625205994,
0.16505292057991028,
0.39376235008239746,
-0.24111472070217133,
0.28204745054... | |
some reasons).
There's a solution that doesn't include explicit joins?
The most obvious solution is a LEFT OUTER JOIN.
See: <http://www.postgresql.org/docs/8.1/static/tutorial-join.html>
If you don't want to use explicit joins you should be able to use a UNION
```
SELECT "authors"."id", "authors"."name", "styles"."... | [
0.11053396016359329,
-0.14084045588970184,
0.5654198527336121,
0.09361541271209717,
0.059698816388845444,
-0.18506482243537903,
0.06575477868318558,
-0.1697436422109604,
-0.30289626121520996,
-0.3780112564563751,
-0.1592237800359726,
0.4653155207633972,
-0.5407740473747253,
0.1920457333326... | |
I just answered a [question](https://stackoverflow.com/questions/388699/security-problems-with-net-platform#388764) where I said that while string interning is good it can be a security problem since a strings value can be easily accessed later on.
And while I'm quite sure this is true :-) I am not sure how easy it r... | [
0.16946296393871307,
0.022521939128637314,
0.24909937381744385,
0.1954999566078186,
-0.11478380858898163,
-0.10000211000442505,
0.48384106159210205,
-0.14001619815826416,
-0.4225527048110962,
-0.5370211005210876,
0.030707867816090584,
0.489289790391922,
-0.18915370106697083,
0.045503035187... | |
or is there a method like AppDomain.GetInteredStringsList()?
And related to that: How easy is it really to get any useful data from intered strings. Is it really a security hole to store sensitive data in strings?
It's not particularly easy - but it's doable.
Basically, if you've got anything which can take a memory... | [
0.13237227499485016,
-0.08255387097597122,
-0.20917321741580963,
0.25454097986221313,
-0.1494685858488083,
-0.3898864686489105,
0.249564528465271,
0.09639598429203033,
-0.3330906331539154,
-0.5026673078536987,
0.024114608764648438,
0.2412819117307663,
-0.22896598279476166,
0.16090191900730... | |
like *all* strings are interned - only string constants, and strings which the user explicitly interns. | [
0.3622424900531769,
0.24865086376667023,
0.022592579945921898,
-0.08831316232681274,
-0.04188784956932068,
-0.32894518971443176,
0.39755088090896606,
0.40496280789375305,
-0.22597436606884003,
-0.31399786472320557,
-0.5397239923477173,
0.18662402033805847,
-0.44138303399086,
0.193927288055... | |
EDIT: minor fixes (virtual Print; return mpInstance) following remarks in the answers.
I am trying to create a system in which I can derive a Child class from any Base class, and its implementation should replace the implementation of the base class.
All the objects that create and use the base class objects shouldn'... | [
0.16521179676055908,
0.10889644175767899,
0.11436781287193298,
0.1493862122297287,
0.004390984307974577,
0.13679245114326477,
0.2821243703365326,
-0.20275135338306427,
-0.24620462954044342,
-0.6303171515464783,
-0.0892854556441307,
0.49294325709342957,
-0.4253932535648346,
0.51085877418518... | |
the Child classes to be done just in one place.
Here is my implementation:
```
class CAbstractFactory
{
public:
virtual ~CAbstractFactory()=0;
};
template<typename Class>
class CRegisteredClassFactory: public CAbstractFactory
{
public:
~CRegisteredClassFactory(){};
Class* CreateAndGet()
{
pC... | [
-0.06358247250318527,
-0.16423752903938293,
0.5827356576919556,
0.07877597957849503,
0.3290996551513672,
0.4839140772819519,
0.38226252794265747,
-0.24114802479743958,
0.08903181552886963,
-0.903207540512085,
0.04839485511183739,
0.6308316588401794,
-0.28694748878479004,
0.4093140065670013... | |
return mRegisteredClasses[sClassName];
}
void RegisterClass(const string & sClassName, CAbstractFactory* pConcreteFactory);
private:
map<string, CAbstractFactory* > mRegisteredClasses;
};
// Here I hold the data about all the registered classes. I hold statically one object of this class.
// in this examp... | [
0.11987213790416718,
0.20173588395118713,
0.43739214539527893,
-0.07718959450721741,
0.16351313889026642,
0.2256757616996765,
0.20770178735256195,
-0.36800849437713623,
-0.1844518780708313,
-0.6135818362236023,
-0.0953051894903183,
0.46391454339027405,
-0.40124350786209106,
0.3571505248546... | |
mRegisteredClasses.RegisterClass("CBaseClass", & mChildClassFactory);
mRegisteredClasses.RegisterClass("CFooBaseClass", & mFooChildClassFactory);
};
CRegisteredClasses* GetRegisteredClasses(){return &mRegisteredClasses;};
private:
CRegisteredClasses mRegisteredClasses;
... | [
0.026160145178437233,
0.47836101055145264,
0.36373332142829895,
-0.28211215138435364,
0.2625720202922821,
0.1909988671541214,
0.33870914578437805,
-0.4870445728302002,
-0.29305794835090637,
-0.49696528911590576,
-0.3768865764141083,
0.44723451137542725,
-0.44707760214805603,
0.489075183868... | |
another class.
class CBaseClass
{
public:
static CBaseClass* Create()
{
CRegisteredClasses* pRegisteredClasses = StaticRegistrationData.GetRegisteredClasses();
if (pRegisteredClasses->find("CBaseClass"))
{
CRegisteredClassFactory<CBaseClass>* pFac =
dynamic_c... | [
0.01723291724920273,
-0.18013031780719757,
0.06466566771268845,
-0.21557855606079102,
-0.1900801807641983,
0.26554447412490845,
0.17473095655441284,
-0.6319456696510315,
-0.4570104479789734,
-0.7581800818443298,
0.03187193721532822,
0.2577865719795227,
-0.725143551826477,
0.261863917112350... | |
else
{
mpInstance = new CBaseClass;
}
return mpInstance;
}
virtual void Print(){cout << "Base" << endl;};
private:
static CBaseClass* mpInstance;
};
class CChildClass : public CBaseClass
{
public:
void Print(){cout << "Child" << endl;};
private:
};
```
Using this... | [
0.21201841533184052,
-0.05364733189344406,
0.2749476134777069,
-0.28284069895744324,
0.3483099639415741,
0.2492591142654419,
0.10917265713214874,
-0.579296886920929,
-0.38749855756759644,
-0.5756921768188477,
-0.002046040026471019,
0.38450366258621216,
-0.6326320171356201,
0.33487132191658... | |
of this design? Did I complicate things too much and it can be done easier? And is it OK that I create a template that inherits from an abstract class?
I had to use dynamic\_pointer (didn't compile otherwise) - is it a hint that something is wrong?
Thank you.
This sort of pattern is fairly common. I'm not a C++ expe... | [
0.5315041542053223,
0.04667147621512413,
-0.18265093863010406,
0.09038900583982468,
-0.04814959317445755,
-0.13152895867824554,
0.34985142946243286,
-0.10099545866250992,
-0.4417860507965088,
-0.6726587414741516,
0.28202053904533386,
0.37874001264572144,
-0.5254921913146973,
0.229229152202... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.