text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
WHEN @orderby = 0 THEN news_edits.[time]
WHEN @orderby = 1 THEN news_edits.lastedit
WHEN @orderby = 2 THEN news_edits.title
END
DESC
) AS num
FROM news_edits
) | [
0.24530832469463348,
-0.14908920228481293,
0.6982160806655884,
-0.07786634564399719,
0.05011588707566261,
0.007775041274726391,
0.33206692337989807,
0.0105988634750247,
-0.33014896512031555,
-0.4732333719730377,
-0.3967454731464386,
0.5260714292526245,
0.06599786132574081,
0.71373152732849... | |
AS a
WHERE num > @start
END
```
The `@orderby` parameter decides which column the results should be ordered by.
`news_edit.[time]` and `news_edits.lastedit` are both datetime fields. But `news_edits.title` is a varchar field.
The query runs fine for both the datetime fields but when `@orderby = 2` I get the fol... | [
-0.01756400428712368,
-0.05396158993244171,
0.5719954371452332,
-0.2585870027542114,
-0.2617553472518921,
0.10966769605875015,
0.17471854388713837,
-0.3006514012813568,
-0.3714788258075714,
-0.43693941831588745,
-0.2934119403362274,
0.5362281203269958,
-0.06514828652143478,
0.5195665955543... | |
= 1 THEN news_edits.lastedit END DESC,
CASE WHEN @orderby = 2 THEN news_edits.title END DESC
```
This is because single `CASE` statement requires that all branches have compatible data types. Since your character string in one `CASE` can't be converted to the date time returned from another `CASE`, you get the co... | [
0.11554432660341263,
-0.09781999886035919,
0.5347171425819397,
-0.08648274838924408,
0.13578230142593384,
0.05908484756946564,
0.22693608701229095,
-0.018720367923378944,
-0.14656873047351837,
-0.5353472828865051,
-0.38163048028945923,
0.36513859033584595,
-0.09617828577756882,
0.522842168... | |
Variable outside of the loop
```
int number = 0;
for(int i = 0; i < 10000; i++){
number = 3 * i;
printf("%d",number);
}
```
or Variable inside of the loop
```
for(int i = 0; i < 10000; i++){
int number = 3 * i;
printf("%d",number);
}
```
Which one is recommended and which one is better in perf... | [
0.2807634472846985,
-0.04731285572052002,
0.25222519040107727,
-0.26565879583358765,
0.011095758527517319,
-0.055384401232004166,
0.5605379939079285,
-0.4797504246234894,
0.06431020796298981,
-0.38238367438316345,
0.2006741315126419,
0.602952778339386,
-0.38987576961517334,
0.1804721355438... | |
to learn something early: any optimization you could make on something like this will be irrelevant in the face of printf.
Printf will be very, very slow. You could quintuple the math and get no measurable speed decrease. It's just the nature of printing to the terminal.
As for your edited question, there is no diffe... | [
0.06912901997566223,
-0.13951100409030914,
0.2529650628566742,
-0.006926233414560556,
0.3229663372039795,
-0.10359746962785721,
0.03862724080681801,
-0.04857771471142769,
0.16610658168792725,
-0.8427651524543762,
-0.04874710366129875,
0.4958060383796692,
0.06355338543653488,
-0.17544007301... | |
i < 500; i++) {
a = i * 3;
}
```
They will produce identical code, unless you start needing to use that variable outside of the loop it is defined in, because it is defined in the local scope of the loop. So...more like this:
```
int forloop::a; // Still not valid code, just trying to show an explanation
namesp... | [
0.19671624898910522,
0.11133141070604324,
0.2321586012840271,
-0.0644969493150711,
0.1467950940132141,
0.06167200580239296,
0.3818502724170685,
-0.4266844093799591,
-0.09468281269073486,
-0.6005449891090393,
-0.08831055462360382,
0.3570381700992584,
-0.4155271649360657,
0.14287737011909485... | |
I am currently trying to figure out how you can bind multiple fields in an MVC 3 view to 1
property on a view model and what is recommended when trying to achieve this.
Using an example for the number of minutes (only) that it takes to prepare something.
The form might look something like this:
Preparation time - H... | [
0.5077797174453735,
-0.04069582000374794,
0.5230547189712524,
-0.01703754812479019,
-0.12074785679578781,
-0.01244025956839323,
0.20347312092781067,
-0.5103368163108826,
-0.04587811231613159,
-0.6432024836540222,
-0.13052339851856232,
0.6516163945198059,
-0.10803114622831345,
-0.0602289289... | |
currently has the below:
```
<div class="editor-label">
@Html.LabelFor(model => model.PreparationTimeInMinutes)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PreparationTimeInMinutes)
@Html.ValidationMessageFor(model => model.PreparationTimeInMinutes)
</div>
```
Here are a few things ... | [
0.30385053157806396,
0.045928116887807846,
0.5955352783203125,
-0.052561402320861816,
-0.05056624114513397,
-0.0821569561958313,
-0.017549272626638412,
-0.5848476886749268,
-0.2912577986717224,
-0.5811722278594971,
0.14433908462524414,
0.34652280807495117,
-0.02844923362135887,
0.308452636... | |
on best practice for this sort of thing? or if I am way off.
Please let me know. Thanks
You should use the first option.
This is exactly what editor templates are made for.
If you want to, you can create a custom ModelBinder to bind two POSTed values to a single number (along with a similar editor template) and ap... | [
0.2887234091758728,
-0.1519572138786316,
0.04625220224261284,
0.44531166553497314,
-0.0887145847082138,
-0.3180485963821411,
0.17031754553318024,
0.16927114129066467,
-0.16485141217708588,
-0.8454601764678955,
0.37291979789733887,
0.8106824159622192,
-0.06106340140104294,
-0.08307665586471... | |
If any of the nested `div`s below have a length longer then an adjacent `div`, the `div`s don't wrap to the next line "properly".
Without dividing each row in it's own div, is there a way to force div #5 (in the example below) to fall underneath div `#1` even if `div` `#1` is taller than the rest?
```html
<style ty... | [
0.1761486828327179,
-0.21826885640621185,
0.7557705640792847,
0.059044916182756424,
-0.21084372699260712,
-0.1472758799791336,
0.17204271256923676,
-0.5241966247558594,
-0.39364421367645264,
-0.40603870153427124,
-0.24788863956928253,
0.4900343418121338,
-0.12414393573999405,
0.37620523571... | |
long... </div>
<div class="video-item">2<br>Description</div>
<div class="video-item">3<br>Description</div>
<div class="video-item">4<br>Description</div>
<div class="video-item">5<br>Description</div>
<div class="video-item">6<br>Description</div>
<div class="video-item">7<br>Description</div>
<d... | [
0.08716771006584167,
-0.2498033046722412,
0.5958994030952454,
0.31087055802345276,
-0.1360536366701126,
0.025468014180660248,
-0.06887833774089813,
-0.4968072474002838,
-0.4204365611076355,
-0.6582213640213013,
-0.031047793105244637,
0.6335776448249817,
-0.017768075689673424,
0.17065560817... | |
be overkill. | [
0.2895345687866211,
0.1551704853773117,
-0.03891940414905548,
0.08885331451892853,
-0.0338895358145237,
-0.11893999576568604,
0.22698546946048737,
-0.15097911655902863,
0.4195166230201721,
-0.3246842324733734,
0.06558196991682053,
0.23339127004146576,
-0.3084935247898102,
-0.22308874130249... | |
I'm trying to install `openCSV` for java and downloaded the files from sourceForge. Unfortunately it's a .`gz` file and I'm not sure how to handle it.
(How do I get the .jar files to add to the path?)
Any suggestions?
I'm using windows 7 machine with netbeans and eclipse.
Use [7-zip](http://www.7-zip.org/) or [winra... | [
0.5190792083740234,
0.08142750710248947,
-0.057466983795166016,
-0.17954915761947632,
-0.16559839248657227,
-0.11497366428375244,
0.5102179050445557,
0.056422628462314606,
-0.0794767290353775,
-0.6735103726387024,
0.048905886709690094,
1.068934679031372,
-0.3696698844432831,
0.011716016568... | |
I'm faced with the prospect of blank pages scattered intermittently in a Word doc, which I'd like to discard. But I need to identify them in VBA first. There are spots in each where a caret lands if I click on the sheet.
But I don't know how to progress from there. How to instruct Word via VBA to identify whether the ... | [
0.2386116087436676,
0.14949776232242584,
0.5552244186401367,
-0.06023765727877617,
0.09799173474311829,
0.07363512367010117,
0.17950862646102905,
-0.3509202003479004,
-0.17991313338279724,
-0.8218485713005066,
-0.2727397084236145,
0.37693578004837036,
-0.010611172765493393,
0.1298255324363... | |
If Selection.Characters.Count < 3 Then
NotEmpty = False
For Each c In Selection.Characters
If Asc(c) > 13 Then
''Possibly not empty
NotEmpty = True
End If | [
-0.017948715016245842,
-0.102261483669281,
0.20598562061786652,
-0.38367563486099243,
0.15940265357494354,
0.18536430597305298,
0.2998234033584595,
-0.4836457371711731,
-0.3335758447647095,
-0.18497850000858307,
-0.41040903329849243,
0.2723921537399292,
-0.10102368146181107,
0.159283876419... | |
Next
End If
If NotEmpty = False Then
Selection.Delete
End If
Next
``` | [
-0.3019735813140869,
0.003927989862859249,
0.3068983852863312,
-0.34102559089660645,
0.17871464788913727,
-0.20384205877780914,
0.4013022780418396,
-0.17296648025512695,
-0.014350675977766514,
-0.5562761425971985,
-0.47616061568260193,
0.31098467111587524,
-0.26220616698265076,
0.420362144... | |
Got a Div being refreshed every 5 seconds. The div has scrolling set to scroll so that user can scroll, but when the refresh happens the div scrolling goes back to the top. Any ideas how I can keep the scroll position after the div is refreshed?
Here's my CSS:
```
#alerts_container {
height: 150px;
width: 250... | [
0.21214278042316437,
-0.15655528008937836,
1.1482692956924438,
-0.006248445250093937,
-0.1333191990852356,
-0.016465142369270325,
0.310133695602417,
-0.03993294760584831,
-0.22169294953346252,
-0.7541148662567139,
-0.19791071116924286,
0.6711121797561646,
0.0019232609774917364,
-0.09358315... | |
include_once('includes/my_alerts.php');
?>
</div>
```
Used SKS's answer to get this to work for me, but I did have to change his code up a bit:
```
var isScrolling = false;
var lastScrollPos = 0;
var counter = 0;
$(function() {
$('#alerts_container').bind("scroll", function (){
isScrolling = true;
... | [
0.3225085437297821,
-0.10455947369337082,
0.7859336733818054,
-0.5497026443481445,
0.0027001018170267344,
-0.034150660037994385,
0.5089038014411926,
-0.7576065063476562,
-0.3417031168937683,
-0.3634248971939087,
-0.22367815673351288,
0.7181329727172852,
-0.5910555720329285,
0.0583985373377... | |
$('#alerts_wrapper').load('staffhome.php #alerts_container', function () {
$('#alerts_container').scrollTop(lastScrollPos);
});
}
isScrolling = false;
}
});
```
You should get scroll height inside your scroll handler using `.scrollTop` and then set it after `.load`
[**DEMO**... | [
-0.00757620669901371,
-0.13566230237483978,
1.165411114692688,
-0.13929788768291473,
0.05989900231361389,
-0.1691521406173706,
0.22282373905181885,
-0.3989793062210083,
-0.35461366176605225,
-0.5855371356010437,
-0.1420263797044754,
0.9598920345306396,
0.021084444597363472,
-0.138736471533... | |
lastScrollPos = this.scrollTop;
});
```
and in `.load` callback
```
$('#leftside div#alerts_container').load('staffhome.php #alerts_container' , function () {
$(this).scrollTop(lastScrollPos);
});
``` | [
0.06100340560078621,
-0.08930988609790802,
1.3643760681152344,
-0.37435832619667053,
0.3030771315097809,
-0.049102168530225754,
0.18105223774909973,
-0.28402769565582275,
-0.39256569743156433,
-0.3009927272796631,
-0.5007722973823547,
0.7748655080795288,
-0.38050442934036255,
-0.0497547052... | |
Most web developers know that to restrict only numbers to a form input, you can do something like this:
```
$(function() {
$("#foobar").keypress(function(e) {
if($.inArray(e.which, range(48, 57)) == -1) {
e.preventDefault();
return false;
}
});
});
function range(start, end) {
var ... | [
0.14294394850730896,
-0.23503203690052032,
0.6517224311828613,
-0.5229381322860718,
0.10921575874090195,
-0.06335800886154175,
0.5107460021972656,
-0.5510183572769165,
0.04658950865268707,
-0.5782226920127869,
-0.5177206993103027,
0.6454610824584961,
-0.5376646518707275,
0.3288963437080383... | |
not quite get the job done on an Android with the default browser. (iPhone and Other Android browsers have not been tested, so they could suffer from the same issue. Tested on an iPhone 4S, which did not have this issue.)
On an Android, let's say you first type "f". Nothing happens. Awesome. Wait just a minute. You th... | [
0.2388724982738495,
-0.24641460180282593,
0.17352603375911713,
0.12128429114818573,
0.15031859278678894,
0.09769399464130402,
0.5100554823875427,
0.20213761925697327,
-0.006528222002089024,
-0.4704884886741638,
-0.32309529185295105,
0.4107597768306732,
-0.03783509135246277,
-0.448026359081... | |
fiddle works fine on a desktop, but try it on Android (phone or emulator). I've tested with Android 2.3.6 and 2.2.
Anyone run into this before? Any direction would be greatly appreciated! For now, the workaround is to remove non-numeric characters immediately afterwards (in the `keyup` event).
**Update:** [**Here is ... | [
-0.2978779971599579,
-0.14863303303718567,
0.5396867990493774,
-0.2703922390937805,
0.15333889424800873,
-0.06795703619718552,
0.5326683521270752,
-0.22815684974193573,
-0.10851648449897766,
-0.5675721764564514,
0.07635737210512161,
0.4878544211387634,
-0.12783430516719818,
-0.160656794905... | |
fix the code, but should circumvent the problem, which looks like a bug, to be honest. | [
0.3576778471469879,
0.27386289834976196,
0.010398066602647305,
0.30101507902145386,
0.4590440094470978,
-0.14245100319385529,
0.455586314201355,
-0.028876325115561485,
-0.057844165712594986,
-0.11841568350791931,
-0.29143205285072327,
0.4250439703464508,
-0.03632933646440506,
-0.1566695421... | |
I have a sample single-page-application in Backbone that I am messing around with. The idea is that I have a button that will trigger a refresh on a view. I am trying to get the event handler to remember 'this' as the backbone view, not the element that it was called on. No matter how much docs I read, I cant seem to m... | [
0.25103285908699036,
-0.0075631095096468925,
0.2844836413860321,
-0.3117847442626953,
-0.16780701279640198,
-0.1403350532054901,
0.2822389602661133,
0.10807482898235321,
-0.04767437279224396,
-0.91044682264328,
0.17033518850803375,
0.4961060583591461,
-0.30198898911476135,
0.06295381486415... | |
//this.$("#add-tweet-button").click(this.render);
//this.$("#add-button").bind("click", this.render);
}
```
When the render function is called, the 'this' element is the button. I know what im missing is pretty easy, can someone help me out with it? Also, is this sound as coding conventions go?
If you use the Vie... | [
0.21682466566562653,
-0.030723029747605324,
0.49604612588882446,
-0.18907323479652405,
-0.007842173799872398,
-0.10048595070838928,
0.2080853432416916,
-0.44380202889442444,
-0.05278358608484268,
-0.836357831954956,
-0.3472440242767334,
0.6793472170829773,
-0.20570316910743713,
-0.10959403... | |
this.$(...), so I'm assuming this is the case. | [
0.25392967462539673,
0.29683753848075867,
0.31839630007743835,
-0.008308528922498226,
0.3853513300418854,
-0.005186727270483971,
-0.16159376502037048,
0.2259073108434677,
-0.08044667541980743,
-0.31013816595077515,
0.04605722427368164,
0.48974084854125977,
-0.0034724795259535313,
0.2511219... | |
I am trying to create a simple message that slides in and "elegantly" slides the content below it down while it slides in. The problem that I'm having is that the content below the message isn't sliding elegantly, it's "jumping" to the full height of the message before the animation has even started. The same is true f... | [
0.053986500948667526,
-0.1277335286140442,
0.6325112581253052,
-0.03188040852546692,
-0.4805961847305298,
0.013765324838459492,
0.11812044680118561,
-0.2427339106798172,
-0.4465567171573639,
-0.7637052536010742,
-0.16098196804523468,
0.18251296877861023,
-0.24840477108955383,
-0.1114056631... | |
is always shown, but jumps down when the slide animation starts instead of sliding down with the element as it's displayed and it stays in place as the div above hides instead of sliding smoothly with it.</div>
```
JS:
```
setTimeout(function() {
show();
}, 500);
function show() {
$(".slide").show('slide',... | [
0.15423284471035004,
-0.33688244223594666,
0.8150679469108582,
-0.26075100898742676,
0.16454029083251953,
0.0005828177090734243,
0.006855238229036331,
-0.43092918395996094,
-0.2180091291666031,
-0.3915664255619049,
-0.32590073347091675,
0.4552781283855438,
-0.23661504685878754,
-0.01094761... | |
direction: 'up'
}, 1000);
});
}
```
**NOTE:** I have tried using the "slideDown" and "slideUp" methods instead, but the animation doesn't function the same. Instead of sliding the content down, the height of the div is adjusted to reveal the content, which is what I would call a "blind" animation, not a "... | [
-0.0814884603023529,
-0.14961972832679749,
0.8181114792823792,
0.15343937277793884,
0.08271408826112747,
0.028300581499934196,
0.08769723027944565,
-0.1784854382276535,
0.016984757035970688,
-0.6595267653465271,
-0.1835470050573349,
0.4709087312221527,
-0.07781156897544861,
0.0398019477725... | |
I already tried several methods getting my xml-script parsed in java, but i can't figure it out!
I have 2 files.
mysql\_get.php is returning an XML script if it is called.
post\_alert.html is fetching the XML script from mysql\_get.php over jQuery $.post(..) as shown below:
```
function init2() {
var response;
... | [
-0.06949270516633987,
-0.07827986031770706,
0.6819295883178711,
-0.20575232803821564,
-0.3280913829803467,
0.2289966493844986,
0.3229202330112457,
-0.5942301154136658,
-0.18216055631637573,
-0.6264235973358154,
-0.14658018946647644,
0.5358465909957886,
-0.2919178307056427,
0.08136916160583... | |
$(this).attr("id")
}));
}
```
After hit a button which call init2(), i get the response message in xml style as i can see by the alert popup.
```
<?xml version="1.0" encoding="uft-8"?>
<root>
<collection collection="locationPoint">
<item id="1">
<latitude>23.4442</latitude>
<longitude>51.2341... | [
-0.005351208616048098,
0.027913713827729225,
0.6895647644996643,
0.04187197610735893,
-0.07039608061313629,
0.1464599370956421,
0.5159987211227417,
-0.2586383819580078,
-0.26645511388778687,
-0.5533933043479919,
-0.323891282081604,
0.21048039197921753,
-0.24585986137390137,
0.0885318219661... | |
are a couple of things:
Line 1 of you xml file should read UTF-8 not UFT-8
Line 2 should be deleted, else make sure you have a closing tag, invalid xml
Then here is a little example that I hope helps:
```
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.... | [
0.33100491762161255,
-0.07912030816078186,
0.7111661434173584,
0.13088835775852203,
0.10220807045698166,
0.03528556600213051,
-0.09497889876365662,
-0.20291712880134583,
-0.0726940855383873,
-0.8264256119728088,
-0.14298060536384583,
0.5561838746070862,
-0.4487195312976837,
-0.290842473506... | |
$.ajax({
url: 'mysql_get.php',
type: 'post',
dataType: 'xml',
success: function(data) {
$(data).find('item').each(function () { | [
-0.08581340312957764,
-0.21993322670459747,
0.39111071825027466,
0.24242472648620605,
0.03361551836133003,
-0.13247111439704895,
0.21581120789051056,
-0.13476164638996124,
-0.11687219142913818,
-0.42000946402549744,
-0.2933077812194824,
0.6010779738426208,
-0.2564089000225067,
-0.087365888... | |
$('#dc').append($(this).attr('id') + '<br/>')
});
},
error: function(data) {
$('#dc').html('error'); | [
0.01808113604784012,
-0.09024037420749664,
0.32789918780326843,
-0.17940755188465118,
-0.012983073480427265,
0.25887152552604675,
0.3618707060813904,
-0.2636251449584961,
-0.022072317078709602,
-0.25343629717826843,
-0.4104742705821991,
0.6873524188995361,
-0.627743124961853,
0.07663012295... | |
}
});
});
</script>
</html>
``` | [
-0.1446342021226883,
0.036129873245954514,
0.57815021276474,
-0.43320199847221375,
0.30058667063713074,
-0.2276587039232254,
0.3108508288860321,
-0.005263324361294508,
0.09733109176158905,
-0.4957992434501648,
-0.7173441052436829,
0.7536147832870483,
-0.39539098739624023,
0.066216669976711... | |
I'm trying to do some fanciness with XIBs and that includes wanting to somehow get and store the paths of images loaded from the xib. To do this, I made some categories and did some method swizzling to override all the UIImage constructors to save their path before calling their parent constructor.
But due to Apple's ... | [
0.48098108172416687,
0.1145002692937851,
0.30842795968055725,
0.15638260543346405,
-0.30864840745925903,
-0.16460104286670685,
0.4846939742565155,
0.22252154350280762,
-0.07925582677125931,
-0.7477152347564697,
0.008237830363214016,
0.573127269744873,
-0.3722660541534424,
0.376414537429809... | |
that exposes what initWithNib actually does behind the scenes.
Thanks!
EDIT:
If you're in a similar situation, you may try using the accessibilityLabel / accessibilityHint which is automatically populated with the image path. The only issue is that accessibility needs to be enabled or these values are nil.
I know the... | [
0.20651696622371674,
-0.17321749031543732,
0.18856270611286163,
0.23863999545574188,
-0.29677122831344604,
-0.39277708530426025,
0.5494145750999451,
-0.00689149321988225,
-0.19503168761730194,
-0.8723304867744446,
-0.07418882846832275,
0.5800604820251465,
-0.23153530061244965,
0.0544783174... | |
than hacking UIImage itself, since for all we know UIImageView could be using a custom subclass that you don't have access to. | [
0.4234367907047272,
-0.34671550989151,
-0.1101982519030571,
0.39943161606788635,
-0.26595571637153625,
-0.5160055160522461,
0.2777005434036255,
0.30912554264068604,
-0.2862575352191925,
-0.5700280666351318,
0.13798588514328003,
0.5289205312728882,
-0.23083344101905823,
0.12209916114807129,... | |
I am about to submit my iPhone app to the app store, and I am wondering: is there a standard for how I organize my source code (the directories, the naming of the directories, which file goes to which folder, etc.)? Actually, do I even submit the source code to Apple at all? Maybe I missed it, but I do not think source... | [
0.7674320936203003,
0.5311273336410522,
0.02634701319038868,
0.00949082337319851,
0.20389966666698456,
0.022711966186761856,
0.16250096261501312,
0.11601892113685608,
-0.24350838363170624,
-0.3589668869972229,
-0.16179661452770233,
0.48347294330596924,
-0.22871176898479462,
-0.122754268348... | |
the Application Loader app. In theory, undocumented API calls should be caught at this time. If nothing is caught, Apple will surely catch them and let you know.
In general, undocumented API calls are prefixed with an underscore. Not all follow this convention, but you could search the source code for methods and func... | [
0.25937849283218384,
0.13773728907108307,
0.10797549039125443,
0.18958121538162231,
0.23654046654701233,
-0.4169923961162567,
0.5472704768180847,
0.20706021785736084,
-0.5659390091896057,
-0.46546533703804016,
-0.34981560707092285,
0.6338930130004883,
-0.36078131198883057,
-0.0490177571773... | |
Computer: windows 7 64bit
SlikSvn is installed. The System variables *PATH* has the bin folder set correctly:
```
...; C:\Program Files\SlikSvn\bin; ...
```
If I type "svn" in the Run dialog (by pressing WIN+R), I can see the svn.exe is called in the cmd window.
If I type "cmd" in the Run dialog, a cmd windo... | [
-0.3955287039279938,
0.005000310018658638,
0.8710700273513794,
-0.01639944314956665,
0.39782509207725525,
-0.13466663658618927,
0.3156179189682007,
0.16690847277641296,
-0.32365739345550537,
-0.8138555884361267,
-0.4077748656272888,
1.1340419054031372,
-0.17678634822368622,
0.0351043827831... | |
with "C:\Program Files\SlikSvn\bin" in it, but it doesn't work neither.
Does anyone have a solution?
Do you really have a space between the semi-colon and the `C:` as shown in the question:
```
...; C:\Program Files\SlikSvn\bin; ...
^
```
If so, that's probably your problem (Windows will not trim such whitespac... | [
-0.18309800326824188,
0.18167774379253387,
0.11473758518695831,
0.1543923169374466,
0.220595583319664,
-0.039803970605134964,
0.4145444333553314,
0.24198585748672485,
-0.1678832620382309,
-0.6371586322784424,
-0.1386079341173172,
0.40259572863578796,
-0.11307321488857269,
-0.03976440429687... | |
Hello I have a small `List<string>` that I want to maintain across postbacks on only ONE page. The List will not contain more than 10 items, with each item being 40 chars max (no sensitive data).
I know that similar questions have been asked, but I am somewhat ambivalent between storing this in `ViewState` or `Session... | [
-0.23446092009544373,
0.18509191274642944,
0.5360462665557861,
-0.23447470366954803,
-0.049714427441358566,
0.19398076832294464,
0.3938758671283722,
0.02260265126824379,
-0.4179944694042206,
-0.6788890957832336,
0.022118311375379562,
0.1700512319803238,
-0.0021492091473191977,
0.1839449405... | |
List (of humble size) be okay to store in `ViewState` or should I be storing it in `Session`? Thank you.
Storing things in ViewState isn't a terrible idea if you don't abuse it. If the list is small and it only makes sense on one page, then go for it.
Just remember ViewState can be tampered with, so if you don't want ... | [
0.37705323100090027,
-0.14374896883964539,
0.0731523334980011,
0.2845131754875183,
-0.07840395718812943,
-0.15624935925006866,
0.1594310849905014,
-0.14699457585811615,
-0.462653785943985,
-0.8301805257797241,
0.12985892593860626,
0.9011487364768982,
0.024133166298270226,
0.099367246031761... | |
I've got an Android app that I want other apps to be able to launch via an intent. This allows other apps to interact with mine and provide initial inputs etc.
The calling App (call it App-A) does the following:
```
Intent intent = new Intent("com.myapp.dosomething");
intent.putExtra("com.myapp.value1", "1.25");
inte... | [
0.5799450278282166,
0.07015377283096313,
0.8706214427947998,
-0.35045868158340454,
0.0906543880701065,
0.019864099100232124,
0.569067120552063,
-0.38322684168815613,
-0.027368495240807533,
-0.6003230214118958,
-0.18080207705497742,
0.9260478615760803,
-0.21414203941822052,
-0.5115393400192... | |
the user hits the home button instead of finishing the task we end up with a major problem. If they try and restart App-A from the launcher my app pops up instead. The user can never get back to App-A without force killing my app. Even worse, my app is specifically designed to not retain any data between launches and w... | [
0.2639513909816742,
0.1363631784915924,
0.5066260695457458,
0.24480824172496796,
0.021761372685432434,
0.041107214987277985,
0.5905339121818542,
0.0955079048871994,
-0.4520065188407898,
-0.3101135790348053,
-0.10109630972146988,
0.4784689247608185,
-0.21577052772045135,
0.3517477512359619,... | |
that App-A doesn't sit there waiting on my app? It should be able to continue running regardless of what my app does. If my app crashes, or doesn't return a value I don't want the calling app to be hung forever.
Any ideas?
Thanks.
Found the Answer [here](https://stackoverflow.com/questions/8862548/simple-xml-framewor... | [
0.06780915707349777,
-0.04009115323424339,
0.49421894550323486,
0.1550755500793457,
0.11749044060707092,
0.11706400662660599,
0.19626875221729279,
-0.09225887805223465,
-0.45698410272598267,
-0.2653222382068634,
-0.15200746059417725,
0.804096519947052,
-0.3031482398509979,
0.04761194810271... | |
I read this and got really interested: [Validating date format using regular expression](https://stackoverflow.com/questions/8173548/validating-date-format-using-regular-expression)
so I started writing my own version of the date validation function, I think I am close, but not quite, and I would like some suggestion ... | [
0.33021649718284607,
-0.009825103916227818,
0.9117658138275146,
-0.1248941570520401,
0.21259815990924835,
-0.31712111830711365,
0.09322955459356308,
-0.11679978668689728,
-0.05885477364063263,
-0.3439931869506836,
-0.20851947367191315,
0.569912850856781,
-0.04266887158155441,
0.09478542953... | |
The date has to be real (13/32) is not acceptable
def checkValidDate(myString):
# Get today's date
today = datetime.date.today()
myMaxYear = int(today.strftime('%Y'))
if (myString[:2] == '00' or myString[3:5] == '00'):
return False
# Check if the month is between 1-12
if (int(myString[... | [
0.34728166460990906,
-0.18739277124404907,
0.9174133539199829,
-0.12740840017795563,
0.3366234600543976,
-0.05043089762330055,
0.4648524224758148,
0.009620865806937218,
0.052356868982315063,
-0.45650047063827515,
-0.282916396856308,
0.32420897483825684,
0.23191842436790466,
0.1678203791379... | |
31):
# Check if the year is between 1900 to current year
if (int(myString[-4:]) <= myMaxYear):
return True
else:
return False
testString = input('Enter your date of birth in 00/00/0000 format: ')
# Making sure the values are correct
print('Month:', testString[:2])
p... | [
0.27842625975608826,
0.020554812625050545,
0.3933955132961273,
-0.127623051404953,
0.3869830369949341,
0.15820050239562988,
0.28932666778564453,
-0.10813836008310318,
0.05416753143072128,
-0.4543275535106659,
-0.17967288196086884,
0.06527085602283478,
0.246506929397583,
0.14869767427444458... | |
print('Passed the value test too.')
else:
print('But you failed the value test.')
else:
print("Failed. Try again")
```
**Question 1:** Is there other way (better) to do `int(myString[3:5])` when I want to compare if it is valid? I feel my method is very repetitive, and this function must require 00/00... | [
0.11364510655403137,
0.40879392623901367,
0.3729681670665741,
-0.11804919689893723,
-0.19659936428070068,
0.09739255905151367,
0.5455267429351807,
-0.44333988428115845,
-0.27882295846939087,
-0.21037593483924866,
0.1340324580669403,
0.6602433919906616,
0.019142376258969307,
-0.067327752709... | |
many `if` statement, I wonder are there better way to write this test?
I would like to learn more about programming in python, any suggestion or advice will be greatly appreciated. Thank you very much.
Like many things in python there's already underlying capabilities to check dates. Assuming you aren't just doing th... | [
0.6494221687316895,
0.2648233473300934,
0.2032518833875656,
0.03741957247257233,
-0.08231313526630402,
-0.22182311117649078,
-0.027690008282661438,
-0.01956385001540184,
-0.18760812282562256,
-0.42357128858566284,
-0.0012307901633903384,
0.2666561007499695,
0.10431438684463501,
0.469768166... | |
int(dateparts[2]) > maxyear or int(dateparts[2]) < minyear:
raise ValueError("Year out of range")
dateobj = datetime.date(int(dateparts[2]),int(dateparts[1]),int(dateparts[0]))
except:
// handle errors
```
if datetime.date is given an invalid date it will complain, eg:
```
datetime.date(2000,45,23)
T... | [
0.006122003775089979,
0.02804153598845005,
0.5319405198097229,
-0.215250164270401,
0.3008030652999878,
0.05663546547293663,
0.13585588335990906,
-0.05502321198582649,
-0.2068358212709427,
-0.30695152282714844,
-0.21953290700912476,
0.2635047435760498,
-0.020139556378126144,
0.2956615686416... | |
I recently upgraded to ggplot2 0.9.0 from version 0.8.9, and now I'm getting that my plot legends only show the factor levels used in the plot (it omits the unused ones). Before it'd include all factor levels in the legend. I'm running Windows 7 and R 2.15.0 (2.14.2 before today).
Is anyone else finding this too? Is t... | [
0.034553851932287216,
0.09492520242929459,
0.8599914312362671,
0.06444959342479706,
0.08330921828746796,
0.07794571667909622,
0.408522367477417,
-0.06788214296102524,
-0.4800775349140167,
-0.46816810965538025,
-0.17366749048233032,
0.8758808970451355,
0.06580454111099243,
0.191495791077613... | |
qty = rnorm(22, 100, 20))
# This plot only gives "apple" in the legend now.
# Before, I used to get both "apple" and "orange".
qplot(year, qty, data = subset(df, fruit=="apple"), colour = fruit)
```
The qplot() used to give me both "apple" and "orange" in the legend (even though there were only points for "apple")... | [
0.0334608368575573,
-0.03458824381232262,
0.4269479811191559,
-0.15362636744976044,
0.008486253209412098,
0.5392019748687744,
0.3535860478878021,
0.2481037974357605,
-0.6254785060882568,
-0.47748321294784546,
-0.31568726897239685,
0.16829228401184082,
0.165040984749794,
0.3571673333644867,... | |
I'd appreciate the unused levels being automatically dropped and not having to type droplevels(), but this is the one case I want those unused levels). Apologies if this is a question local to my computer only.
---
**Edit**: Note that as of R 4.0.0, the above code no longer produces a `df$fruit` as a factor, which ch... | [
0.04184591397643089,
-0.026213763281702995,
0.4366498589515686,
-0.2761650085449219,
0.1306576132774353,
0.47912687063217163,
0.23351968824863434,
0.017062291502952576,
-0.6353627443313599,
-0.5045398473739624,
-0.49624907970428467,
0.4915591776371002,
-0.18369898200035095,
-0.026104526594... | |
"apple"),aes(x = year,y = qty,colour = fruit)) +
geom_point() +
scale_colour_discrete(drop = FALSE)
``` | [
-0.07787399739027023,
0.32022517919540405,
0.35409998893737793,
-0.3018628656864166,
0.3575107455253601,
0.6710874438285828,
0.17055512964725494,
0.2463873326778412,
-0.3715313971042633,
-0.4119502604007721,
-0.5034347772598267,
0.04650197923183441,
-0.13866953551769257,
0.4508114457130432... | |
Let's say string is:
```
$str="abcdefg foo() hijklmopqrst";
```
How do I let php call foo() and insert the returning string to this string?
```
$str="abcdefg foo() hijklmopqrst";
function foo() {return "bar";}
$replaced = preg_replace_callback("~([a-z]+)\(\)~",
function ($m){
return $m[1]();
},... | [
0.13875822722911835,
0.01783890463411808,
0.8731675148010254,
-0.5310223698616028,
-0.1411980241537094,
0.0037571939174085855,
0.297920823097229,
-0.3825659155845642,
-0.16037598252296448,
-0.27903512120246887,
-0.2970180809497833,
0.6344173550605774,
-0.7076027989387512,
0.142994731664657... | |
remote code injection attacks.
```
$allowedFunctions = array("foo", "bar" /*, ...*/);
$replaced = preg_replace_callback("~([a-z]+)\(\)~",
function ($m) use ($allowedFunctions) {
if (!in_array($m[1], $allowedFunctions))
return $m[0]; // Don't replace and maybe add some errors.
... | [
0.14600466191768646,
-0.25799205899238586,
0.3805871903896332,
-0.05908967927098274,
0.1834782063961029,
-0.11551186442375183,
0.6212424039840698,
-0.417764276266098,
-0.09191789478063583,
-0.44043031334877014,
-0.28381583094596863,
0.8381644487380981,
-0.5734617114067078,
0.40876153111457... | |
preg_replace_callback("~(".implode("|",$allowedFunctions).")\(\)~",
function ($m) {
return $m[1]();
}, $str);
``` | [
-0.05081420764327049,
-0.09948206692934036,
0.7643882036209106,
-0.616037130355835,
0.5684539079666138,
0.2006690502166748,
0.31182631850242615,
-0.2796423137187958,
-0.011163869872689247,
-0.21701298654079437,
-0.6105651259422302,
1.1624996662139893,
-0.6038364768028259,
0.234232738614082... | |
I have an email account in Google Apps that I use to get emails with one attached picture. I want to write a script that gets the emails from that account and get the attached picture of each email and later it upload it to a server.
My question is: What is the recommended way of doing this in Ruby? I assume it's usin... | [
0.479303777217865,
0.30696266889572144,
0.38242146372795105,
-0.0458524189889431,
-0.21097226440906525,
0.024234943091869354,
0.1880556344985962,
0.01360293198376894,
-0.053481243550777435,
-0.7502529621124268,
0.21733596920967102,
0.3390631675720215,
-0.3840859532356262,
-0.01085608359426... | |
causing the whole list as one big element to be floated, which is forcing it down below the `img`. | [
0.3374096751213074,
0.0278566125780344,
0.5859051942825317,
-0.191697359085083,
0.0635860413312912,
-0.22688940167427063,
-0.030821725726127625,
-0.1633373498916626,
-0.3855029344558716,
-0.23136663436889648,
0.03200114890933037,
-0.06110386922955513,
-0.2236129492521286,
0.435643613338470... | |
**The html below works fine by itself but when put inside a table td, the drop down button appears on the left side of the input when it should be on the right side.** It should look something like the append with button example in the 'Extending form controls' section of this page: <http://twitter.github.com/bootstrap... | [
0.007399953436106443,
-0.09033185988664627,
0.849862277507782,
0.10030163079500198,
-0.3157199025154114,
0.1049913838505745,
0.19043289124965668,
-0.08724112808704376,
-0.17563605308532715,
-0.7725787162780762,
-0.06534203886985779,
0.28221797943115234,
-0.07685703784227371,
-0.29185864329... | |
I want them to appear as in the markup, with the input side by side with the drop down button, appearing to be joined together. Even if a try using the class "input-prepend' (not that a want it that way) it doesn't change.
**Note: I'm using twitter bootstrap in a rails application via the latest version of the twitter... | [
0.14165900647640228,
-0.18444854021072388,
0.4677967429161072,
-0.16471487283706665,
-0.21445392072200775,
0.546783447265625,
0.018272094428539276,
-0.24890893697738647,
-0.39470401406288147,
-0.8115665912628174,
0.04126787185668945,
0.5144636034965515,
-0.11003176867961884,
-0.36278352141... | |
<li><a href="#">apple</a></li>
<li><a href="#">orange</a></li>
<li><a href="#">banana</a></li>
</ul>
</div>
```
* The only css I have is what came with twitter bootstrap and also jquery ui.
* Its the same in safari and firefox.
* Its within form tags.
* I've tried as many combinations of divs... | [
0.006362572778016329,
-0.04726312309503555,
0.20033524930477142,
-0.1590183675289154,
-0.3101389408111572,
0.4456802308559418,
0.29122689366340637,
0.24364082515239716,
-0.31641051173210144,
-0.9474835395812988,
-0.03906751424074173,
0.31317949295043945,
-0.33952924609184265,
-0.4416714906... | |
would be appreciated.**
For bonus points: The **append and prepend** example( <http://twitter.github.com/bootstrap/base-css.html#forms> ) doesn't work on my site either in or out of a table. I can only use one or the other not both at the same time.
I see what you're trying to do now, you want to use an input instead ... | [
0.47673705220222473,
-0.10277239233255386,
-0.035354133695364,
0.23624522984027863,
-0.049710601568222046,
0.02565132826566696,
0.26207250356674194,
0.16975536942481995,
-0.393346905708313,
-0.8613288402557373,
0.1784304976463318,
0.5469053983688354,
-0.1431252360343933,
-0.054914280772209... | |
so:
**CSS**
```
.btn-group .input:first-child {
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
margin-left: 0;
}
.btn-group .input {
float: left;
position: relative;
}
```
With this CSS in place all you have to do is include the `.input` class in your input field and it should wor... | [
-0.013185909017920494,
-0.00024745569680817425,
0.5565131306648254,
-0.2913789749145508,
0.11426442861557007,
0.37010180950164795,
0.023845382034778595,
-0.5399412512779236,
-0.3262414336204529,
-0.7798352241516113,
-0.3737066388130188,
0.3996308147907257,
-0.13635846972465515,
-0.25477725... | |
<li><a href="#">apple</a></li>
<li><a href="#">orange</a></li>
<li><a href="#">banana</a></li>
</ul>
</div>
```
[Demo](http://jsfiddle.net/N6vGZ/2/show), edit [here](http://jsfiddle.net/N6vGZ/2/). | [
-0.3399689495563507,
-0.18117232620716095,
-0.0034210835583508015,
-0.45224636793136597,
-0.1742703914642334,
0.5310615301132202,
0.3025990128517151,
0.09257156401872635,
-0.5315943360328674,
-0.8003809452056885,
-0.796711802482605,
0.19977796077728271,
-0.36351945996284485,
-0.09948488324... | |
Suppose I have the following array:
```
1, 4, 5, 2, 3
```
I need to rearrange it to
```
5, 1, 4, 2, 3
```
There is only on extra space; one `int`.
I figured one solution to solve it. But it is `O(n^2)` complexity.
Can anyone offer a faster solution?
Thanks
Edited:
sorry, not rotating array.
I need to change ... | [
0.11299847066402435,
0.24217046797275543,
0.31706133484840393,
-0.0748562216758728,
-0.02623751200735569,
0.31599417328834534,
0.08396518230438232,
-0.16517676413059235,
-0.40139684081077576,
-0.7492306232452393,
-0.06984801590442657,
0.314683198928833,
-0.08585236966609955,
0.119264058768... | |
Amazon interviewer for this. LOL
This solution works using O(1) space.
```
>>> def arrayswap(source, dest):
... for i in range(len(dest)):
... source[source.index(dest[i])], source[i] = source[i], source[source.index(dest[i])]
...
>>> a = [1, 4, 5, 2, 3]
>>> b = [5, 1, 4, 2, 3]
>>> arrayswap(a, b)
>>> a
[... | [
-0.08049662411212921,
-0.20767201483249664,
0.18606029450893402,
-0.12158726155757904,
-0.3537214398384094,
0.48254600167274475,
0.32087650895118713,
-0.5487795472145081,
-0.17747452855110168,
-0.6322327256202698,
-0.061959587037563324,
0.462051123380661,
-0.2879491448402405,
-0.2245662063... | |
Consider a model that has 2 types: A and B. Both types store a color as a string. Type A can be blue or red. Type B can be white or black.
When displaying the form for type A, there is an HTML select list that contains [blue, red]. For type B, the select list contains [white, black].
What is the best method to displa... | [
0.14056141674518585,
-0.23133784532546997,
0.38429516553878784,
0.040706194937229156,
-0.11614599823951721,
0.4188951253890991,
0.14691713452339172,
-0.13280870020389557,
-0.19905473291873932,
-0.7271367311477661,
0.09087642282247543,
0.3930934965610504,
-0.6575409173965454,
0.189617812633... | |
this be designed as two separate models, inheriting from a common base model?
I considered an AJAX (jQuery) update of the select based on the selection of type. This seems like a very complicated solution to a simple problem.
Using jQuery it's quite trivial. v2.0 uses the `table` class on all tables.
```
$('.table > ... | [
0.01901359297335148,
-0.20081153512001038,
0.46029144525527954,
-0.0741237923502922,
-0.02005855366587639,
-0.19933852553367615,
0.023395732045173645,
-0.1573837697505951,
-0.06379888206720352,
-0.6289013028144836,
0.09108089655637741,
0.6695933938026428,
-0.5872647166252136,
0.15105597674... | |
I have three data frames, the first (with column headers, but no row numbering) looks like
```
ID 1 2 3
A 12 NA NA
B NA 7 NA
C NA NA 22
```
The second may look like
```
ID 1 2 3
A NA 6 NA
B NA NA 29
C 43 NA NA
```
Lastly, the third looks like
```
ID 1 | [
0.11671727895736694,
0.25333744287490845,
0.4325212240219116,
-0.0964183509349823,
-0.25345614552497864,
0.4108637869358063,
0.03692927211523056,
-0.4423381984233856,
-0.09281407296657562,
-0.6926813125610352,
0.0225821603089571,
0.05186451971530914,
-0.16280487179756165,
0.260957986116409... | |
2 3
A NA NA 32
B 5 NA NA
C NA 2 NA
```
The first column is an ID column and the same for all three data frames. The final three columns represent the same variables (1, 2, and 3). The record for observation A, variable 1 is only in one of the data sets. So is the record for observation A, variabl... | [
0.30422699451446533,
0.398006796836853,
0.19334828853607178,
-0.12702247500419617,
-0.3792087733745575,
0.3419797718524933,
0.31386396288871765,
-0.7486404776573181,
-0.24329416453838348,
-0.37024325132369995,
-0.05477999895811081,
-0.23951691389083862,
-0.5322889685630798,
0.3707789182662... | |
1 2 3
A 12 6 32
B 5 7 29
C 43 2 22
```
I apologize that I didn't have a better way of describing this problem. If someone could share the terminology for it, that would be great.
Nice title! This is quite similar to [R - Vector/ Array Addition](https://stackoverflow.com/questions/9900690/r-vect... | [
0.2823297381401062,
-0.03089923970401287,
0.4076991081237793,
-0.07411912828683853,
-0.27870407700538635,
0.04691483452916145,
-0.07851003110408783,
-0.6224892139434814,
-0.2842361330986023,
-0.5943556427955627,
0.060452669858932495,
0.421855092048645,
-0.270938903093338,
0.165179803967475... | |
2 3
A 12 NA NA
B NA 7 NA
C NA NA 22", header = TRUE)
df2 <- read.table(text="ID 1 2 3
A NA 6 NA
B NA NA 29
C 43 NA NA", header = TRUE)
df3 <- read.table(text="ID 1 2 3
A NA NA 32
B 5 NA NA
C NA 2 | [
0.1492178738117218,
0.1759706288576126,
0.29524505138397217,
-0.19516845047473907,
-0.19842031598091125,
0.3017570376396179,
0.5429293513298035,
-0.8702418804168701,
-0.29816368222236633,
-0.43531814217567444,
-0.3565616309642792,
0.08857717365026474,
-0.09275245666503906,
0.05192777514457... | |
NA", header = TRUE)
# gather inputs and remove common ID column
lists <- list(df1, df2, df3)
pieces <- lapply(lists, '[', , -1)
# turn data into a multi-dimensional array
a <- array(unlist(pieces), dim = c(nrow(df1),
ncol(df1) - 1, | [
-0.029291247949004173,
-0.25374549627304077,
0.26196664571762085,
-0.14886416494846344,
-0.05368296056985855,
0.3212219476699829,
0.2688843309879303,
-0.6626216769218445,
-0.3924981951713562,
-0.44135406613349915,
-0.17950180172920227,
-0.026102818548679352,
-0.16734369099140167,
0.2022624... | |
length(pieces)))
# compute sums across pieces
rowSums(a, na.rm = TRUE, dims = 2)
# [,1] [,2] [,3]
# [1,] 12 6 32
# [2,] 5 7 29
# [3,] 43 2 22
```
Then you're only left with pasting the ID column back. | [
0.05674410238862038,
0.14343419671058655,
0.40749022364616394,
-0.15950164198875427,
-0.3916016221046448,
0.18617306649684906,
0.2243105173110962,
-0.9380019307136536,
-0.4286588430404663,
-0.1224294900894165,
0.05763477459549904,
0.18582060933113098,
0.11862644553184509,
0.259379506111145... | |
Could a database administrator override the largest value that a `bigint` datatype could hold (making it smaller than what is listed in the documentation)?
Yes, you could put a check constraint on the column
example
```
ALTER TABLE SomeTable
ADD CONSTRAINT chkMaxValue CHECK (SomeCol < 123456 );
GO
```
You could als... | [
0.12756036221981049,
-0.14624591171741486,
0.1976161003112793,
0.24431361258029938,
0.22301562130451202,
-0.5588993430137634,
0.16685131192207336,
-0.1267310082912445,
-0.22103646397590637,
-0.37032756209373474,
-0.029850056394934654,
0.5325590372085571,
-0.6057247519493103,
0.031890284270... | |
I want to insert an arraylist in Datarow.
using this code,
```
ArrayList array=new ArrayList();
foreach (string s in array)
{
valuesdata.Rows.Add(s);
}
```
But My datatable must have only one datarow. My code created eight datarows.
I tried,
```
valuesdata.Rows.Add(array);
```
... | [
-0.03197590634226799,
0.11905776709318161,
0.4236162006855011,
-0.36606210470199585,
0.039571765810251236,
0.25386855006217957,
0.2703052759170532,
-0.5686705112457275,
-0.23783938586711884,
-0.5920275449752808,
0.09324134141206741,
0.5155317783355713,
-0.42785772681236267,
0.0474907755851... | |
String[array.Count];
for (int i = 0; i < array.Count; i++)
{
arrayB[i] = array[i].ToString();
}
valuesdata.Rows.Add(arrayB);
``` | [
-0.037869323045015335,
-0.11556936800479889,
0.3446667492389679,
-0.5538886785507202,
0.13014540076255798,
0.10226109623908997,
0.3319607377052307,
-0.6060819029808044,
-0.19675008952617645,
-0.16970762610435486,
-0.22745081782341003,
0.5228280425071716,
-0.5745797753334045,
0.076920792460... | |
I read the [man 2 listen](http://linux.die.net/man/2/listen).
I don't understand what is the backlog value, it says
> The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow
Right, how can I define what is the best value?
Thanks
Basically, what the `listen()` b... | [
0.21725548803806305,
-0.032488372176885605,
0.466878205537796,
-0.2636106312274933,
-0.1828499436378479,
-0.2219148576259613,
0.6419562697410583,
-0.14074957370758057,
-0.3183947205543518,
-0.5709676146507263,
0.12455831468105316,
0.6501665711402893,
-0.24637570977210999,
0.268835008144378... | |
i have created a generic function named `ExecuteProcedure<T>(T command, string parameters)`, now inside the `ExecuteProcedure` function i want to cast the `T into SqlCommand`, so that i can use `SqlCommand's` properties like `Parameters.Add()` here is my code.
```
T could be SqlCommand or SqlDataAdapter
```
here's m... | [
0.25997623801231384,
-0.017812635749578476,
0.5300599336624146,
-0.20785459876060486,
0.2771432101726532,
-0.0711057037115097,
0.014899221248924732,
-0.15834322571754456,
-0.022034315392374992,
-0.6560062766075134,
-0.009767413139343262,
0.6304205656051636,
-0.33676478266716003,
0.46629583... | |
}
command.CommandType = CommandType.StoredProcedure;
foreach (string param in parameters.Split(','))
{
SqlParameter par = new SqlParameter(param, param.Substring(1, param.Length - 1));
command.Parameters.Add(par);
}
connection.Open();
command.Exec... | [
-0.14208880066871643,
-0.11761076003313065,
0.51871258020401,
-0.03550548478960991,
0.11138075590133667,
0.37256887555122375,
0.35663676261901855,
-0.471966415643692,
-0.36866483092308044,
-0.3812551498413086,
-0.20797422528266907,
0.3696777820587158,
-0.3818379044532776,
0.297224789857864... | |
to get the favorite number of 10 once, then start an `until` loop checking for `favnumOverTen > 10` like this:
```
puts "What is your favorite number greater than 10?"
favnumOverTen = gets.to_i
until favnumOverTen > 10 do
puts "Hey! I said GREATER than 10! Try again buddy."
favnumOverTen = gets.to_i
end
```
This... | [
-0.11612672358751297,
-0.13677141070365906,
0.5882132053375244,
-0.09616347402334213,
-0.03250034525990486,
0.06929569691419601,
0.4625612795352936,
-0.02676880545914173,
-0.25431621074676514,
-0.3369710147380829,
-0.4043603241443634,
0.47044357657432556,
-0.12408589571714401,
-0.128637909... | |
I am setting up an opt-in list for a newsletter. Below is my php script, which is working, but when I receive the email, I can't see the email address in the message, only this:
Email:
How can I get the email variable to display in the email message?
Edit: I'm posting the form using jquery/ajax, that's why there's ... | [
0.31165486574172974,
0.040606919676065445,
0.6203390955924988,
-0.24139872193336487,
-0.14104478061199188,
-0.11267517507076263,
0.09779147058725357,
-0.3162335753440857,
-0.16064991056919098,
-0.9096935987472534,
0.12511183321475983,
0.5984647274017334,
-0.2903202176094055,
-0.31218355894... | |
type: "POST",
url: "newsletter.php",
data: $("input#email").val(),
success: function() {
$('#signup').html("<div id='message'></div>");
$('#message').html("<h3>Blah, blah, blah!</h3>")
.css({color:"#00000", fontFamily: "Arial", fontSize: "12px"})
.hide()
... | [
0.06095302477478981,
-0.029791925102472305,
0.45277175307273865,
-0.23335151374340057,
-0.26570212841033936,
0.21777547895908356,
0.3410572409629822,
-0.0561663880944252,
-0.15308697521686554,
-0.7076249718666077,
-0.44856351613998413,
0.21316832304000854,
-0.34488922357559204,
-0.08787754... | |
type: "POST",
url: "newsletter.php",
data: {"email" : $("input#email").val()},
success: function() {
$('#signup').html("<div id='message'></div>");
$('#message').html("<h3>Blah, blah, blah!</h3>")
.css({color:"#00000", fontFamily: "Arial", fontSize: "12px"})
... | [
0.09452109783887863,
0.0704650953412056,
0.6180822849273682,
-0.10022039711475372,
-0.19150668382644653,
0.16164687275886536,
0.374422162771225,
-0.21657678484916687,
-0.19820311665534973,
-0.6273133158683777,
-0.3745943605899811,
0.16221705079078674,
-0.27290621399879456,
0.02338536456227... | |
$("form").serialize()`).
<http://api.jquery.com/serialize/> | [
0.6113512516021729,
0.04313597083091736,
0.36963316798210144,
-0.1694324016571045,
-0.013756247237324715,
0.0918821319937706,
0.2615574598312378,
-0.16381867229938507,
-0.1572246551513672,
-0.2998937666416168,
-0.35472938418388367,
0.34570395946502686,
-0.4811726212501526,
0.37470427155494... | |
I was wondering if there were a way to get back how far into an assembly a PKParser has parsed before encountering a syntax error.
reference: <http://parsekit.com/>
I'm using a grammar that basically describes a prefix notation expression language.
For example:
given your standard prefix notation expression gramma... | [
0.2683393955230713,
0.30639222264289856,
-0.024103999137878418,
-0.045127760618925095,
-0.04187612235546112,
-0.014809676446020603,
0.3395746946334839,
0.004766462836414576,
-0.1748792976140976,
-0.4863419830799103,
0.0066712526604533195,
0.4298256039619446,
-0.1845664530992508,
-0.1439904... | |
but it's not necessary for a grammar as simple as what I'm using.
From the book mentioned as the user manual, it seemed as if I would need to create a custom parser for this, but I was hoping that maybe I'd simply missed something in the framework.
Thoughts?
Try this:
```
$.ajax({
type: "POST",
u... | [
0.08043023198843002,
0.1313164085149765,
0.3067294955253601,
-0.08585774153470993,
-0.030872130766510963,
-0.10784036666154861,
0.32176291942596436,
0.08426990360021591,
-0.21960408985614777,
-0.7325534820556641,
0.155186265707016,
0.6369247436523438,
-0.08183407783508301,
-0.3118818104267... | |
$('#signup').html("<div id='message'></div>");
$('#message').html("<h3>Blah, blah, blah!</h3>")
.css({color:"#00000", fontFamily: "Arial", fontSize: "12px"})
.hide()
}
});
```
Also check out jQuery serialize method (you can just type `data: $("form").serialize()`).
<http://api.jque... | [
0.32602638006210327,
-0.04702194407582283,
0.6836195588111877,
-0.15475870668888092,
-0.14855413138866425,
0.23245888948440552,
0.2970970571041107,
-0.17229202389717102,
-0.2719913721084595,
-0.7095943093299866,
-0.32832756638526917,
0.22521285712718964,
-0.37596821784973145,
-0.1238752752... | |
I'm looking for a way to replace certain strings with an image. All strings are enclosed in {} and when the code sees the [} what's inside will be read and what it equals will become the specific image. I haven't the foggiest how to implement this and was hoping someone could give me an example.
Here's my example to b... | [
0.13839097321033478,
0.06808548420667648,
0.2561751902103424,
-0.014187832362949848,
-0.09883640706539154,
0.21200992166996002,
0.23081554472446442,
0.05903860554099083,
-0.09121541678905487,
-0.6784668564796448,
-0.2284488081932068,
0.5368387699127197,
-0.5635842680931091,
-0.092293582856... | |
magic card casting costs to be more specific. So it would be limited too.....
B,U,R,G,W,X,T, 1-99 for example
===============================
So.....something like this?
```
$image_string = '{R}{R}{R}{3}
$Mana_symbol ='BURGWXT1-99';
$output = preg_replace_all('/\{([' . $Mana_symbol. '])\}/', '<img src="\1.png"/>'... | [
0.12385430932044983,
-0.3005273938179016,
0.43555116653442383,
0.12719297409057617,
-0.013441120274364948,
0.17395220696926117,
0.03544453904032707,
-0.5978010892868042,
-0.43847429752349854,
-0.15188036859035492,
0.1266772747039795,
0.17993944883346558,
-0.3443748950958252,
0.345028728246... | |
"green_mana.png"/>';
break;
case ('R'):
$mana = '<img src = "red_mana.png"/>';
break;
case ('W'):
$mana = '<img src = "white_mana.png"/>';
break;
case ('1'):
$mana = '<img src = "1_colorless_mana.png"/>';
break;
case ('2'):
$mana | [
-0.20429213345050812,
-0.251039057970047,
-0.22550517320632935,
-0.1563505083322525,
0.4660639464855194,
0.31997549533843994,
0.14335235953330994,
-0.38821637630462646,
-0.9312919974327087,
-0.3315615653991699,
-0.7754361033439636,
0.6668614149093628,
-0.6605501770973206,
0.238166958093643... | |
= '<img src = "2_colorless_mana.png"/>';
break;
case ('3'):
$mana = '<img src = "3_colorless_mana.png"/>';
break;
....etc....
```
Should't I use preg\_replace\_all since there will be some with multiple instances of this? Like in the case example as the $image\_string above it wil... | [
0.2824802100658417,
-0.0032565586734563112,
0.31020358204841614,
-0.1032702773809433,
-0.16089217364788055,
0.11540638655424118,
0.2532701790332794,
-0.24567636847496033,
-0.4933697581291199,
-0.5507597327232361,
-0.28770869970321655,
0.5238351225852966,
-0.5582101345062256,
-0.00274688703... | |
an image';
// Use a regular expression
// The codes below will be placed into a character class
$validCodes = 'BURGWXT0-9';
// This array contains the image transforms
$images = array(
'B' => 'black_mana.png',
'U' => 'blue_mana.png',
// ...
);
// Use preg replace to insert the images
$string = preg_repla... | [
0.07058219611644745,
-0.1753688007593155,
0.5760571360588074,
-0.20138506591320038,
0.04073351249098778,
0.4124719798564911,
0.143220454454422,
-0.3848413825035095,
-0.2736317217350006,
-0.6825591325759888,
-0.4619111716747284,
0.45336657762527466,
-0.6325600147247314,
0.02866588532924652,... | |
}
return '';
},
$string
);
echo $string;
?>
```
Please ask if you need further clarification.
**Edit**
I've added a mechanism for you to add your own transforms by populating an array.
`preg_replace` and `preg_replace_callback` will both replace all occurances they find in the string.
Note that ... | [
0.17483027279376984,
-0.32298150658607483,
0.4112427234649658,
-0.1921486109495163,
-0.21413706243038177,
0.08633708953857422,
0.3833402395248413,
-0.45325803756713867,
0.037323225289583206,
-0.82109534740448,
-0.15943095088005066,
0.7711276412010193,
-0.34837523102760315,
-0.0944608375430... | |
I have some pom files in my project with the following structure
```
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>xparent</... | [
-0.12066139280796051,
0.23662850260734558,
0.4383162558078766,
-0.2573515772819519,
-0.11280661821365356,
0.21548572182655334,
-0.4270452857017517,
-0.4511699974536896,
-0.36554694175720215,
-0.44745659828186035,
0.037848103791475296,
0.05960841849446297,
0.07093093544244766,
0.09760418534... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.