text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Handler(T object) {
this.object = object;
}
@Override
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable {
synchronized (object) {
return method.invoke(object, | [
0.39448633790016174,
-0.4396132528781891,
-0.10216899961233139,
-0.07633950561285019,
-0.11323420703411102,
-0.010277843102812767,
0.4656308889389038,
-0.22564730048179626,
-0.03383443504571915,
-0.1666574627161026,
-0.17989805340766907,
0.4932619631290436,
-0.7123814225196838,
0.243258595... | |
args);
}
}
}
}
```
This code is not tested, by the way. Use at your own risk. | [
0.26705411076545715,
0.23070822656154633,
0.18077175319194794,
-0.01977417804300785,
0.12902313470840454,
-0.3583219051361084,
0.6067194938659668,
-0.2549886405467987,
-0.1704404354095459,
-0.5017926096916199,
-0.050812773406505585,
0.6557164788246155,
-0.541228175163269,
-0.13355773687362... | |
Is it good to send stack allocated object as a pointer parameter to some other function?
Yes, but the more common C++ idiom for this situation is to use a reference (and probably a const rreference) instead of a pointer. So instead of
```
void foo( sometype * p ) {
p->func();
}
```
you write:
```
void foo( somet... | [
0.15055303275585175,
0.14223334193229675,
0.44366455078125,
-0.2666153311729431,
-0.02278837189078331,
-0.1734253615140915,
0.13830766081809998,
-0.13805609941482544,
-0.12634138762950897,
-0.18945379555225372,
-0.1886613667011261,
0.6915128827095032,
-0.6845939755439758,
-0.09637250006198... | |
function to take ownership of the object. | [
0.023407787084579468,
-0.21610158681869507,
-0.19465509057044983,
0.05669790133833885,
-0.607738196849823,
0.009939235635101795,
0.29093196988105774,
0.2004697024822235,
0.23498521745204926,
-0.3329039216041565,
-0.5023619532585144,
0.5119090676307678,
-0.4007335603237152,
-0.0128560299053... | |
I am developing an asp.net website that will need regular updates for source codes and HTML sides. After i have completed the necessary updates, i use the 'publish website tool' and publish the site to my local directory. Then i upload all files to Remote File.
Is there any way to fix my site with just changed fil... | [
0.6455780267715454,
0.15382571518421173,
0.4138418138027191,
-0.1046227514743805,
-0.27707064151763916,
-0.1340618133544922,
0.20260600745677948,
-0.07805909961462021,
-0.44912806153297424,
-0.7645784616470337,
-0.11099682003259659,
0.5056156516075134,
-0.07255802303552628,
-0.180921673774... | |
you are probably doing everything just fine for a Visual Studio Website project. When I'm working with a website rather than a web application, I will only FTP the files that have changed. For example, if I were to change some HTML tags around within an .aspx page, then only that page would need to be uploaded to the w... | [
0.7166516780853271,
-0.11748303472995758,
0.4368075430393219,
0.01496852282434702,
-0.13280194997787476,
-0.21694795787334442,
0.0074867261573672295,
0.09657864272594452,
-0.6298954486846924,
-0.8308396339416504,
0.03050783835351467,
0.6043612360954285,
-0.29528626799583435,
-0.05846998468... | |
upload the changed files. So after you use visual studio to publish your website, you can grab the entire contents of that directory and drag it over to the FTP server location and only update what has changed. | [
0.637518048286438,
-0.11719287931919098,
0.4493842124938965,
0.17605119943618774,
0.016917113214731216,
-0.17569012939929962,
0.022419335320591927,
0.24814379215240479,
-0.39494168758392334,
-0.7350738048553467,
-0.16822443902492523,
0.45174071192741394,
-0.23192507028579712,
0.20154684782... | |
What are the best practices for exceptions over remote methods?
I'm sure that you need to handle all exceptions at the level of a remote method implementation, because you need to log it on the server side. But what should you do afterwards?
Should you wrap the exception in a RemoteException (java) and throw it to th... | [
0.255375474691391,
0.1470603197813034,
-0.15686027705669403,
0.14827479422092438,
0.060115523636341095,
-0.335798054933548,
0.27012547850608826,
-0.13257427513599396,
-0.414976567029953,
-0.4238012731075287,
0.1697389781475067,
0.43599575757980347,
-0.3149886131286621,
0.06726551055908203,... | |
should you log on the client? I've even heard of using return codes(for efficiency maybe?) to tell the caller about what happened.
The important thing to keep in mind, is that the client **must** be informed of what went wrong. A generic answer of "Something failed" or no notification at all is unacceptable. And what ... | [
0.43279972672462463,
-0.004347848240286112,
0.04401177912950516,
0.1602105051279068,
0.04110722243785858,
-0.11545225232839584,
0.541721761226654,
-0.19600023329257965,
-0.4990231990814209,
-0.37530460953712463,
0.04460194334387779,
0.6125816106796265,
-0.3753376305103302,
-0.0914288908243... | |
it won't contain all the details of the caught Exception, because the client doesn't need them. They have already been logged on the server side. Now, on the client, these Exceptions can be handled how the user wishes.
Why I chose using Exceptions and not return codes is because of one very important drawback of retur... | [
0.246792271733284,
0.18126270174980164,
0.06209951266646385,
0.24881933629512787,
0.06712926924228668,
-0.13580222427845,
0.32093074917793274,
-0.040114112198352814,
-0.3370935618877411,
-0.5332334041595459,
0.07087969779968262,
0.5068249106407166,
-0.2717949151992798,
-0.04029011353850365... | |
I have been trying to register 3 hotkeys.
I followed [this](http://209.85.229.132/search?q=cache:SxqcrRMN6zAJ:www.delphi3000.com/articles/article_3529.asp+GetShortCutKey+GetShortCutModifier&cd=3&hl=en&ct=clnk&gl=de&client=firefox-a) example (or [this](http://www.delphi3000.com/articles/article_3529.asp)).
The code is ... | [
0.08313806354999542,
0.15460677444934845,
0.4364131987094879,
-0.21698004007339478,
-0.05027465522289276,
-0.03811720013618469,
0.617228090763092,
-0.4436715245246887,
-0.11706894636154175,
-0.6074564456939697,
-0.3748822808265686,
0.3628682494163513,
-0.5319840312004089,
-0.08792909979820... | |
RegisterHotShortCut(const h:THandle; const Atom: integer; const ShortCut: TShortCut): Boolean;
VAR
key : Word;
Shift: TShiftState;
begin
Windows.UnregisterHotKey(h, Atom);
ShortCutToKey(ShortCut, key, shift);
Result:= RegisterHotKey(h, Atom, ShiftState2Modif... | [
-0.0460222102701664,
-0.09191887825727463,
0.4386287033557892,
-0.22553275525569916,
0.26022863388061523,
0.16377632319927216,
0.5062689185142517,
-0.2169005274772644,
-0.09253417700529099,
-0.42218783497810364,
-0.584526002407074,
0.5328765511512756,
-0.46277672052383423,
-0.1028633937239... | |
I declared everything right but the last hotkey takes control over (unregisters) the others.
Or saying it in other way, pressing the key combination for the for first registered shortcuts do not make the program to enter the `TFrmSettings.HotyKeyMsg(VAR msg: TMessage)` procedure.
Any hints?
Thanks.
---
Edit1:
1. T... | [
0.15006503462791443,
-0.0134424502030015,
0.30198538303375244,
0.07914991676807404,
-0.10659308731555939,
-0.06876759231090546,
0.6678653359413147,
0.09076739102602005,
-0.17189885675907135,
-0.5076822638511658,
-0.1598116159439087,
0.551327645778656,
-0.4114883840084076,
-0.09799520671367... | |
and 3, the code works. If I use 4,5,6, the code fails again.
Problem (semi) solved.
SOLVED The above code fails ONLY if I use the "GlobalAddAtom" function. If instead of atoms I use just numbers 1, 2 and 3, the code works. If I use 4,5,6, the code fails again. Problem (semi) solved. | [
-0.2234780639410019,
0.2720423936843872,
0.36204618215560913,
-0.1388629525899887,
-0.24470925331115723,
0.3805297017097473,
0.6337811350822449,
-0.3226282000541687,
-0.1200009435415268,
-0.6221836805343628,
-0.19704771041870117,
0.3900099992752075,
-0.41435861587524414,
0.0936122387647628... | |
A while ago we started developing a new project which internally has about 25-30 different classes/types/models that are heavily related to each other either via 1:n, n:m or n:1 relationships.
Back then we went with a native .net oodbms system basically because what it allowed us to do was to take our object model and... | [
0.06510923057794571,
0.14428842067718506,
0.025957664474844933,
0.20753371715545654,
0.003347120014950633,
-0.049461908638477325,
0.3011232912540436,
0.10618662089109421,
-0.0957200676202774,
-0.5725331902503967,
0.193393737077713,
0.42305073142051697,
-0.22309613227844238,
0.2179959714412... | |
scalability issues on the horizon and license fees have almost increased by a factor of 5 for us with no change on our end (they got bought by big inc.).
Therefore we're currently starting to look for a long-term solution in terms of scalability/performance as well as maintenance. We had a look at other "real" oodbms'... | [
0.1676263064146042,
0.23159348964691162,
0.531014621257782,
0.23035292327404022,
0.15273168683052063,
-0.3267713189125061,
0.17921672761440277,
0.19699779152870178,
-0.4676049053668976,
-0.5300800800323486,
-0.07071677595376968,
0.23596060276031494,
-0.19371797144412994,
0.2651097774505615... | |
does anyone have any real-world experience with Microsoft's Entity Framework or any other .NET ORM that keeps configuration as maintainable as possible as well as performs well in closely/heavily related entities? The amount of data we store is not amazing or extensive in any sort (we expect a total of 100k instances a... | [
0.025170624256134033,
-0.020742902532219887,
-0.09554288536310196,
0.349176824092865,
-0.30374854803085327,
-0.1533825397491455,
0.09866085648536682,
0.14881402254104614,
-0.3442170023918152,
-0.46283888816833496,
0.22472263872623444,
0.49151450395584106,
-0.08778161555528641,
0.1951464563... | |
good choice. Here's why:
1. You won't have to make (m)any additions / changes to your domain model classes to support persistence. NHibernate goes a long way towards supporting persistence ignorance in your domain model, although you may find you need make some minor changes such as marking more methods / properties a... | [
-0.10306807607412338,
-0.18862882256507874,
0.2420351207256317,
0.2090027928352356,
-0.3856702744960785,
-0.24903042614459991,
0.4927261471748352,
0.03606536239385605,
-0.09326041489839554,
-0.8566206097602844,
0.11022758483886719,
0.7223060727119446,
-0.18092377483844757,
0.09382089972496... | |
the hbm2ddl tool with standard NHibernate mapping files. This also helps, of course, with maintainability - changes to your object model can be quickly reflected in your database schema.
3. Using fluent NHibernate for mapping helps to make the initial mapping quite fast as you get autocomplete and a simplified mapping ... | [
-0.11596617102622986,
0.10829930752515793,
0.43824639916419983,
-0.004855375271290541,
-0.5686331987380981,
-0.4449748694896698,
0.38681337237358093,
-0.2849385142326355,
-0.1049482449889183,
-0.7536519765853882,
-0.17255139350891113,
0.5981193780899048,
-0.2652721703052521,
-0.03118835575... | |
for the most part.
Using Entity Framework for this will be more challenging. While entity framework is a capable ORM in many respects, it is not as mature as NHibernate and there are a few reasons in this case specifically why I think it's probably not the best choice:
1. You will have to make a lot of changes to you... | [
-0.02986726351082325,
-0.07809671759605408,
0.18492627143859863,
0.12064666301012039,
-0.2130713015794754,
-0.2588609755039215,
0.011800745502114296,
-0.17909502983093262,
0.12896022200584412,
-0.5911332964897156,
0.2921668589115143,
0.6717919707298279,
-0.23611223697662354,
0.293435305356... | |
inheritance requirement may or may not be a problem for you depending on your existing object model. You could avoid this by supporting [some interfaces](http://msdn.microsoft.com/en-us/library/bb738631.aspx) in your code but this is non-trivial and I think you will lose a lot of the built in tooling support for managi... | [
0.060439370572566986,
-0.044084206223487854,
0.06419496983289719,
0.21105164289474487,
-0.2517794072628021,
-0.6016709804534912,
0.1567939668893814,
-0.08784095197916031,
-0.2583436667919159,
-0.6220813989639282,
0.24919776618480682,
0.7582074403762817,
-0.387199729681015,
0.08467593789100... | |
OODBMS, and it is supported by most other ORM's (including NHibernate of course), but with entity framework you will find that you need to explicitly .Load() related objects (both parent and child relationships) before you reference them in your code. There are workarounds for this (e.g. [this one](http://blogs.msdn.co... | [
-0.26988109946250916,
-0.013064619153738022,
0.4294169247150421,
0.04937705770134926,
0.06707742810249329,
-0.08362086117267609,
-0.14002539217472076,
-0.011099410243332386,
-0.2802748382091522,
-0.34022387862205505,
-0.03745279461145401,
0.3911178708076477,
-0.2707740068435669,
0.04339449... | |
offerings such as [Lightspeed](http://www.mindscape.co.nz/products/LightSpeed/) - I have little experience with this particular tool myself (customers generally object to paying for an ORM when there are good free alternatives) but it is highly regarded. | [
0.35256877541542053,
-0.16799014806747437,
0.33315184712409973,
-0.01199907436966896,
-0.20424345135688782,
-0.044868480414152145,
-0.06855245679616928,
0.1204468309879303,
0.04935207962989807,
-0.2587827146053314,
0.18543824553489685,
0.40303221344947815,
0.5620784759521484,
-0.2246800810... | |
I need a min-heap implemented as a binary tree. Really fast access to the minimum node and insertion sort.
Is there a good implementation in stl or boost that anyone can point me too?
I think [std::priority\_queue](http://en.cppreference.com/w/cpp/container/priority_queue) is what you are looking for. | [
-0.0021815942600369453,
-0.20085620880126953,
0.1688830703496933,
0.2272021621465683,
0.09735020250082016,
0.05400113761425018,
-0.15781858563423157,
0.36925971508026123,
-0.29208821058273315,
-0.6319301128387451,
-0.06794534623622894,
0.27098289132118225,
0.1830376535654068,
-0.0004260212... | |
Microsoft has been aggresively pitching for usage of Team Foundation Server. The VSS population in our organization is pretty huge. I am trying to find the absolute must reasons for the transition. And nothing scares more from the fact that VSS 6.0/ 2005 would go bust in 20XX.
THe MSDN site still runs the 2004 update ... | [
0.2169284224510193,
0.009352900087833405,
0.3105829358100891,
0.07921288907527924,
-0.17817051708698273,
-0.11664361506700516,
0.4570615291595459,
0.16159510612487793,
-0.14601460099220276,
-0.5172311067581177,
-0.007131447084248066,
0.4066181182861328,
-0.037668514996767044,
0.13996917009... | |
2005 that I'm aware of seems to be the [2005 GDR package](http://blogs.msdn.com/richardb/archive/2007/06/06/list-of-bugs-fixed-in-sourcesafe-2005-gdr.aspx), which was released in 2007. Although I stopped using SourceSafe at around that time and switched to subversion (never looked back since then). | [
-0.17918816208839417,
0.03834531828761101,
-0.03955463320016861,
-0.013529968447983265,
-0.479287326335907,
-0.2612953186035156,
0.11260733753442764,
0.012318920344114304,
-0.4406595528125763,
0.014793358743190765,
-0.03354034945368767,
0.6095616817474365,
-0.48835957050323486,
-0.24978287... | |
I have a pool of threads which are fed tasks from a queue. Generally, a small number of threads are able to keep the queue empty. Occasionally, a particularly large burst of events will keep the queue size above zero for some time, but not for long.
My concern is regarding events that are duplicates or carry data that... | [
0.47390180826187134,
0.06702414155006409,
-0.08508260548114777,
0.16997505724430084,
0.2864654064178467,
0.16526713967323303,
0.06200973317027092,
0.07132792472839355,
-0.4965759813785553,
-0.5686044096946716,
0.2206117957830429,
0.33302241563796997,
-0.13198712468147278,
0.338130593299865... | |
good way to conflate such a queue? I could conflate at insertion time by iterating from back to head and searching for a candidate to replace, however this seems too brute-force. If you have code or library recommendations, please keep in mind that I am using Java.
Why not just implement hashCode() and equals() based o... | [
-0.17990906536579132,
0.21166379749774933,
0.18192651867866516,
-0.06882588565349579,
-0.05202537402510643,
0.22675466537475586,
0.09370137006044388,
-0.11301613599061966,
-0.41005945205688477,
-0.8381685018539429,
0.20292602479457855,
0.28696438670158386,
-0.5418192148208618,
0.1623004674... | |
We get
"The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state."
message when we close the application. Can anyone tell me how to fix it? We know it is communication channel trying to close but it is not able to close due to service ... | [
0.221395805478096,
0.40302565693855286,
0.6929840445518494,
0.12683174014091492,
0.07513774931430817,
-0.041968364268541336,
0.46901828050613403,
0.03368454799056053,
-0.2739371061325073,
-0.4662991166114807,
-0.4335801303386688,
0.5290554761886597,
-0.4071713387966156,
0.46514931321144104... | |
exception, including all InnerException instances. You should catch the exception, display ex.ToString(), then rethrow the exception with "throw":
```
try {
// Do whatever causes the exception
} catch (Exception ex) {
Console.WriteLine(ex.ToString()); // Or Debug.Print, or whatever
throw; // So exception ... | [
0.13841605186462402,
-0.00705717084929347,
0.24942104518413544,
-0.18929030001163483,
-0.04328214377164841,
-0.2937365770339966,
0.45422863960266113,
-0.14074791967868805,
-0.0894920825958252,
-0.6698055863380432,
-0.06910843402147293,
0.4779829680919647,
-0.3490901291370392,
0.21877245604... | |
block. Instead, you need to do it by hand. See <http://web.archive.org/web/20100703123454/http://old.iserviceoriented.com/blog/post/Indisposable+-+WCF+Gotcha+1.aspx>.
Also, see "[What is the best workaround for the WCF client `using` block issue?](https://stackoverflow.com/questions/573872/what-is-the-best-workaround-... | [
0.20366445183753967,
0.0633460134267807,
0.15248499810695648,
-0.11851963400840759,
-0.3275977075099945,
-0.11608473211526871,
0.4048926532268524,
-0.5110169649124146,
-0.45424628257751465,
-0.48988762497901917,
-0.4301024079322815,
0.19079966843128204,
-0.49769628047943115,
-0.10043431073... | |
do you guys know how can i determine from what file was a function called inside of that function?
I was thinking of using debug\_backtrace .. but that does not look as an elegant way to do it, and they also enumarate other reasons in another question [here](https://stackoverflow.com/questions/346703/php-debugbacktrac... | [
0.1345515102148056,
0.29773223400115967,
0.1392543911933899,
0.16762800514698029,
0.06533708423376083,
0.11655867099761963,
0.3352528214454651,
-0.21153806149959564,
-0.331633985042572,
-0.20143431425094604,
0.0394052118062973,
0.7045146226882935,
-0.1292017102241516,
0.030134117230772972,... | |
always have the same value. The function in which scope `f` is declared. | [
0.30877694487571716,
0.1187189593911171,
0.47028598189353943,
-0.08612129092216492,
0.0697813332080841,
-0.23800569772720337,
0.160801962018013,
-0.023556405678391457,
-0.019039617851376534,
-0.33355510234832764,
-0.41384851932525635,
0.6422666907310486,
-0.3602834641933441,
0.069056496024... | |
Sometimes when I open a modal window in my Delphi application it takes a while to show up, then I notice that the application is kind of blocked, and what happened was that the modal form was open with ShowModal but wasn't displayed and the application became locked as if the Modal Window was in the first layer.
Usual... | [
0.23232880234718323,
-0.13354602456092834,
0.33842772245407104,
0.11511153727769852,
-0.3027728796005249,
-0.5050649642944336,
0.555767297744751,
0.27396783232688904,
-0.11288782954216003,
-0.6472951769828796,
-0.12998461723327637,
0.7381893396377563,
-0.3869284987449646,
0.062601000070571... | |
from happening?
Thanks.
**\* EDIT \***
Apparently setting Application.MainFormOnTaskbar := True solved the problem, but it is still too early to jump to conclusions because this happens randomly.
**\* EDIT 2 \***
ModalFormOnTaskbar didn't solve the problem, after that I tried setting PopupMode = pmAuto , but that ... | [
0.03590134531259537,
-0.03175230696797371,
0.9245114326477051,
0.12696979939937592,
0.2699468731880188,
-0.23568753898143768,
0.6037158370018005,
0.241310715675354,
-0.3303554058074951,
-0.49256524443626404,
-0.19125068187713623,
0.703899085521698,
-0.4013782739639282,
0.3260951638221741,
... | |
the value of the related PopupMode property.
If you set the modal form's PopupParent to the form that's active just before you call ShowModal, that may help. | [
-0.15489590167999268,
-0.22716550529003143,
0.5350915193557739,
-0.025920158252120018,
-0.17803150415420532,
-0.1710434854030609,
0.17929194867610931,
0.25451645255088806,
-0.017775626853108406,
-0.4052826762199402,
-0.5742091536521912,
0.9129667282104492,
-0.172248974442482,
-0.0579583831... | |
I was wondering if there was a better way of handling the case in C where you want to exit a function as soon as you encounter an error in a series of expressions. (in this case, its a function that returns a NULL on error)
e.g. in some C code where they tried to short circuit error handling by combining a series of s... | [
0.29808565974235535,
0.23411111533641815,
-0.06616351008415222,
-0.1585473269224167,
-0.02901732176542282,
0.049637384712696075,
0.6177356839179993,
-0.3138529360294342,
-0.03726201131939888,
-0.27990445494651794,
-0.047670841217041016,
0.4622967541217804,
-0.3170408606529236,
0.2209200859... | |
guess the alternative is
```
if (!(value = doSomething()))
return NULL;
if (!(value = doSomething2()))
return NULL;
etc
return value;
```
But what about short circuit error evaluation that I've seen in perl and bash scripts..
```
int die(int retvalue) {
exit(retvalue);
}
.....
(value = doSomething()) ||... | [
0.29641008377075195,
-0.12004008889198303,
0.5265709757804871,
-0.17384082078933716,
0.09251665323972702,
-0.08803992718458176,
0.6224861741065979,
-0.6646398305892944,
-0.038420166820287704,
-0.3379664719104767,
-0.05215037614107132,
0.7327091693878174,
-0.26017776131629944,
-0.0206506159... | |
first example. The problem is that you need to be careful if you decide to add another expression in the middle.
I've seen the use of GOTOs in C for this exact purpose.
Because there isn't a 'finally' construct in C, a method was needed to free all your memory even if you were exiting a function early.
So it's essen... | [
0.18239404261112213,
-0.13258472084999084,
0.1642751693725586,
-0.14766764640808105,
0.3242005407810211,
-0.33194461464881897,
0.352375864982605,
-0.4036761522293091,
-0.050436340272426605,
-0.4700751304626465,
-0.27102574706077576,
0.47315746545791626,
-0.15109345316886902,
0.012075548991... | |
GOTO Failure;
if(!DoSomething3())
GOTO Failure;
/* return success */
return true;
Failure:
/* release allocated resources */
/* print to log if necessary */
return false;
}
```
**Important note**
Do not use GOTOs for execution flow. They should only be used on error, and only t... | [
0.22924932837486267,
-0.025977641344070435,
0.17042605578899384,
0.10892710834741592,
0.04772304743528366,
0.005434900056570768,
0.6664895415306091,
-0.46133527159690857,
-0.28440675139427185,
-0.3534533977508545,
-0.2635886073112488,
0.6286540031433105,
-0.48168352246284485,
0.13454803824... | |
destroy the fabric of reality. Just don't do it.
**EDIT**
As one of the posters noted, using Exit(x) will kill your entire program, which keeps that solution reserved for fatal errors. However your original proposed solution (DS() && DS2() && DS3()) all on one line poses a problem for error handling.
If you wanted ... | [
0.5154086947441101,
0.07536834478378296,
0.26408207416534424,
0.09800822287797928,
-0.009137914516031742,
-0.042421065270900726,
0.8079361915588379,
-0.11008427292108536,
-0.14455284178256989,
-0.7185719013214111,
-0.116771399974823,
0.3203718066215515,
-0.6834827661514282,
0.4103410542011... | |
= DoSomething();
if(result1)
result2 = DoSomething2();
if(result2)
result3 = DoSomething3();
return result1 && result2 && result3;
```
Because this method would not preclude error handling. | [
-0.14350095391273499,
-0.11340183019638062,
0.5901996493339539,
-0.4328000843524933,
0.05346345528960228,
0.016380947083234787,
0.4120314419269562,
-0.9327409267425537,
0.0237034410238266,
-0.19490499794483185,
-0.0893954411149025,
0.7380027174949646,
-0.23845674097537994,
-0.0829148590564... | |
I have an image that the user can zoom/scroll.
I want to draw some rectangles/circles on a different layer (for example: drawing a circle for each person's face that was identified in the picture).
The rectangle position is relative to the image.
How do I create such an overlay?
I have managed to do something simila... | [
0.288702130317688,
-0.06341156363487244,
0.5838695168495178,
0.1250438243150711,
-0.0595763735473156,
0.13054336607456207,
-0.07633302360773087,
-0.2434062361717224,
-0.14640265703201294,
-0.8958528637886047,
0.1508285105228424,
0.15795500576496124,
-0.08942991495132446,
0.1255664378404617... | |
Width="{Binding ElementName=imageControl, Path=Width}"
Height="{Binding ElementName=imageControl, Path=Height}"
ItemContainerStyle="{StaticResource rectStyle}"
PreviewMouseMove="ItemsControl_PreviewMouseMove"
PreviewMouseDown="ItemsControl_PreviewMouseDown"
PreviewMouseUp="ItemsC... | [
-0.06907383352518082,
-0.5005381107330322,
0.35557809472084045,
0.008512151427567005,
-0.47028037905693054,
0.1442219465970993,
0.20238538086414337,
-0.3918418884277344,
-0.14710333943367004,
-0.6688581705093384,
-0.1795983910560608,
0.2609710693359375,
0.1996167004108429,
-0.0968873351812... | |
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
....
</ItemsControl>
``` | [
-0.05368063971400261,
0.13974793255329132,
0.15561543405056,
-0.056118667125701904,
-0.21418160200119019,
0.4470030665397644,
-0.11718130111694336,
0.04821749031543732,
-0.5544195771217346,
-0.7958243489265442,
-0.21334512531757355,
-0.07185766845941544,
0.22974200546741486,
0.121731720864... | |
I've a xml file in which I'm storing some HTML content in an element tag called `<body>`. Now I'm trying to read all the HTML content of body tag using XML DOM in JavaScript.
I tried this code:
```
var xmlDoc=loadXMLDoc('QID_627.xml');
var bodytag = xmlDoc.getElementsByTagName("body");
document.write(bodytag);
```
... | [
0.5874408483505249,
0.05217811092734337,
0.4495673179626465,
-0.13915963470935822,
-0.31070759892463684,
0.04577195271849632,
0.08343033492565155,
-0.649509608745575,
-0.17571932077407837,
-0.5289071798324585,
-0.11296137422323227,
0.4628361165523529,
-0.3195970952510834,
-0.07014574855566... | |
try to serialize out the content of the body tag with
```
document.write(bodytag[0].innerHTML);
```
Better yet would be directly attaching the source DOM nodes into your destination DOM.
You'd use something like
```
document.getElementById("destinationNodeId").appendChild(bodytag[0]);
```
There may be some iss... | [
0.4073807895183563,
-0.28827762603759766,
0.4930962920188904,
0.1411570906639099,
0.09425441920757294,
-0.3020783066749573,
0.26436689496040344,
-0.23760564625263214,
-0.03304766118526459,
-0.6375976204872131,
-0.2924383580684662,
0.7083333134651184,
-0.1877617985010147,
0.1283942312002182... | |
ActiveRecord objects of the class 'Location' (representing the db-table Locations) have the attributes 'url', 'lat' (latitude) and 'lng' (longitude).
Lat-lng-combinations on this model should be unique. The problem is, that there are a lot of Location-objects in the database having duplicate lat-lng-combinations.
I ... | [
-0.08192313462495804,
-0.08173010498285294,
0.43092191219329834,
0.10676957666873932,
0.03197718784213066,
-0.09044774621725082,
0.36270368099212646,
-0.10664337873458862,
-0.24722206592559814,
-0.6699276566505432,
-0.038277462124824524,
0.6009352803230286,
-0.5816768407821655,
0.175217404... | |
thing then I'd just do it in Ruby and not worry too much about efficiency. I haven't tested this thoroughly, check the sorting and such to make sure it'll do exactly what you want before running this on your db :)
```
keep = []
locations = Location.find(:all)
locations.each do |loc|
# get all Locations's with the s... | [
0.1545334905385971,
-0.009313719347119331,
0.39372384548187256,
0.013799050822854042,
0.5034074783325195,
0.012679321691393852,
0.19303572177886963,
-0.20282618701457977,
-0.047814738005399704,
-0.6294048428535461,
0.010934429243206978,
0.32747218012809753,
-0.14233343303203583,
0.22019962... | |
l.lng == loc.lng }
with_urls = same_coords.select { |l| !l.url.empty? }
# decide which list to use depending if there were any urls
same_coords = with_urls.any? ? with_urls : same_coords
# pick the best one
keep << same_coords.sort { |a,b| b.created_at <=> a.created_at }.first.id
end
# only keep unique ids... | [
0.20844273269176483,
0.06878796219825745,
0.33201417326927185,
-0.10725250840187073,
0.32079604268074036,
0.24496982991695404,
0.01181864459067583,
-0.12416941672563553,
-0.20625969767570496,
-0.9773188829421997,
0.0633249431848526,
0.6273664832115173,
-0.2990453839302063,
0.09688958525657... | |
worth the time saved in thinking up something 'better', especially if it's just a one-off. | [
0.3765183091163635,
0.2006155103445053,
-0.08948778361082077,
0.11756305396556854,
-0.18424567580223083,
-0.041200894862413406,
0.21406976878643036,
0.3005041182041168,
0.05418043211102486,
-0.4131802022457123,
0.22362738847732544,
0.1678621768951416,
0.5720489025115967,
-0.140179574489593... | |
If I am hosting a long running application such as a web server within a Common Lisp image, what strategy should I use to manage the garbage collector?
I'm assuming that, by default, the garbage collector is entitled to spend long periods of time sorting out the heap, at times I can't predict. This may impact a partic... | [
0.005859646946191788,
0.24057669937610626,
0.04913688078522682,
0.06279157847166061,
-0.2512449622154236,
-0.38246822357177734,
0.09818614274263382,
-0.03579875826835632,
-0.2641656994819641,
-0.7015509605407715,
-0.08405332267284393,
0.6700942516326904,
-0.29989826679229736,
-0.0608335807... | |
allocation rate of small objects (conses, ...).
There are a few things to consider.
* Precise vs. Conservative GC. I'm not a huge fan of conservative GCs (Boehm etc.) for Lisp. A problem of conservative GCs is that they don't find all garbage. This can be a problem for long running programs and lead to fragmentation ... | [
-0.08836331963539124,
-0.06601817905902863,
0.13041040301322937,
0.36290737986564636,
-0.518024742603302,
-0.3333042860031128,
-0.08046460151672363,
-0.13079260289669037,
-0.023409511893987656,
-0.7212170362472534,
0.006170106120407581,
0.5673999190330505,
-0.4437061548233032,
-0.148939907... | |
memory fragmentation in long running Lisps, a GC that compacts and localizes objects can be useful. A problem sometimes comes up when hashtables need to be rehashed (because the location changes). A copying GC may need more memory (because there is a from and a to space of memory). But when the GC copies the objects fr... | [
-0.3099309802055359,
0.04051123559474945,
-0.03170949965715408,
0.3946074843406677,
-0.21012365818023682,
-0.460208535194397,
-0.128627210855484,
0.003188034053891897,
-0.44788363575935364,
-0.6474884152412415,
-0.3752339482307434,
0.017130171880126,
-0.6315029859542847,
0.2980728149414062... | |
GC. This means that there is a first GC stage that exclusively runs in main memory and gets some support from a memory management unit to identify changed memory regions. Scanning main memory is fast than scanning virtual memory and scanning only changed memory regions reduces the amount of work further. When lots of o... | [
-0.11964095383882523,
0.019671890884637833,
0.3358019292354584,
0.1857103705406189,
-0.011117576621472836,
-0.5051594972610474,
-0.13363787531852722,
0.28274714946746826,
-0.4700469970703125,
-0.642835795879364,
-0.3996717035770416,
-0.07310278713703156,
-0.1309313029050827,
0.506803035736... | |
GCed very often.
* Tuning. GCs of, say, LispWorks and Allegro CL have a lot of tuning knobs. Especially for long-running applications it makes sense to read the manual and for example tune the number of generations, their sizes and other things.
* virtual memory. GC over virtual memory is usually very slow. Avoid that ... | [
-0.06288199126720428,
0.08380021899938583,
0.42841336131095886,
0.38562771677970886,
-0.06106509640812874,
-0.32966727018356323,
-0.07637543231248856,
0.16858235001564026,
-0.3929861783981323,
-0.5333369970321655,
0.06184154376387596,
0.6592267155647278,
-0.22305729985237122,
-0.0986064076... | |
of them is in read buffers for streams. Instead of creating new strings by every read operation, it is useful to use reusable buffers.
* stack allocation. Some Common Lisp allow stack allocation of some data - leaving the block then automatically frees the memory. This assumes then that the memory is no longer referenc... | [
-0.26309913396835327,
0.04751875251531601,
0.27335721254348755,
0.03872770816087723,
-0.14139938354492188,
-0.1851131170988083,
0.08686444163322449,
-0.09316005557775497,
-0.6136392951011658,
-0.4902867078781128,
-0.43969452381134033,
0.20917047560214996,
-0.6382935047149658,
0.06846796721... | |
Lisp implementation runs on the JVM, like ABCL, then it might be able to use a JVM concurrent/parallel GC.
* profiling the memory allocation. If you are not sure where allocation happens and what the GC does, you need to find that out using profiling information.
If your Lisp has a precise generational GC which runs i... | [
-0.014312941581010818,
0.05832039564847946,
0.06719794124364853,
0.2739824950695038,
-0.4905933439731598,
-0.4104364514350891,
0.0031193771865218878,
0.22727710008621216,
-0.30679965019226074,
-0.45333221554756165,
-0.12935717403888702,
0.46505963802337646,
-0.9831152558326721,
-0.12872432... | |
64bit Lisp implementation with more main memory.
Pointers:
* Clozure CL, [Understanding and Configuring the Garbage Collector](http://ccl.clozure.com/manual/chapter15.html)
* CMUCL, [Garbage Collection](http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#toc30)
* LispWorks, [Storage Management](http://w... | [
-0.6476178169250488,
0.21330668032169342,
0.42418497800827026,
0.07631979137659073,
-0.23605898022651672,
0.41287532448768616,
-0.12117937207221985,
-0.28220513463020325,
-0.5311632752418518,
-0.19755259156227112,
-0.3365563154220581,
0.2774561047554016,
-0.4724688231945038,
-0.28386169672... | |
Allocated 361K, Free 142K
minimum free space 64K,
Awaiting promotion = 0K, sweeps before promotion =10
Segment 217E7050: Total Size 1315K, Allocated 729K, Free 582K
minimum free space 0K, | [
-0.32209834456443787,
-0.29186925292015076,
-0.05948895215988159,
0.40022894740104675,
0.05696454271674156,
0.6351531147956848,
0.2323320060968399,
-0.15772679448127747,
-0.5996188521385193,
-0.5698188543319702,
-0.4769443869590759,
-0.3749792277812958,
0.03304871544241905,
-0.004440699238... | |
Awaiting promotion = 0K, sweeps before promotion =2
Generation 1: Total Size 1397K, Allocated 513K, Free 871K
Segment 20CB9A50: Total Size 68K, Allocated 48K, Free 15K
minimum free space 0K, | [
-0.2707008719444275,
-0.4217130243778229,
0.12798306345939636,
0.37856829166412354,
0.15900945663452148,
0.5113219618797302,
0.135805144906044,
-0.10833261907100677,
-0.3744245171546936,
-0.42131778597831726,
-0.4536902606487274,
-0.4279007315635681,
0.026198122650384903,
0.046572461724281... | |
Awaiting promotion = 0K, sweeps before promotion =4
Segment 216D7050: Total Size 1088K, Allocated 331K, Free 752K
minimum free space 0K,
Awaiting promotion = 0K, sweeps before promotion =4
Segment 2004E4F8: Total Size 241K, Allocated 133K, Free 103K | [
-0.5973089933395386,
-0.15325869619846344,
0.004072411917150021,
0.38646456599235535,
-0.012071426026523113,
0.5439096093177795,
0.2438288778066635,
-0.324013888835907,
-0.4211147129535675,
-0.49895891547203064,
-0.5814889669418335,
-0.14998041093349457,
0.11174555867910385,
0.037893563508... | |
minimum free space 0K, static
Generation 2: Total Size 2884K, Allocated 1290K, Free 1585K
Segment 21417050: Total Size 2816K, Allocated 1227K, Free 1584K
minimum free space 0K,
Awaiting promotion = | [
-0.32826733589172363,
-0.3939838111400604,
0.08886586129665375,
0.31898289918899536,
0.07995093613862991,
0.6048775315284729,
0.23323440551757812,
0.011018991470336914,
-0.38079768419265747,
-0.41330602765083313,
-0.4937810003757477,
-0.3084581196308136,
-0.09953423589468002,
0.08821450173... | |
0K, sweeps before promotion =4
Segment 20DA5DA0: Total Size 68K, Allocated 62K, Free 1K
minimum free space 117K,
Awaiting promotion = 0K, sweeps before promotion =4
Generation 3: Total Size 19373K, Allocated 19232K, Free 128K
Segment 20109A50: Total Size | [
-0.41993629932403564,
-0.33227992057800293,
0.044786032289266586,
0.21185466647148132,
-0.0074663665145635605,
0.7003071308135986,
0.30328574776649475,
-0.26545849442481995,
-0.4236999750137329,
-0.4844679832458496,
-0.5170542001724243,
-0.38060909509658813,
0.1833297461271286,
0.150922983... | |
11968K, Allocated 11963K, Free 0K
minimum free space 3K,
Awaiting promotion = 0K, sweeps before promotion =10
Segment 20DB6E18: Total Size 6528K, Allocated 6396K, Free 128K
minimum free space 0K, | [
-0.37515363097190857,
-0.2175123542547226,
-0.06749637424945831,
0.42084938287734985,
0.045700088143348694,
0.48097550868988037,
0.3229654133319855,
-0.1918264627456665,
-0.49967828392982483,
-0.4504282772541046,
-0.5026182532310486,
-0.19870246946811676,
-0.07190431654453278,
-0.011056300... | |
Awaiting promotion = 0K, sweeps before promotion =10
Segment 20CCAAC8: Total Size 876K, Allocated 872K, Free 0K
minimum free space 0K,
Awaiting promotion = 0K, sweeps before promotion =10
Total | [
-0.3785407543182373,
-0.28301313519477844,
0.28891411423683167,
0.2621607184410095,
-0.03724680095911026,
0.5392076969146729,
0.25559893250465393,
0.001970578683540225,
-0.5360305905342102,
-0.36527273058891296,
-0.3501944839954376,
-0.26342713832855225,
0.12535691261291504,
-0.00589431077... | |
Size 25792K, Allocated 22127K, Free 3310K
``` | [
-0.5880208015441895,
-0.05922374129295349,
-0.1797310709953308,
0.42122751474380493,
-0.09922714531421661,
0.8772097229957581,
0.2590154707431793,
-0.12653999030590057,
-0.276883065700531,
-0.14691661298274994,
-0.2251916527748108,
-0.10290723294019699,
-0.011241694912314415,
-0.0026512243... | |
I'm trying to post an image to TwitPic.com using their API.
However, I have never posted an image using HTTPPOST or however else before.
Anybody enlighten me to how I can post NSData from a UIImage using their api?
TwitPic is expecting a [multi-part form data](http://www.twitpic.com/api.do#uploadAndPost). There is a ... | [
0.5588347911834717,
-0.00731233786791563,
0.3427475690841675,
-0.0059232572093605995,
-0.6404541730880737,
0.04833442345261574,
0.37683093547821045,
0.04333718866109848,
-0.2159312665462494,
-1.11318838596344,
0.23533497750759125,
0.21399235725402832,
-0.0002448015147820115,
0.169441759586... | |
I'm writing a modal dialog in WPF. How do I set a WPF window to not have a close button? I'd still like for its `WindowState` to have a normal title bar.
I found `ResizeMode`, `WindowState`, and `WindowStyle`, but none of those properties allow me to hide the close button but show the title bar, as in modal dialogs.
W... | [
0.23261979222297668,
0.10498133301734924,
0.8629083037376404,
-0.2664535343647003,
0.018603648990392685,
-0.08598030358552933,
0.382957398891449,
-0.4091942608356476,
-0.055959854274988174,
-0.7422529458999634,
-0.1927265077829361,
0.6487832069396973,
-0.3321341574192047,
-0.04049987718462... | |
true)]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
```
Then put this code in the Window's `Loaded` event:
```cs
var hwnd = new WindowInteropHelper(this).Handle;
SetWindowLong(hwnd, GWL_STY... | [
-0.007312385365366936,
0.04375667870044708,
1.2094011306762695,
-0.20016801357269287,
0.16378024220466614,
0.04970515891909599,
0.4944227337837219,
-0.19077879190444946,
-0.08960650116205215,
-0.502420961856842,
-0.589909553527832,
0.9192025065422058,
-0.30791357159614563,
0.30863109230995... | |
the window will still close.
If you don't want to allow the window to close before the background thread is done, then you could also override `OnClosing` and set `Cancel` to true, as Gabe suggested. | [
0.6867707371711731,
-0.12607446312904358,
0.6520634889602661,
-0.1700669229030609,
0.5627709627151489,
-0.10539694130420685,
0.535174548625946,
-0.10658835619688034,
0.006001793313771486,
-0.4115317463874817,
-0.24824486672878265,
0.4188663363456726,
-0.2645692229270935,
0.3430383801460266... | |
I can't use boost:hash because I have to stick with C and can't use C++.
But, I need to hash a large number (10K to 100k) of tokens strings (5 to 40 bytes length) so that search within those are fastest.
MD5, SHA1 or any long hash function seems too heavy for a simple task, I am not doing cryptography. Plus there is ... | [
-0.028806904330849648,
0.16508091986179352,
0.028367137536406517,
0.009094861336052418,
-0.27134254574775696,
-0.1341625452041626,
0.10785625129938126,
-0.16294075548648834,
-0.13518494367599487,
-0.48905766010284424,
0.18362434208393097,
0.33792540431022644,
-0.15540604293346405,
0.046262... | |
Does hash algorithm in Perl/Python use 32 bit hashes too? Or do I have to jump to 64?
3. Regarding implementation of hash tables in common scripting languages: does the implementation check for collisions or can I avoid that part altogether?
You can find a good (and fast) hash function, and an interesting read, at [<ht... | [
-0.18597769737243652,
0.25373199582099915,
0.029978130012750626,
-0.05963927134871483,
-0.20374423265457153,
-0.18257808685302734,
0.07996384799480438,
0.07461589574813843,
-0.2187732607126236,
-0.4489102363586426,
-0.044398386031389236,
0.5745586156845093,
-0.29377850890159607,
-0.1764486... | |
It might sound like a dumb question but I can't for the life of me find the answer to this one.
We have a project set up in Redmine and linked to an SVN repository. Everything is working fine, but we recently did a repository relocation and we needed to update its Redmine repository path setting to point to the new re... | [
0.5552804470062256,
0.08737502247095108,
-0.008658760227262974,
0.20808571577072144,
0.056931272149086,
-0.17653200030326843,
0.3858194649219513,
0.32942578196525574,
-0.14268432557582855,
-0.4421227276325226,
-0.040881115943193436,
0.3252626061439514,
0.02141077071428299,
0.38687941431999... | |
in it!!) and I don't want to wipe out the repo. There's no reference I could find about this in the Redmine manual. What should I do?
Also --related to this-- do you know if all ticket references in old commits will still be pointing at the right places?
Ok, I figured out. I created a dummy project with a dummy svn re... | [
0.43388810753822327,
-0.02162444405257702,
0.3607516288757324,
0.3255614638328552,
0.002167510101571679,
-0.3357490003108978,
0.2933385670185089,
0.144683375954628,
-0.32861563563346863,
-0.3069327175617218,
0.13389450311660767,
0.38678815960884094,
-0.26101332902908325,
0.2813047766685486... | |
I am working on Asp.Net project which needs to fill in a word document. My client provides a word template with last name, firstname, birth date,etc... . I have all those information in the sql database, and the client want the users of the application be able to download the word document with filled in information fr... | [
0.5241461992263794,
0.22642242908477783,
-0.0047601195983588696,
0.047589901834726334,
0.2148135006427765,
0.06523770838975906,
0.09272823482751846,
0.3440935015678406,
-0.22444070875644684,
-0.7600148320198059,
0.026890527456998825,
0.06353483349084854,
0.1300664097070694,
0.2834956943988... | |
on something similar and you might want to look into using an RTF instead. You can use pattern replacement in the RTF. For example you can add a tag like {USER\_FIRST\_NAME} in the RTF document. When the user clicks the download button, your application can take the information from the database and replace every insta... | [
0.29286256432533264,
-0.0922265499830246,
0.4185871481895447,
0.08136380463838577,
-0.14581511914730072,
-0.3130510449409485,
0.14517535269260406,
0.1744016855955124,
-0.23760150372982025,
-0.9118202328681946,
-0.041983652859926224,
0.734218418598175,
-0.4408855736255646,
0.152988776564598... | |
For example, the following selects a division with id="2":
```
row = $("body").find("#2");
```
How do I do something like this:
```
row_id = 5;
row = $("body").find(row_id);
```
The above syntax produces an error. I checked the jQuery documentation and answers here without success.
```
row = $("body").find('#' + ... | [
0.13351663947105408,
0.11677949875593185,
0.02074895240366459,
-0.08990919589996338,
-0.09720956534147263,
0.019727978855371475,
0.27875393629074097,
-0.5598974227905273,
-0.04858781024813652,
-0.7013840079307556,
-0.23665142059326172,
0.637505829334259,
-0.045882437378168106,
-0.223023205... | |
I have in a MySQL table a DATE column that represents the date in this format: YYYY-MM-DD.
I wanto to retrieve the date from the database using PHP but display it like this: DD Month, YYYY.
From '2009-04-13' to '13 April, 2009' for example.
Witch is the best way to do it?? ( I know how to get the date from the DB. I... | [
0.2636857032775879,
0.2962253987789154,
0.7981676459312439,
0.08403272926807404,
-0.5974766612052917,
0.02670276165008545,
0.45284175872802734,
0.2374357283115387,
-0.23573370277881622,
-0.4747390151023865,
0.38720062375068665,
0.028453262522816658,
0.40236392617225647,
0.29222819209098816... | |
detailed.
Thanks!!!
Refer to [DATE\_FORMAT()](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format) function in MySQL. I guess that's the best way for you to do it.
Also, you can make this:
* Fetch your date from DB
* Use [strtotime](http://www.php.net/strtotime) in PHP, to conver... | [
0.29078227281570435,
-0.13962040841579437,
0.6805514097213745,
0.22712342441082,
0.22947154939174652,
-0.20775540173053741,
-0.0029397967737168074,
0.09971741586923599,
-0.10148803889751434,
-0.6332055330276489,
-0.13028891384601593,
0.31583118438720703,
0.35085299611091614,
0.040633030235... | |
Consider i execute a method 'Method1' in C#.
Once the execution goes into the method i check few condition and if any of them is false, then the execution of Method1 should be stopped. how can i do this, i.e can the execution of a method when certain conditions are met.?
but my code is something like this,
```
int Me... | [
0.23086868226528168,
-0.12067580968141556,
0.05700887739658356,
-0.26613500714302063,
0.17018289864063263,
-0.30651071667671204,
0.3860435485839844,
-0.27676472067832947,
-0.24957183003425598,
-0.4419771730899811,
-0.0663217157125473,
0.47036826610565186,
-0.4319435954093933,
0.21232090890... | |
else
//Stop executing the method.**
break;
case2:
...
}
}
```
Use the `return` statement.
```
if(!condition1) return;
if(!condition2) return;
// body...
``` | [
0.15392255783081055,
0.03804023936390877,
0.22778066992759705,
-0.1501224786043167,
0.2899439334869385,
-0.22639614343643188,
0.6127369403839111,
-0.5459661483764648,
0.09480303525924683,
-0.12600982189178467,
-0.3335370421409607,
0.6298677325248718,
-0.3318589925765991,
0.0059330170042812... | |
We are tracking down some memory issues in our application and we have visibility into the size of our sessions where the problem seems to be. It is only affecting certain sessions where they seem to balloon out of control and we'd like to have the ability to invalidate those sessions more-or-less 'by hand' to reclaim ... | [
0.34914064407348633,
-0.11905855685472488,
0.23746193945407867,
0.05714104324579239,
0.02938033640384674,
-0.4513316750526428,
0.5423917770385742,
-0.4612589180469513,
-0.41152551770210266,
-0.5662901997566223,
-0.09234684705734253,
0.5001170635223389,
-0.24725976586341858,
-0.082567751407... | |
can get the active sessions from that MBean--
`/opt/lib/jboss-4.2.3.GA/bin/twiddle.sh -s 172.16.0.216:1099 invoke "<--MBean-->" listSessionIds`
--And finally, once you have that list, you can pick out the session of interest and expire it--
`/opt/lib/jboss-4.2.3.GA/bin/twiddle.sh -s <--ServerIP-->:1099 invoke "<--... | [
0.0014119006227701902,
-0.09209681302309036,
0.6553207635879517,
-0.06899028271436691,
0.22708337008953094,
-0.2783074378967285,
0.37059900164604187,
-0.1063365638256073,
-0.36685630679130554,
-0.7318639755249023,
-0.3711259067058563,
0.5113955736160278,
-0.34347644448280334,
0.01395853143... | |
of twiddle on your machine. It is included in JBoss. | [
0.43630245327949524,
-0.3673842251300812,
0.38653647899627686,
0.1971311718225479,
0.18402737379074097,
-0.3916400671005249,
0.43361255526542664,
-0.048354677855968475,
0.0023855608887970448,
-0.4642969071865082,
0.15290510654449463,
0.537850558757782,
-0.3519757091999054,
-0.1473055332899... | |
I'm having a problem implementing custom 404 error pages on my Windows/IIS/PHP webhost. Whenever I try to send the 404 status message in the header, no content is sent to the client and a blank page is displayed instead.
Here is a very simple script I'm using:
```
<?php
header('HTTP/1.1 404 Not Found');
header('S... | [
0.32145828008651733,
0.12595635652542114,
0.48238110542297363,
-0.011973844841122627,
-0.33651164174079895,
-0.13842330873012543,
0.6286717653274536,
-0.11328568309545517,
-0.28237348794937134,
-1.0347540378570557,
0.06205867603421211,
0.7677863836288452,
-0.37856876850128174,
0.2440342456... | |
what content is echoed by PHP, or included below as normal HTML, though PHP processing e.g. logging, database writes etc continue as normal.
Can anyone suggest what the problem might be or how to resolve it?
If PHP is configured at your host to run through CGI, it may be impossible to generate 404 error pages in IIS (... | [
0.4222707748413086,
0.20769844949245453,
0.40169936418533325,
0.1845519244670868,
-0.4153330326080322,
-0.3134305775165558,
0.6187708973884583,
0.11303263157606125,
-0.5701019167900085,
-0.277958482503891,
0.11232222616672516,
0.6304624080657959,
-0.36422911286354065,
0.08906536549329758,
... | |
as it being slow. On IIS, the PHP ISAPI extension should be preferred (though as I've not tried it I can't confirm it solves this specific problem). | [
-0.25113874673843384,
-0.3816796839237213,
0.5469207763671875,
-0.041143953800201416,
-0.12737880647182465,
-0.010370512492954731,
0.22635366022586823,
0.05578543618321419,
-0.03950190916657448,
-0.4267285168170929,
-0.11027637869119644,
0.5373319387435913,
-0.3336506187915802,
-0.38667097... | |
Instead of deleting records in my Django application, I want to just mark them as "deleted" and have them hidden from my active queries. My main reason to do this is to give the user an undelete option in case they accidentally delete a record (these records may also be needed for certain backend audit tracking.)
Ther... | [
0.353231817483902,
0.45494723320007324,
-0.08053677529096603,
0.10025966912508011,
0.17928694188594818,
-0.46064507961273193,
0.31558606028556824,
0.17981964349746704,
-0.5450301170349121,
-0.42346590757369995,
-0.00031366138136945665,
0.40372252464294434,
-0.30632734298706055,
0.201151490... | |
and it seems that the documentation is recommending not to do that now: <https://docs.djangoproject.com/en/dev/topics/db/managers/#don-t-filter-away-any-results-in-this-type-of-manager-subclass>
Django offers out of the box the exact mechanism you are looking for.
You can change the manager that is used for access th... | [
0.025999046862125397,
0.100996233522892,
0.18487249314785004,
-0.15768612921237946,
-0.2833578288555145,
-0.4059526324272156,
0.11231811344623566,
0.03669153153896332,
-0.5897422432899475,
-0.636104941368103,
0.12122572958469391,
0.4897087514400482,
-0.5244765877723694,
-0.0785318166017532... | |
Consider this:
Requisite:
```
//The alphabet from a-z
List<char> letterRange = Enumerable.Range('a', 'z' - 'a' + 1)
.Select(i => (Char)i).ToList(); //97 - 122 + 1 = 26 letters/iterations
```
Standard foreach:
```
foreach (var range in letterRange)
{
Console.Write(range + ",");
}
Console.Write("\n");
```
Inbu... | [
-0.15938659012317657,
0.05904576554894447,
0.5761561989784241,
-0.31050676107406616,
0.1473621428012848,
0.2695682644844055,
0.337909072637558,
-0.8104856014251709,
0.023062337189912796,
-0.74220210313797,
-0.25208401679992676,
0.7763712406158447,
-0.15371017158031464,
-0.2464795857667923,... | |
+ ",");
}
Console.Write("\n");
```
Doesn't act execute faster than standard foreach as far as I can tell.
I think your benchmark is flawed. `Console.Write` is an I/O bound task and it's the most time consuming part of your benchmark. This is a micro-benchmark and should be done very carefully for accurate results.
H... | [
-0.3225037455558777,
0.20356325805187225,
0.6172471046447754,
-0.0974765494465828,
0.0989278107881546,
-0.12680502235889435,
0.7140637040138245,
-0.09189879894256592,
-0.08967576920986176,
-0.7198003530502319,
-0.021616768091917038,
0.7972285151481628,
-0.05938926339149475,
0.4327615499496... | |
I have a CEdit text box which is a part of a property pane and only allows numeric values (positive integers). The box works fine when people enter non-numeric values, but when they delete the value in the box a dialog pops up saying:
"Please enter a positive integer."
Here is the situation:
1. I have a number (say... | [
0.13288941979408264,
0.25594228506088257,
0.19355542957782745,
-0.04899950698018074,
0.12420093268156052,
-0.13860078155994415,
0.3852507174015045,
-0.10052363574504852,
-0.23086319863796234,
-0.5437533855438232,
-0.13531729578971863,
0.4614584445953369,
-0.21794159710407257,
0.27584239840... | |
int DEFAULT_VALUE = 20;
class MyPropertyPane:public CPropertyPane
{
//....
private:
CEdit m_NumericBox;
int m_value;
//....
public:
afx_msg void OnEnChangeNumericBox();
//....
}
void MyPropertyPane::MyPropertyPane()
{
// Set a default value
m_value = DEFAULT_VALUE;
}
//....
void MyPr... | [
-0.15899619460105896,
-0.15249890089035034,
0.48985615372657776,
-0.2673632800579071,
0.1341547667980194,
0.4303261339664459,
0.038856714963912964,
-0.045243680477142334,
-0.30547013878822327,
-0.5253176689147949,
-0.3093108832836151,
0.4538889229297638,
-0.4170530140399933,
0.151424065232... | |
changed.
// I try to get the value from the box by updating my data
UpdateData(TRUE);
// m_value is still 20 although the value is
// deleted inside the text box.
}
```
The message you are receiving is coming from the data validation routines, not the data exchange routines. There is probably a call... | [
0.3463039994239807,
-0.15096211433410645,
0.7310874462127686,
-0.13803690671920776,
0.151864156126976,
0.2005157619714737,
0.2319585233926773,
-0.1755322515964508,
-0.2140662670135498,
-0.7267342805862427,
-0.11292906850576401,
0.5427639484405518,
-0.6002045273780823,
0.2171524614095688,
... | |
1-20, MFC will pop up an error dialog
}
```
You can fix this problem by removing the built-in MFC data validation and adding your own:
```
void MyPropertyPane::DoDataExchange(CDataExchange* pDX)
{
DDX_Control(pDX, IDC_NUMERIC_BOX, m_NumericBox);
DDX_Text(pDX, IDC_NUMERIC_BOX, m_value);
if( m_value < 1 |... | [
-0.1466730386018753,
-0.03398163244128227,
0.5122259855270386,
-0.2205500304698944,
0.2906746566295624,
-0.084771528840065,
0.1570059359073639,
-0.2208014875650406,
-0.2845028340816498,
-0.6615002751350403,
-0.39745214581489563,
0.5638493895530701,
-0.6347489953041077,
0.022507207468152046... | |
When creating a MailMessage object by calling the "CreateMailMessage" method on the MailDefinition class, the third parameter is an object of type System.Web.UI.Control.
```
MailDefinition mail = new MailDefinition();
ListDictionary replacements = new ListDictionary();
replacements.Add("<%myname%>", "John");
mail.Bo... | [
0.380289763212204,
-0.05681823194026947,
0.5100610852241516,
-0.1406276822090149,
-0.13553671538829803,
0.06138192117214203,
0.6058579087257385,
-0.3515712022781372,
-0.12832848727703094,
-0.8936693072319031,
-0.059815309941768646,
0.3755095601081848,
-0.48351728916168213,
0.13910903036594... | |
control.
```
MailMessage message = mail.CreateMailMessage("example@example.com,", replacements, this);
```
As for the reason why, [here is what MSDN says:](http://msdn.microsoft.com/en-us/library/0002kwb2.aspx)
> The owner parameter indicates which control is the parent of the MailDefinition control. It determines ... | [
-0.03314278647303581,
-0.18250435590744019,
0.7277067303657532,
0.05634726583957672,
0.08346021920442581,
-0.03534233942627907,
-0.0007807647925801575,
-0.14939236640930176,
0.08524177968502045,
-0.40219271183013916,
-0.12871402502059937,
0.3910179138183594,
-0.34278562664985657,
0.3659456... | |
I want to give my users the option to use a textbox and press Enter. The challenge is that I have 5 textbox, and 2 options. 3 textbox belong to one button, and 2 textbox to the other. How do I trigger a particular Button according to the textbox the user was in when he press Enter?
I accomplished this on my own where I... | [
0.23452964425086975,
-0.24803604185581207,
0.377742737531662,
-0.08816889673471451,
0.11258377134799957,
0.3136324882507324,
0.35680335760116577,
-0.4569745659828186,
-0.1425352245569229,
-0.5312848687171936,
-0.027415985241532326,
0.47085708379745483,
-0.2018071413040161,
-0.1246255040168... | |
one I wished. That way when they finished typing in the form and hit the enter key, it would submit on the correct button.
**Example**:
```
<asp:Panel id="panel1" DefaultButton="button1">
<asp:textbox id="textbox1"/>
<asp:textbox id="textbox2"/>
<asp:buton id="button1"/>
</asp:panel>
<asp:panel id="panel... | [
-0.1992085725069046,
-0.17367422580718994,
0.7634329795837402,
-0.22463390231132507,
-0.06436575204133987,
0.20701751112937927,
0.10768144577741623,
-0.7340519428253174,
-0.22215227782726288,
-0.5963422656059265,
-0.2191731184720993,
0.4556792378425598,
-0.39770594239234924,
-0.18361063301... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.