text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
What are the primary differences between LISP and C# with regards to functional programming? In specific, if a LISP programmer was to switch to using C#, what are the features they are most likely to miss?
Doing functional programming in C# is technically possible (well, any language that has function pointers or deleg... | [
0.03200459107756615,
0.17219491302967072,
0.052318256348371506,
0.013123000971972942,
-0.5079541802406311,
-0.446527898311615,
0.44821396470069885,
0.08602502942085266,
-0.2049228996038437,
-0.4065547287464142,
0.05000877380371094,
1.0136091709136963,
-0.4185761511325836,
-0.22423906624317... | |
Particularly when you declare a local function... Func<...> = ouch.
* Full first class functions
+ Delegates aren't the answer, since they aren't structually equivalent. There's no canonical type to represent a function of a certain type. Ex: What is "increment"? Is it a Func? Is it a Converter? Is it something else? ... | [
-0.04461212456226349,
-0.19210520386695862,
0.47214919328689575,
0.16211135685443878,
-0.435080349445343,
-0.30781301856040955,
0.40667521953582764,
-0.1371946483850479,
-0.2219124138355255,
-0.6347641944885254,
-0.3948330581188202,
0.6495302319526672,
-0.4232151210308075,
0.06448683142662... | |
C# 7
* Discriminated unions (sum types)
* **Pattern matching** C# 7
+ Makes tuples and sum types much more valuable
+ Allows more expression-oriented code
* General monad syntax
+ **Makes things like async code much easier to write** C# 5
+ After you've nested 2+ layers of BeginXXX/EndXXX, it gets quite ugly.
* Eas... | [
0.03131219372153282,
0.002461300464347005,
0.44981396198272705,
-0.17092223465442657,
-0.48261505365371704,
-0.21067240834236145,
0.40112677216529846,
-0.2275085598230362,
-0.318982869386673,
-0.5644925832748413,
-0.1743980348110199,
0.7232614755630493,
-0.2835831046104431,
-0.173992231488... | |
should emit tail.call too.** Not needed, the JIT will add tail calls itself as appropriate.
Items in **bold** have been addressed since this answer was written. | [
0.19762642681598663,
-0.11512674391269684,
0.5637364387512207,
0.05328813195228577,
-0.34018445014953613,
-0.18852514028549194,
0.1861962527036667,
0.08081968873739243,
-0.06510736793279648,
-0.3385714590549469,
-0.28332266211509705,
0.2853131890296936,
-0.2393479198217392,
0.1021489500999... | |
A `JComponent` of mine is firing a `mouseDragged` event too vigorously. When the user is trying to click, it interprets is as a drag even if the mouse has only moved 1 pixel.
How would I add a rule for a particular component that amounted to:
> Do not consider it a drag event unless
> the mouse has moved 10 pixels ... | [
0.19637247920036316,
-0.19099999964237213,
0.14176300168037415,
0.08290670812129974,
-0.22712157666683197,
-0.1653004288673401,
0.1829935610294342,
-0.09509312361478806,
-0.48276275396347046,
-0.376455157995224,
0.2885361909866333,
0.5123475790023804,
-0.4321725070476532,
-0.21556422114372... | |
my mouse event processing code, cut down to just the bits relating to making drag require a few pixels before being treated as a drag.
```
public void mousePressed(int mod, Point loc) {
pressLocation=copyLocation(loc,pressLocation);
dragLocation=null;
}
public void mouseReleased(int mod, Point loc) {
... | [
-0.005186644848436117,
-0.25188103318214417,
0.7530702948570251,
-0.25134649872779846,
0.22384651005268097,
0.06587980687618256,
0.031690165400505066,
-0.06534925103187561,
-0.06615030020475388,
-0.4522240459918976,
-0.022796712815761566,
0.9525449275970459,
-0.496551513671875,
-0.12236583... | |
}
else if(dragLocation!=null) {
// action for drag completed
}
else {
// do nothing
}
pressLocation=null;
dragLocation=null;
}
public void mouseDragged(int mod, Point loc) {
if(pressLocation!=null) { | [
-0.05882943421602249,
-0.4142773449420929,
0.66806960105896,
-0.23201802372932434,
0.21297426521778107,
0.12257987260818481,
0.2739281952381134,
-0.1888662576675415,
-0.09973543137311935,
-0.21257959306240082,
-0.10612061619758606,
0.906572163105011,
-0.590969443321228,
-0.1150666996836662... | |
// initial drag actions following mouse press
dragLocation=pressLocation; // consider dragging to be from start point
if(Math.abs(loc.x-pressLocation.x)<dragMinimum && | [
-0.30083519220352173,
-0.17442192137241364,
0.6998116970062256,
-0.27354612946510315,
0.03686685115098953,
0.3801495134830475,
-0.005183303263038397,
-0.3790137767791748,
-0.10809256881475449,
-0.32963863015174866,
-0.19325798749923706,
0.8333773612976074,
-0.19981274008750916,
-0.39073646... | |
Math.abs(loc.y-pressLocation.y)<dragMinimum) {
return; // not dragged far enough to count as drag (yet)
} | [
-0.023901958018541336,
-0.39552024006843567,
0.6484780311584473,
-0.03999870643019676,
0.176819309592247,
0.21561063826084137,
0.008744359947741032,
-0.0995309129357338,
-0.11890748143196106,
-0.1805059313774109,
-0.2041788101196289,
0.8475444912910461,
-0.11652044206857681,
-0.19190658628... | |
// action drag from press location
pressLocation=null;
}
else {
// action drag from last drag location
dragLocation=copyLocation(loc,dragLocation);
}
}
```
And note, I also had problems with Java some JVM's generating click events after dragging, which I had to detect a... | [
-0.18313530087471008,
-0.02146276645362377,
0.2902717590332031,
-0.4271678030490875,
-0.011952538974583149,
0.1605152040719986,
0.16558346152305603,
-0.32183101773262024,
-0.22369858622550964,
-0.3541358709335327,
-0.07596603035926819,
0.8747531771659851,
-0.3314327895641327,
-0.1676453799... | |
Given a struct like this:
```
public struct SomeStruct
{
public SomeStruct(String stringProperty, Int32 intProperty)
{
this.StringProperty = stringProperty;
this.IntProperty = intProperty;
}
public String StringProperty { get; set; }
public Int32 IntProperty { get; set; }
}
```
O... | [
0.002666209591552615,
0.0429706946015358,
0.2877733111381531,
-0.037580933421850204,
0.10234032571315765,
-0.0036795095074921846,
0.27646780014038086,
-0.11795977503061295,
0.007318439893424511,
-0.25009626150131226,
-0.5562959313392639,
0.4296351969242096,
-0.49984416365623474,
0.11421353... | |
do I have to implement properties the old-fashioned way with my own explicit backing fields?
Prior to C# 6, you need to use the "this" constructor in this scenario:
```
public SomeStruct(String stringProperty, Int32 intProperty) : this()
{
this.StringProperty = stringProperty;
this.IntProperty = intProperty;
}... | [
0.013100807555019855,
0.1935078650712967,
0.386680006980896,
-0.15204761922359467,
0.05909555405378342,
-0.11421157419681549,
0.30590131878852844,
-0.19216614961624146,
-0.05505501106381416,
-0.20038054883480072,
-0.24455803632736206,
0.7201764583587646,
-0.2688245177268982,
0.120097763836... | |
intProperty)
{
this.StringProperty = stringProperty;
this.IntProperty = intProperty;
}
public string StringProperty { get; }
public int IntProperty { get; }
}
``` | [
-0.23675993084907532,
-0.22490181028842926,
0.6798425316810608,
-0.06576894968748093,
0.2622993290424347,
0.3445132076740265,
0.4940464198589325,
-0.17414692044258118,
-0.00760285509750247,
-0.23926490545272827,
-0.8900211453437805,
0.6707239747047424,
-0.5364255905151367,
0.25288826227188... | |
Having just read the first four chapters of [Refactoring: Improving the Design of Existing Code](https://rads.stackoverflow.com/amzn/click/com/0201485672), I embarked on my first refactoring and almost immediately came to a roadblock. It stems from the requirement that before you begin refactoring, you should put unit ... | [
0.4558872580528259,
0.447147011756897,
0.10560217499732971,
-0.10601550340652466,
0.12394791096448898,
-0.007050350308418274,
0.23146232962608337,
-0.6984858512878418,
-0.1325373649597168,
-0.5690454840660095,
0.2689952850341797,
0.43722835183143616,
0.10081066191196442,
0.2176786661148071... | |
one task? It seems to me that I would have to refactor my legacy code just to make it unit-testable.
Does anyone have any experience refactoring using unit tests? And, if so, do you have any practical examples you can share with me?
My second question is somewhat hard to explain. Here's an example: I want to refactor... | [
0.21968531608581543,
0.029588215053081512,
-0.1415453851222992,
0.19691964983940125,
0.12209929525852203,
0.06054645776748657,
-0.000007824051863281056,
-0.3214026391506195,
-0.29747438430786133,
-0.47077375650405884,
0.1330374777317047,
0.4498165547847748,
-0.07529091835021973,
0.31415191... | |
method produces the same results as the old method? If that is true, then how long do I leave the old deprecated method in the source code? Do I just whack it after I test a few different records? Or, do I need to keep it around for a while in case I encounter a bug in my refactored code?
Lastly, since a couple people... | [
0.484178751707077,
-0.14253602921962738,
0.20324869453907013,
0.17821888625621796,
-0.021191908046603203,
-0.12961310148239136,
0.3091716468334198,
-0.514202892780304,
-0.13541428744792938,
-0.3604137599468231,
0.35223087668418884,
0.40808412432670593,
-0.2404516488313675,
0.15041252970695... | |
insist on [Single Responsibilty](http://en.wikipedia.org/wiki/Single_responsibility_principle), so we have lovely clean code and tests to go with it. However, in the real (messy) world, code (especially legacy code) does lots of things and has no tests. What this needs is dose of refactoring to clean the mess.
My appr... | [
0.9222469925880432,
0.3936483860015869,
-0.18247894942760468,
0.17468707263469696,
-0.40825122594833374,
-0.552954375743866,
0.6299946308135986,
-0.3745120167732239,
-0.10008801519870758,
-0.2263304442167282,
-0.20366822183132172,
0.3114999532699585,
-0.15895628929138184,
0.329228550195693... | |
more often than not those helpers can then be added into the code base, as they have encapsulated emergent behaviour/logic/requirements. I don't mean I have a single huge test, what I do mean is mnay tests are doing work which a purist would call an integration test - does such a thing still exist? Also I've found it u... | [
0.43831610679626465,
0.29165616631507874,
-0.4865400791168213,
0.19345848262310028,
0.004288529045879841,
-0.16018426418304443,
0.4429694414138794,
0.07771606743335724,
0.05460020527243614,
-0.53635174036026,
-0.07086927443742752,
0.3295188844203949,
-0.28314584493637085,
-0.02231493964791... | |
I'm trying to finish up a Flash website for my company, and am having some major frustrations with Lightwindow links in Flash. I have a "Videos" page that has a few links, that when you click on one, it opens a Lightbox with a .SWF that plays the video. The problem is that the top of the Lightwindow and the Flash menu ... | [
0.6115066409111023,
0.2977546155452728,
0.6418583989143372,
-0.14609475433826447,
-0.04647993668913841,
-0.2458774298429489,
0.1898779273033142,
0.009639927186071873,
-0.23604349792003632,
-0.5449495911598206,
0.27432864904403687,
0.5376937389373779,
0.12066886574029922,
0.1460912823677063... | |
coding standard - more like coding style
```
SELECT
T1.col1,
T1.col2,
T2.col3
FROM
table1 T1
INNER JOIN ON Table2 T2 ON T1.ID = T2.ID
WHERE
T1.col1 = 'xxx'
AND T2.Col3 = 'yyy'
```
* capitalize reserved words
* main keywords on new line
* can't get used to commas before columns
* always us... | [
-0.28693675994873047,
0.17725145816802979,
0.3522501289844513,
0.082926906645298,
-0.06636597216129303,
0.04782518744468689,
0.029340622946619987,
-0.14617052674293518,
-0.2594705820083618,
-0.552202045917511,
-0.46720829606056213,
0.16421553492546082,
-0.1731976717710495,
-0.1847759485244... | |
Does anyone know of a utility (for Windows or Linux or MacOSX) that will append the selected contents to the clipboard? Rather than killing what's already there...(maybe using a different keyboard shortcut instead of **Ctrl+C** to do this?
And I don't mean multiple-clipboard items...
----------------------------------... | [
0.5026481747627258,
-0.058208104223012924,
0.4942578375339508,
0.30173444747924805,
0.18152281641960144,
-0.11003663390874863,
-0.17115618288516998,
0.15956836938858032,
-0.6233557462692261,
-0.6383715271949768,
0.31505802273750305,
0.4546087086200714,
-0.25807124376296997,
0.0174851138144... | |
I've set up a SOAP WebServiceProvider in JAX-WS, but I'm having trouble figuring out how to get the raw XML from a SOAPMessage (or any Node) object. Here's a sample of the code I've got right now, and where I'm trying to grab the XML:
```
@WebServiceProvider(wsdlLocation="SoapService.wsdl")
@ServiceMode(value=Service.... | [
0.423697829246521,
0.055481117218732834,
0.29407408833503723,
-0.03240879625082016,
-0.06062452495098114,
0.03900546953082085,
0.31824439764022827,
-0.4111025631427765,
0.19570977985858917,
-0.8950205445289612,
-0.0373636819422245,
0.465451180934906,
-0.09914090484380722,
0.097229905426502... | |
XML by setting up a different type of Provider (such as Source), I'd be willing to do that, too.
It turns out that one can get the raw XML by using Provider<Source>, in this way:
```
import java.io.ByteArrayOutputStream;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transf... | [
0.4415927529335022,
-0.1558484435081482,
0.3456170856952667,
-0.196125790476799,
-0.2750183045864105,
0.2545555531978607,
0.3134559094905853,
-0.4045296609401703,
0.11846622824668884,
-0.9177191853523254,
-0.25166332721710205,
0.4887046217918396,
-0.34751665592193604,
0.1031392365694046,
... | |
Transformer trans = TransformerFactory.newInstance().newTransformer();
trans.transform(msg, sr);
// Use out to your heart's desire.
}
catch (TransformerException e) {
e.printStackTrace();
}
return msg; | [
0.12010709941387177,
-0.7370829582214355,
0.5143104791641235,
-0.20974093675613403,
0.2314683496952057,
0.44133028388023376,
0.4925147593021393,
-0.5985425710678101,
0.28135165572166443,
-0.6002110242843628,
-0.023082775995135307,
0.5229129195213318,
-0.7501427531242371,
0.2333618849515915... | |
}
}
```
I've ended up not needing this solution, so I haven't actually tried this code myself - it might need some tweaking to get right. But I know this is the right path to go down to get the raw XML from a web service.
(I'm not sure how to make this work if you absolutely must have a SOAPMessage object, but then ... | [
0.3139408528804779,
0.06616006791591644,
-0.02044319361448288,
0.1686946004629135,
0.05444790795445442,
-0.005144840106368065,
0.10444126278162003,
0.19495061039924622,
0.18569400906562805,
-0.5826234817504883,
0.006988645531237125,
0.3916464149951935,
-0.17118585109710693,
0.0692388862371... | |
I have two models: Person and Relation. The second one stores information about relations between two people. It has parent\_id and child\_id fields and doesn`t have id field. I connected it with has\_many :through and it works.
But:
1. Relation.find(:all) returns empty array even if there are some relations in the t... | [
-0.39743685722351074,
-0.024762103334069252,
0.14353445172309875,
-0.10197417438030243,
0.00964430719614029,
0.3437618017196655,
0.0031539981719106436,
-0.21910938620567322,
0.1292949914932251,
-0.7963728904724121,
0.09909126907587051,
0.5967535376548767,
-0.2014116793870926,
0.43057397007... | |
"parent_id"
has_many :parent_relations,
:class_name => "Relation",
:foreign_key => "child_id"
has_many :children, :through => :child_relations
has_many :parents, :through => :parent_relations
end
class Relation < ActiveRecord::Base
belongs_to :parent, :class_name => "Person"
belongs_... | [
-0.10177984833717346,
0.25939735770225525,
0.16691814363002777,
-0.052924495190382004,
0.19150634109973907,
0.22674144804477692,
-0.03564063459634781,
-0.22567346692085266,
0.073749840259552,
-0.8017497658729553,
-0.09138969331979752,
0.26605233550071716,
0.11439886689186096,
0.39738211035... | |
an id in the join table. It makes the join table a whole model. Since every operation with records happens with an id, you wont be able to directly interface with a table without it. When you delete a record rails generates sql to delete the record by its id. **If you have a join table that acts as a full model, it mus... | [
0.0017063487321138382,
0.06789646297693253,
0.1856551468372345,
0.3696509003639221,
-0.139725923538208,
-0.3779149353504181,
0.012127785012125969,
-0.239336758852005,
-0.37146222591400146,
-0.7846328616142273,
0.1886357218027115,
0.15597788989543915,
-0.34450533986091614,
0.325550138950347... | |
an ID to the join table. That way in the future if the relationship model becomes more complex you can track it as its own entity. | [
0.4501523971557617,
-0.15147125720977783,
0.49046066403388977,
0.4532676637172699,
0.1653090864419937,
-0.16834117472171783,
-0.41734376549720764,
-0.18412712216377258,
-0.10990580171346664,
-0.5163085460662842,
0.11695154011249542,
0.4639616906642914,
-0.05625852197408676,
0.0122141428291... | |
I've read a great deal of discussion recently (both on this site and elsewhere) about "friendly URLs" but I'm not sure what exactly makes a URL "friendly" and why we really even care (up to a certain point). Illustration:
The following is an example of a URL that would be held up by the majority of current web develop... | [
0.6275247931480408,
0.35536590218544006,
0.48716622591018677,
-0.02800699695944786,
-0.2594006657600403,
-0.4326367974281311,
-0.025088855996727943,
0.3179985582828522,
-0.07959552109241486,
-0.3739062547683716,
-0.055803436785936356,
0.16529615223407745,
-0.11315382272005081,
0.2650772929... | |
do you need the title? Wouldn't this be a violation of the "don't repeat yourself" mantra?
* What difference does the form of a URL make as far as users are concerned? Do users ever actually **type** full URLs by hand (other than the TLD, of course)? Do users ever look to the URL of a page to determine what the page is... | [
0.8206731677055359,
0.15814746916294098,
0.2349652647972107,
0.2594080865383148,
-0.28355273604393005,
-0.6171210408210754,
0.5088782906532288,
0.38872870802879333,
-0.3829251527786255,
-0.11493416130542755,
-0.18418258428573608,
0.40077483654022217,
0.01010646391659975,
0.1411165148019790... | |
preferred. Why does a search engine spider care about the URL? Aren't they just automated pieces of software that crawl pages (and the links to other pages that are contained within them)? If search engines were written like other software components (e.g. database access components), the URL would just be a meaningles... | [
0.12973301112651825,
0.035269588232040405,
0.5295311808586121,
0.40255773067474365,
-0.2979865074157715,
-0.4239611327648163,
-0.08801619708538055,
0.25800821185112,
-0.41887328028678894,
-0.46111610531806946,
-0.16696953773498535,
0.32758235931396484,
-0.15620604157447815,
0.3238551914691... | |
out of hand. Here is an actual URL from Amazon.com that I don't think anyone in their right mind would consider "friendly":
> <http://www.amazon.com/Bissell-Kitchen-Housewares/b/ref=amb_link_5001972_17?ie=UTF8&node=694500&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=gp-center-5&pf_rd_r=1ZXNJFE0CCFFDH4B9HGH&pf_rd_t=101&pf_rd_p=405478... | [
0.26710382103919983,
0.47309353947639465,
0.5286032557487488,
-0.0015699719078838825,
-0.13491332530975342,
-0.3291468322277069,
0.024568011984229088,
0.23122954368591309,
-0.2323838472366333,
-0.47643715143203735,
0.1091824546456337,
-0.039361752569675446,
-0.005434261169284582,
0.3640464... | |
between keeping the old URL, or changing the URL to match the new title. Changing the URL will break any previous links to that page; and not changing it means you'll have a URL that doesn't match the page. Neither is good for the user. Better to just go with *www.myblog.com/posts/123*.
* Users often do need to type a ... | [
0.8380240797996521,
0.08897912502288818,
0.3188611567020416,
0.23363876342773438,
-0.22108201682567596,
-0.391815185546875,
0.0714339166879654,
0.2944098114967346,
-0.49910247325897217,
-0.6559670567512512,
0.10698693990707397,
0.2042643427848816,
0.05287321284413338,
0.3246002197265625,
... | |
and figure that the URL for the page I want to see is www.myblog.com/posts/124. That's a level of user-friendliness that can be a big help to people trying to find what they're looking for. Including other information (like the subject of the post) can make this impossible -- so it reduces my exploration options.
* **F... | [
0.6885590553283691,
0.2946896255016327,
0.47567546367645264,
0.17723703384399414,
-0.3029790222644806,
-0.3970591425895691,
0.4220399260520935,
0.4576484262943268,
-0.33274391293525696,
-0.49138250946998596,
0.11792118102312088,
0.4746965169906616,
0.23909442126750946,
-0.1283320039510727,... | |
If my goal is to test the rendering speed in IE of a specific web page through repeated loads (merely using a javascript onload event for timing and viewing the page doesn't cut it), what would be a good way to do it?
My current attempt was by using the IE WebBrowser object in VB and C#, though I'm open to other sugge... | [
0.6087067127227783,
-0.0959361270070076,
0.1446227878332138,
-0.04319681227207184,
-0.4485945999622345,
0.09779126942157745,
0.34058141708374023,
0.08639360219240189,
-0.06294269114732742,
-1.0007160902023315,
0.191420316696167,
0.5301286578178406,
-0.2169574797153473,
-0.2378685176372528,... | |
a readystate loop. In all cases, the tests take longer and longer to run, though using `reload` complete instread of `navigate2` seems to help a little, perhaps implying the problem is some sort of history issue.
```
For cnt = 1 To 100
timer = GetTickCount()
Form1.WebBrowser1.Navigate2 "http://www.example.com"... | [
0.21824951469898224,
0.09427786618471146,
0.5943001508712769,
-0.05896364524960518,
0.4079313278198242,
-0.02270979806780815,
0.3983878195285797,
-0.5170705318450928,
-0.0970289558172226,
-0.6301215887069702,
-0.08924254029989243,
0.4941035211086273,
-0.07568708062171936,
-0.17947582900524... | |
}
``` | [
0.3354566991329193,
0.5660994052886963,
-0.045124202966690063,
0.08949362486600876,
0.36271432042121887,
-0.03456072509288788,
0.2035233974456787,
0.4996976852416992,
0.20306141674518585,
-0.48415371775627136,
-0.1802433431148529,
0.4521971344947815,
-0.138974130153656,
0.3154967725276947,... | |
I'm using Windbg (with the sos extention) and trying to debug a crashed application. I was able to dump the IL of the call that threw the exception and by examining the code, it seems like I could obtain the information that I need if I could dump the contents of the evaluation stack. Is it possible to do what with Win... | [
-0.05200062692165375,
-0.031248250976204872,
0.5681845545768738,
-0.05315857380628586,
-0.22058391571044922,
-0.1624976545572281,
0.39340654015541077,
-0.27044132351875305,
-0.3884936273097992,
-0.47564637660980225,
-0.18990565836429596,
0.31069180369377136,
-0.24154338240623474,
0.0568914... | |
is the method offset of the method that crashed as reported by the Windows Error Reporting tool*. I got this output:
Module: 000e2c3c (theApplicationName.exe)
Token: 0x0600009a
MethodDesc: 000e67c8
Name: MyNamespace.MyClassName.theCulpritFn(MyOtherClass)
JITTED Code Address: 0081b1d0
5. **!dumpil 00e67c8**... | [
-0.38051480054855347,
-0.027417998760938644,
0.36984580755233765,
0.136139377951622,
-0.13899776339530945,
0.07417850941419601,
0.1434261053800583,
-0.21729816496372223,
-0.18225589394569397,
-0.44158709049224854,
0.09348130226135254,
0.584112823009491,
-0.19734080135822296,
-0.04935176670... | |
newobj MyNamespace.MySpecialExceptionType::ctor
IL_009d: throw
}
```
The question is: is there a way for me to see what was pushed on the stack before the exception was thrown. If I'm not mistaken, the argument passed into the exception constructor should be the local variable at index 0 on the evaluation stack.
P... | [
0.05033769831061363,
0.1036304235458374,
0.48854562640190125,
-0.0009742775000631809,
0.17733703553676605,
-0.21023283898830414,
0.14630742371082306,
-0.03126591444015503,
-0.44171443581581116,
-0.7368813753128052,
0.0314532108604908,
0.46136778593063354,
-0.21970173716545105,
0.3841154277... | |
the current thread is displayed in the WinDbg prompt.
`!threads` will display all managed threads in your application. Once identified you can switch threads using `~Xs` where X is the WinDbg id for the thread.
`!clrstack` will show you the stack trace. If you want locals and/or parameters use `-l` / `-p` (or `-a` f... | [
-0.30859094858169556,
-0.05467208847403526,
0.8293598890304565,
0.07142650336027145,
0.04626944661140442,
-0.03252115845680237,
0.08370199054479599,
0.09720874577760696,
-0.29070577025413513,
-0.8121801018714905,
-0.2905389070510864,
0.20214176177978516,
0.029965447261929512,
0.38143339753... | |
I've already looked at [this question](https://stackoverflow.com/questions/88904/error-creating-window-handle), and I've already checked out the suggestions that were made there. My program creates and destroys a lot of UI controls (a *lot* of UI controls), and anything that makes controls hang around after they're "de... | [
0.40756213665008545,
0.02143542282283306,
0.5204389691352844,
0.19796313345432281,
0.2759096324443817,
-0.5571505427360535,
0.13158497214317322,
-0.16365350782871246,
-0.26628851890563965,
-0.2855686545372009,
-0.24897529184818268,
0.49665921926498413,
-0.09498491883277893,
0.4086664915084... | |
its container is being destroyed.)
The thing is, it's actually possible that my application really is running out of window handles. The program's got a single form that has nested tab controls. Each parent tab has 12 or 13 child tabs, and a child tab can have 30 or 40 controls on it. It's quite possible for the user ... | [
0.19376949965953827,
0.15554147958755493,
0.2354493886232376,
0.41543957591056824,
0.16482065618038177,
0.44740942120552063,
0.1450027972459793,
0.026782071217894554,
-0.43486279249191284,
-0.5643306970596313,
-0.017958223819732666,
0.15504491329193115,
0.01101698912680149,
0.3072572350502... | |
looks like you've designed the UI wrong," let me disabuse of that: the whole reason the application exists in the first place is that the users have an enormous space of data that they need to be able to navigate to quickly. The tabs-within-tabs thing actually works really well for them.)
My understanding is that ther... | [
0.27600225806236267,
0.1547611951828003,
0.4674625098705292,
0.27008765935897827,
0.02342028170824051,
-0.05598330497741699,
0.5798825621604919,
0.17564192414283752,
-0.3841409981250763,
-0.5616948008537292,
-0.015948114916682243,
0.5598726272583008,
-0.27732911705970764,
0.053189493715763... | |
the least recently used tab when I start running low on window handles.
But how do I tell that I've started running low on window handles? And is this really the right approach to the problem?
(This is but one of the many reasons that I'd like to rebuild this UI in WPF.)
I've fixed this problem, which I've described ... | [
-0.06734467297792435,
0.009986239485442638,
0.6647305488586426,
0.10135895758867264,
-0.1271791309118271,
-0.24362416565418243,
0.06002992391586304,
0.08600564301013947,
-0.26969873905181885,
-0.6251329779624939,
-0.08873239904642105,
0.347354531288147,
-0.1818096786737442,
0.0781369060277... | |
the user visits one.
2. Count the window handles in use before creating a new tab page.
3. If too many window handles are in use, dispose the contents of least-recently-visited tab pages until the number of window handles in use gets down to a safe level. | [
0.055661171674728394,
-0.17509283125400543,
0.6104830503463745,
-0.019823459908366203,
-0.15557312965393066,
-0.434415727853775,
0.15046197175979614,
-0.26291951537132263,
-0.14898499846458435,
-0.8628038763999939,
-0.4062073230743408,
0.4904492199420929,
-0.3333771526813507,
0.01484207995... | |
I have a NIB file with a UIView, a couple of UIImageView's (including a logo) and a UITableView inset within the UIView below the logo where I allow users to input a username/password to login to my application. I also have a third arbitrary UITextField within a UITableViewCell below the username/password. The problem ... | [
0.17571000754833221,
0.03727930411696434,
0.7383949160575867,
-0.030324280261993408,
-0.10754051804542542,
0.01567443273961544,
0.22359536588191986,
0.014210868626832962,
0.048456378281116486,
-0.9694967865943909,
0.1516503393650055,
0.6366214752197266,
-0.15793578326702118,
0.286373436450... | |
going to guess because the UITableView is inset within the UIView.
Any suggestions on how to get the appropriate behavior would be much appreciated.
I've fixed this problem, which I've described in detail in [this answer](https://stackoverflow.com/questions/143206/how-do-you-obtain-current-window-handle-count-and-wind... | [
0.13392116129398346,
-0.08788125962018967,
0.47208109498023987,
0.0261619221419096,
-0.0034430334344506264,
0.05172352492809296,
-0.02280130796134472,
-0.2984577417373657,
0.15567642450332642,
-0.6029421091079712,
0.015513904392719269,
0.3183041512966156,
-0.2299765646457672,
-0.0305120032... | |
least-recently-visited tab pages until the number of window handles in use gets down to a safe level. | [
0.06369304656982422,
-0.011788125149905682,
0.830939531326294,
0.12905386090278625,
-0.12299814820289612,
-0.21967078745365143,
0.08340708911418915,
0.4325321614742279,
-0.4179762601852417,
-0.4899180829524994,
-0.6228866577148438,
0.22396452724933624,
0.15730395913124084,
0.22662556171417... | |
I have inherited two complicated COM objects. One was derived from the other and (allegedly) the GUIDs, etc., were all changed so that they should not interfere. They do interfere and so far our debugging has not identified the culprit -- we've done registry compares and source code diffs and looked through the SCCS ch... | [
0.7065262794494629,
0.021684687584638596,
0.07227763533592224,
0.18083789944648743,
0.21214978396892548,
-0.09349655359983444,
-0.01620716042816639,
-0.027503356337547302,
-0.41935667395591736,
-0.68301922082901,
0.16183079779148102,
0.6768144965171814,
0.027288023382425308,
0.324747234582... | |
use [regcap](http://nidget.wordpress.com/2012/08/01/create-registry-file-reg-equivalent-to-the-regsvr32-command/) to pull out the registry entries and then just collect a list of GUIDs via a script. You could also use OLEView (also from Visual Studio) to do this.
There are also other free tools that can do this:
M... | [
0.47773998975753784,
-0.28697469830513,
0.6299260854721069,
0.054289449006319046,
-0.1235160157084465,
-0.1524561643600464,
-0.1088421568274498,
-0.0470832958817482,
-0.320138156414032,
-0.8260924816131592,
0.22368773818016052,
0.6740899682044983,
-0.17789757251739502,
0.08141184598207474,... | |
I've hit a small dilemma! I have a handler called vote; when it is invoked it sets a user's vote to whatever they have picked. To remember what options they previously picked, I store a VoteRecord options which details what their current vote is set to.
Of course, the first time they vote, I have to create the object ... | [
0.20737864077091217,
-0.23799613118171692,
0.2625306248664856,
0.23541760444641113,
-0.23171380162239075,
0.399034321308136,
-0.19690591096878052,
-0.21599841117858887,
-0.18309542536735535,
-0.769180417060852,
0.25991785526275635,
0.28510749340057373,
-0.07668347656726837,
-0.118255853652... | |
still bad when it does.
The issue happens because two separate handlers both do essentially this:
```
query = VoteRecord.all().filter('user =', session.user).filter('poll =', poll)
if query.count(1) > 0:
vote = query[0]
poll.votes[vote.option] -= 1
poll.votes[option] += 1
poll.put()
vote.option = option
vote... | [
0.10633133351802826,
0.10168391466140747,
0.4518173635005951,
-0.12638762593269348,
0.12705206871032715,
0.2367435097694397,
0.20976945757865906,
-0.3001500964164734,
-0.12228338420391083,
-0.43714362382888794,
0.1731971949338913,
0.31847530603408813,
-0.42190083861351013,
-0.0371784344315... | |
== 0:
obj = VoteRecord()
obj.user = user
obj.option = option
obj.put()
```
Without a transaction, your code could run in this order in two interpreter instances:
```
if vote.count(1) == 0:
obj = VoteRecord()
obj.user = user
if vote.count(1) == 0:
obj = VoteRecord()
obj.user = user
... | [
-0.15554147958755493,
-0.1740838587284088,
0.36090922355651855,
-0.17851127684116364,
-0.06512833386659622,
0.40046340227127075,
0.2820374369621277,
-0.16865810751914978,
-0.13714686036109924,
-0.5910682082176208,
-0.2981284260749817,
0.41681191325187683,
-0.4946407377719879,
-0.4086546301... | |
the put has occured, so the second thread goes through the first part of the conditional instead of the second.
You can fix this by putting the code in a function and then using
```
db.run_in_transaction()
```
to run the function.
Problem is you seem to be relying on the count of objects returned by a query for yo... | [
0.2761579155921936,
-0.1842525601387024,
-0.025836078450083733,
0.03158096969127655,
0.0033960745204240084,
-0.030362224206328392,
0.13032834231853485,
-0.27110224962234497,
-0.1173674464225769,
-0.5203262567520142,
0.11620272696018219,
0.6054173111915588,
-0.37826165556907654,
0.152827799... | |
query for it *outside* of the transaction function, and then pass the key for that entity to your transaction function.
Here's an example of a transaction function that checks an entity property. It's passed the key as a parameter:
```
def checkAndLockPage(pageKey):
page = db.get(pageKey)
if page.locked:
retu... | [
0.004256454296410084,
0.09965634346008301,
0.38861221075057983,
-0.022462468594312668,
-0.055227819830179214,
-0.1960313618183136,
0.14838102459907532,
-0.29812175035476685,
0.07744953781366348,
-0.8350112438201904,
-0.1566486954689026,
0.38567227125167847,
-0.35949185490608215,
0.41360649... | |
I've spent the last 4 years in C# so I'm interested in current best practices and common design patterns in C++. Consider the following partial example:
```
class World
{
public:
void Add(Object *object);
void Remove(Object *object);
void Update();
}
class Fire : Object
{
public:
virtual void Update()... | [
0.5998290181159973,
0.3897573947906494,
0.19331131875514984,
-0.4019382894039154,
0.1663980633020401,
-0.30916082859039307,
0.45976126194000244,
0.004001076333224773,
-0.12989632785320282,
-0.5968639850616455,
-0.20503774285316467,
0.7396013140678406,
-0.0024498351849615574,
0.379216134548... | |
}
}
}
```
Here we have a world responsible for managing a set of objects and updating them regularly. Fire is an an object that might be added to the world under many different circumstances but typically by another object already in the world. Fire is the only object that knows when it has burned out so currentl... | [
0.2642880976200104,
0.36441999673843384,
0.14983336627483368,
0.051845282316207886,
0.101070836186409,
-0.09106948971748352,
0.2966592013835907,
0.11109502613544464,
-0.4330918490886688,
-0.5161658525466919,
-0.22848011553287506,
0.5013871192932129,
-0.3873007595539093,
0.4678654968738556,... | |
clean up these objects?
The problem with this is that you're really creating an implicit coupling between the object and the World class.
If I try to call Update() outside the World class, what happens? I might end up with the object being deleted, and I don't know why. It seems the responsibilities are badly mixed up... | [
0.3897227942943573,
0.10411067306995392,
-0.010312125086784363,
0.2269299477338791,
-0.14303354918956757,
-0.24143478274345398,
0.7991631627082825,
-0.16499485075473785,
-0.31927886605262756,
-0.44222018122673035,
0.12931428849697113,
0.31981033086776733,
-0.20759570598602295,
0.3205531537... | |
from the world, the current map, and the player's inventory? Your Update function will remove it from the world, and then delete the object, and the next time the map or the inventory tries to access the object, Bad Things Happen.
In general, I'd say it is very unintuitive for an Update() function to delete the object... | [
0.19543170928955078,
0.03934040665626526,
0.3537714183330536,
0.09648753702640533,
0.3158937394618988,
-0.12367995083332062,
0.2404223382472992,
0.08658219128847122,
-0.34275734424591064,
-0.416700541973114,
-0.47217345237731934,
0.5577102899551392,
-0.1799362599849701,
0.3660622537136078,... | |
removing it from the world. For deleting it, think in terms of ownership.
Who owns the object? The world? That means the world alone gets to decide when the object dies. That's fine as long as the world's reference to the object is going to outlast an other references to it.
Do you think the object own itself? What do... | [
0.05506822466850281,
0.08294423669576645,
0.35219329595565796,
0.15828047692775726,
0.1993318498134613,
-0.1791238933801651,
-0.0445866733789444,
0.07300372421741486,
-0.35050123929977417,
-0.2203376591205597,
-0.40044742822647095,
0.1605689972639084,
-0.44182777404785156,
0.83127689361572... | |
member function on the object itself, which is hardcoded to remove the object from *one* specific list, whether or not it exists there, and whether or not it also exists in any other list, and also delete the object itself regardless of which references to it exist, is a bad idea. | [
-0.137380450963974,
0.023335203528404236,
-0.17812752723693848,
0.045229144394397736,
-0.01968134567141533,
-0.33641523122787476,
0.5458436012268066,
0.08839195221662521,
-0.462965726852417,
-0.21053512394428253,
-0.4280751645565033,
-0.07309028506278992,
-0.4818846881389618,
0.48218220472... | |
I am using jQuery to make some ajax calls and wonder how people handle this situation.
1. An ajax request is made to the server to retrieve some info.
2. Before the request returns another request is made. The first request is now invalid and out of date.
How do I tell that the initial request is now invalid and can... | [
0.22843094170093536,
-0.10051335394382477,
0.44040197134017944,
0.08731270581483841,
-0.33224907517433167,
-0.405630886554718,
-0.0428866408765316,
-0.0757966935634613,
0.02909819781780243,
-0.5977582931518555,
-0.0771927535533905,
0.5215423107147217,
-0.29137569665908813,
0.14752468466758... | |
lastRequest;
function getSomeData() {
if(lastRequest) {
lastRequest.abort();
lastRequest = null
}
lastRequest = $.ajax(...);
}
```
The net effect is that earlier requests' responses are ignored if a subsequent request is made. | [
-0.22442293167114258,
-0.4810439646244049,
0.30135026574134827,
-0.2560070753097534,
0.13770759105682373,
-0.1382247358560562,
0.4393775761127472,
-0.053131137043237686,
-0.2734120786190033,
-0.7122839093208313,
-0.44743674993515015,
0.6366478800773621,
-0.17654970288276672,
0.141228541731... | |
I have a WCF service that uses a System.ServiceModel.Syndication.SyndicationFeed to create an RSS feed.
But I'm having trouble figuring out how to add a Processing Instruction to output that points to my CSS stylesheet.
What I need is a processing instruction that looks a bit like this:
```
<?xml-stylesheet type="t... | [
0.32014209032058716,
-0.08944422751665115,
0.5554136633872986,
-0.1694493591785431,
-0.26919445395469666,
-0.4317348599433899,
-0.0368204265832901,
-0.1069798693060875,
-0.2915678322315216,
-0.8326605558395386,
-0.01631290279328823,
0.5474556684494019,
-0.4785679280757904,
0.25884291529655... | |
lastRequest = null
}
lastRequest = $.ajax(...);
}
```
The net effect is that earlier requests' responses are ignored if a subsequent request is made. | [
-0.17906682193279266,
-0.26020368933677673,
0.1974826455116272,
-0.16934430599212646,
-0.00009410337952431291,
-0.23258590698242188,
0.3563375771045685,
0.010218258015811443,
-0.23958063125610352,
-0.6379748582839966,
-0.3693941831588745,
0.5906393527984619,
-0.24474158883094788,
0.0916088... | |
There is a very [similar question](https://stackoverflow.com/questions/225471/how-do-i-replace-accented-latin-characters-in-ruby) already. One of the solutions uses code like this one:
```
string.mb_chars.normalize(:kd).gsub(/[^x00-\x7F]/n, '').to_s
```
Which works wonders, until you notice it also removes spaces, d... | [
-0.28977516293525696,
0.014829806983470917,
0.2804557681083679,
-0.13652196526527405,
-0.2612612843513489,
0.17344027757644653,
0.5824209451675415,
0.03571111336350441,
-0.22789642214775085,
-0.7425512671470642,
-0.4937363266944885,
0.47219645977020264,
-0.20417268574237823,
-0.13843773305... | |
# Also tried ISO-8859-1
iconv.iconv 'Café' # Throws an error: Iconv::IllegalSequence: "é"
```
Help please?
> it also removes spaces, dots, dashes, and who knows what else.
It shouldn't.
```
string.mb_chars.normalize(:kd).gsub(/[^x00-\x7F]/n, '').to_s
```
You've mistyped, there should be a backslash before the x00... | [
-0.043320432305336,
0.024850500747561455,
0.5859078168869019,
-0.09459169209003448,
0.053918205201625824,
0.11771668493747711,
0.7756417393684387,
0.010434729047119617,
-0.34740662574768066,
-0.3553125858306885,
-0.3466840982437134,
0.5258262157440186,
-0.5352146029472351,
0.08250830322504... | |
I'm trying out my first Spring project and must be doing something really stupid because I can't figure out how to get the following simple snippet of code to work:
Here is my definition file:
```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://... | [
0.46337080001831055,
0.17449761927127838,
-0.1400679349899292,
-0.15875296294689178,
-0.2773089110851288,
0.28167346119880676,
0.28418925404548645,
-0.4779667854309082,
-0.012254050001502037,
-0.6598142385482788,
0.05018100142478943,
0.20661266148090363,
-0.318818598985672,
0.0254257842898... | |
</bean>
</beans>
```
And my two simple beans:
```
public class AWSProperties {
private String awsAccessKey;
private String awsSecretKey;
private String awsSQSQueueName;
public void setAwsAccessKey(String awsAccessKey) {
awsAccessKey = awsAccessKey;
}
public String getAwsAccessKey(... | [
0.43681421875953674,
0.2342897355556488,
0.0913732722401619,
-0.07061362266540527,
-0.29952120780944824,
0.5010074377059937,
0.4000675678253174,
0.04586150869727135,
0.13624867796897888,
-0.7526795268058777,
-0.4791875183582306,
0.735425591468811,
-0.48724016547203064,
0.17874324321746826,... | |
return awsSecretKey;
}
public void setAwsSQSQueueName(String awsSQSQueueName) {
awsSQSQueueName = awsSQSQueueName;
}
public String getAwsSQSQueueName() {
return awsSQSQueueName;
}
}
public class QueueService {
private AWSProperties properties;
public QueueService(AWSPro... | [
0.1398206204175949,
-0.3112243711948395,
0.2191566824913025,
-0.13857409358024597,
-0.05555204302072525,
0.25887036323547363,
0.5991755127906799,
-0.04587738588452339,
0.23241114616394043,
-0.6727940440177917,
-0.30439311265945435,
0.6644582748413086,
-0.1620342880487442,
0.436785697937011... | |
System.out.println(properties.getAwsAccessKey());
}
}
```
When I run the following snippet I get "null" when I am expecting "test1"
```
public class VMMConsumer {
public static void main(String[] args)
{
ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"VMMCons... | [
0.092076376080513,
-0.2744174301624298,
0.7598523497581482,
-0.2529142200946808,
-0.023313002660870552,
0.09551265090703964,
0.4917171001434326,
-0.23327919840812683,
-0.2844494879245758,
-0.6245471835136414,
-0.2661713659763336,
0.4965624213218689,
-0.3148745000362396,
0.23893561959266663... | |
parameters as a Save Action.
Mind you - you won't make the same mistake twice! | [
0.27999770641326904,
-0.3189447820186615,
-0.0390300527215004,
0.476718932390213,
-0.013249577954411507,
-0.15540103614330292,
0.33839452266693115,
-0.1432882696390152,
-0.27533096075057983,
-0.19168734550476074,
0.2852829098701477,
1.0027705430984497,
-0.21884393692016602,
0.0655990168452... | |
Semantically, I want an itemized list, but visually I just want some space. How can I hide the bullets?
I can't speak for any other setup, but I'm using Tufte-Latex on MacTex, and I just typed the following:
`\begin{itemize}[]`
It worked. :-) I love it when guessing does that. So just try adding `[]` after.
P.S. t... | [
0.0014822917291894555,
0.3147203326225281,
-0.14419423043727875,
0.07689686119556427,
-0.30981871485710144,
0.15698912739753723,
0.3075997829437256,
-0.3663840591907501,
0.030378514900803566,
-0.459236741065979,
-0.06104283779859543,
0.3867753744125366,
-0.35415735840797424,
-0.16394264996... | |
approach is to again use [], but next to each item in the list as in other answers on this page. If you tire of seeing square brackets on each line, try other approaches on this page :)
```
\begin{description}
\item[] first item
\end{description}
``` | [
0.02475403994321823,
-0.0999932661652565,
0.17103464901447296,
0.04338705539703369,
-0.17993085086345673,
-0.0008414778276346624,
0.07212840765714645,
-0.5478881001472473,
-0.18083161115646362,
-0.705418050289154,
-0.1737961620092392,
0.6952997446060181,
-0.22348222136497498,
0.12872111797... | |
Based on the code I've found, it seems that the Visitor is required to known the structure of the visited objects and call on the needed children. This seems a bit clunky in some cases where the visitor would want to continue to work even if the visited classes are modified.
I guess the real question is: *Is their a p... | [
0.14728453755378723,
0.14028774201869965,
-0.02328515239059925,
0.2048405408859253,
0.07672250270843506,
0.06114017963409424,
0.3663771450519562,
0.13780486583709717,
-0.7286554574966431,
-0.38831785321235657,
-0.24990786612033844,
0.41361868381500244,
-0.15363624691963196,
0.0074208145961... | |
of thing the visitor knows how to visit. This allows the visitor to decide how much it really wants to visit, and in what order.
Suppose you have a tree. One visitor might do a pre-order traversal, one might do an in-order traversal, and yet another visitor might act only on leaf nodes. The visitor classes can do all ... | [
-0.02170950174331665,
-0.11683181673288345,
0.2765401601791382,
0.3512345552444458,
-0.01858012191951275,
-0.10889284312725067,
0.554975152015686,
-0.1266874372959137,
-0.5793269276618958,
-0.46571359038352966,
-0.38227415084838867,
0.39232802391052246,
-0.24643951654434204,
0.373415738344... | |
object, and the visitor will invoke the command on each thing it visits.
If you want to have a simple operation and let the collection give you each item to act on, then you want the collection to provide an **iterator** for itself. Call your function on each thing the iterator gives you.
If you want to iterate over ... | [
-0.25957146286964417,
-0.2820044755935669,
0.3052161633968353,
0.16594421863555908,
-0.1478019654750824,
0.20732809603214264,
0.16065582633018494,
-0.11949814110994339,
-0.49800556898117065,
-0.4134913384914398,
-0.30409765243530273,
0.5084372758865356,
-0.4574015438556671,
0.2482490390539... | |
Given the following tables in ActiveRecord:
* authors
* sites
* articles
I don't know how to express that an author is paid a different amount depending on the publication, but that authors working for the same publication have different rates:
* John publishes an article in Foo for $300
* John publishes an article ... | [
0.49538516998291016,
0.6118369102478027,
0.5830581784248352,
-0.08698340505361557,
-0.24472248554229736,
0.13869734108448029,
0.16077065467834473,
-0.12974178791046143,
-0.11678789556026459,
-0.41973286867141724,
0.35425764322280884,
0.6072626113891602,
-0.1958361268043518,
0.0197988543659... | |
publication.id and author.id, I derive the cost of the article with
```
cost = Rate.find(:first, :conditions => ["author_id = ? and site_id = ?", author.id, site.id]).rate
```
That works, but I'm not sure it's the best way, and I'm not sure how to make sure I don't end up with 'John' having two rates for 'Baz.'
I ... | [
0.13517887890338898,
0.5689693689346313,
0.5224831700325012,
0.35047152638435364,
-0.025842059403657913,
-0.13589027523994446,
0.13236455619335175,
-0.09571337699890137,
0.16310422122478485,
-0.7330058813095093,
0.07468847185373306,
0.6096877455711365,
0.13812744617462158,
0.20177294313907... | |
Publication
has_many :authors, :through => :rates
end
class Rate #rich join table
belongs_to :author
belongs_to :publication
end
```
And you can then simplify your finding like this:
```
@author.rates.find_by_site_id(123)
```
Plus you get direct access accross the join table
```
@author.publications
@publi... | [
0.1399993747472763,
0.33081379532814026,
0.6684126257896423,
0.16154253482818604,
0.009331694804131985,
-0.5275876522064209,
-0.23417045176029205,
-0.3143462836742401,
-0.27149781584739685,
-0.733649492263794,
-0.10244646668434143,
0.469916433095932,
-0.026721090078353882,
0.18785244226455... | |
My intuition was
```
Lorem ipsum\footnote{long footnote
that spans a whole
bunch of
lines.
}
```
But regardless of where I put the `{` and `}` in relation to the footnote text, I get the following error:
```
Latex Error: ./mydoc.tex:142 Package inputenc Error: Unicode char \u8:― not set up for use with LaTeX.... | [
0.22441181540489197,
0.30110880732536316,
0.41676172614097595,
-0.0022604046389460564,
0.11094238609075546,
-0.05226849764585495,
0.2091815322637558,
0.2087513655424118,
0.053432073444128036,
-0.5788884162902832,
0.0281230341643095,
0.4333747625350952,
-0.1604127138853073,
-0.1103799715638... | |
...
it finally comes to a stop.
}
```
That is not your problem. looking at the error message (which I don't recognize from personal experience), I'd say your problem is character set or font related.
Is you editor using unicode? | [
-0.0457356758415699,
0.5168578028678894,
-0.053455233573913574,
0.001258242642506957,
-0.1110384538769722,
-0.0147521598264575,
-0.03921922296285629,
0.2658422887325287,
-0.21487191319465637,
-0.7498002648353577,
-0.16515912115573883,
0.5680219531059265,
-0.46618491411209106,
0.00164943712... | |
I have a section:
```
\section{Introduction} \label{sec:introduction}
```
I'd like a link to the section where the link text is the name of the section. I can use `hyperref`:
```
The \hyperrf[sec:introduction]{Introduction} introduces the paper.
```
But that requires repeating the section title ("Introduction"). ... | [
0.1835431456565857,
0.28270840644836426,
0.5152023434638977,
0.11501187831163406,
-0.297262966632843,
-0.33958226442337036,
-0.08375242352485657,
0.020103657618165016,
-0.38309651613235474,
-0.37801966071128845,
-0.0005840749945491552,
0.17027278244495392,
-0.15707938373088837,
0.157669171... | |
same author as hyperref, Heiko Oberdiek; it's the one that I would choose. Here's an example:
```
\documentclass[oneside,12pt]{article}
\usepackage[user,titleref]{zref}
\begin{document}
\section{Introduction of sorts.}\zlabel{sec:intro}
Hello
\subsection{Structure}
We begin in `\ztitleref{sec:intro}'.
\end{document}
... | [
-0.4147355258464813,
0.11973361670970917,
0.5580042600631714,
0.2261607050895691,
-0.19877967238426208,
-0.24484029412269592,
0.10029903054237366,
0.12164414674043655,
-0.336243599653244,
-0.3457682430744171,
-0.31137096881866455,
0.024346234276890755,
-0.021258892491459846,
0.349169999361... | |
So I am working on something in php where I have to get my images from a sql database where they will be encoded in base64. The speed of displaying these images is critical so I am trying to figure out if it would be faster turn the database data into an image file and then load it in the browser, or just echo the raw ... | [
0.34651216864585876,
0.12819626927375793,
0.2854599952697754,
0.02834036946296692,
-0.2805454134941101,
0.021268615499138832,
0.016380729153752327,
-0.07199655473232269,
-0.1867864429950714,
-0.7059118151664734,
-0.03608626499772072,
0.5114655494689941,
-0.42305341362953186,
-0.06005066260... | |
http request when using ajax to load the images?
The images would be no more than 100 pixels total.
Well I don't agree with anyone of you. There are cases when you've to load more and more images. Not all the pages contain 3 images at all. Actually I'm working on a site where you've to load more than 200 images. What ... | [
0.2790778577327728,
-0.020438676699995995,
0.3046700358390808,
0.334143728017807,
-0.44254180788993835,
-0.06244633346796036,
0.30740705132484436,
0.0705723688006401,
-0.4301837384700775,
-0.9520654678344727,
0.29187244176864624,
0.378365159034729,
-0.33841466903686523,
0.07484768331050873... | |
so much thumbnails I'd prefer the base64 representation, pre-saved in the database. I found the solution and a strong argumentation at <http://www.stoimen.com/2009/04/23/when-you-should-use-base64-for-images/>. The guy is really in that case and made some tests. I was impressed and make my tests as well. The reality is... | [
0.49746978282928467,
0.33406224846839905,
0.1508130133152008,
0.297304630279541,
-0.02871187962591648,
-0.013489080592989922,
0.2405177354812622,
0.22197073698043823,
-0.2538568675518036,
-0.4978941082954407,
0.23331458866596222,
0.6329783201217651,
-0.054837025701999664,
0.032889734953641... | |
Ok, I had a simple layout problem a week or two ago. Namely sections of a page needed a header:
```none
+---------------------------------------------------------+
| Title Button |
+---------------------------------------------------------+
```
Pretty simple stuff. Thing is... | [
0.23813393712043762,
0.2823060154914856,
0.3356893062591553,
0.08363208174705505,
-0.28689953684806824,
-0.43486538529396057,
0.1270381659269333,
0.11383930593729019,
-0.432021826505661,
-0.5165292620658875,
0.16763003170490265,
0.3185623288154602,
-0.05550341680645943,
0.3703809380531311,... | |
tables?](https://stackoverflow.com/questions/519234/why-use-definition-lists-dl-dd-dt-tags-for-html-forms-instead-of-tables) Now the general topic of tables vs divs/CSS has previously been discussed, for example:
* [DIV vs Table](https://stackoverflow.com/questions/83073/div-vs-table); and
* [Tables instead of DIVs](h... | [
-0.025816263630986214,
-0.07597441971302032,
0.6653986573219299,
-0.11425013840198517,
-0.3179911971092224,
0.1512516587972641,
-0.17674778401851654,
-0.04271237924695015,
-0.5491631031036377,
-0.5066067576408386,
-0.09918755292892456,
0.3420656621456146,
-0.35013332962989807,
0.0587434954... | |
I ended up going back to:
```html
<style type="text/css">
.group-header { background-color: yellow; width: 100%; }
.group-header td { padding: 8px; }
.group-title { text-align: left; font-weight: bold; }
.group-buttons { text-align: right; }
</style>
<table class="group-header">
<tr>
<td class="group-title">Title</t... | [
0.19015154242515564,
0.02397232875227928,
0.6100837588310242,
-0.12473804503679276,
-0.10886439681053162,
0.08179028332233429,
0.2746584713459015,
-0.4514448940753937,
-0.02780916914343834,
-0.5796872973442078,
-0.04061327502131462,
0.39790695905685425,
0.11901344358921051,
-0.137987688183... | |
control over positioning (padding and/or margin) and styling.
On a side note, I came across a couple of interesting articles today:
* [Why CSS should not be used for layout](http://www.flownet.com/ron/css-rant.html); and
* [Tables vs CSS: CSS Trolls begone](http://iamelgringo.blogspot.com/2009/02/tables-vs-css-css-tr... | [
-0.18565794825553894,
-0.04654295742511749,
0.4845702350139618,
0.07098180055618286,
-0.39189618825912476,
0.09457427263259888,
-0.11907923221588135,
-0.35920101404190063,
-0.07494200766086578,
-0.4094008207321167,
-0.021294644102454185,
0.2981453537940979,
-0.1333240121603012,
-0.02385936... | |
}
.group-title { float: left; padding: 8px; }
.group-buttons { float: right; padding: 8px; }
</style>
</head>
<body>
<div class="group-header">
<div class="group-title">This is my title</div>
<div class="group-buttons"><input type="button" value="Collapse"></div>
</div>
<div ... | [
-0.007181778084486723,
-0.11342562735080719,
0.6329496502876282,
-0.08058863133192062,
0.032766904681921005,
-0.036380231380462646,
0.17477554082870483,
-0.3742064833641052,
0.10309714823961258,
-0.7216651439666748,
-0.09438551217317581,
0.44057440757751465,
0.03136061131954193,
-0.0244725... | |
<p>So can anyone do the equivalent without tables that is backwards compatible to at least FF2 and IE6?</p>
<p>On a side note, I came across a couple of interesting articles today:</p>
</div>
</body>
</html>
```
Thanks to [Ant P](https://stackoverflow.com/users/42092/ant-p) for the `overflow: hidden` part... | [
0.013476110994815826,
0.03476349636912346,
0.47468143701553345,
0.0348048098385334,
-0.1906995326280594,
0.043857090175151825,
0.06118638813495636,
-0.15232227742671967,
-0.4254566729068756,
-0.5335834622383118,
0.14573031663894653,
0.6045299768447876,
-0.06048639118671417,
0.0838427543640... | |
type="text/css">
.group-header, .group-content { width: 500px; margin: 0 auto; }
.group-header { border: 1px solid red; background: yellow; overflow: hidden; }
.group-content { border: 1px solid black; background: #DDD; }
.group-header td { vertical-align: middle; }
.group-title { padding:... | [
-0.22008274495601654,
-0.07380370795726776,
0.7133387327194214,
0.03435789793729782,
-0.12069611251354218,
0.3576009273529053,
0.07600148767232895,
-0.3363727331161499,
-0.16940760612487793,
-0.5129373669624329,
-0.46228134632110596,
0.2015816569328308,
-0.1664816290140152,
0.0285611599683... | |
is my title</td>
<td class="group-buttons"><input type="button" value="Collapse"></td>
</tr>
</table>
<div class="group-content">
<p>And it works perfectly. It's simple, as backward compatibile as it gets (that'll work probably even on IE5) and it just works. No messing about with positioning or... | [
0.17087599635124207,
-0.07914354652166367,
0.5216895937919617,
0.0419381782412529,
-0.22442463040351868,
-0.04262358695268631,
0.161108136177063,
-0.2705000936985016,
-0.046109460294246674,
-0.6455614566802979,
0.02049747109413147,
0.39963027834892273,
0.29335033893585205,
-0.0738803818821... | |
</div>
</body>
</html>
```
which works perfectly.
There is nothing wrong with using the tools that are available to you to do the job quickly and correctly.
In this case a table worked perfectly.
I personally would have used a table for this.
I think nested tables should be avoided, things can get messy. | [
0.4872279763221741,
0.08223158866167068,
-0.02338653802871704,
0.05719766765832901,
0.01587638258934021,
0.08047039806842804,
0.033176060765981674,
0.011224314570426941,
-0.25308331847190857,
-0.8502128720283508,
0.1801033914089203,
0.6716389656066895,
-0.004215715453028679,
-0.40689823031... | |
I've been thinking about how to implement the badge feature similar to SO's on a new website. What is the best way to store criteria for badges?
Two ideas:
* All code
* 'Second system' - create a meta architecture for defining badges and their criteria. Store some info in the database and have code query it to figure... | [
0.6879542469978333,
-0.08576317876577377,
0.11450934410095215,
0.34686359763145447,
-0.07421375066041946,
-0.19666914641857147,
0.43834879994392395,
-0.3063828945159912,
-0.33262795209884644,
-0.8195315003395081,
0.3138130009174347,
0.17566697299480438,
-0.1089395210146904,
-0.120158456265... | |
Rather, you have a simple rule that watches each post come by, and "count them", storing the rules state in the user profile.
That way "made 10 posts" is as cheap as "made 1,000,000" posts.
This also makes the system much more extensible. | [
0.8018712997436523,
-0.34856775403022766,
0.4162245988845825,
0.35166117548942566,
0.09065577387809753,
0.023268356919288635,
0.3842325508594513,
-0.16135981678962708,
-0.4835933744907379,
-0.5038833022117615,
0.1931842565536499,
0.14079710841178894,
-0.13095718622207642,
0.119010664522647... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.