text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
knows which arena to deallocate from when destructed.
arena_ptr<char> string(a); string.allocate(80);
// or: arena_ptr<char> string; string.allocate(a, 80);
arena_ptr<int> intp(a); intp.allocate();
// or: arena_ptr<int> intp; intp.allocate(a);
arena_ptr<foo> fp(a); fp.allocate();
// or: arena_ptr<foo>; fp.allocate(a);
... | [
-0.35918334126472473,
-0.0979406014084816,
0.555134654045105,
-0.34863919019699097,
-0.01658695749938488,
0.1838134080171585,
0.05046796053647995,
-0.4864441752433777,
-0.3998260498046875,
-0.41605061292648315,
-0.3644225597381592,
0.5083492398262024,
-0.5827420949935913,
-0.20838423073291... | |
around classes with *significant* *constructors* and *destructors* located in a *custom memory management scheme*. While that could be useful, and I can't argue with it, it's pretty limited in commonality.
Basically, we have placement new and per-class allocators -- what problems can't be solved with these approaches?... | [
0.1428345888853073,
0.07431488484144211,
0.0027995724231004715,
0.37418481707572937,
-0.11612726747989655,
-0.24175827205181122,
0.14861485362052917,
0.31890884041786194,
-0.24626405537128448,
-0.4358384311199188,
-0.12009952962398529,
0.46756571531295776,
-0.2001226544380188,
-0.086734883... | |
whole problem.
The complaints in the rant seem to come down to
1. "I liked the way malloc does it"
2. "I don't like being forced to explicitly create objects of a known type"
He's right about the annoying fact that you have to implement both `new` and `new[]`, but you're forced into that by Stroustrups' desire to ma... | [
0.3106221556663513,
0.41036051511764526,
0.06559053063392639,
-0.01506801787763834,
-0.23474496603012085,
-0.09836132079362869,
0.6770140528678894,
-0.33093318343162537,
-0.33324146270751953,
-0.26791152358055115,
-0.3381972014904022,
0.6639173030853271,
-0.25935664772987366,
0.24924001097... | |
make use of the identity
```
*(a+i) == a[i]
```
which would break a very large subset of all C code.
So, you could have a language which
* implements a more complicated notion of an array, and eliminates the wonders of pointer arithmetic, implementing arrays with dope vectors or something similar.
* is garbage col... | [
0.14712369441986084,
0.2306540161371231,
-0.07432727515697479,
-0.09253782778978348,
-0.14910267293453217,
-0.21993571519851685,
0.37083473801612854,
-0.2210046797990799,
-0.2947729229927063,
-0.3525083661079407,
-0.13821789622306824,
0.6291758418083191,
-0.5321267247200012,
-0.10345901548... | |
Bar without the compiler seeing it. This would also enable ducktyping, if you want it.
The thing is, once you've done those things, you've got Python or Ruby with a C-ish syntax.
I've been writing C++ since Stroustrup sent out tapes of cfront 1.0; a lot of the history involved in C++ as it is now comes out of the des... | [
0.48175373673439026,
0.4177183210849762,
0.5204833745956421,
-0.3142452836036682,
-0.18481820821762085,
0.32431212067604065,
0.02383904531598091,
0.1911533921957016,
-0.4693332314491272,
-0.33004438877105713,
0.07568137347698212,
0.6148027777671814,
-0.39454007148742676,
-0.322479426860809... | |
could fit into the C world. | [
0.3024163544178009,
-0.19578194618225098,
0.14025801420211792,
0.27954140305519104,
0.11182662099599838,
-0.039019882678985596,
0.06685880571603775,
0.31484389305114746,
0.0560091994702816,
-0.41996538639068604,
-0.05006222799420357,
0.012154513038694859,
0.2068096548318863,
0.057202838361... | |
I'm trying to read in and parse an xml document in an iPhone app. I begin parsing and then use the override method:
```
static void startElementSAX(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI,
int nb_namespaces, const xmlChar **namespaces, int nb_attribute... | [
-0.1849219799041748,
0.3473871052265167,
0.3296538293361664,
-0.09856240451335907,
0.09428296238183975,
0.2787756621837616,
0.16545985639095306,
-0.12529174983501434,
0.026386087760329247,
-0.7517439723014832,
-0.30597972869873047,
0.5476356744766235,
-0.2526763081550598,
-0.16412353515625... | |
in front of it. And why when trying to extract the data and convert it to a string with the above code do I get the warning:
passing argument 1 of 'initWithCString:encoding:' from incompatible pointer type.
The documentation for libxml's [start element callback](http://www.xmlsoft.org/html/libxml-SAX2.html#xmlSAX2Sta... | [
-0.2931492030620575,
0.042208440601825714,
0.7218019962310791,
-0.05821877717971802,
-0.13128694891929626,
0.062119971960783005,
-0.024269549176096916,
-0.29716551303863525,
-0.19109351933002472,
-0.4465451240539551,
-0.3461129069328308,
0.21568012237548828,
-0.14838655292987823,
0.3672040... | |
value (a pointer to the start
of the xmlChar string for the value)
5. end [of value] (a pointer to the end of the
xmlChar string for the value)
So you need to step through the array, get each value out of the items for the first attribute, then use the start value pointer to get the xmlChar string that is length = end... | [
0.08754938095808029,
0.26518598198890686,
0.5258830189704895,
-0.15208804607391357,
0.007219530642032623,
-0.014052396640181541,
0.04096398502588272,
-0.488309770822525,
-0.2978803813457489,
-0.37705060839653015,
-0.0916721299290657,
0.543662965297699,
-0.17932309210300446,
0.0926671102643... | |
case you would get the attributes as an NSDictionary. To get all the attributes out of it you could do the following:
```
for (NSString *attributeName in [attributeDict allKeys]) {
NSString *attributeValue = [attributeDict objectForKey:attributeName];
// do something here with attributeName and attributeValue
... | [
0.05148100107908249,
0.09576135873794556,
0.06162092089653015,
-0.048505593091249466,
0.14653578400611877,
-0.054641567170619965,
0.36391350626945496,
-0.39809298515319824,
-0.00918268971145153,
-0.2791668474674225,
-0.10804703086614609,
0.5978578329086304,
-0.10660018026828766,
-0.4368565... | |
**Problem Definition:** To be able to dynamically load a CSS at runtime to skin a Flex Application.
**More Information:** I've found that loading and applying a CSS is as simple as using "mx:style source="../assets/default.css"". But what I would like to do is something more like (pseudocode):
```
If (condition == 1)... | [
0.2716372311115265,
-0.07929928600788116,
0.06280706822872162,
-0.20111845433712006,
-0.059171948581933975,
0.04158473387360573,
0.06790827959775925,
-0.24031291902065277,
-0.6196396350860596,
-0.8387683629989624,
-0.21943733096122742,
0.6740151047706604,
-0.21555578708648682,
-0.320837020... | |
CSS->SWF compilation or anything complex like that.
Using the style tag, you're basically just inlining the style sheet. To my knowledge, there's no way to accomplish exactly what you're hoping to do. At the same time, you're probably best off doing this the way it's intended, using CSS to SWF compilation. That really ... | [
0.43464726209640503,
0.025803217664361,
-0.08364050835371017,
-0.05130075663328171,
-0.30277177691459656,
-0.2072596549987793,
0.2479238063097,
-0.06149820238351822,
-0.2862764596939087,
-0.776771068572998,
-0.28304627537727356,
0.36896634101867676,
-0.2250775545835495,
-0.1270475536584854... | |
I'm creating a structure of Rationals (int \* int) and one of my functions is:
```
fun diff ((n, d), (n', d')) =
let
val (top, bot) = sum ((n, d), (~n', d'))
in
(top / gcd(top, bot), bot / gcd(top, bot))
end
```
`gcd` gives me the greatest common denominator, so I don't end up with 2/8, but rather 1... | [
-0.3258557915687561,
-0.17113523185253143,
0.3583175539970398,
-0.20114552974700928,
-0.25539594888687134,
0.11701218783855438,
0.1289636641740799,
-0.530110776424408,
0.05871441215276718,
-0.4491676092147827,
-0.343117892742157,
0.6942940354347229,
-0.3934941589832306,
-0.1479431837797165... | |
I tried adding `: int * int` to the end of the `diff` declaration, it gives me a type error that the expressions `real * real` and `int * int` don't match.
How can I force integer division, or cast the expression to an integer? If both are possible, which one is better?
Yeah you are using the wrong operator. `/` is th... | [
0.22895872592926025,
0.052103787660598755,
-0.17907601594924927,
-0.16533368825912476,
-0.11942565441131592,
0.2385946810245514,
0.09980067610740662,
-0.308360755443573,
-0.10885078459978104,
-0.24860252439975739,
-0.008241563104093075,
0.45714667439460754,
-0.30804452300071716,
0.33410722... | |
If the the user is not using javascript, I will refresh the view with a RedirectToAction after an IsAjaxRequest check. This works when I have a user contrl in the page and return partial view.
BUt when I just want to return a value, say int, and also still want to use RedirectToAction when not an ajax request, how do... | [
-0.31275179982185364,
-0.401102215051651,
0.7549781799316406,
-0.22931739687919617,
-0.04813472181558609,
-0.05229963734745979,
0.4666549861431122,
-0.3001392185688019,
-0.12181828171014786,
-0.8091639876365662,
-0.24333347380161285,
0.9052102565765381,
-0.259614497423172,
-0.0634985417127... | |
return RedirectToAction("parentAction");
}
```
It will serialize the anonymous object in to a JSON result. Or if you really want to just return an "int", which isn't really common AJAX you should use the `ContentResult`. | [
-0.12735755741596222,
-0.2767581343650818,
0.08382164686918259,
0.01970268227159977,
-0.15496158599853516,
-0.3806111812591553,
0.33279284834861755,
0.13319651782512665,
0.10700935870409012,
-0.41358014941215515,
-0.3219897449016571,
0.6471590399742126,
-0.5132156610488892,
0.0262482315301... | |
I've been developing a compiler for a new language. I thought it would be neat to be able to demonstrate its development in a syntax aware environment. The language has quite a few custom keywords, and its structure is significantly different than common languages such as Java or C/C++.
How can I develop a custom synt... | [
0.541014552116394,
0.3600907325744629,
-0.003258735639974475,
0.018845215439796448,
-0.3197501301765442,
0.046339862048625946,
0.13816817104816437,
-0.01208798959851265,
-0.003831870388239622,
-0.42612525820732117,
0.011344925500452518,
0.6783515810966492,
-0.2952054738998413,
-0.158513188... | |
syntax coloring (they call it coloring, not highlighting), it is not as simple as it is in other editors.
If you really want to try and mess with it, you may want to read [the following from the Eclipse plug-in developer guide](http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/editors... | [
0.33834177255630493,
0.14130781590938568,
0.15142273902893066,
-0.172893688082695,
-0.5002264380455017,
-0.06797964125871658,
0.3795645833015442,
0.18810957670211792,
-0.1311943531036377,
-0.7934581637382507,
0.06966613233089447,
0.5368170738220215,
-0.4056151509284973,
-0.3505449891090393... | |
I hope that in this post, I can get people's opinions on best practices for the interface between JSF pages and backing beans.
One thing that I never can settle on is the structure of my backing beans. Furthermore, I have never found a good article on the subject.
What properties belong on which backing beans? When i... | [
0.49895256757736206,
0.219647616147995,
0.23000994324684143,
0.23830918967723846,
-0.49922114610671997,
-0.3222055733203888,
0.045692138373851776,
0.3633076846599579,
-0.36084848642349243,
-0.5429446697235107,
0.13842731714248657,
0.03562239557504654,
-0.02866976521909237,
0.03568254783749... | |
involved with injecting one bean into another? Should the backing bean contain any actual business logic, or should it strictly contain data?
Feel free to answer these questions and any others that may come up.
---
As for reducing coupling between the JSF page and the backing bean, I never allow the JSF page to acc... | [
0.15782569348812103,
0.2667497992515564,
0.08792039752006531,
0.015187970362603664,
-0.0574323907494545,
-0.2519584596157074,
0.35430899262428284,
-0.1612856388092041,
-0.1639373004436493,
-0.31062552332878113,
-0.361742228269577,
0.588634729385376,
-0.5676583051681519,
0.13340288400650024... | |
down into an object in a data table, for instance.
In general, this approach feels "right" to me. It avoids any coupling between the view and the data. Please correct me if I'm wrong.
You might want to check this out: [making distinctions between different kinds of JSF managed beans](http://java.dzone.com/articles/ma... | [
-0.09854952991008759,
-0.11976955085992813,
0.06993075460195541,
-0.05690404400229454,
-0.10013264417648315,
-0.08287850022315979,
0.1200997531414032,
-0.07910282164812088,
-0.5852867364883423,
-0.6397184729576111,
-0.2537916898727417,
0.29555657505989075,
-0.39986366033554077,
0.154068917... | |
POJO that follows the JavaBean design pattern with getters/setters encapsulating properties. The most common use case for a model bean is to be a database entity, or to simply represent a set of rows from the result set of a database query.
* **Backing Managed-Bean**: *Normally request scope.* This type of managed-bean... | [
-0.07827573269605637,
-0.0595417320728302,
0.5077633261680603,
0.0413179025053978,
0.017943428829312325,
-0.07567591965198517,
-0.1366429477930069,
0.14151151478290558,
-0.19256499409675598,
-0.1450628936290741,
-0.21914632618427277,
0.4277065694332123,
-0.5770806074142456,
-0.107013203203... | |
of the View -- not of the underlying application data model. JSF backing-beans may also have JSF actionListener and valueChangeListener methods.
* **Controller Managed-Bean**: *Normally request scope.* This type of managed-bean participates in the "Controller" concern of the MVC design pattern. The purpose of a control... | [
-0.03528391197323799,
-0.19792290031909943,
0.7949998378753662,
-0.054898813366889954,
-0.012833510525524616,
0.03972258418798447,
0.011196078732609749,
0.0982421338558197,
-0.43530431389808655,
-0.3467433750629425,
-0.39575448632240295,
0.5152377486228943,
-0.5789893865585327,
-0.23260933... | |
typical use case is supplying an ArrayList to JSF h:selectOneMenu drop-down lists that appear in more than one JSF view. If the data in the dropdown lists is particular to the user, then the bean would be kept in session scope. However, if the data applies to all users (such as a dropdown lists of provinces), then the ... | [
0.19805866479873657,
-0.21579229831695557,
0.20874400436878204,
-0.10914549231529236,
-0.2686561942100525,
-0.2949637770652771,
0.2355469912290573,
-0.22509877383708954,
-0.5053842663764954,
-0.593360960483551,
-0.3359338343143463,
0.2795948088169098,
-0.5487560033798218,
-0.13875706493854... | |
might be a FileUpload bean that can be reused in multiple web applications. | [
0.4334034025669098,
-0.23233908414840698,
-0.10501717031002045,
0.5162637233734131,
0.11508971452713013,
-0.2903234362602234,
-0.33130699396133423,
0.1051507368683815,
-0.37889364361763,
-0.4226129949092865,
-0.11767282336950302,
0.1165318414568901,
-0.27471014857292175,
0.257897287607193,... | |
I currently have a solution with a couple of projects and one of them is a WCF Service. I created another projected with a static class that basically provides a gateway to an instance of the WCF client, like such :
```
public static class WSGateway
{
public static DBInteractionGatewayClient MR_WebService
{
... | [
0.07293511927127838,
0.01366780512034893,
0.6255224943161011,
-0.029725490137934685,
0.06022036448121071,
-0.08673328906297684,
0.29520803689956665,
-0.17510707676410675,
-0.1476617008447647,
-0.7491511702537537,
0.012849229387938976,
0.2616333067417145,
-0.279881089925766,
0.5775888562202... | |
that (or so I thought) I could use a single `app.config` file that will be in that library only and then other projects can just just reference it and get a reference to that client from that property.
But the problem is that when a project tries to access that property, an exception is thrown telling me that I need t... | [
0.3365113139152527,
0.47324201464653015,
0.3771468698978424,
0.15011703968048096,
0.2935033142566681,
-0.11608089506626129,
0.264510840177536,
-0.20953017473220825,
-0.4146409034729004,
-0.866557776927948,
-0.05742567405104637,
0.7851148843765259,
-0.3967035114765167,
0.07797835767269135,
... | |
Solution:**
Following [Anderson Imes](https://stackoverflow.com/questions/746107/c-wcf-having-a-single-app-config-in-a-shared-library-that-provides-access-to-th/746174#746174)' suggestions, for now I decided to hardcode the client reference configuration in the class and thus eliminated the need for multiple `app.conf... | [
-0.2774753272533417,
-0.05424319580197334,
0.5744014978408813,
0.09351567178964615,
0.09062601625919342,
0.215634286403656,
0.5135747790336609,
-0.4317838251590729,
-0.3562718331813812,
-0.7077450752258301,
-0.2782260775566101,
0.36640501022338867,
-0.3967053294181824,
0.3007005751132965,
... | |
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="6000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false"> | [
-0.10382368415594101,
-0.15110477805137634,
0.36681973934173584,
-0.005087919533252716,
0.17024298012256622,
0.01773267425596714,
0.8851710557937622,
-0.16852112114429474,
-0.3459075093269348,
-0.37432730197906494,
-0.31408244371414185,
0.7259964346885681,
-0.5060602426528931,
0.0836095139... | |
<security mode="None"/>
<readerQuotas maxDepth="6000000" maxStringContentLength="6000000" maxArrayLength="6000000"
maxBytesPerRead="6000000" maxNameTableCharCount="6000000" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
... | [
-0.2674570679664612,
-0.21127301454544067,
0.49608251452445984,
0.37596020102500916,
0.34434986114501953,
-0.21605266630649567,
0.793829619884491,
-0.19491969048976898,
-0.14957945048809052,
-0.32782503962516785,
-0.19486671686172485,
0.7742906212806702,
-0.029822207987308502,
-0.083311960... | |
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://agnt666laptop:28666/DBInteractionGateway.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDBInteractionGateway"
contract="DBInteraction_Service.IDBInteracti... | [
-0.4273664057254791,
0.0905051976442337,
0.7411730885505676,
-0.3005389869213104,
-0.6507384777069092,
0.24173671007156372,
0.3447969853878021,
-0.855915904045105,
-0.053750645369291306,
-0.4490947723388672,
-0.1873236894607544,
0.2009790986776352,
-0.30285245180130005,
0.5974107980728149,... | |
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
```
To this (a `static class`):
```
public static class WSGateway
{
private static WSHttpBinding binding;
private static EndpointAddress ... | [
-0.24867211282253265,
-0.27424904704093933,
0.9064223766326904,
-0.3433535099029541,
-0.07027079164981842,
0.022342143580317497,
0.25953179597854614,
-0.30570998787879944,
-0.17464514076709747,
-0.8246951699256897,
-0.6361218690872192,
0.04074283316731453,
-0.392031729221344,
0.42604941129... | |
var readerQuotas = new XmlDictionaryReaderQuotas()
{
MaxDepth = 6000000,
MaxStringContentLength = 6000000,
MaxArrayLength = 6000000,
MaxBytesPerRead = 6000000,
MaxNameTableCharCount = 6000000
}; | [
-0.3475685119628906,
-0.32752084732055664,
0.7737044095993042,
0.023720553144812584,
0.06182863190770149,
0.3823792040348053,
0.3476257622241974,
-0.1173388734459877,
-0.05939602479338646,
-0.7035008072853088,
-0.29118141531944275,
0.5347679853439331,
-0.21163983643054962,
0.35819688439369... | |
binding = new WSHttpBinding(SecurityMode.None) {MaxReceivedMessageSize = 6000000, ReaderQuotas = readerQuotas};
endpointAddress = new EndpointAddress("http://agnt666laptop:28666/DBInteractionGateway.svc");
}
public static DBInteractionGatewayClient MR_WebService
{
get
{
... | [
0.015803072601556778,
-0.11015443503856659,
0.906722903251648,
-0.20734189450740814,
-0.08630260825157166,
0.06444571912288666,
0.7227146625518799,
-0.7788463830947876,
-0.21773742139339447,
-0.48992016911506653,
-0.47970646619796753,
0.5294137597084045,
-0.4973520040512085,
0.290602475404... | |
var ws = MR_WebService;
command.Invoke(ws);
ws.Close();
}
}
```
The reason you get that error is that the default constructor for a WCF client proxy looks up the channel configuration from local config. You can override this behavior by specifying the binding and address you want to use / connect t... | [
0.2172948271036148,
-0.08648485690355301,
0.43301987648010254,
-0.2103538066148758,
-0.06251706928014755,
-0.15786467492580414,
0.3921583592891693,
-0.3454296886920929,
-0.018580330535769463,
-0.9686236381530762,
-0.12813623249530792,
0.4765878915786743,
-0.5793487429618835,
0.569098353385... | |
address); For this solution, you'd only distribute the assembly your WSGateway code was in (hereafter called "WSGateway Assembly".
2. Create a common configuration file that all sites have access to. If these are all services on the same machine, this is easy to do. Place configuration data in a shared common drive loc... | [
0.3404614329338074,
-0.1188601404428482,
0.47056376934051514,
-0.03340032696723938,
-0.12936976552009583,
-0.42803317308425903,
0.12174686789512634,
-0.23766854405403137,
-0.2673642933368683,
-1.1458890438079834,
-0.1711670160293579,
0.3284660577774048,
-0.4454282224178314,
0.3396897614002... | |
centrally located config file was accessible and distribute you WSGateway Assembly.
3. Move your configuration to a common resource accessible from all applications, like a database. This would allow you to access this configuration data from any point in your solution. For this solution, you would ensure your configur... | [
0.13351969420909882,
-0.042985860258340836,
0.5248278379440308,
0.00444900244474411,
0.07705686241388321,
-0.13379128277301788,
-0.28969606757164,
-0.25925561785697937,
-0.16832506656646729,
-0.9891687631607056,
-0.07259064167737961,
0.3801620304584503,
-0.27139583230018616,
0.128767266869... | |
I'm a complete selenium newbie. Where should I start if I want to learn how to use it?
I've used Selenium in two different ways:
1. [Selenium Remote Control](http://seleniumhq.org/projects/remote-control/) - Great at scripting tests that manipulate a large amount of data to hit or insert into a website because you can... | [
0.44102880358695984,
-0.03340620920062065,
-0.058008771389722824,
0.11203408241271973,
-0.3135946989059448,
-0.20105302333831787,
0.19044938683509827,
-0.2165328860282898,
0.16255013644695282,
-0.7171024084091187,
0.03775617107748985,
0.43624740839004517,
-0.16621297597885132,
-0.013545460... | |
of the two ways and write a script to do something routine on the web (check for latest Hockey scores from NHL.com, etc). After you have that super-simple script running, try something more complex. | [
0.634649932384491,
-0.17620061337947845,
0.019860105589032173,
0.25057515501976013,
0.07210501283407211,
-0.413713663816452,
0.4570484161376953,
0.29780951142311096,
0.27373895049095154,
-0.9580168724060059,
0.28783613443374634,
0.7492842078208923,
-0.2955268323421478,
-0.2696516811847687,... | |
Lately, I've been reading some code that has
```
if (! (a == b) )
```
instead of
```
if ( a != b )
```
in some places.
Obviously these are logically equivalent, but I'm wondering if there is any particular reason to use one over the other.
Are there certain circumstances where one is preferable, or is it a... | [
0.45668691396713257,
0.26480188965797424,
-0.25853943824768066,
0.13161271810531616,
-0.21269696950912476,
-0.3604753315448761,
0.22720177471637726,
0.2483271360397339,
-0.34830135107040405,
-0.6985393762588501,
-0.15078581869602203,
0.522147536277771,
-0.050268903374671936,
0.028759121894... | |
you can do to make code more understandable, the better.** | [
0.4831521809101105,
0.12548229098320007,
-0.08380447328090668,
0.43723806738853455,
0.03082345239818096,
-0.1193772554397583,
0.7461940050125122,
0.09966866672039032,
-0.09325125813484192,
-0.7844713926315308,
-0.31760331988334656,
0.32841724157333374,
0.019267035648226738,
-0.196681842207... | |
I have a form with a choice field that is using CheckboxSelectMultiple widget:
```
foo = forms.ChoiceField(widget=forms.CheckboxSelectMultiple,
choices=(
("1", "ONE"), | [
0.19114962220191956,
0.061612989753484726,
0.43495726585388184,
-0.19560813903808594,
0.1754905879497528,
0.008687028661370277,
-0.15107443928718567,
-0.3807511627674103,
0.332844614982605,
-0.7976450324058533,
0.027247782796621323,
0.2746402323246002,
-0.41494569182395935,
0.0486381798982... | |
("2", "TWO"),
))
```
The form renders fine showing two checkboxes, however it doesn't validate.
If I select both checkboxes I am getting an error: Select a valid choice. [u'1', u'2'] is not one of the available choices
Selecting one checkbox doesn't work either, it gives me: Select ... | [
0.17693962156772614,
0.09593207389116287,
0.2542438507080078,
0.06502523273229599,
0.09588368237018585,
0.037330739200115204,
0.39186036586761475,
-0.1954197883605957,
-0.14812055230140686,
-0.7460393905639648,
-0.1769016981124878,
0.36130475997924805,
-0.4664352536201477,
-0.0278092548251... | |
field a forms.MultipleChoiceField rather than a forms.ChoiceField it will work better. | [
0.09879697859287262,
-0.5432987213134766,
0.1828908920288086,
0.045023396611213684,
-0.3336796164512634,
0.05566912516951561,
-0.020221898332238197,
-0.11088346689939499,
-0.10399014502763748,
-0.8563993573188782,
-0.35972726345062256,
0.34440821409225464,
-0.20496866106987,
-0.18410553038... | |
I have been writing some Web services to be used by a few different client apps and i was trying to write a web service method that simply outputs an RSS XML Feed.
I can create the XML using an XmlTextWriter Object
Then i have tryed outputing to the Response (like i have done in the past when its an aspx page) but th... | [
0.28624704480171204,
-0.07803494483232498,
0.4994153082370758,
-0.0781833752989769,
-0.3652673363685608,
0.07566798478364944,
0.15688994526863098,
-0.1678406149148941,
-0.03209700435400009,
-0.559475302696228,
0.0755133181810379,
0.5600196123123169,
-0.5095950961112976,
-0.0580032616853714... | |
then wrapped in a tag.
How can i do this?
Obviously create the interfaces and rest of the WCF service as normal.
Mark the class with the following attribute
```
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
```
And then this function
```
public Stream GetRSS()
{
string output;
//output = som... | [
0.1371060162782669,
-0.34255555272102356,
0.7341806292533875,
-0.10791130363941193,
-0.053585734218358994,
-0.1604837030172348,
0.5058536529541016,
-0.1941930502653122,
-0.047033242881298065,
-0.889337956905365,
-0.32338473200798035,
0.4702266752719879,
-0.3673895299434662,
0.3620651960372... | |
I wish to write a small tool that will capture a global event when the user presses the Windows button and scrolls the mousewheel up or down. When such an event is captured, I wish to redirect said output to a virtual keystroke combination of Win-+ or Win-- (plus/minus). Can this be done?
If the windows key is reserv... | [
-0.20161163806915283,
-0.19770342111587524,
0.31117597222328186,
0.2775363326072693,
0.2517189383506775,
0.014891993254423141,
0.15920351445674896,
0.16286183893680573,
-0.3328920602798462,
-0.6852689385414124,
0.04209108650684357,
0.460811585187912,
-0.21752525866031647,
0.325150132179260... | |
to make a global hotkey for them.
You will have to make a global window message hook and trap the WM\_MOUSEWHEEL message. But you may have to do that in C/C++. A C dll to accomplish this is below, you can call Hook and Unhook from C# to enable and disable the function.
WARNING: I have not tested this code and is prov... | [
-0.32145920395851135,
-0.11550869047641754,
0.4038397967815399,
-0.12013473361730576,
0.23661240935325623,
-0.19044528901576996,
0.41032320261001587,
-0.08907082676887512,
-0.33251991868019104,
-0.5020011067390442,
-0.20417194068431854,
0.7685338258743286,
-0.6552098989486694,
0.1104303002... | |
isWinKeyDown = TRUE;
else if (nCode == WM_KEYUP && (wParam == VK_LWIN || wParam == VK_RWIN))
isWinKeyDown = FALSE;
else if (nCode == WM_MOUSEHWHEEL && isWinKeyDown) {
if (HIWORD(wParam) > 0) { //mousewheel up
CallNextHookEx(thehook, WM_KEYDOWN, VK_ADD, 0);
CallNextHookEx(... | [
-0.2262420654296875,
-0.028278062120079994,
0.6897574067115784,
-0.34189173579216003,
0.43230774998664856,
-0.26683253049850464,
0.5963081121444702,
-0.6342690587043762,
0.28098902106285095,
-0.36611208319664,
-0.38276633620262146,
0.8233650922775269,
-0.3320559561252594,
-0.11476623266935... | |
//mousewheel down
CallNextHookEx(thehook, WM_KEYDOWN, VK_SUBTRACT, 0);
CallNextHookEx(thehook, WM_KEYUP, VK_SUBTRACT, 0);
}
return 0;
}
return CallNextHookEx(thehook, nCode, wParam, lParam);
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fwdReason, LPVOID lpvReserved) {... | [
-0.2666929364204407,
-0.2664399743080139,
0.4561035633087158,
-0.23095577955245972,
0.5069507956504822,
0.16574880480766296,
0.2645818293094635,
-0.2931196689605713,
-0.010094674304127693,
-0.3166748285293579,
-0.4577217698097229,
0.7912498712539673,
-0.49617087841033936,
0.187477663159370... | |
myInstance = hInstance;
} break;
case DLL_THREAD_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_DETACH:
break;
}
return(TRUE); | [
-0.21547389030456543,
-0.15444184839725494,
0.571515679359436,
-0.19465044140815735,
0.30932846665382385,
0.10907064378261566,
0.5722639560699463,
-0.08806169778108597,
-0.20499083399772644,
-0.47527846693992615,
-0.48258545994758606,
0.36467790603637695,
-0.18577343225479126,
0.6522943377... | |
// The initialization was successful, a FALSE will abort
// the DLL attach
}
extern "C" void __declspec(dllexport) Hook() {
if (!thehook)
thehook = SetWindowsHookEx(WH_CALLWNDPROC, &HookHandler, myInstance, 0);
}
extern "C" void __declspec(dllexport) UnHook() {
if (theho... | [
0.03971007838845253,
-0.1683926284313202,
0.5650337338447571,
-0.23947972059249878,
0.45052284002304077,
-0.1362464725971222,
0.38586559891700745,
-0.6356157660484314,
0.05643527954816818,
-0.19973918795585632,
-0.42835283279418945,
0.5420975089073181,
-0.3108813166618347,
0.11130767315626... | |
= 0;
}
``` | [
0.09475599229335785,
0.37012702226638794,
0.2098611444234848,
-0.4676172733306885,
0.2345598191022873,
-0.30276408791542053,
0.29915156960487366,
-0.023969855159521103,
0.24680107831954956,
0.07376717031002045,
-0.43182817101478577,
0.6778627634048462,
-0.45995065569877625,
0.2591769099235... | |
I have a ListBox with it's ItemTemplate bound to a DataTemplate. My problem is I cannot get the elements in the template to stretch to the full width of the ListBox.
```
<ListBox x:Name="listPeople" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Margin="0,0,0,0" Background="{x:Null}" SelectionMode="Ext... | [
-0.029805460944771767,
-0.32938456535339355,
0.7271655201911926,
-0.2664831280708313,
-0.03174576163291931,
0.24668867886066437,
-0.02169138938188553,
-0.6094805598258972,
-0.16138945519924164,
-0.8008782863616943,
-0.002370011992752552,
0.21125945448875427,
-0.07152964919805527,
0.1595384... | |
CornerRadius="5,5,5,5" MinWidth="100" Height="50"/>
</Grid>
</ListBoxItem>
</DataTemplate>
```
As you can see, I have added a border within the grid to indicate the width of the template. My goal is to see this border expand to the full width of the listbox. Currently its width is determined by its contents ... | [
0.22769293189048767,
-0.3336597979068756,
0.9607237577438354,
0.042023759335279465,
0.11487668007612228,
-0.15085065364837646,
-0.26344382762908936,
-0.278317928314209,
-0.2696681022644043,
-1.0664317607879639,
0.14658470451831818,
0.09264213591814041,
0.10017167031764984,
0.21690896153450... | |
is constructed using ItemContainerStyle.
The default control style for ListBoxItem is used to define the ItemContainerStyle by default. This style sets the ListBoxItem.HorizontalContentAlignment property to 'Left'. Notice how the ContentPresenter binds its HorizontalAlignment to this property.
You need to override th... | [
-0.035463131964206696,
-0.3371357023715973,
0.8819859623908997,
-0.32005035877227783,
0.007021770346909761,
0.018509484827518463,
0.012630467303097248,
-0.24141819775104523,
-0.14713086187839508,
-0.7287358641624451,
-0.377803772687912,
0.4158736765384674,
-0.2836955785751343,
0.1088863015... | |
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="TabNavigation" Value="Local"/>
... | [
-0.09332501143217087,
-0.3911917209625244,
0.43835368752479553,
0.05670808628201485,
0.36214303970336914,
0.14393292367458344,
0.20682787895202637,
-0.30018848180770874,
-0.3944244086742401,
-0.6300144195556641,
-0.37373045086860657,
0.4567151963710785,
-0.3791099488735199,
0.0561405308544... | |
<ControlTemplate TargetType="ListBoxItem">
<Grid Background="{TemplateBinding Background}">
<!-- VSM excluded for readability --> | [
-0.012385235168039799,
-0.4638780653476715,
0.1399272382259369,
0.24525980651378632,
0.09274255484342575,
-0.15038801729679108,
-0.02302655391395092,
-0.38328924775123596,
0.013835576362907887,
-0.5554028153419495,
-0.04203448444604874,
0.3885878622531891,
-0.34652629494667053,
-0.04035422... | |
<Rectangle x:Name="fillColor" Fill="#FFBADDE9" RadiusX="1" RadiusY="1" IsHitTestVisible="False" Opacity="0"/>
<Rectangle x:Name="fillColor2" Fill="#FFBADDE9" RadiusX="1" RadiusY="1" IsHitTestVisible="False" Opacity="0"/>
<ContentPresenter x:Name="contentPresenter"... | [
-0.15136489272117615,
-0.31259477138519287,
0.7727662324905396,
0.12554015219211578,
-0.05517607554793358,
0.030028875917196274,
-0.03087218478322029,
-0.5956630110740662,
-0.21174322068691254,
-0.4858565628528595,
-0.059366583824157715,
0.38322314620018005,
-0.12040060013532639,
0.0209579... | |
<Rectangle x:Name="FocusVisualElement" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1" Visibility="Collapsed"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
``` | [
-0.1733710765838623,
-0.2777264714241028,
0.4639102816581726,
0.056276384741067886,
-0.24437353014945984,
0.06267347931861877,
-0.12858515977859497,
-0.5059897899627686,
-0.12260407954454422,
-0.6507230997085571,
-0.022597314789891243,
0.41010579466819763,
-0.16212761402130127,
-0.00909940... | |
Ok, suppose I have Ruby program to read version control log files and do something with the data. (I don't, but the situation is analogous, and I have fun with these analogies). Let's suppose right now I want to support Bazaar and Git. Let's suppose the program will be executed with some kind of argument indicating whi... | [
0.4736447036266327,
0.11521448194980621,
0.15403534471988678,
0.2076062560081482,
-0.21209903061389923,
-0.389372318983078,
0.18073390424251556,
0.000029153587092878297,
-0.18110060691833496,
-0.5950424075126648,
0.0020875344052910805,
0.8555969595909119,
-0.4027078151702881,
0.15675674378... | |
internal representation. So, of course, I can make BazaarLogFileReader and GitLogFileReader and hard-code them into the program, but I want it to be set up in such a way that adding support for a new version control program is as simple as plopping a new class file in the directory with the Bazaar and Git readers.
So,... | [
0.13446436822414398,
-0.07759756594896317,
0.32112109661102295,
0.08489350229501724,
-0.047066859900951385,
-0.09752096980810165,
0.02129613794386387,
-0.11235903948545456,
-0.4542703330516815,
-0.804885745048523,
-0.11556948721408844,
0.6747809052467346,
-0.2786101698875427,
0.11354815959... | |
to call "do-something-with-the-log --software svn" without ANY changes to the rest of the program. (The files can of course be named with a specific pattern and globbed in the require call.)
I know this can be done in Ruby... I just don't how I should do it... or if I should do it at all.
You don't need a LogFileReade... | [
0.4661906957626343,
0.06773620843887329,
0.2130110114812851,
-0.150644451379776,
-0.10131711512804031,
-0.44637614488601685,
0.6890860199928284,
-0.21052394807338715,
-0.03203228861093521,
-0.8108843564987183,
-0.13004599511623383,
0.915061354637146,
-0.3890863358974457,
0.0360850505530834... | |
BzrLogFileReader.new
else
raise "Bad log file type: #{type}"
end
end
end
class GitLogFileReader < LogFileReader
def display
puts "I'm a git log file reader!"
end
end
class BzrLogFileReader < LogFileReader
def display
puts "A bzr log file reader..."
end
end
```
As you can see, the sup... | [
0.2434459775686264,
0.054399874061346054,
0.2226993590593338,
-0.036212291568517685,
-0.23487962782382965,
-0.251168429851532,
0.4353659152984619,
0.016390440985560417,
-0.36612293124198914,
-0.5528963804244995,
-0.26544198393821716,
0.46874305605888367,
-0.4586041271686554,
0.333769589662... | |
def self.create type
c = @@subclasses[type]
if c
c.new
else
raise "Bad log file type: #{type}"
end
end
def self.register_reader name
@@subclasses[name] = self
end
end
class GitLogFileReader < LogFileReader
def display
puts "I'm a git log file reader!"
end
register_reader... | [
0.1987372785806656,
0.2316066324710846,
0.5445367693901062,
-0.342239648103714,
-0.3696933686733246,
0.04300626367330551,
0.3722020983695984,
-0.5502685308456421,
-0.19127027690410614,
-0.6245882511138916,
-0.020653853192925453,
0.530047595500946,
-0.447755366563797,
0.023489203304052353,
... | |
puts "Subersion reader, at your service."
end
register_reader :svn
end
LogFileReader.create(:svn).display
```
And there you have it. Just split that up into a few files, and require them appropriately.
You should read Peter Norvig's [Design Patterns in Dynamic Languages](http://norvig.com/design-patterns/) if y... | [
0.06672689318656921,
-0.10192114859819412,
0.11037696897983551,
0.12102390080690384,
0.09312816709280014,
-0.1828474998474121,
0.4520803391933441,
-0.13454467058181763,
-0.46123379468917847,
-0.7612614631652832,
-0.5004698038101196,
0.19966484606266022,
-0.429797887802124,
-0.1318383067846... | |
are relevant to Ruby as well.
You might also want to take a look at [Why's Poignant Guide to Ruby](http://poignantguide.net/ruby/), particularly chapters 5 and 6, though only if you can deal with surrealist technical writing.
**edit**: Riffing of off Jörg's answer now; I do like reducing repetition, and so not repeat... | [
0.3474300503730774,
0.39910128712654114,
0.2407573163509369,
-0.050158750265836716,
-0.4532044529914856,
-0.19331984221935272,
0.5450050830841064,
-0.2392021119594574,
-0.0957152396440506,
-0.44382229447364807,
-0.2467111349105835,
0.3160396218299866,
-0.2933503985404968,
-0.02726003900170... | |
puts "I'm a git log file reader!"
end
end
log_file_reader :bzr do
def display
puts "A bzr log file reader..."
end
end
```
Of course, in production code, you may want to actually name those classes, by generating a constant definition based on the name passed in, for better error messages.
```
def log_file... | [
0.20131416618824005,
0.08478053659200668,
0.3931174576282501,
-0.23145930469036102,
-0.10894020646810532,
0.18132823705673218,
0.13275986909866333,
-0.19497030973434448,
-0.2709368169307709,
-0.6892734169960022,
-0.4109252095222473,
0.3390780985355377,
-0.2328241914510727,
0.11543776839971... | |
I am trying to replace last 2 digits of a integer with 38. I am doing that like below.
```
int num = 1297;
num = (num/100)*100 + 38;
```
What i am assuming is that compiler won't optimize (num/100)\*100 to num. If that happens then in my above example, num will become 1335 instead of 1238. So, is it guaranteed in C ... | [
0.14099152386188507,
0.2784784436225891,
0.14712148904800415,
-0.11350290477275848,
0.09623684734106064,
0.1098719909787178,
0.3175257444381714,
-0.183042511343956,
-0.2569296658039093,
-0.5012175440788269,
-0.1686030626296997,
0.40908148884773254,
-0.24105742573738098,
-0.1702844351530075... | |
course). When they do, it is usually because you are relying on undefined behaviour.
No sane compiler would replace `(num/100)*100` with `num`. Optimising compilers are far, far, *far* smarter than that. The compiler might optimise it to `num - (num % 100)`, if that is a sensible decision for the target platform.
I a... | [
0.41140350699424744,
0.17189954221248627,
-0.06169559061527252,
0.04307587817311287,
0.023272082209587097,
0.17861521244049072,
0.3480406403541565,
0.10746648907661438,
-0.029833370819687843,
-0.512603759765625,
-0.23792698979377747,
0.5835806131362915,
-0.17234252393245697,
-0.17101652920... | |
Let's take an example. When I run:
> xkbprint $DISPLAY keyboard.ps
what happens in the system? I would like to know how the X really work because I regularly get nasty error reports such as
> Fatal Error: Cannot load geometry for /tmp/launch-NawGIk/:0
>
>
>
> ```
> Exiting
>
> ```
I know that the X... | [
0.7472225427627563,
0.10407239943742752,
0.37537580728530884,
0.0857793465256691,
-0.10891635715961456,
-0.21531489491462708,
0.20249255001544952,
0.259956955909729,
-0.22896340489387512,
-0.801004946231842,
0.10227353125810623,
0.5114533305168152,
-0.23121899366378784,
-0.0036512308288365... | |
expect.
The syntax of [xkbprint(1](http://www.xfree86.org/current/xkbprint.1.html)) is
> $ xkbprint *sourcefile* *destfile*
and *sourcefile* should be a compiled xkb file. `$DISPLAY` is going to resolve to something like `mymachine:0.0`, which isn't a very reasonable file name.
Actually, since you're running a Mac,... | [
0.3843590021133423,
-0.001379668596200645,
0.20495256781578064,
0.1150958314538002,
-0.06423912942409515,
-0.3881293833255768,
0.3728325664997101,
0.06350039690732956,
-0.25149229168891907,
-0.9319025874137878,
-0.29503852128982544,
0.7071014046669006,
-0.2675926089286804,
-0.2109778523445... | |
you want a starting introduction to X, [try this article](http://www.linuxjournal.com/article/4879). | [
0.5844520926475525,
0.03198148310184479,
0.030196961015462875,
0.24411162734031677,
-0.12296073138713837,
-0.5236983299255371,
-0.10266777873039246,
0.7557471394538879,
-0.07501700520515442,
-0.25933563709259033,
-0.2069697082042694,
0.4326797425746918,
-0.31673648953437805,
0.084558524191... | |
I'm using Visual C++ 2008, SP1. I have a QT app (gui, .exe) in debug build config. It's set to use the Multi-threaded Debug DLL version of the CRT, aka MSVCRTD.lib.
I'm linking against a 3rd party library that is built in release mode and using the Multi-threaded DLL (non-debug) version of the CRT, aka MSVCRT.lib.
It... | [
-0.11093196272850037,
0.31508028507232666,
0.4730969965457916,
-0.25354790687561035,
-0.03918477147817612,
-0.24435758590698242,
0.851306140422821,
-0.03769279643893242,
0.02472754381597042,
-0.8349248170852661,
-0.11730756610631943,
0.688304603099823,
-0.7602069973945618,
0.15082655847072... | |
two different libs? What is the alternative? Can I create a DLL out of the 3rd party lib I have? Or is that something the 3rd party would have to do?
The exception at startup is:
"Unhandled exception at ....... in MyApp.exe: ......
Access violation reading location 0x00000000f"
The following is the call stack after ... | [
-0.36495521664619446,
0.12147697806358337,
0.6479701399803162,
-0.25666344165802,
0.17241454124450684,
0.5388481616973877,
0.36368316411972046,
-0.5153170824050903,
-0.17410776019096375,
-0.6850460767745972,
-0.2850031852722168,
0.9055653214454651,
-0.9095270037651062,
0.03151664882898331,... | |
0xf bytes C++
MyApp.exe!std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,unsigned int,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,unsigned int> > >::oper... | [
-0.03855571895837784,
0.11940684914588928,
0.38284969329833984,
-0.08488299697637558,
0.085289865732193,
0.21042005717754364,
0.3024105429649353,
-0.44306716322898865,
-0.07299928367137909,
-0.7242372632026672,
-0.3662651479244232,
0.5807192921638489,
-0.5795631408691406,
0.178927510976791... | |
Switch to the "Linker/Debugging" section and enable generation of debug info. Make sure to set the program database file (PDB).
At this point your application will emit debugging information for everything in your code and link against the non-debug DLL CRT. This enables you to debug your application in a Release con... | [
0.33037686347961426,
0.07177933305501938,
0.11234623193740845,
0.2739787697792053,
0.03112228587269783,
-0.5749058723449707,
0.4102077782154083,
0.08454134315252304,
-0.25045397877693176,
-0.5223657488822937,
-0.5275238752365112,
0.5159224271774292,
-0.41296622157096863,
0.1751716583967209... | |
I'm currently getting my feet wet with Win CE 5.0 to update some code on an existing platform. We're interested in deploying a custom shell/home screen/application launcher as well and I had a couple questions:
1) We're running the standard CE shell and I'm assuming it can be customized because the source code is made... | [
0.6434012651443481,
0.05778418108820915,
0.12964023649692535,
-0.0738736242055893,
0.0764605775475502,
0.0452873632311821,
0.2955349087715149,
0.038274962455034256,
-0.2928621172904968,
-1.0069630146026611,
0.07872491329908371,
0.45372238755226135,
0.1373160183429718,
-0.07318148761987686,... | |
doubts about this.
2) If it can't be removed, can the taskbar be resized and moved to the top of the screen? We're basically trying to find a way to reserve the first 20 or so pixel rows at the top of the screen for our own status bar and prevent maximized application windows from drawing over top of it.
Thanks very ... | [
0.39418965578079224,
0.06850937008857727,
0.4848642647266388,
-0.01644839346408844,
0.13107509911060333,
0.20644547045230865,
0.20027966797351837,
-0.4539496600627899,
-0.32914137840270996,
-0.5795580148696899,
-0.0731189176440239,
0.49779534339904785,
-0.3527137339115143,
-0.0674032568931... | |
25 pixels in the top of the screen.
:D
If you have doubts maybe [this](http://leo-luo.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=cat%3DTrip%2520of%2520Mobile) can help you or [this](http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesnative/thread/89d434c4-43cb-40a0-85b1-577543717add).... | [
0.0029523575212806463,
-0.06055385619401932,
0.80776447057724,
0.17302940785884857,
0.03105582855641842,
-0.07591111958026886,
0.16457363963127136,
0.041365738958120346,
-0.34479066729545593,
-0.9545115232467651,
-0.08793313056230545,
0.3365474343299866,
-0.0344330295920372,
-0.07423377782... | |
I know there are startup folders and certain registry keys I need to look into. But how to do that using Windows API? I'm interested to know for Windows XP and Vista. Thanks for your time.
There is no single API to get *all* the programs that run while the system is starting up. Consider all the things that [Autoruns](... | [
0.7985449433326721,
-0.07711725682020187,
0.12396970391273499,
0.30745336413383484,
0.12695825099945068,
-0.17852136492729187,
0.36379653215408325,
0.2545183598995209,
-0.42325714230537415,
-0.7248532176017761,
0.047069694846868515,
0.726009726524353,
-0.10322516411542892,
0.09822655469179... | |
program that's gradually expanding its notion of what an "auto-run program" is.
Work out what *you* wish to consider to be a "startup process," and then you can determine what APIs or other techniques you can combine to find out what all those processes are.
Among the places to look include the following:
* The "run... | [
0.2804111838340759,
-0.09887056797742844,
0.2952498495578766,
0.13773924112319946,
0.3449297547340393,
0.01632528379559517,
0.32194212079048157,
0.07144514471292496,
-0.33342909812927246,
-0.6053979992866516,
-0.3421858549118042,
0.6566698551177979,
-0.21320481598377228,
-0.006466963328421... | |
you need more, consider asking some more specific questions. | [
0.5540613532066345,
-0.0680844634771347,
-0.28773775696754456,
0.3686029314994812,
0.02734934724867344,
-0.11880063265562057,
-0.04953822121024132,
0.34693947434425354,
-0.01236713957041502,
-0.4424971640110016,
0.17989693582057953,
0.5171836614608765,
0.14208848774433136,
-0.1377716362476... | |
Consider the following criteria query:
var x = SomeCriteria.AddOrder(new Order("Name", true)).List();
This will order the result set by the Name property, but case sensitive:
```
"A1"
"B1"
"a2"
```
Any ideas how to add the order case insensitive so result "a2" will end up before "B1"?
You should be able to accompl... | [
-0.014546055346727371,
-0.14395055174827576,
0.10696714371442795,
-0.1649990826845169,
-0.10655112564563751,
0.034384630620479584,
-0.20479127764701843,
-0.43843311071395874,
-0.15914440155029297,
-0.474528431892395,
-0.008368061855435371,
0.5099130868911743,
-0.44822561740875244,
-0.15439... | |
NHibernateUtil.String,
Projections.Property("Name"));
var x = SomeCriteria.AddOrder(Orders.Asc(projection)).List()
```
If you're using SQL Server, I'd recommend using the "upper" function instead of "lower" for efficiency. Microsoft has optimized its native code for | [
-0.20660783350467682,
-0.05671662464737892,
0.49642619490623474,
-0.12864331901073456,
0.043462321162223816,
-0.07357394695281982,
-0.029758399352431297,
-0.13669581711292267,
-0.26039716601371765,
-0.3825625479221344,
0.09441642463207245,
0.42098715901374817,
-0.35175421833992004,
0.25712... | |
performing uppercase comparisons, where the rest of the world seems to have optimized on lowercase. | [
-0.13804508745670319,
-0.02990545891225338,
-0.04587304964661598,
0.1547415852546692,
-0.03897581249475479,
0.5141896605491638,
0.011063555255532265,
-0.17890740931034088,
-0.11826897412538528,
-0.7854627966880798,
-0.047291599214076996,
0.33934712409973145,
0.1237107515335083,
-0.48479941... | |
In c# I am using the UdpClient.Receive function:
```
public void StartUdpListener(Object state)
{
try
{
udpServer = new UdpClient(new IPEndPoint(IPAddress.Broadcast, 1234));
}
catch (SocketException ex)
{
MessageBox.Show(ex.ErrorCode.ToString());
... | [
0.35711321234703064,
-0.1366550177335739,
0.695235550403595,
-0.4855223298072815,
0.05197169631719589,
-0.014013735577464104,
0.38083362579345703,
-0.12095898389816284,
-0.04206348583102226,
-0.5384526252746582,
-0.433954119682312,
0.3096715211868286,
-0.481082022190094,
0.1391680240631103... | |
IPEndPoint remoteEndPoint = null;
receivedNotification=udpServer.Receive(ref remoteEndPoint);
...
```
However I am getting a socket exception saying that the address is not available with error code 10049
What do I do to negate this exception?
Here's the jist of some code I am currently using in a pro... | [
0.09922326356172562,
0.00009757967927725986,
0.5206994414329529,
-0.06631603091955185,
-0.25410619378089905,
-0.20880140364170074,
0.273520290851593,
-0.08076007664203644,
-0.12211534380912781,
-0.6945415735244751,
0.03225502371788025,
0.37851592898368835,
-0.22583270072937012,
0.398532807... | |
Adam Alexander your only problem is that you need to use IPAddress.Any, instead of IPAddress.Broadcast. You would only use IPAddress.Broadcast when you wanted to *Send* a broadcast UDP packet.
Set up the udp client
```
this.broadcastAddress = new IPEndPoint(IPAddress.Any, 1234);
this.udpClient = new UdpClient();
thi... | [
0.23164811730384827,
0.2398204207420349,
0.35873836278915405,
-0.054442111402750015,
-0.05495976284146309,
-0.052578337490558624,
0.34993770718574524,
-0.47061780095100403,
-0.37470129132270813,
-0.6015555262565613,
-0.035326436161994934,
0.23925232887268066,
-0.4942079186439514,
-0.120652... | |
something else must be using the port that you are trying to listen on.
So, to clarify.
IPAddress.Any = Used to receive. I want to listen for a packet arriving on any IP Address.
IPAddress.Broadcast = Used to send. I want to send a packet to anyone who is listening. | [
0.49578166007995605,
-0.03609379008412361,
0.4540717899799347,
-0.23339441418647766,
-0.18165317177772522,
0.06177371367812157,
0.28035271167755127,
0.6356789469718933,
-0.5264339447021484,
-0.7991398572921753,
0.02493090182542801,
0.3101363480091095,
-0.35345131158828735,
-0.0108915809541... | |
I have seen this character a number of times in CSS files but I have no idea how its used. Can anyone explain it to me and show how they are useful in making a page style easier?
It's a CSS child selector. `P > SPAN` means applying the style that follows to all SPAN tags that are children of a `P` tag.
Note that "chil... | [
0.13398420810699463,
-0.026847094297409058,
0.490447074174881,
0.048515528440475464,
-0.15234479308128357,
0.27143236994743347,
-0.05275484547019005,
-0.19159047305583954,
-0.19881057739257812,
-0.6421154141426086,
-0.37400010228157043,
0.07952374964952469,
-0.16938404738903046,
0.11319242... | |
that is a child/descendant of a `P` tag. `P > SPAN` only applies to `SPAN` tags that are children of a `P` tag. | [
-0.1495599001646042,
-0.07344400137662888,
0.1290690004825592,
0.10647851973772049,
0.07970433682203293,
-0.020268380641937256,
0.0036713636945933104,
0.06312097609043121,
0.015895986929535866,
-0.5525224804878235,
-0.7935365438461304,
-0.03837822005152702,
-0.2879178822040558,
0.039155878... | |
I know it's wrong to put a block element inside an inline element, but what about the following?
Imagine this valid markup:
```
<div><p>This is a paragraph</p></div>
```
Now add this CSS:
```
div {
display:inline;
}
```
This creates a situation where an inline element contains a block element (The div becomes... | [
0.35946527123451233,
0.3358645439147949,
0.5199187397956848,
0.025930777192115784,
-0.21093113720417023,
-0.1746148020029068,
0.09651965647935867,
-0.1588224470615387,
-0.14379236102104187,
-0.6073904633522034,
-0.1331614851951599,
0.3766067326068878,
-0.2721494436264038,
-0.03794539719820... | |
<h1>Heading</h1>
<p>Paragraph.</p>
</a>
```
This is actually really useful if you want a large block of HTML to be a link.
From the [CSS 2.1 Spec](http://www.w3.org/TR/CSS2/visuren.html#anonymous-block-level):
> When an inline box contains an in-flow block-level box, the inline box (and its inline ancestors wi... | [
-0.06542006134986877,
-0.09430073946714401,
0.5665597915649414,
0.17562304437160492,
-0.2805744409561157,
-0.13246293365955353,
0.047392576932907104,
-0.22608040273189545,
-0.17161576449871063,
-0.5946876406669617,
-0.37477055191993713,
-0.09388680756092072,
-0.45748159289360046,
0.0657753... | |
after the break are enclosed in anonymous block boxes, and the block-level box becomes a sibling of those anonymous boxes. When such an inline box is affected by relative positioning, any resulting translation also affects the block-level box contained in the inline box.
>
>
> This model would apply in the following ... | [
-0.02378668077290058,
-0.09757546335458755,
0.6597955226898193,
0.0949203222990036,
0.03928694128990173,
-0.32654932141304016,
0.3256504535675049,
-0.19573219120502472,
-0.21695049107074738,
-0.3828783631324768,
-0.7365715503692627,
0.07760003954172134,
-0.36034730076789856,
0.043285045772... | |
a block</TITLE>
> </HEAD>
> <BODY>
> <P>
> This is anonymous text before the SPAN.
> <SPAN>This is the content of SPAN.</SPAN>
> This is anonymous text after the SPAN.
> </P>
> </BODY>
>
> ```
>
> The P element contains a chunk (C1) of anonymous text followed by a block-level element fol... | [
0.15155990421772003,
0.04269362613558769,
0.6412736773490906,
0.25710952281951904,
-0.2843650281429291,
-0.011181441135704517,
-0.1394621729850769,
-0.4916726350784302,
-0.2017984390258789,
-0.3720177710056305,
-0.6046687364578247,
-0.11723870038986206,
-0.1845375895500183,
-0.158270403742... | |
C1, the SPAN block box, and another anonymous block box around C2.
>
>
> The properties of anonymous boxes are inherited from the enclosing non-anonymous box (e.g., in the example just below the subsection heading "Anonymous block boxes", the one for DIV). Non-inherited properties have their initial value. For exampl... | [
0.11157874017953873,
0.06782179325819016,
0.29772910475730896,
0.058328188955783844,
-0.07264114171266556,
-0.055453360080718994,
-0.1389823704957962,
-0.5958156585693359,
-0.26592937111854553,
-0.5484558343887329,
-0.42599162459373474,
0.13438013195991516,
-0.2279081791639328,
0.042458184... | |
the P element in the above example, the border would be drawn around C1 (open at the end of the line) and C2 (open at the start of the line).
>
>
> Some user agents have implemented borders on inlines containing blocks in other ways, e.g., by wrapping such nested blocks inside "anonymous line boxes" and thus drawing ... | [
0.11266766488552094,
-0.33859938383102417,
0.3867837190628052,
0.03781632333993912,
-0.23135900497436523,
0.0003279063676018268,
0.06400612741708755,
-0.3694516122341156,
-0.24268846213817596,
-0.561366856098175,
-0.1785566210746765,
-0.09162963926792145,
-0.6189205050468445,
-0.0415345877... | |
this specification was released.
Make of that what you will. Clearly the behaviour is specified in CSS, although whether it covers all cases, or is implemented consistently across today's browsers is unclear. | [
0.6926512122154236,
-0.22525571286678314,
0.3064269423484802,
-0.35634469985961914,
0.025695854797959328,
-0.41020667552948,
0.11541911959648132,
-0.021446911618113518,
-0.11944670975208282,
-0.5991711020469666,
-0.38957715034484863,
0.5202904939651489,
-0.21944169700145721,
-0.34234678745... | |
Give an algorithm to find a given element x (give the co-ordinates), in an n by n matrix where the rows and columns are monotonically increasing.
My thoughts:
Reduce problem set size.
In the 1st column, find the largest element <= x. We know x must be in this row or after (lower). In the last column of the matrix, fi... | [
-0.3883447051048279,
-0.035165268927812576,
0.22384949028491974,
-0.024924568831920624,
0.0556960292160511,
0.34139373898506165,
0.1051722839474678,
-0.47600266337394714,
-0.12142299860715866,
-0.742225706577301,
-0.30045264959335327,
0.28316643834114075,
-0.5028018355369568,
-0.1134707182... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.