text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
editing of already existing elements. Relies on SVG semantics for animation - which is not that great.
[SnapSVG](http://snapsvg.io/) as a pure SVG version of Raphael
--------------------------------------------------------------
SnapSVG is the successor of Raphael. It is supported only in the SVG enabled browsers and... | [
0.08113422244787216,
-0.3531159460544586,
0.6851613521575928,
-0.018725601956248283,
-0.5818098187446594,
-0.18078207969665527,
-0.09019508957862854,
-0.0015616824384778738,
-0.23273062705993652,
-0.5877044200897217,
-0.03352317959070206,
0.5458658337593079,
-0.27995896339416504,
-0.402492... | |
I thought a foreign key meant that a single row must reference a single row, but I'm looking at some tables where this is definitely not the case. Table1 has column1 with a foreign key constraint on column2 in table2, BUT there are many records in table2 with the same value in column2. There's also non-unique index on ... | [
-0.04510895535349846,
0.30585339665412903,
0.16899648308753967,
0.1497204601764679,
-0.04348335787653923,
-0.16982971131801605,
0.05974961072206497,
0.022053591907024384,
-0.3840964734554291,
-0.33805418014526367,
0.15059956908226013,
0.15938778221607208,
-0.2878028452396393,
0.45240908861... | |
fit in to the picture, but I'm less concerned about that at the moment).
update: Apparently, this behavior is specific to MySQL, which is what I was using, but I didn't mention it in my original question.
From [MySQL documentation](http://dev.mysql.com/doc/refman/5.6/en/innodb-foreign-key-constraints.html):
> InnoDB ... | [
-0.2791841924190521,
0.1702600121498108,
0.3505561053752899,
-0.22803400456905365,
0.0599907748401165,
-0.026284217834472656,
0.3022310435771942,
-0.14606571197509766,
-0.283838152885437,
-0.40828585624694824,
-0.09404175728559494,
0.6476930975914001,
-0.4884258806705475,
0.037302657961845... | |
that contain NULL values is not well defined (...) You are advised to use foreign keys that reference only UNIQUE (including PRIMARY) and NOT NULL keys. | [
0.19921976327896118,
0.507453203201294,
-0.19778209924697876,
0.2654370963573456,
0.2317296713590622,
-0.5261833071708679,
0.28279563784599304,
0.07044311612844467,
-0.15670321881771088,
-0.21853888034820557,
-0.5591474175453186,
0.20766198635101318,
-0.2479933202266693,
0.2017108649015426... | |
i've noticed that popup shows BEFORE text gets updated in the textbox, i guess js gets called before the page gets rendered ... that would explain the 'undefined' popup ... how do i make sure js gets called AFTER the page is rendered?
rewriting to make it as simple as possible:
```
<body>
<form id="form1" runat="serv... | [
0.024446675553917885,
0.01706329546868801,
0.7457650899887085,
-0.1736937165260315,
-0.22050854563713074,
0.04941946640610695,
0.15332888066768646,
-0.2905997037887573,
-0.24139109253883362,
-0.8744945526123047,
-0.3067221939563751,
0.4607076048851013,
-0.12614506483078003,
-0.369062632322... | |
<asp:Button ID="btnDoneWithRcs" runat="server" OnClick="btnDoneWithRcs_Click" Text="Action Completed / Update Notes" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
<script type="text/javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(
... | [
-0.10635922104120255,
-0.35198974609375,
0.9724431037902832,
-0.250952810049057,
0.0356421135365963,
0.24219729006290436,
0.40109872817993164,
-0.534579873085022,
-0.2488953024148941,
-0.9220694899559021,
-0.4030601680278778,
0.49844253063201904,
-0.21225975453853607,
-0.11993719637393951,... | |
$(document).ready(function() {
$('txtRcaNotes').hide();
alert($('txtRcaNotes').attr('id')); | [
0.21718761324882507,
-0.25679299235343933,
0.4125290811061859,
-0.34113436937332153,
0.5326710939407349,
-0.22790253162384033,
0.2150404006242752,
-0.335111141204834,
0.018893742933869362,
-0.38917580246925354,
-0.6232035160064697,
0.8080474138259888,
-0.5207512974739075,
-0.29030156135559... | |
});
}
</script>
</body>
```
Code Behind:
```
protected void btnDoneWithRcs_Click(object sender, EventArgs e)
{
txtRcaNotes.Text += "asdfadf";
}
```
**TEXTBOX DOESN'T GET HIDDEN, ALERT() RETURNS 'UNDEFINED'**
[](https://i.stack.imgur.com/0x60B.jpg)
You'... | [
-0.05957106128334999,
-0.20883658528327942,
0.44421401619911194,
-0.39525070786476135,
-0.0058260345831513405,
-0.0029025261756032705,
0.4183554947376251,
-0.3528596758842468,
-0.38356301188468933,
-0.4586734175682068,
-0.48809680342674255,
0.815251350402832,
-0.3636208474636078,
-0.101218... | |
We have a legacy database that uses strings as primary keys. I want to implement objects on top of that legacy database to better implement some business logic and provide more functionality to the user.
I have read in places that using strings for primary keys on tables is bad. I'm wondering why this is? Is it becaus... | [
0.05652719736099243,
0.11431428045034409,
0.040862780064344406,
0.2945389151573181,
-0.2922433316707611,
-0.10273750126361847,
-0.12367170304059982,
-0.011969227343797684,
-0.07821384072303772,
-0.457660973072052,
0.1964615136384964,
0.55133455991745,
-0.28176233172416687,
0.43581148982048... | |
or the like? (we only have about 25-30 tables involved)
Okay, I will have a stab at this. I will give a couple of quick caveats - I am not an expert on databases and my experience is with Hibernate (Java) rather than NHibernate, but here goes.
I think the issue of primary keys as strings is to do with the SQL data-typ... | [
0.15119759738445282,
0.037896595895290375,
-0.0043791900388896465,
0.11339962482452393,
-0.3269907534122467,
-0.09222142398357391,
0.023168984800577164,
0.06907236576080322,
-0.21872301399707794,
-0.4571395218372345,
0.17693071067333221,
0.6788541674613953,
-0.12013430893421173,
0.01142057... | |
using numbers, these are simply stored as bytes which computers are really good at doing stuff with quickly. As soon as you start using strings, the cost of these operations (comparisons mainly) goes up significantly. Even if the database engine is using really neat strategies to compare keys, it will still always be f... | [
0.25379034876823425,
0.015056127682328224,
-0.020996516570448875,
0.1655246764421463,
-0.47237300872802734,
-0.06715957075357437,
0.24465663731098175,
0.14456748962402344,
-0.366253525018692,
-0.8100304007530212,
0.27147769927978516,
0.4471537172794342,
-0.20528866350650787,
-0.05243605747... | |
my experience, because my application has a complex graph of objects that often have references to other persisted objects, often as lists or sets, the references are all stored using the ID of the other object, and because of the rules I have in place for cascading saves, fetching and so on, this will mean that the pr... | [
0.5579178929328918,
-0.08924728631973267,
0.11749018728733063,
0.13767734169960022,
0.028431208804249763,
-0.44030681252479553,
0.3466186225414276,
0.3882133662700653,
-0.1498677134513855,
-0.27614372968673706,
-0.10213495045900345,
0.25447922945022583,
-0.23996205627918243,
-0.07196138054... | |
queries end up generating quite complex SQL.
So - in summary - strings as primary keys are bad due to cost of simple operations on them and using Hibernate may magnify this. In practice though, modern database engines have lots of neat strategies to ensure that the performance hit is not that bad. (Postgres - and pres... | [
-0.15933893620967865,
0.15715867280960083,
0.2420603185892105,
0.3627769351005554,
-0.3349999487400055,
-0.1589908003807068,
0.7711308002471924,
0.023173494264483452,
-0.09176495671272278,
-0.4786049723625183,
-0.3545912206172943,
0.5283281207084656,
-0.13071049749851227,
-0.05435522273182... | |
good idea, otherwise there will probably be minimal benefit, with the downside of having to spend time changing all your tables. You could expect to get much better results refining the strategies you are using with NHibernate (ie fetching strategies and when you are cascading saves and so on). | [
0.0400560237467289,
-0.2339680939912796,
0.15703852474689484,
0.037375617772340775,
-0.16814430058002472,
-0.009987137280404568,
-0.240110844373703,
-0.06908844411373138,
-0.003154408885166049,
-0.7615402936935425,
0.2525874674320221,
0.5355300307273865,
-0.04731910303235054,
-0.0576223134... | |
**Edit**:
[Duplicate](https://stackoverflow.com/questions/372820/how-do-you-databind-to-a-system-windows-forms-treeview-control/373177#373177)
I'm new to .NET, and I've taken on a small work project, converting an existing VB6 product to a current version of VB (its either that or learning VB6!). This product is an in... | [
0.12387203425168991,
0.2097507268190384,
0.3754820227622986,
-0.14228899776935577,
-0.2093709260225296,
-0.040284473448991776,
0.35318130254745483,
0.0167792197316885,
-0.387847363948822,
-0.7988132238388062,
0.05284769833087921,
0.2670336663722992,
-0.15170015394687653,
0.1425566822290420... | |
need something extra to make this work?
According to [another question](https://stackoverflow.com/questions/372820/how-do-you-databind-to-a-system-windows-forms-treeview-control), this isn't possible, as the normal treeview control doesn't support databinding.
You'd need to either [programatically populate](https://st... | [
0.20151785016059875,
-0.3618161976337433,
0.21486099064350128,
0.34824517369270325,
0.24914079904556274,
-0.18742240965366364,
0.13529817759990692,
-0.12345807254314423,
-0.4441995322704315,
-0.3606150448322296,
-0.17229394614696503,
0.4708068072795868,
-0.3580379784107208,
-0.154977157711... | |
I have a bunch of files with a mixtures of encodings mainly ISO-8859-1 and UTF-8.
I would like to make all files UTF-8, but when trying to batch encode this files using
iconv some problems arise. (Files cuts by half, etc.)
I supposse the reason is that iconv requires to know the 'from' encoding, so if the command loo... | [
0.4542185962200165,
0.15684664249420166,
0.12660332024097443,
0.06492361426353455,
-0.16077645123004913,
0.05250333249568939,
0.1265028864145279,
-0.04863576218485832,
-0.13952526450157166,
-0.6079068183898926,
-0.06219123303890228,
0.5379999876022339,
-0.2628045976161957,
0.33144670724868... | |
but you can find files that are valid UTF-8 (which unlike most multibyte encodings give you a reasonable assurance that they are in fact UTF-8). [moreutils](http://kitenet.net/~joey/code/moreutils/) has a tool `isutf8` which can do this for you. Or you can write your own, it would be fairly simple. | [
0.5773475766181946,
-0.2719302475452423,
0.15726923942565918,
0.43942034244537354,
0.1931036412715912,
-0.4808214604854584,
0.2566986083984375,
0.2622503340244293,
-0.43792724609375,
-0.6151834726333618,
-0.153669074177742,
0.47604790329933167,
-0.08167420327663422,
-0.193627268075943,
0... | |
I wanted to speed up compilation so i was thinking i could have my files be build on a ramdisk but also have it flushed to the filesystem automatically and use the filesystem if there is not enough ram.
I may need something similar for an app i am writing where i would like files to be cached in ram and flushed into t... | [
0.3447713255882263,
0.11491139233112335,
0.13000370562076569,
0.3125441074371338,
0.2153657227754593,
0.1414368599653244,
-0.0833783894777298,
-0.0301655363291502,
-0.30058181285858154,
-0.6687051057815552,
0.026024451479315758,
0.6016343235969543,
-0.40115365386009216,
-0.1404352486133575... | |
it takes to compile when there is a specific problem to solve before progressing. the less we can get done.
Ram-disks went the way of the dodo with the file system cache. It can make much better decisions than a static cache, having awareness of RAM usage by other programs and the position of the disk write head. The l... | [
0.039541102945804596,
-0.0835752785205841,
-0.03363172709941864,
0.21154002845287323,
-0.39399734139442444,
-0.1311158984899521,
-0.1036166101694107,
0.010684535838663578,
-0.21563269197940826,
-0.35351499915122986,
0.04453560709953308,
0.8508853316307068,
0.005493874661624432,
-0.24539592... | |
I'm trying to create another dll with just forms and some shell method to call an external exe while allowing my main form to run unpertubed sort of something like a pseudo multithreading. And all of these wholesome goodness are in old vb6 legacy app.
So i'm trying to decide if i should use .net to write the dll or vb... | [
0.7189198136329651,
0.04285937547683716,
0.4133114516735077,
0.020878590643405914,
-0.28718483448028564,
-0.015549994073808193,
0.4235169291496277,
0.13309399783611298,
-0.17724056541919708,
-0.5670687556266785,
0.17786666750907898,
0.6744000911712646,
-0.48709720373153687,
0.0162221137434... | |
that can be displayed and the calling application is continues to run. The two don't stop each other. A .NET DLL is overkill in this case.
If you need something that involves traditional multi-tasking, like taking a chunk of data and processing it, then a .NET DLL may be a better solution as the multi-tasking is more ... | [
0.24321070313453674,
-0.37381473183631897,
0.23158207535743713,
0.27887406945228577,
-0.30993640422821045,
-0.2821618914604187,
-0.005010990425944328,
0.04093630239367485,
-0.20822598040103912,
-0.7534379959106445,
-0.08632699400186539,
0.582356870174408,
-0.42780834436416626,
0.1154704540... | |
the way to go.
More specifics would help me craft a better answer.
@EDIT AFTER COMMENT
Then transferring the forms and objects over the ActiveX EXE would be the right way to go. Then you can reference the ActiveX EXE from the original EXE.
The only gotcha is whether what you are copying is truly standalone. The go... | [
0.6636724472045898,
-0.24524109065532684,
0.5270050168037415,
0.44331517815589905,
-0.15233047306537628,
-0.3945487439632416,
0.35768091678619385,
0.11555725336074829,
-0.17379051446914673,
-0.6440200805664062,
-0.14117030799388885,
0.6338984370231628,
-0.004466457292437553,
0.261264741420... | |
OK, so I have a very large multi-threaded unmanaged c++ application (server) that runs on a windows 2003 server. It hosts sessions for 20-50 concurrent users doing all sorts of business logic... At times it can be using a very large amount of memory due to things like object/session caching due to users having large nu... | [
0.07149118185043335,
0.37640127539634705,
0.24557022750377655,
0.10130700469017029,
-0.16939689218997955,
-0.265543133020401,
0.1350034773349762,
0.023968253284692764,
-0.44061124324798584,
-0.4538367688655853,
0.16200077533721924,
0.5368338823318481,
-0.2343970686197281,
0.158697724342346... | |
errors.
Now I know that Windows will start page-faulting when it feels it needs to free up physical memory, and also that win32 applications normally are only able to allocate up to a maximum of 4GB worth of memory, really only with 2GB of that available for actual use by the application for 'user-mode' address space,... | [
0.09123591333627701,
0.5126893520355225,
0.19082103669643402,
0.11110060662031174,
0.08893308788537979,
0.010490325279533863,
0.38285624980926514,
0.19995355606079102,
-0.38550397753715515,
-0.6261701583862305,
0.023098139092326164,
0.8083765506744385,
-0.08859293162822723,
-0.053489271551... | |
how much has been used at any given time (preferably from outside of the application, i.e. some windows management tool)?**
[edit] After looking at the Process Explorer and the website, it looks like the value 'Virtual Size' is the value of how much memory the application has access to.
Sounds like a case for [Process... | [
0.09036312252283096,
0.08232825249433517,
0.35246026515960693,
0.01841520145535469,
0.4265398681163788,
0.11308834701776505,
-0.20476944744586945,
-0.17547239363193512,
-0.9317903518676758,
-0.5460608005523682,
-0.4225362241268158,
0.27693143486976624,
0.21551179885864258,
0.49035492539405... | |
loaded.
>
>
> The Process Explorer display consists
> of two sub-windows. The top window
> always shows a list of the currently
> active processes, including the names
> of their owning accounts, whereas the
> information displayed in the bottom
> window depends on the mode that
> Process Explorer is in: if it... | [
-0.18582762777805328,
-0.15650510787963867,
0.6405117511749268,
0.17599327862262726,
0.0453256219625473,
0.21702878177165985,
-0.07172730565071106,
0.077736996114254,
-0.3097318112850189,
-0.7914891242980957,
-0.16449110209941864,
0.4271085262298584,
-0.14462918043136597,
0.489576786756515... | |
Explorer also has
> a powerful search capability that will
> quickly show you which processes have
> particular handles opened or DLLs
> loaded.
>
>
> The unique capabilities of Process
> Explorer make it useful for tracking
> down DLL-version problems or handle
> leaks, and provide insight into the
> way Win... | [
-0.20109933614730835,
-0.010691802017390728,
0.46004557609558105,
0.15048831701278687,
-0.2171008139848709,
-0.3164176046848297,
-0.027949729934334755,
0.12477151304483414,
0.06886667013168335,
-1.0291091203689575,
0.00254468759521842,
0.27941787242889404,
-0.14516866207122803,
0.361842453... | |
calls it TSAdminEx.
See below for a screenshot, and [click here to learn more about it and to get the beta](http://www.remkoweijnen.nl/blog/2009/02/20/tsadminex-beta-release/). It's free software, BTW.
 | [
0.4131098687648773,
-0.011868656612932682,
0.20455536246299744,
-0.4251272976398468,
0.20563100278377533,
-0.43380045890808105,
0.20113708078861237,
0.38811084628105164,
-0.1459263563156128,
-0.10927898436784744,
-0.3129581809043884,
0.04398634657263756,
-0.12740369141101837,
-0.0532353967... | |
I have a loop that is doing some error checking in my PHP code. Originally it looked something like this...
```
foreach($results as $result) {
if (!$condition) {
$halt = true;
ErrorHandler::addErrorToStack('Unexpected result.');
}
doSomething();
}
if (!$halt) {
// do what I want cos ... | [
0.31223878264427185,
-0.024179896339774132,
0.36765745282173157,
-0.022580016404390335,
0.02364633046090603,
-0.19605013728141785,
0.6428001523017883,
-0.2298564463853836,
-0.22719530761241913,
-0.42993199825286865,
0.12821580469608307,
0.35899460315704346,
-0.33090999722480774,
0.19378805... | |
looking for the [break](http://www.php.net/break) statement.
```
$arr = array('one', 'two', 'three', 'four', 'stop', 'five');
while (list(, $val) = each($arr)) {
if ($val == 'stop') {
break; /* You could also write 'break 1;' here. */
}
echo "$val<br />\n";
}
``` | [
-0.03038385696709156,
-0.010082107968628407,
0.16277702152729034,
-0.3820416033267975,
0.2256685048341751,
0.08196479082107544,
0.4428858757019043,
-0.2699934244155884,
-0.5211289525032043,
-0.09524490684270859,
-0.4259202778339386,
0.6372255682945251,
-0.3904913663864136,
-0.0575239248573... | |
I have a standard aspx page with which I need to add another standard HTML form into and have it submit to another location (external site), however whenever I press the submit button the page seems to do a post back rather than using the sub-forms action url.
A mock up of what the form relationships is below. Note i... | [
0.49196159839630127,
0.22272352874279022,
0.566129207611084,
-0.07138027995824814,
-0.22011640667915344,
-0.36523646116256714,
0.07107666879892349,
-0.28722941875457764,
-0.16213583946228027,
-0.36686253547668457,
-0.17973756790161133,
0.10317215323448181,
0.028573468327522278,
0.098240010... | |
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<form id="subscribe_form" method="post" action="https://someothersite.com" name="em_subscribe_form" >
<input type="text" id="field1" ... | [
0.038756728172302246,
0.013002063147723675,
0.7371861338615417,
0.1235956996679306,
-0.04061485081911087,
-0.059147536754608154,
0.04504510387778282,
-0.13058680295944214,
-0.3888118267059326,
-0.33353087306022644,
-0.03602108731865883,
-0.18863944709300995,
-0.0587119534611702,
0.08812589... | |
<input id="submitsubform" type="submit" value="Submit" />
</form>
</div>
</form>
</body>
</html>
```
It's an interesting problem. Ideally you only want the 1 form tag on the page as other users have mentioned. Potentially you could post the data via javascript without hav... | [
0.4161888062953949,
0.0006899444269947708,
0.4005923867225647,
0.1734166294336319,
-0.24028439819812775,
-0.3524048328399658,
0.04233193397521973,
-0.5723889470100403,
-0.16423822939395905,
-0.8470101356506348,
-0.2649856507778168,
0.25101616978645325,
-0.2102144956588745,
-0.0207587517797... | |
taken from [here](http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/), modified for your needs. Not 100% sure if this will work for you but I think this is how you'll have to approach it.
```
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page<... | [
0.062107957899570465,
-0.15143156051635742,
0.6830312013626099,
-0.215744286775589,
-0.06339835375547409,
0.516769289970398,
0.2153092920780182,
-0.7110007405281067,
0.0639304667711258,
-0.5289400219917297,
-0.43960636854171753,
0.0759425163269043,
-0.16003380715847015,
-0.0417094975709915... | |
id="form1" runat="server">
<div>
<div>
<input type="text" id="field1" name="field1" />
<asp:Button ID="btnSubmitSubscribe" runat="server" Text="Submit" OnClientClick="postdata(); return false;" />
</div>
</div>
</form>
</body>
</html>
```
If javascript is not a viab... | [
0.22335530817508698,
-0.2222016602754593,
0.2881051301956177,
-0.024566004052758217,
-0.4410952627658844,
0.08476175367832184,
0.2530139088630676,
-0.5244629383087158,
0.005730346776545048,
-0.722830593585968,
-0.2759157419204712,
0.19898010790348053,
-0.40140241384506226,
-0.1066350787878... | |
textbox:
```
private void OnSubscribeClick(object sender, System.EventArgs e)
{
string field1 = Field1.Text;
ASCIIEncoding encoding=new ASCIIEncoding();
string postData="field1="+field1 ;
byte[] data = encoding.GetBytes(postData);
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Cre... | [
-0.09863924235105515,
0.1211429312825203,
0.6435104608535767,
-0.18815763294696808,
-0.08810696750879288,
0.2578182816505432,
0.40950068831443787,
-0.2192053496837616,
-0.012826005928218365,
-0.6727209687232971,
-0.5916462540626526,
0.3634711503982544,
-0.4818460941314697,
0.26003313064575... | |
How do you specify where to start reading in a file when using StreamReader?
I have created a streamreader object, along with a file stream object. After both objects are created, how would I go upon controlling where I want the StreamReader to start reading from a file?
Let's say the file's contents are as follows,... | [
0.2461644411087036,
0.09739195555448532,
0.22952309250831604,
0.33800143003463745,
0.18486563861370087,
-0.08731836825609207,
-0.14412157237529755,
-0.009123193100094795,
0.06839636713266373,
-0.6499835848808289,
0.14150406420230865,
0.5471908450126648,
0.0045635635033249855,
0.42396134138... | |
#5?
Edit: By delimiter I mean, a way to make StreamReader start reading from ('2.')
Are you trying to deserialize a file into some in-memory object? If so, you may want to simply parse the entire file in using `ReadLine` or something similar, store each line, and then access it via a data structure such as a `KeyValue... | [
0.2246709167957306,
-0.34193286299705505,
0.21106241643428802,
0.09280869364738464,
0.07793984562158585,
0.03429699316620827,
0.21159709990024567,
-0.17789091169834137,
-0.12972573935985565,
-0.6625978350639343,
-0.17938914895057678,
0.5430600643157959,
-0.1849895417690277,
0.3134281337261... | |
for a set position, you can simply `Read()` that many characters and throw away the return value.
If you're looking for complex delimiter, you can read the entire line or even the entire file into memory and use [Regular Expressions](http://msdn.microsoft.com/en-us/library/30wbz966.aspx).
Hope that helps... | [
-0.06092876195907593,
-0.3189335763454437,
0.2806151807308197,
0.12441415339708328,
0.19687171280384064,
0.20133036375045776,
0.21032093465328217,
-0.013422893360257149,
-0.07266519963741302,
-0.6656067371368408,
-0.334402859210968,
0.44202661514282227,
-0.01424829289317131,
-0.20420424640... | |
This is a memory allocation issue that I've never really understood.
```
void unleashMonkeyFish()
{
MonkeyFish * monkey_fish = new MonkeyFish();
std::string localname = "Wanda";
monkey_fish->setName(localname);
monkey_fish->go();
}
```
In the above code, I've created a MonkeyFish object ... | [
0.1525316685438156,
0.13560602068901062,
-0.12022070586681366,
-0.33167752623558044,
-0.029588157311081886,
-0.17796649038791656,
0.5401709079742432,
0.15781359374523163,
-0.5103656053543091,
-0.6807786226272583,
-0.18100397288799286,
0.24026167392730713,
-0.575918436050415,
0.632268428802... | |
when I define the "name" data member inside the MonkeyFish class, I can choose one of the following:
```
std::string name;
std::string & name;
```
When I define the prototype for the setName() function inside the MonkeyFish class, I can choose one of the following:
```
void setName( const std::string & parameter_... | [
0.08801159262657166,
0.08897949010133743,
-0.05461227893829346,
-0.17036081850528717,
-0.0896931141614914,
-0.04142799973487854,
0.3113190531730652,
0.021772420033812523,
-0.14571373164653778,
-0.6626521944999695,
0.23682262003421783,
0.4846343398094177,
-0.6978516578674316,
0.395849257707... | |
unleashMonkeyFish() function completes. Does that mean I'm FORCED to pass the parameter by copy? Or can I pass it by reference and "get away with it" somehow?
Basically, I want to avoid these scenarios:
1. I don't want to set the MonkeyFish's name, only to have the memory for the localname string go away when the un... | [
0.2892301380634308,
0.07045120000839233,
0.21437421441078186,
-0.015191305428743362,
-0.23170825839042664,
-0.21881738305091858,
0.6071322560310364,
-0.2844308018684387,
-0.27774298191070557,
-0.4589700400829315,
0.06419946253299713,
0.4383060336112976,
-0.5233758687973022,
0.2692219018936... | |
keyword to ensure that the memory is not automatically de-allocated when unleashMonkeyFish() ends. Since the ultimate goal of this application is to unleash N MonkeyFish (all of which must have unique names) this is not a viable option. (And yes, MonkeyFish - being fickle creatures - often change their names, sometime ... | [
0.31566938757896423,
0.07460840046405792,
0.045151568949222565,
-0.11449990421533585,
-0.015475505031645298,
-0.037779372185468674,
0.5617222785949707,
-0.11519605666399002,
-0.23329730331897736,
-0.32131075859069824,
-0.16187936067581177,
0.3816569447517395,
-0.4919549226760864,
0.4056908... | |
be useful to someone seeing this problem for the first time.
One way to do this is to have your string
```
std::string name;
```
As the data-member of your object. And then, in the unleashMonkeyFish function create a string like you did, and *pass it by reference* like you showed
```
void setName( const std::strin... | [
0.16207270324230194,
-0.08073119074106216,
0.1605282425880432,
-0.05031467601656914,
0.000008598214662924875,
-0.2696968615055084,
0.18737567961215973,
-0.09297675639390945,
-0.2768455743789673,
-0.7366817593574524,
0.01783868856728077,
0.5077256560325623,
-0.46849194169044495,
0.221266850... | |
few bytes. std::string has the capability to reserve bytes. So you can call "name.reserve(25);" in your constructor and it will likely not reallocate if you assign something smaller. (i have done tests, and it looks like GCC always reallocates if you assign from another std::string, but not if you assign from a c-strin... | [
0.10869564861059189,
-0.18523938953876495,
0.08850908279418945,
0.03784366697072983,
-0.0186338908970356,
-0.018434692174196243,
0.28346967697143555,
-0.2580221891403198,
-0.29638493061065674,
-0.7019158601760864,
0.0035067396238446236,
0.4449646472930908,
-0.1063917800784111,
0.4856881797... | |
free allocated resources once objects die, std::string has too. In my opinion, you should not worry about having that std::string local in the function. It will not do anything noticeable to your performance anyway most likely. Some std::string implementations (msvc++ afaik) have a small-buffer optimization: For up to ... | [
-0.03608579561114311,
-0.17541658878326416,
0.016149012371897697,
0.15739706158638,
-0.11907115578651428,
-0.12236274033784866,
0.15161743760108948,
-0.09059496223926544,
-0.3276192843914032,
-0.8330790996551514,
-0.24167057871818542,
0.43532076478004456,
-0.40443289279937744,
0.0691341757... | |
that now the caller knows that the argument is being copied. Return value optimization and similar optimizations can now be applied easily by the compiler. Consider this case, for example
```
obj.setName("Mr. " + things.getName());
```
If you had the `setName` take a reference, then the temporary created in the argu... | [
-0.12928219139575958,
0.23713654279708862,
0.4689449965953827,
-0.27574825286865234,
0.16487035155296326,
-0.12929151952266693,
0.04295002669095993,
-0.05340556800365448,
-0.08572735637426376,
-0.48425087332725525,
-0.2416120320558548,
0.4465721845626831,
-0.4064466953277588,
0.41585779190... | |
the caller see that the argument is being copied anyway, and make the optimizer's job much more easy - because it wouldn't have to inline the call to see that the argument is copied anyway.
For further explanation, read the excellent article [`BoostCon09/Rvalue-References`](https://www.boostpro.com/trac/wiki/BoostCon... | [
-0.015479599125683308,
0.02853282541036606,
0.8322795033454895,
0.06710159033536911,
-0.04532542824745178,
-0.06200149655342102,
0.19144347310066223,
-0.2790897488594055,
-0.08812698721885681,
0.06807171553373337,
-0.31849443912506104,
1.110083818435669,
-0.2127145230770111,
-0.39251041412... | |
Is there a way to do multiple calls in the same "session" in Popen? For instance, can I make a call through it and then another one after it without having to concatenate the commands into one long string?
You're not "making a call" when you use popen, you're running an executable and talking to it over stdin, stdout, ... | [
0.1979730874300003,
-0.018430262804031372,
0.11595907062292099,
-0.14106659591197968,
-0.42681175470352173,
-0.07058920711278915,
0.4827038645744324,
-0.11783818900585175,
-0.1684090495109558,
-0.4368714988231659,
-0.03697386011481285,
0.589150607585907,
-0.4378874897956848,
0.030262773856... | |
I am going to be building a Pylons-based web application. For this purpose, I'd like to build a minimal Linux platform, upon which I would then install the necessary packages such as Python and Pylons, and other necessary dependencies. The other reason to keep it minimal is because this machine will be virtual, probabl... | [
0.486111581325531,
0.13077160716056824,
0.41727936267852783,
0.013590035028755665,
-0.22496512532234192,
0.1055593192577362,
-0.11295361071825027,
0.2665887475013733,
-0.2910931408405304,
-0.9000242352485657,
-0.1416238397359848,
0.18814045190811157,
-0.20301726460456848,
0.083002924919128... | |
the Ubuntu Server Edition. | [
-0.5942620635032654,
-0.05993475764989853,
0.3965512216091156,
-0.17975717782974243,
-0.3693263530731201,
-0.13741853833198547,
-0.10585224628448486,
0.5408706665039062,
0.0029166582971811295,
-0.8023698329925537,
-0.8435750007629395,
0.09361621737480164,
-0.7674757838249207,
0.00838724244... | |
Edit: This makes alot more sense to me now that i've taken a step away from the code, thanks for the help.
Just found stack overflow the other day through Coding Horror and it looks awesome. Figure that i'd ask the community about a problem i'm currently trying to work out.
I'm developing a roguelike sortof game usi... | [
0.641250729560852,
-0.11842309683561325,
0.2805318832397461,
0.20819410681724548,
-0.29496338963508606,
-0.09658584743738174,
0.14808902144432068,
0.19346719980239868,
-0.30101484060287476,
-0.7178863883018494,
0.1786022037267685,
0.49888941645622253,
-0.19087810814380646,
0.21015594899654... | |
GameCanvas and Implements runnable. It's run method calls repaint() and then sleeps for 50 ms, resulting in a frame rate of 20 FPS. This allows me to write the rest of the game without having to put repaint everywhere and should make animations and effects easier to do later on. (at least in theory).
The flow of the ... | [
0.20192444324493408,
-0.37526318430900574,
0.6057887077331543,
0.18625319004058838,
-0.17595398426055908,
-0.24860140681266785,
0.2644495666027069,
-0.06746391206979752,
-0.16179537773132324,
-0.7184807658195496,
-0.16225984692573547,
0.6996851563453674,
0.17944027483463287,
-0.08937932550... | |
I originally was calling `gameManager.runUntilHeroTurn()` in the `keyPressed` method of my `HaxCanvas`. However after reading up on j2me system threads I realized that putting a method with the potential to run for a while in a callback is a bad idea. However I must used keyPressed to do input handeling, since i need a... | [
0.12104097753763199,
-0.18934239447116852,
0.22890199720859528,
-0.02913343347609043,
0.2256816029548645,
-0.2529478371143341,
-0.019028307870030403,
0.03585595637559891,
-0.17402996122837067,
-0.3198372423648834,
0.04114857688546181,
0.5447597503662109,
-0.23714661598205566,
0.40137499570... | |
question is this:
For a "turn based" game in j2me, what's the best way to implement the game loop, allowing for input handeling only when it's the player's turn?
I would avoid threading for the game logic as J2ME threading, depending on manufacturer of course, does not do a great job of sharing the limited resources. ... | [
0.24828076362609863,
-0.14303900301456451,
-0.030734067782759666,
0.10562540590763092,
0.0702170729637146,
-0.08628500998020172,
-0.10254138708114624,
-0.004902162589132786,
-0.1922796368598938,
-0.3067549169063568,
0.2322908192873001,
0.6276266574859619,
-0.14103898406028748,
0.1683983057... | |
each of the AI in one frame. I would do something like following in the run function:
```
public void run() {
while(true) {
// Update the Game
if(gameManager.isUsersTurn()) {
// Collect User Input
// Process User Input
// Update User's State
} | [
0.43310797214508057,
-0.43304359912872314,
-0.020138539373874664,
-0.05365891754627228,
0.14836585521697998,
-0.06247160956263542,
0.399527907371521,
-0.16664741933345795,
-0.06373926997184753,
-0.7485257387161255,
-0.11844433099031448,
0.877988338470459,
-0.5379517674446106,
0.05394681170... | |
else {
// Update the active NPC based on their current state
gameManager.updateCurrentNPC();
}
// Do your drawing
}
}
```
You want to avoid having everything updated in one frame as 1) the updating might be slow, resulting in no immediate visual feedback for the user 2) yo... | [
0.3248591721057892,
-0.06896042078733444,
0.2684420049190521,
0.018861526623368263,
-0.07376366853713989,
-0.1935899406671524,
0.34838610887527466,
-0.2863360345363617,
-0.1660785973072052,
-0.974342405796051,
-0.19588731229305267,
0.6217427849769592,
-0.4154472351074219,
-0.26201209425926... | |
With this setup you could have NPC states, NPC\_DECIDE\_MOVE and NPC\_ANIMATING, that would allow you further control of what the NPC is doing. NPC\_ANIMATING would basically put the game in a waiting state for the animation to take place, avoiding any further processing until the animation is complete. Then it could m... | [
0.338686466217041,
-0.39890390634536743,
0.1902269423007965,
0.029685676097869873,
-0.04983372241258621,
0.1398318111896515,
-0.22795060276985168,
-0.25656071305274963,
-0.35463833808898926,
-0.7867035269737244,
0.1739768385887146,
0.9296760559082031,
-0.3142530024051666,
-0.25344768166542... | |
and then call flushGraphics(), then wait. The method you mention is the way of tackling it for the Canvas class. Just thought I would mention this and post a link:
[Game Canvas Basics](http://developers.sun.com/mobility/midp/ttips/gamecanvas/index.html) | [
0.009055512957274914,
-0.598007082939148,
0.3704712688922882,
0.09722033888101578,
0.031003938987851143,
-0.20339028537273407,
-0.1793205440044403,
-0.08653943240642548,
-0.44305068254470825,
-0.9041560292243958,
-0.04227551445364952,
0.8275609612464905,
0.11849040538072586,
-0.36332491040... | |
Maybe I've had too much coffee, maybe I've been working too long, regardless, I'm at a loss as to what this method does, or rather, why and how it does it, could anyone shed some light upon me? What is the nextColor?
```
public Color nextColor() {
int max = 0, min = 1000000000, cr = 0, cg = 0, cb = 0;
for (int r... | [
0.16810180246829987,
-0.23925700783729553,
0.8655045628547668,
0.13486504554748535,
0.5476104021072388,
-0.1861760914325714,
-0.08896470814943314,
-0.3245387673377991,
-0.4573136270046234,
-0.8116090297698975,
-0.14440281689167023,
0.3638949990272522,
-0.17733171582221985,
0.24393980205059... | |
for (int b = 0; b < 256; b += 4) {
if (r + g + b < 256 || r + g + b > 512) {
continue;
}
min = 1000000000;
for (Color c : colorTable) { | [
-0.00812008697539568,
-0.31261059641838074,
0.3426128327846527,
-0.19330258667469025,
0.4962829351425171,
0.37851718068122864,
0.29094383120536804,
-0.3368057608604431,
-0.2581033408641815,
-0.4540308713912964,
-0.4137832522392273,
0.5234363675117493,
-0.2115725576877594,
0.251548290252685... | |
int dred = r - c.getRed();
int dgreen = g - c.getGreen();
int dblue = b - c.getBlue();
int dif = dred * dred + dgreen * dgreen + dblue * dblue; | [
0.15466921031475067,
-0.15074868500232697,
0.13364966213703156,
-0.3193697929382324,
-0.06430061906576157,
0.20499078929424286,
0.43564605712890625,
-0.47220566868782043,
0.17122770845890045,
-0.3068132996559143,
-0.63499516248703,
0.5518812537193298,
-0.4514268636703491,
0.202989950776100... | |
if (min > dif) {
min = dif;
}
}
if (max < min) {
max = min; | [
-0.11347947269678116,
-0.5873823165893555,
0.1933051198720932,
-0.44051167368888855,
0.24227535724639893,
0.4362875819206238,
0.27819913625717163,
0.0050295209512114525,
0.42159655690193176,
-0.3446256220340729,
-0.5333576798439026,
0.61393803358078,
-0.014608669094741344,
-0.0929715186357... | |
cr = r;
cg = g;
cb = b;
}
}
}
}
return new Color(cr, cg, cb, 0x90);
}
```
---
UPDATE
Thanks for the responses everyone. Looking at the context of the method within the program it is clear that | [
0.19005075097084045,
0.25925612449645996,
0.5500414967536926,
-0.12563201785087585,
0.000012102418622816913,
0.186764657497406,
0.20792503654956818,
-0.37584543228149414,
-0.21101737022399902,
-0.41526639461517334,
-0.4123450815677643,
0.5643649697303772,
-0.2982957363128662,
0.03206431865... | |
their intent was indeed to return a new Color that is "furthest away" from the set of existing Colors.
Thanks Sparr for posing the [followup](https://stackoverflow.com/questions/592310/finding-the-farthest-point-in-one-set-from-another-set) to this question, I will definitely rewrite the above with your advice in mind... | [
0.03493604063987732,
0.023201661184430122,
0.09518566727638245,
0.1688113659620285,
-0.0019111658912152052,
0.04791271314024925,
-0.07838189601898193,
-0.06428800523281097,
-0.1457161009311676,
-0.3832630515098572,
-0.11652649194002151,
0.5183556079864502,
0.00802992470562458,
-0.080429412... | |
does the numerical analysis of the RGB components actually yield the appropriate color?
Consider the case where the pseudo-solid defined by the points in the colorTable has a large "hollow" in its interior, such that nextColor selects the point in the center of that hollow as the nextColor. Depending on what you know a... | [
-0.22844427824020386,
-0.01777714490890503,
0.2536262571811676,
-0.008404864929616451,
0.4196520447731018,
0.3594341576099396,
-0.383876234292984,
-0.03915566951036453,
-0.24697259068489075,
-0.6043466925621033,
-0.18528620898723602,
0.425492525100708,
-0.2416728436946869,
0.29222413897514... | |
the above-described one, the color selected by nextColor will be somewhere on the surface of the minimal convex hull enclosing all of the points in the 1/64-dense colorspace defined by your loops. Generating the list of points on that surface is slightly more computationally complex than the simple loops that generate ... | [
-0.2897163927555084,
-0.3399601876735687,
0.4080736041069031,
0.01231342926621437,
0.11687513440847397,
0.15118584036827087,
0.13903723657131195,
-0.07195635139942169,
-0.11751873791217804,
-0.9211233258247375,
-0.23782037198543549,
0.14473579823970795,
-0.3897698223590851,
0.0613791607320... | |
space to a trivial list (24 candidates, if my mental geometry serves me well) that could simply be stored ahead of time.
If the nextColor selected from those is "too close" to your colorTable, then you could fall back on running the original type of search in hopes of finding the sort of "hollow" mentioned above. The ... | [
-0.0987594723701477,
-0.4814416468143463,
0.39442577958106995,
0.44195321202278137,
0.16932646930217743,
0.0325247123837471,
0.021963294595479965,
-0.2661350667476654,
-0.2908676266670227,
-0.6796430349349976,
-0.07629420608282089,
0.059014640748500824,
-0.012389394454658031,
0.12089083343... | |
that you would have to find a hollow at least 16 units across within the colorTable. Run the original search with a step of 8 and store any candidates more than 4 units distant (the hollow is not likely to be aligned with your search grid), then center a radius-12 search of higher density on each of those candidates.
... | [
0.13813605904579163,
0.21369987726211548,
0.2830362617969513,
0.1273079216480255,
0.04180928319692612,
0.49035847187042236,
0.233708456158638,
-0.49454405903816223,
-0.4415149986743927,
-0.3743453025817871,
-0.05786895006895065,
0.33659833669662476,
-0.1735207885503769,
0.21169953048229218... | |
with that compromise.
All of this presumes that you want to stick with improvements on this naive method of finding a contrasting color. There are certainly better ways, given equal or more (which colors in colorTable are the most prevalent in your usage? what colors appear more contrast-y to the human eye?) informati... | [
0.29158642888069153,
-0.12204907834529877,
0.01702844724059105,
0.4466733932495117,
0.01364777609705925,
-0.11111624538898468,
0.1578439623117447,
-0.11795621365308762,
-0.0385780856013298,
-0.8821973204612732,
0.04965203255414963,
0.8271836042404175,
-0.07394392788410187,
0.13000269234180... | |
I'm trying to understand how to use Wireshark right now, but the [official manual](http://www.wireshark.org/docs/wsug_html_chunked/index.html) isn't a fun read at all when starting out. Its too detailed, and the details are going right over my head because of the information overloading :)
What are some more didactic ... | [
0.6754465103149414,
-0.09764400124549866,
0.1534033864736557,
0.3193376064300537,
-0.255342036485672,
-0.8136356472969055,
0.08247270435094833,
-0.0982949435710907,
-0.13315638899803162,
-0.2970444858074188,
0.2671166658401489,
0.368359237909317,
-0.39099714159965515,
-0.11790779232978821,... | |
dtrace, prstat, cat, visual studio or eclipse.
I wouldn't start with a tutorial on Wireshark itself necessarily. Reading the Wireshark manual first is kind of like reading the help guide to Visual Studio; if you already knew the basics of how programming is done the IDE would naturally make a lot of sense.
If you goog... | [
0.5915725827217102,
-0.6255043745040894,
0.203752338886261,
0.4488395154476166,
-0.26173892617225647,
-0.36267101764678955,
-0.09634632617235184,
0.25643736124038696,
0.16000664234161377,
-0.6135997176170349,
0.06789656728506088,
0.6532688140869141,
-0.2589818239212036,
-0.1867966651916504... | |
understand each layer of that then you'll have a deep understanding of what Wireshark is telling you.
If you just want a quickstart: <http://www.youtube.com/watch?v=0bazkLeY6b4> | [
0.763898491859436,
-0.35118943452835083,
0.5334976315498352,
0.4148528277873993,
0.1811848282814026,
-0.4520491361618042,
0.19139502942562103,
0.10866069048643112,
-0.2969352900981903,
-0.3989611268043518,
-0.12797808647155762,
0.5203336477279663,
-0.051534224301576614,
-0.0869389548897743... | |
If you stare at a monitor for 8-12 hours a day looking at code, I have a couple questions for those that may have researched the health factors of this or have tried a few options.
1. To be easy on the eyes, can a monitor be "too big"?
2. Is there a particular type of display technology over another that reduces eye f... | [
0.7397670745849609,
0.08336739987134933,
0.1707793027162552,
0.19633238017559052,
0.007859976030886173,
-0.17663584649562836,
0.44677111506462097,
0.05242934077978134,
-0.4597761929035187,
-0.8643178343772888,
0.18912753462791443,
0.8300210237503052,
-0.1950049102306366,
-0.380598008632659... | |
30 minutes, lean back, close your eyes, and rest them for 10 seconds. Or, if you don't want to look like you're napping, gaze out a window or across the room. You should do this regardless of whether you're staring at a monitor, a book, or a sheet of music. Staring at *anything* for hours at a time is going to strain y... | [
0.6042367815971375,
-0.023573588579893112,
0.2954760789871216,
-0.02103297971189022,
0.1920837014913559,
-0.3476611077785492,
0.281188428401947,
0.40837860107421875,
-0.046897321939468384,
-0.6665568351745605,
0.32277294993400574,
0.6574701070785522,
0.19414961338043213,
-0.155449822545051... | |
the precise question you asked, but I think you're looking in the wrong place for a solution. Rather than investing in a new monitor, just rest your eyes on a regular basis. There. I just saved you a few hundred bucks.
EDIT: References have been requested, so here they are. There's a decent scientific article on the v... | [
0.4043576717376709,
0.11241726577281952,
0.058327026665210724,
0.17747840285301208,
0.1862986534833908,
-0.13014288246631622,
0.4480448365211487,
-0.1440684050321579,
-0.4092240631580353,
-0.5804489850997925,
-0.19481270015239716,
0.46777835488319397,
-0.019085370004177094,
0.1483640521764... | |
I'm trying to create a text edit in place myself just by manipulating jQuery selectors. But, after the first ajax callback, the others callback for the same input text doesn't work anymore...
```
function editaVal(celDiv, id)
{
var novoConteudo = $("<input type='text' id='novoCont" + id + "' value='" + $(c... | [
0.11748985201120377,
0.15803515911102295,
0.5231450796127319,
-0.2082381695508957,
-0.02437579073011875,
0.005161128006875515,
0.6144060492515564,
-0.41081249713897705,
-0.06820987910032272,
-0.6396268606185913,
-0.13542543351650238,
0.5145654082298279,
-0.457755446434021,
0.37677562236785... | |
$(novoConteudo).blur(function()
{
$(novoConteudo).parents("tr").removeClass('trSelected');
$.ajax({
type: 'POST',
url: '/SuperAdmin/SalvaValor/?busca=' + $(novoConteudo).val() + '&codValor=' + id,
beforeSend: function() | [
-0.23999114334583282,
-0.15528805553913116,
0.5698885917663574,
-0.09307445585727692,
0.3443099558353424,
0.045019809156656265,
0.27920812368392944,
-0.049714088439941406,
-0.05840831622481346,
-0.5309740304946899,
-0.23578272759914398,
0.636451005935669,
-0.34373939037323,
0.5035909414291... | |
{
$(celDiv).html($("#loading").show());
},
success: function()
{
$(celDiv).html($("#loading").hide()); | [
0.05077182874083519,
0.011275299824774265,
0.46669629216194153,
-0.230143740773201,
-0.04271991178393364,
0.12986396253108978,
0.44350460171699524,
-0.42345568537712097,
-0.1357376128435135,
-0.3796091377735138,
-0.517877995967865,
0.5982121229171753,
-0.3660958707332611,
0.141311407089233... | |
$(celDiv).html(novoConteudo.val());
}
});
});
}
```
My question is: how can i rebind this??? Rebind the blur event... When I blur the input text, nothing happens on the second ajax callback.
thanks!!
You're attaching a `"onblur"` handler to an element that gets wiped out after... | [
0.078231580555439,
-0.11415517330169678,
0.5461943745613098,
0.10301132500171661,
-0.0031260261312127113,
-0.19101957976818085,
0.4585146903991699,
0.15946492552757263,
-0.1103479191660881,
-0.6721490621566772,
-0.2707883417606354,
0.804623007774353,
-0.37553665041923523,
0.121370047330856... | |
want the event to persist, just bind it *when you create it* (ie on the `dblclick`):
```
function editaVal(celDiv, id)
{
$(celDiv).dblclick(function()
{
var text = $(this).html();
var novoConteudo = $('<input type="text" />')
.appendTo($(this).empty())
.attr('id', 'novoC... | [
0.011433513835072517,
-0.15101461112499237,
0.6027129292488098,
-0.1868560016155243,
0.11200245469808578,
-0.03295410796999931,
0.6113032698631287,
-0.2410561740398407,
-0.2595444917678833,
-0.5878297090530396,
-0.33529427647590637,
0.6118302345275879,
-0.30023545026779175,
0.4212649762630... | |
.blur(function()
{
$(this).parents("tr").removeClass('trSelected');
$.ajax({
type: 'POST',
url: '/SuperAdmin/SalvaValor/?busca=' + $(this).val() + '&codValor=' + id, | [
-0.2500840127468109,
-0.45092156529426575,
0.7240979671478271,
-0.060431867837905884,
0.22210077941417694,
0.19240327179431915,
0.31203535199165344,
0.07779373973608017,
0.07817687094211578,
-0.6916857957839966,
-0.25936999917030334,
0.6552048921585083,
-0.36570486426353455,
0.263861030340... | |
beforeSend: function()
{
$(celDiv).html($("#loading").show());
},
success: function() | [
-0.011729300953447819,
0.04963662847876549,
0.5037696957588196,
-0.1570127308368683,
-0.2273005247116089,
0.23976190388202667,
0.5154608488082886,
-0.4309432804584503,
-0.3250671625137329,
-0.5038278698921204,
-0.33789220452308655,
0.4065285325050354,
-0.2179579734802246,
0.226286485791206... | |
{
$(celDiv).html($("#loading").hide());
$(celDiv).html(novoConteudo.val());
} | [
0.33106595277786255,
-0.07979031652212143,
0.38741979002952576,
0.14939932525157928,
-0.05608091130852699,
0.0754501223564148,
0.43727853894233704,
-0.257398396730423,
-0.31908392906188965,
-0.5576633214950562,
-0.3096204996109009,
0.47602757811546326,
-0.39279425144195557,
0.4309875369071... | |
});
});
});
}
``` | [
-0.13501621782779694,
0.19410276412963867,
0.4619080424308777,
-0.5470830202102661,
0.2678522765636444,
-0.4162300229072571,
0.32937178015708923,
-0.1110178679227829,
0.06137986108660698,
-0.333900511264801,
-0.4945527911186218,
0.9818923473358154,
-0.5292561650276184,
0.2966938316822052,
... | |
Is it possible to have `make` create a temp directory before it executes the first target? Maybe using some hack, some additional target etc.?
All commands in the Makefile would be able to refer to the automatically created directory as `$TMPDIR`, and the directory would be automatically removed when the `make` comman... | [
0.7140511274337769,
-0.009552083909511566,
0.3461911976337433,
-0.24537937343120575,
0.18603235483169556,
-0.1569315791130066,
0.33310529589653015,
-0.28692442178726196,
-0.011491324752569199,
-0.36566367745399475,
-0.11066289246082306,
0.6032238006591797,
-0.45087626576423645,
0.377839148... | |
in $(SUBDIRS); do \
echo "make all in $$i..."; \
(cd $$i; $(MAKE) $(MFLAGS) all); \
done
```
Just checked it and this works fine:
```
$ cat Makefile
all:
-mkdir tempdir
-echo hello >tempdir/hello
-echo goodbye >tempdir/goodbye
$(MAKE) $(MFLAGS) old_all
-rm -rf tempdir
old_all... | [
-0.0482574887573719,
0.2949625253677368,
0.7148293256759644,
-0.6822292804718018,
0.37052786350250244,
0.1700226217508316,
0.5157495141029358,
-0.6063920855522156,
-0.12399011850357056,
-0.5363540649414062,
-0.49005839228630066,
0.6496775150299072,
-0.6665757894515991,
0.37037473917007446,... | |
4 allachan None 0 Feb 26 15:00 ..
-rw-r--r-- 1 allachan None 8 Feb 26 15:00 goodbye
-rw-r--r-- 1 allachan None 6 Feb 26 15:00 hello
make[1]: Leaving directory '/home/pax'
rm -rf tempdir
$ ls -al tempdir
ls: cannot access tempdir: No such file or directory
``` | [
-0.15400469303131104,
0.4865845739841461,
1.0327601432800293,
-0.47693783044815063,
0.1308613121509552,
0.2647121548652649,
0.6275455355644226,
-0.314279705286026,
0.32483336329460144,
-0.25942495465278625,
-0.4181530773639679,
0.79139244556427,
-0.11455585807561874,
0.28250852227211,
-0... | |
I often find [Bash](http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) syntax very helpful, e.g. process substitution like in `diff <(sort file1) <(sort file2)`.
Is it possible to use such Bash commands in a Makefile? I'm thinking of something like this:
```
file-differences:
diff <(sort file1) <(sort file2) > $... | [
0.33659613132476807,
0.18851374089717865,
0.05936174839735031,
-0.33406734466552734,
-0.1669335663318634,
-0.11086195707321167,
0.09056118875741959,
-0.43845459818840027,
-0.13917280733585358,
-0.31522834300994873,
-0.1903870850801468,
0.8159965872764587,
-0.2101190686225891,
-0.0608039088... | |
:= /bin/bash` at the top of your makefile, and you should be good to go.
BTW: You can also do this for one target, at least for GNU Make. Each target can have its own variable assignments, like this:
```make
all: a b
a:
@echo "a is $$0"
b: SHELL:=/bin/bash # HERE: this is setting the shell for b only
b:
@... | [
0.7336044311523438,
-0.10018137842416763,
0.08185768127441406,
-0.3893525004386902,
-0.13663654029369354,
-0.28782007098197937,
0.3062438368797302,
-0.32199177145957947,
-0.05958212539553642,
-0.4661501944065094,
0.03556683659553528,
0.6032273173332214,
-0.5229313969612122,
-0.026585897430... | |
### Duplicate
> [Regex for variable declaration and initialization in c#](https://stackoverflow.com/questions/585853/regex-for-variable-declaration-and-initialization-in-c)
I was looking for a Regular Expression to parse CSV values, and I came across this Regular Expression
```
[^,]+
```
Which does my work by spli... | [
0.19250521063804626,
0.25283190608024597,
0.04591658338904381,
0.08009137213230133,
-0.1311236172914505,
0.04988816753029823,
0.2743425667285919,
0.037644077092409134,
-0.5045022368431091,
-0.30212733149528503,
0.1156284511089325,
0.37640807032585144,
-0.6653264760971069,
0.332706153392791... | |
with Value\_name followed by one or more whitespaces. Go to Next State. In That State read a word until a "," comes. Then do it again! And each word will be grouped!
Am i wrong in understanding it?
You could use a Regex similar to those proposed:
```
(?:^value_name\s+)?([^,]+)(?:\s*,\s*)?
```
* The first group is n... | [
-0.14627835154533386,
-0.3225524425506592,
0.37525269389152527,
-0.0913388654589653,
-0.2579043209552765,
0.23953397572040558,
0.09606780111789703,
-0.39304354786872864,
-0.07879304885864258,
-0.5887712836265564,
-0.3981263339519501,
0.4551497995853424,
-0.4778280258178711,
-0.034101255238... | |
third group is non-capturing and would match the `,`, and any whitespace before and after it.
Again, we make it optional by using the `'?'` modifier, otherwise the last `'vXX'` group would not match unless we ended the string with a final `','`.
In you trials, the Regex wouldn't match multiple times: you have to re... | [
-0.24659553170204163,
-0.22193916141986847,
0.21783015131950378,
-0.09793531894683838,
-0.340171217918396,
0.14130879938602448,
0.07273181527853012,
-0.5368092060089111,
-0.08700612932443619,
-0.3716459274291992,
-0.19249090552330017,
0.43197551369667053,
-0.5057076811790466,
-0.1193073466... | |
match every occurrence of `'vXX'` in it.
In C#, you could list all matches and groups using code like this:
```
Regex r = new Regex(@"(?:^value_name\s+)?([^,]+)(?:\s*,\s*)?");
Match m = r.Match(subjectString);
while (m.Success) {
for (int i = 1; i < m.Groups.Count; i++) {
Group g = m.Groups[i];
if... | [
0.09505409747362137,
-0.2168780267238617,
0.528658926486969,
-0.20597121119499207,
-0.20585091412067413,
0.10713394731283188,
0.20305372774600983,
-0.8545970916748047,
-0.05798450484871864,
-0.47103291749954224,
-0.2514492869377136,
0.5398669242858887,
-0.4894423484802246,
-0.0044661518186... | |
// match length: g.Length
}
}
m = m.NextMatch();
}
``` | [
-0.4998476803302765,
-0.1904999315738678,
0.389495849609375,
-0.37972337007522583,
0.41226324439048767,
-0.0034428031649440527,
0.17807036638259888,
-0.3956300914287567,
0.14578363299369812,
-0.7429295778274536,
-0.2740669846534729,
0.6811202764511108,
-0.3787465989589691,
0.15490524470806... | |
I have two applications, one is the `www.myexample.com`, another is the `blog.myexample.com`. I am using PHP and Apache.
Now, I want to let `www.myexample.com` runs on port 82 of my machine, and `blog.myexample.com` on port 83, on the same machine. How to configure the apache and/ or the PHP scripts so that when the r... | [
0.5326517224311829,
0.3013558089733124,
0.39552953839302063,
0.10347582399845123,
-0.06428592652082443,
0.11046679317951202,
0.2983693480491638,
0.33470821380615234,
-0.050348468124866486,
-0.9219663143157959,
0.2159404456615448,
0.4252895414829254,
0.08940418809652328,
0.33610615134239197... | |
the gateway server ( the one which is also hosting www.myexample.com) will check whether this is a request for www.myexample.com or for blog.myexample.com and does the necessary reroutes.**
How to do this? Thanks.
I will assume that you have your own reason for wanting the two sites (`www` and `blog`) to run on differ... | [
0.2433253824710846,
0.013503761030733585,
0.5053641200065613,
0.28030622005462646,
-0.04260934144258499,
-0.1442645639181137,
0.4083986282348633,
0.4508034586906433,
-0.29725417494773865,
-1.0549473762512207,
0.06053423881530762,
0.2027587592601776,
-0.09147290885448456,
0.5699941515922546... | |
port 80. *Otherwise, read on.*
Assuming that you have your two apache+php processes listening on localhost:82 and localhost:83 respectively, bring up a third, apache-only process to act as a reverse proxy. Have the reverse proxy apache instance listen for requests coming on port 80 from the internet, with two virtual ... | [
-0.12381500005722046,
0.19842341542243958,
0.6761465668678284,
-0.1767747551202774,
0.07044485956430435,
0.09146607667207718,
0.48334264755249023,
0.08046835660934448,
-0.280817449092865,
-0.7074007391929626,
0.08251108229160309,
0.6076526045799255,
-0.2646530270576477,
0.2523568570613861,... | |
http://localhost:82/
ProxyPassReverse / http://localhost:82/
</VirtualHost>
# blog
<VirtualHost *:80>
ServerName blog.myexample.com
ProxyPass / http://localhost:83/
ProxyPassReverse / http://localhost:83/
</VirtualHost>
``` | [
-0.22457659244537354,
0.3440963625907898,
0.4611132740974426,
-0.1922254115343094,
-0.24852962791919708,
0.037768784910440445,
0.3719337284564972,
0.37085965275764465,
-0.37962767481803894,
-0.9824603796005249,
-0.07184606790542603,
0.22263698279857635,
-0.1718621701002121,
0.0881294384598... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.