text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
screen width and then set the class I disencourage you to do it that way. It's not nice and in the future if you need to change your page layout you'll be doomed by having all those echo in php and you'll avoid a lot of redirects (index.html -> process.php -> index.php).
By your example you can do it all in Javascript... | [
0.32048970460891724,
-0.04794362559914589,
0.4339148700237274,
-0.08518117666244507,
-0.2338808923959732,
-0.20370662212371826,
0.2783638536930084,
-0.11966291069984436,
-0.310224324464798,
-0.8692116737365723,
0.094459667801857,
0.6963950991630554,
-0.15661820769309998,
0.0133830551058053... | |
:)
---
**TRY THIS:** (I believe is what you want)
You can do this with just JS and CSS.
Here is an example:
set the style for your body margin and your test div:
```
<style type="text/css">
body {
margin: 0px 0px 0px 200px;
}
.divForTesting {
width: 250px;
border: 1px solid green;
... | [
0.46755921840667725,
-0.022062737494707108,
0.6544841527938843,
0.04869119077920914,
-0.03166929632425308,
0.02577289380133152,
0.21145907044410706,
-0.4769692122936249,
-0.08178116381168365,
-0.905705988407135,
0.29302695393562317,
0.6551405787467957,
0.0683956891298294,
-0.27718910574913... | |
width
var width = $(window).width();
// get the number of pixels left in the screen (which is the width
// minus the margin you want, rest by 250px which is the "inner boxes" width)
var size = (width - 200) % 250;
// then re-set the margin (the "-10" is because you'll need extra space
// for bor... | [
0.046802155673503876,
-0.15008868277072906,
0.9322121739387512,
-0.19345057010650635,
-0.16837620735168457,
0.14620065689086914,
-0.027149612084031105,
-0.5328056216239929,
-0.16622425615787506,
-0.7158458232879639,
-0.023791959509253502,
0.5066624283790588,
0.08408621698617935,
-0.0956465... | |
red; float:right;" id="test">
<div class="divForTesting">test</div>
<div class="divForTesting">test</div>
<div class="divForTesting">test</div>
<div class="divForTesting">test</div>
<div class="divForTesting">test</div>
<div class="divForTesting">test</div>
<div class="divForTesting">test</div>
<div class="divForTestin... | [
-0.27859532833099365,
0.00603859405964613,
0.34818869829177856,
-0.22668179869651794,
-0.0969948023557663,
0.17693689465522766,
0.34542885422706604,
-0.722341001033783,
-0.10400298237800598,
-0.5731130838394165,
-0.12271992862224579,
0.5477852821350098,
-0.18997490406036377,
-0.05144977197... | |
I have a problem with winform application which uses threads to update the UI. My application does upload and downloading of files from cloud. Same time I am also displaying Network speed details on the same window. These three operations (upload, download, display n/w speed) are invoked by 3 different threads. Problem... | [
0.06079259514808655,
-0.04406854882836342,
0.6799612641334534,
0.12082444876432419,
-0.04539719969034195,
0.11695825308561325,
0.41392573714256287,
0.13087187707424164,
-0.338449090719223,
-0.9078986048698425,
0.12494309991598129,
0.7746868133544922,
-0.17048309743404388,
0.219254866242408... | |
\*\*Download\*\* one after the other, first thread will pause and download thread starts. once \*\*Download\*\* is done then \*\*Upload\*\* continues. Its not going in parallel. Also UI doesn't respond immediately for other button click or window resize, move actions.
```
public delegate void UploadDelgt();
UploadDel... | [
-0.08504114300012589,
-0.35014843940734863,
0.9746183156967163,
-0.16959740221500397,
0.037647075951099396,
-0.06945190578699112,
0.274044394493103,
-0.3200777769088745,
-0.5207160711288452,
-0.7395576238632202,
-0.5086742639541626,
0.5464314818382263,
-0.3818209767341614,
0.31600144505500... | |
updates the progressbar accordingly..
}
```
Your UI freezes because you are calling `form.Invoke` in your `load` method. From [MSDN](http://msdn.microsoft.com/en-us/library/zyzhdc6b.aspx) about `Invoke`: `Executes the specified delegate on the thread that owns the control's underlying window handle.`
So, thought you a... | [
0.02763155847787857,
-0.23054665327072144,
0.5724292993545532,
0.11111827939748764,
0.14084146916866302,
-0.40956488251686096,
0.43994978070259094,
-0.18047292530536652,
-0.1576714962720871,
-0.7798720002174377,
-0.4398094713687897,
0.24020500481128693,
-0.3226166069507599,
0.0913286283612... | |
A while back I was playing with methods using variable-length argument lists (java) that get defined as below
```
public static int[] makeArray (int... a) {
return a;
}
```
this is a silly program but what it will do is take in an undefined amount of integers and create an array out of them so all of the below woul... | [
0.30490216612815857,
0.025505753234028816,
0.13257820904254913,
-0.24680523574352264,
-0.1463017761707306,
-0.023285893723368645,
0.10851052403450012,
-0.5001568794250488,
-0.11088673770427704,
-0.514207124710083,
0.22704321146011353,
0.23313291370868683,
-0.6680797338485718,
0.11494705826... | |
array but I am not 100% sure if this is possible as the arrays could that get added could vary in size. (maybe even for this reason it isn't possible?). But as far as I know 2d array is the only way to make an array of arrays.
I have tried (please note this isn't the actual use I have for this, I just used this to exp... | [
0.5409088134765625,
0.023868227377533913,
0.231693834066391,
-0.0152102867141366,
-0.3336668908596039,
-0.11646576225757599,
0.2464166283607483,
-0.3620457947254181,
-0.22789376974105835,
-0.6089695692062378,
0.1222558319568634,
0.5501381158828735,
-0.5543553233146667,
0.09167960286140442,... | |
that will take in X many arrays and then based on that run for loops such that it adds all the array
eg:
```
int[] sum = new int[a[0].length];
for (int i=0; i<a.length; i++){
for (int j=0; j<a[0].length; j++){
n[i] += a[i][j];
}}
```
Not sure why you say it doesn't compile - the following example works for me (com... | [
0.0012953970581293106,
0.003275563707575202,
0.25172340869903564,
-0.27674826979637146,
-0.1419438123703003,
0.10778018087148666,
0.4428319036960602,
-0.4786546528339386,
-0.30652549862861633,
-0.24379782378673553,
-0.18175563216209412,
0.3068491816520691,
-0.670844554901123,
0.21814036369... | |
a.length;
}
``` | [
0.137419655919075,
0.24194440245628357,
0.18098458647727966,
-0.37811875343322754,
0.09943491965532303,
-0.14208783209323883,
-0.05504092201590538,
0.008595781400799751,
-0.026685895398259163,
-0.3591884970664978,
-0.3778327405452728,
0.6306204795837402,
-0.36160099506378174,
0.40935841202... | |
I'm trying to add an animation to my TabActivty. For example, when the user select the 2nd tab, I want the new activity comes from the right. When the user select the first tab, I want the activity comes from the left.
I've found how to add one animation, but I want to add one again. Here is the code I'm using:
```
p... | [
0.12027157098054886,
-0.08906447142362595,
0.5241385698318481,
-0.040529098361730576,
0.1415553092956543,
0.21896852552890778,
-0.05113174393773079,
0.21970517933368683,
-0.1010640412569046,
-1.048762321472168,
-0.06907463818788528,
0.4887668192386627,
-0.30230584740638733,
0.3360247611999... | |
Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f);
inFromRight.setDuration(240);
inFromRight.setInterpolator(new AccelerateInterpolator());
return inFromRight;
}
```
And
```
getTabHost().setOnTabChangedListener(new OnTabChangeListener() {
public void onTabChanged(... | [
-0.3037417531013489,
-0.3715662658214569,
1.218183159828186,
-0.006732831243425608,
0.20530684292316437,
0.37324798107147217,
0.33485111594200134,
-0.13891808688640594,
-0.18593424558639526,
-0.7273256778717041,
-0.22021731734275818,
0.8125144839286804,
0.06843400001525879,
0.3295397758483... | |
public void onTabChanged(String tabId)
{
View currentView = getTabHost().getCurrentView();
if (getTabHost().getCurrentTab() > currentTab)
{
currentView.setAnimation( inFromRightAnimation() );
}
else | [
0.1082543358206749,
-0.3786662220954895,
0.7447431683540344,
-0.2030567079782486,
0.3174731731414795,
0.015162787400186062,
0.2181813269853592,
0.006995173636823893,
-0.04792880639433861,
-0.3961375951766968,
-0.2922542989253998,
0.9119159579277039,
-0.24311348795890808,
0.3583894073963165... | |
{
currentView.setAnimation( outToRightAnimation() );
}
currentTab = getTabHost().getCurrentTab();
}
});
```
And the animations:
```
public Animation inFromRightAnimation()
{
Animation inFromRight = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, +1.... | [
-0.02614600770175457,
-0.24495108425617218,
0.9503528475761414,
0.05071859806776047,
0.3070685863494873,
0.19673489034175873,
0.050724096596241,
-0.0669570341706276,
-0.031986016780138016,
-0.7431009411811829,
-0.4450548589229584,
0.4720152020454407,
-0.27041223645210266,
0.375456243753433... | |
Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f);
inFromRight.setDuration(240);
inFromRight.setInterpolator(new AccelerateInterpolator());
return inFromRight;
}
public Animation outToRightAnimation()
{
Animation outtoLeft = new TranslateAnimation(
Animatio... | [
-0.28038859367370605,
-0.26476266980171204,
0.8055961728096008,
-0.111262746155262,
0.3068656027317047,
0.46790871024131775,
0.08120507001876831,
-0.040263839066028595,
-0.11284369975328445,
-0.8462066650390625,
-0.45814475417137146,
0.35863539576530457,
-0.2617560029029846,
0.385578483343... | |
outtoLeft.setInterpolator(new AccelerateInterpolator());
return outtoLeft;
}
``` | [
-0.5088238716125488,
-0.29507502913475037,
0.5473623275756836,
-0.28229087591171265,
0.29759150743484497,
0.3444010615348816,
0.03973851352930069,
-0.15491077303886414,
-0.0380827933549881,
-0.6220388412475586,
-0.19096800684928894,
0.5358678102493286,
-0.43017810583114624,
0.2323821336030... | |
I have the following 2 tables and I want to take the contents of table2 and add it to the end of table1 (eg: combine the 2 tables into 1). Would want the ID to continue to auto-increment.
Table 1:
```
CREATE TABLE IF NOT EXISTS `world` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`country` varchar(2) DEFAU... | [
0.21539567410945892,
0.12403184175491333,
0.7658834457397461,
0.02288009598851204,
0.3584842383861542,
0.07272101193666458,
0.1924312710762024,
-0.0774577260017395,
-0.1875535398721695,
-0.7850648760795593,
-0.22266273200511932,
0.05469677224755287,
-0.319011390209198,
0.4572121798992157,
... | |
DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5871647 ;
```
Table2:
```
CREATE TABLE IF NOT EXISTS `extra` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`country` varchar(2) DEFAULT NULL,
`city` varchar(60) DEFAULT NULL,
`latitude` double DEFAULT NULL,
`... | [
-0.19407252967357635,
0.025958405807614326,
0.5116259455680847,
0.19839921593666077,
0.3410371243953705,
0.34984657168388367,
0.2048552930355072,
-0.029554763808846474,
-0.3657844662666321,
-0.5192869305610657,
-0.31292515993118286,
0.3308194577693939,
-0.37637218832969666,
0.2191991955041... | |
FROM extra;
``` | [
0.17076607048511505,
0.104825958609581,
0.18788978457450867,
-0.22822615504264832,
0.0280873142182827,
0.3907483220100403,
-0.07104118168354034,
-0.014514586888253689,
-0.16609568893909454,
-0.32407087087631226,
-0.7737982869148254,
0.692783772945404,
-0.2035224884748459,
-0.00393097195774... | |
So my problem is the following: it is easy to get data concerning some record and make it available in a form.
The thing is: part of it is a location (continent, country, city) which is represented by 3 inter-related drop-down lists.
What I get is the browser to stop responding, I need some ideas to come up with a be... | [
0.35143381357192993,
0.18563364446163177,
-0.015087248757481575,
0.3488464057445526,
0.10111363977193832,
-0.2229071855545044,
0.11087077856063843,
0.3797973692417145,
-0.5734525322914124,
-0.5549527406692505,
0.024605728685855865,
-0.16294677555561066,
-0.3376728892326355,
0.2605375945568... | |
function processRow(command, id) {
switch(command){
case 'Delete': {
$("#deleteId").val(id);
$('#deleteEventModal').reveal();
}
break;
case 'Edit': {
/* Fetch Data to Fill up the form */
$.ajax({
type: "GET",
url: "scripts/fetchEventById.p... | [
-0.01227493118494749,
-0.4926784336566925,
0.5910665392875671,
-0.10630190372467041,
0.05123542249202728,
0.33501335978507996,
0.24102456867694855,
-0.35548263788223267,
-0.11724604666233063,
-0.44120198488235474,
-0.2145768254995346,
0.6565355062484741,
-0.003329428844153881,
0.3151541650... | |
dataType: "json",
success: function(response){
/* On Successful Posting to server side */
// THIS DROP DOWN LOADS AND SETS DB VAL OK | [
-0.3488418757915497,
-0.1656854748725891,
0.4025736451148987,
-0.07932066172361374,
-0.2052472084760666,
0.21322950720787048,
0.5924427509307861,
-0.20660364627838135,
-0.15598085522651672,
-0.6451290249824524,
-0.5505020618438721,
0.530902624130249,
-0.23403778672218323,
0.183122768998146... | |
loadContinents("#editEventContinents");
$("#editEventContinents").val(response.eventData.continentId);
// FROM THIS MOMENT ON IT WILL STALL
// last instruction sets continent drop-down with | [
-0.17534905672073364,
-0.47524893283843994,
0.630585789680481,
0.05364159494638443,
0.333331823348999,
0.17963552474975586,
0.2439684122800827,
0.17441660165786743,
-0.39675524830818176,
-0.4416691064834595,
-0.16575534641742706,
0.1376185417175293,
0.09212872385978699,
0.20010651648044586... | |
proper value BUT
// when fetching the countries for that continent (below)
// the continent drop-down value comes empty as if nothing
// was selected | [
-0.019068043678998947,
-0.2346688061952591,
0.6209651827812195,
0.20292343199253082,
0.20137342810630798,
0.056666746735572815,
0.09796585887670517,
-0.022874943912029266,
-0.3688727915287018,
-0.2568819224834442,
-0.28385308384895325,
0.009788118302822113,
-0.06643471866846085,
0.23930154... | |
// but it was, I visually confirmed that
// after setting it with val() above
loadCountries("#editEventContinents", "#editEventCountries", "#editEventCities");
$("#editEventCountries").val(response.eventData.countryId); | [
0.09379574656486511,
-0.5353190898895264,
0.8478243350982666,
-0.05312943458557129,
0.20371505618095398,
0.08443421125411987,
0.4168144166469574,
0.13091708719730377,
-0.10372856259346008,
-0.2236548513174057,
-0.0598701611161232,
0.5124887228012085,
-0.04760122671723366,
-0.19638213515281... | |
loadCities("#editEventCountries", "#editEventCities");
$("#editEventCities").val(response.eventData.cityId);
$("#editEventStartDate").val(response.eventData.startDate);
$("#editEventEndDate").val(response.eventData.endDate);
$("#editEventUserN... | [
-0.11160455644130707,
-0.6290017366409302,
0.738599956035614,
-0.013465067371726036,
-0.16230887174606323,
0.2529537081718445,
0.2522195875644684,
-0.22800706326961517,
-0.18828783929347992,
-0.7379361987113953,
-0.4345908761024475,
0.6175336837768555,
-0.39833754301071167,
-0.000298142898... | |
$("#editEventDetails").val(response.eventData.details);
},
error: function(jqXHR, textStatus, errorThrown){
/* log the error to the console */
console.log( | [
-0.12501810491085052,
-0.19855612516403198,
0.29728269577026367,
-0.19658440351486206,
0.22468675673007965,
0.18397748470306396,
0.5427644848823547,
-0.06109996885061264,
-0.07459674775600433,
-0.4988246262073517,
-0.3181890845298767,
0.7503165006637573,
-0.21837648749351501,
0.13882376253... | |
"The following error occured: " +
textStatus, errorThrown
);
}
});
// Get the overlay with the form for editing to pop up | [
-0.27596622705459595,
0.08793648332357407,
0.32724371552467346,
-0.03695976734161377,
0.33689069747924805,
-0.01747608184814453,
0.4979165196418762,
0.13290192186832428,
0.02005569264292717,
-0.4346739649772644,
-0.3684190809726715,
0.6140506863594055,
-0.2351032942533493,
-0.1226892620325... | |
$('#editEventModal').reveal();
}
break;
default:
// oops, something wrong happened
break;
}
return false;
}
// Here is the load continents function
function loadContinents(continentObj) {
// fetch continent data
$.ajax({
type: "GET",
url: "scripts/fetchContinents.php",
dataTyp... | [
-0.029325800016522408,
-0.2114948034286499,
0.7839666604995728,
0.13234631717205048,
0.067973792552948,
-0.2162219136953354,
0.3945460319519043,
0.047777630388736725,
-0.6386771202087402,
-0.3829919993877411,
-0.07467158883810043,
0.02862543612718582,
0.0443110354244709,
0.2437039911746978... | |
function(data){
/* On Successful Posting to server side */
// Add fetched options to the select object responsible for holding the continents list
$(continentObj).empty(); //clear current available selections
if( data == "" ){
$(continentObj).append("<option value=\"\">No co... | [
-0.32473936676979065,
-0.49038299918174744,
0.8781769871711731,
0.10001663118600845,
0.29614222049713135,
0.18993720412254333,
0.11512074619531631,
0.049001481384038925,
-0.628601610660553,
-0.43749895691871643,
-0.39306944608688354,
-0.1016145572066307,
-0.22965630888938904,
0.42997655272... | |
for( i = 0; i < data.id.length; i++ ){
$(continentObj).append("<option value=\"" + data.id[i] + "\">" + data.name[i] + "</option>");
}
}
},
error: function(jqXHR, textStatus, errorThrown){
/* log the error to the console */
console.log( | [
-0.25005805492401123,
-0.07761538028717041,
0.328870952129364,
-0.10946694016456604,
0.40569227933883667,
0.1009536162018776,
0.5766377449035645,
-0.1110314428806305,
-0.02264757640659809,
-0.43352219462394714,
-0.1877652257680893,
0.2542555630207062,
-0.2064574658870697,
0.244616180658340... | |
"The following error occured: " +
textStatus, errorThrown
);
$(countryObj).append("<option selected value=\"\">Select Continent</option>");
$("#searchEventError").fadeOut(200);
$("#searchEventError").fadeIn(200).html("<div class=\"alert-box error\">Something went wrong wit... | [
-0.011028735898435116,
-0.35861966013908386,
0.6521838307380676,
0.005064872559159994,
0.11866358667612076,
-0.02536504529416561,
0.3972542881965637,
-0.14765606820583344,
-0.5128150582313538,
-0.5256325006484985,
-0.45864278078079224,
-0.018095742911100388,
-0.38336703181266785,
0.3239252... | |
url: "scripts/fetchCountries.php?continent=" + encodeURIComponent(continentOption),
dataType: "json",
success: function(data){
/* On Successful Posting to server side */
// Add fetched options to the select object responsible for holding the countries list
if( data == "" ){
... | [
-0.20385216176509857,
-0.26582303643226624,
0.860004186630249,
0.25042450428009033,
0.023021275177598,
0.057403720915317535,
0.2440696507692337,
0.1709354966878891,
-0.722500205039978,
-0.2534303665161133,
-0.4499860405921936,
-0.30953675508499146,
0.013452318497002125,
0.5664882659912109,... | |
for( i = 0; i < data.id.length; i++ ){
$(countryObj).append("<option value=\"" + data.id[i] + "\">" + data.name[i] + "</option>");
}
}
},
error: function(jqXHR, textStatus, errorThrown){
/* log the error to the console */
console.log( | [
-0.13008980453014374,
0.05745203047990799,
0.33561497926712036,
-0.2669154107570648,
0.5631799101829529,
0.3235986828804016,
0.554969847202301,
-0.21440836787223816,
0.0006942120380699635,
-0.2905398905277252,
-0.27003276348114014,
0.42199233174324036,
-0.26926806569099426,
0.1665426939725... | |
"The following error occured: " +
textStatus, errorThrown
);
$(countryObj).append("<option selected value=\"-1\">Please Select Continent First</option>");
$("#searchEventError").fadeOut(200);
$("#searchEventError").fadeIn(200).html("<div class=\"alert-box error\">Something... | [
0.04849521070718765,
-0.5375178456306458,
0.7769906520843506,
-0.06306027621030807,
-0.04053149372339249,
-0.15332955121994019,
0.4318281412124634,
-0.23826108872890472,
-0.41389942169189453,
-0.7991165518760681,
-0.4085206687450409,
0.1362367570400238,
-0.36413776874542236,
0.207348614931... | |
url: "scripts/fetchCities.php?country=" + encodeURIComponent(countryOption),
dataType: "json",
success: function(data){
/* On Successful Posting to server side */
// Add fetched options to the select object responsible for holding the cities list
if( data == "" ){
$(cit... | [
-0.06755044311285019,
-0.4868423044681549,
0.7867863774299622,
0.3160953223705292,
-0.17018193006515503,
0.08022826910018921,
0.23605622351169586,
0.04820374399423599,
-0.4317414164543152,
-0.6228055953979492,
-0.5194675922393799,
0.05107982084155083,
-0.19648706912994385,
0.34781923890113... | |
for( i = 0; i < data.id.length; i++ ){
$(cityObj).append("<option value=\"" + data.id[i] + "\">" + data.name[i] + "</option>");
}
}
},
error: function(jqXHR, textStatus, errorThrown){
/* log the error | [
-0.08523882925510406,
-0.16893424093723297,
0.4293960928916931,
-0.29032206535339355,
0.08929526805877686,
0.33575719594955444,
0.5348557233810425,
-0.29020342230796814,
0.12098027765750885,
-0.4440780580043793,
-0.4053521454334259,
0.5606725215911865,
-0.41904282569885254,
0.0734532922506... | |
to the console */
console.log(
"The following error occured: " +
textStatus, errorThrown
);
$(cityObj).append("<option selected value=\"-1\">Please Select Country First</option>");
$("#searchEventError").fadeOut(200);
$("#searchEventError").fadeIn(200).... | [
-0.15386904776096344,
-0.21741704642772675,
0.7312045097351074,
-0.12748581171035767,
0.30234870314598083,
0.020572463050484657,
0.4625299870967865,
-0.06819450110197067,
0.000007886709681770299,
-0.6275805234909058,
-0.585057258605957,
0.40340691804885864,
-0.3212686777114868,
0.096114002... | |
below. [check this](http://dev.mysql.com/doc/refman/5.0/en/insert-select.html)
```
INSERT INTO world (country, city, latitude, longitude)
SELECT country, city, latitude, longitude FROM extra;
``` | [
0.19126108288764954,
0.08564434945583344,
0.49743250012397766,
0.2369447946548462,
0.4273252785205841,
0.15553344786167145,
-0.013707764446735382,
0.2277805507183075,
-0.08264019340276718,
-0.5765377283096313,
-0.47808241844177246,
-0.13831904530525208,
-0.4663580060005188,
0.1917828619480... | |
I'm attempting to use the following ExcelReader library:
<http://exceldatareader.codeplex.com/>
The code example shows:
```
//1. Reading from a binary Excel file ('97-2003 format; *.xls)
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
```
My application is (unfortunately) in VB.NET. I... | [
0.26519182324409485,
0.23870819807052612,
0.35976338386535645,
-0.18180032074451447,
-0.23192916810512543,
-0.28209084272384644,
0.35682451725006104,
-0.02096983976662159,
0.03768090531229973,
-0.7625430226325989,
0.09651221334934235,
0.604804277420044,
-0.36277997493743896,
0.209752574563... | |
to do but this code is seen a lot.
consider this code
```
Sub Main()
Dim o As String
Try
o = "Hello"
Console.Out.WriteLine("hi {0}", o)
Catch ex As Exception
' do something here
Finally
o = Nothing
End Try
' unable to do something here
End Sub
```
Allthough i... | [
0.04358110576868057,
-0.0016264831647276878,
0.4043692350387573,
-0.19230690598487854,
0.20390553772449493,
-0.40924087166786194,
0.7986938953399658,
-0.10629133135080338,
-0.3262277841567993,
-0.291469931602478,
-0.43471166491508484,
0.25447073578834534,
-0.26220351457595825,
0.4057591557... | |
reference o outside now because it is no longer set to an instance of an object. That is why it is done by a lot of people. If you are in a function and a function ends at that point there is no need to set to Nothing as the object falls out of scope however lots of people will set stuff to `Nothing` out of habit **I'd... | [
0.3886224925518036,
0.3965108394622803,
0.43254005908966064,
-0.1473279744386673,
-0.06086665764451027,
-0.22459529340267181,
0.5645967125892639,
0.08686810731887817,
-0.2835538387298584,
-0.6316975355148315,
-0.1466297209262848,
0.42742618918418884,
-0.2830692529678345,
0.3871232271194458... | |
I have faced the same problem many times.
The Same Problem was With This Question and Got Solution Like the Same,
[How to compare known hours ad current hour in android?](https://stackoverflow.com/questions/9795464/how-to-compare-known-hours-ad-current-hour-in-android/9817945#9817945)
**Problem :**
When I use `Calen... | [
0.2844693958759308,
0.1992107629776001,
0.5169765949249268,
0.03376229852437973,
-0.027912849560379982,
0.18469178676605225,
0.14980126917362213,
0.023918690159916878,
-0.3287394940853119,
-0.7828329205513,
0.24794945120811462,
0.4810815155506134,
-0.11030340939760208,
0.4813036024570465,
... | |
- Normal", ""+calCurr.getTimeInMillis());
// see what it gives? dont know why?
Date date = new Date();
calCurr.set(date.getYear()+1900, date.getMonth()+1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds());
// so added one month to it
Log.i("Time in mil... | [
0.29013895988464355,
-0.3463205099105835,
1.0560238361358643,
0.07160621881484985,
0.2816820442676544,
0.02143198437988758,
0.15252135694026947,
0.04781872779130936,
-0.40736153721809387,
-0.36483505368232727,
-0.26027077436447144,
0.2760910391807556,
0.1131659522652626,
0.4208223223686218... | |
Why it's giving the wrong output?
* Is it a bug in there or My concept about the Calendar class is wrong?
* tell me what should have been done
for that?
It works perfectly as expected if you change to `getDate()` it outputs :
> Time in mili of Current - Normal Wed Apr 04 11:34:34 BST 2012
>
>
> Time in mili of Curre... | [
0.19966039061546326,
-0.1968112289905548,
0.8839226961135864,
0.09423302114009857,
-0.13477100431919098,
-0.028823304921388626,
0.6220611929893494,
-0.2293243557214737,
-0.4348211884498596,
-0.5145803689956665,
0.07359334826469421,
0.336977481842041,
0.16118532419204712,
0.0789759010076522... | |
update 1336127834557
and the calculation is (difference, divided by milliseconds in a day) :
```
1336127834557 - 1333535834557 = 2 592 000 000
2592000000 / 86400000 = 30
```
And todays date in milliseconds after 1970 is [1333536754](http://www.esqsoft.com/javascript_examples/date-to-epoch.htm) ... which fits, I do... | [
-0.18533183634281158,
0.10454431176185608,
0.9825479984283447,
-0.23727001249790192,
-0.2096652388572693,
0.027968499809503555,
0.23288650810718536,
-0.11025705188512802,
-0.786713719367981,
-0.4655904471874237,
0.019893823191523552,
0.13587208092212677,
-0.11275870352983475,
0.37772548198... | |
In my iPhone app, the application receives its data from a server in XML format and displays it in UILabel. The data coming from the server may contain `£` sign. This sign is not encoded in any way - just passed as is in the XML string. The app takes this string and displays it in a UILabel.
This works just fine most ... | [
0.3597066104412079,
0.21637530624866486,
0.7220216393470764,
-0.10902318358421326,
-0.0556681789457798,
0.3863978385925293,
0.10533490777015686,
-0.08157486468553543,
0.1478847861289978,
-0.5805167555809021,
-0.06136537343263626,
0.4288347363471985,
-0.04583261162042618,
-0.455935269594192... | |
UILabel text is set with this simple line of code:
```
contentLabel.text = [node getValueForKey:keyName];
```
I have stepped through the code with debugger and can see that the correct string value is being passed and set. I can also see correct results on the simulator.
However (as can be seen from the image below... | [
0.2607456147670746,
0.006346883252263069,
0.8487380743026733,
0.19178971648216248,
-0.14942124485969543,
-0.5043713450431824,
0.6463156938552856,
-0.060235027223825455,
0.034245483577251434,
-1.0339486598968506,
-0.03591640666127205,
0.4246443510055542,
-0.15303249657154083,
0.165601894259... | |
from me, so I can't get physical access to their phone.
Here's the screenshot from the simulator:

And here's the screenshot from the affected user's phone:

Explicitly setting `... | [
0.15521204471588135,
-0.02921544387936592,
0.6426630020141602,
-0.21531063318252563,
0.11152512580156326,
0.268452525138855,
0.08817808330059052,
-0.4889633059501648,
-0.2292485386133194,
-0.6232564449310303,
-0.12672021985054016,
0.6200535893440247,
-0.20240329205989838,
-0.09164561331272... | |
android:text="Some text here"
android:gravity="center"
android:padding="@null"
android:background="@drawable/my_button"/>
```
My IDE (IntelliJ IDEA 11.1) picked up the `@null` as an error, even though it compiled. Setting it to `-1px` also worked. | [
-0.2709487974643707,
-0.07735664397478104,
0.422597736120224,
-0.37561583518981934,
-0.02342969737946987,
0.14550335705280304,
0.09030074626207352,
0.00924708228558302,
0.0212602186948061,
-0.740175724029541,
-0.15109924972057343,
0.3923063278198242,
-0.46466970443725586,
-0.10987258702516... | |
What is the difference between a parked thread and a waiting thread in java ? I've a jboss core dump and analysing it is showing a lot of parked threads.
Look at [Javadoc](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/locks/LockSupport.html#park%28%29) the `park()` method:
> Disables the current th... | [
0.4497722387313843,
-0.27172890305519104,
0.18951277434825897,
0.18896859884262085,
0.36801353096961975,
-0.5446506142616272,
-0.03325817734003067,
-0.03315212205052376,
0.027814920991659164,
-0.1748795509338379,
-0.21651591360569,
0.4551120400428772,
-0.5932152271270752,
0.378304243087768... | |
or Some other thread interrupts the current thread; or The
> call spuriously (that is, for no reason) returns. This method does not
> report which of these caused the method to return. Callers should
> re-check the conditions which caused the thread to park in the first
> place. Callers may also determine, for exam... | [
0.329357385635376,
-0.3145325481891632,
0.24273806810379028,
0.287611186504364,
0.4332773983478546,
-0.4502318203449249,
0.19320935010910034,
0.054519981145858765,
-0.19630451500415802,
-0.21096007525920868,
-0.46902212500572205,
0.2861948311328888,
-0.573540985584259,
0.6038112044334412,
... | |
I have a function that return `[[]]`, and I want to test the result as unit test.
But I found that the expression `[[]] == [[]]` return `false`.
Here a simple test code:
```
# [[]] == [[]];;
- : bool = false
```
Can someone explain me why this expression is evaluated as false?
Thanks.
Use `=` since you have *struct... | [
0.11389153450727463,
0.3152242600917816,
-0.0931604653596878,
0.05047345533967018,
0.045828625559806824,
0.04399855434894562,
0.5042455196380615,
-0.3030574917793274,
0.14593787491321564,
-0.36962249875068665,
-0.03156900033354759,
0.5482314825057983,
-0.011356519535183907,
0.1112070754170... | |
I have a web site that contains an HTML form, in this form I have a dropdownlist with list of agents that works in the company, I want to fetch data from MySQL database to this dropdownlist so when you add a new agent his name will appear as an option in the drop down list.
```
<select name="agent" id="agent">
</selec... | [
0.3419126570224762,
0.055425483733415604,
0.3982882797718048,
-0.03089430369436741,
0.15653693675994873,
0.03196025639772415,
0.15908361971378326,
-0.007957754656672478,
-0.18502876162528992,
-0.6131014823913574,
-0.0193747840821743,
0.4122115671634674,
-0.29998087882995605,
-0.13602252304... | |
$db is a PDO object
$query = $db->query("YOUR QUERY HERE"); // Run your query
echo '<select name="DROP DOWN NAME">'; // Open your drop down box
// Loop through the query results, outputing the options one by one
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
echo '<option value="'.htmlspecialchars($row['somethin... | [
-0.009942456148564816,
-0.15873456001281738,
0.24862171709537506,
-0.30636903643608093,
-0.3691231608390808,
0.22582344710826874,
0.2269834727048874,
-0.6655991673469543,
0.14172838628292084,
-0.13162468373775482,
-0.19918730854988098,
-0.007588563021272421,
-0.5681131482124329,
0.24723218... | |
Is it possible to directly compute the product (or for example sum) of two columns without using
```
grouped.apply(lambda x: (x.a*x.b).sum()
```
It is much (less than half the time on my machine) faster to use
```
df['helper'] = df.a*df.b
grouped= df.groupby(something)
grouped['helper'].sum()
df.drop('helper', axi... | [
-0.06333047151565552,
-0.03798457980155945,
0.2945791780948639,
-0.10076888650655746,
-0.3722902536392212,
0.12932397425174713,
0.1125502660870552,
-0.5916652679443359,
-0.1547602117061615,
-0.47870320081710815,
0.09747742116451263,
0.3923165798187256,
-0.5129326581954956,
-0.0960993766784... | |
of Python-- if you implemented a Cython aggregator to do `(x * y).sum()` then it could be connected with groupby, but ideally you could write the Python expression as a function:
```
def weight_sum(x, y):
return (x * y).sum()
```
and that would get "JIT-compiled" and be about as fast as groupby(...).sum(). What ... | [
0.2524339556694031,
0.18283724784851074,
0.06490055471658707,
-0.19592046737670898,
-0.40495389699935913,
-0.3151589035987854,
0.2630089223384857,
-0.23202671110630035,
-0.1522722691297531,
-0.20793814957141876,
0.1868738979101181,
0.40228235721588135,
-0.43480873107910156,
-0.042807649821... | |
i want that during marshelling special character should escape,
is there any way to do this?
```
alt="<i><b> image alt</b></i>"
```
this is saved as
```
<b><i>image alt</b></i>
```
i want to save value as it is
I want to eventually build an embedded array expression evaluator (Numexpr on steroids) t... | [
0.022099647670984268,
-0.06311385333538055,
0.07818145304918289,
-0.08047828823328018,
-0.20865502953529358,
0.18765060603618622,
0.24436618387699127,
-0.5239153504371643,
0.06142845377326012,
-0.3569295108318329,
0.08290126174688339,
0.6627386808395386,
-0.290121853351593,
0.0668854266405... | |
about as fast as groupby(...).sum(). What I'm describing is a pretty significant (many month) project. If there were a BSD-compatible APL implementation I might be able to do something like the above quite a bit sooner (just thinking out loud). | [
0.3141341805458069,
-0.05897842347621918,
0.22876298427581787,
-0.018996238708496094,
-0.10578365623950958,
-0.4073650538921356,
0.27543169260025024,
0.11514920741319656,
-0.3310689926147461,
-0.3696931004524231,
0.1844852864742279,
0.23374567925930023,
0.16159430146217346,
0.0576524958014... | |
When trying to add a custom image to a ImageButton, I get the following error:
```
E/AndroidRuntime(3304): Caused by: java.io.FileNotFoundException: res/drawable/btn_default.xml
```
This Works:
```
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wra... | [
0.19822464883327484,
-0.10523611307144165,
0.6496009230613708,
-0.34857913851737976,
-0.24399353563785553,
0.32678842544555664,
0.2771839201450348,
-0.5453384518623352,
-0.40773776173591614,
-0.7649247050285339,
0.00598200224339962,
0.7827815413475037,
-0.48082759976387024,
-0.028684994205... | |
HTML using MarkdownSharp and then PDF using `https://wkhtmltopdf.org/`.
Any other answer which links to a token based parser or a library which could generate PDF directly will be awarded the answer. | [
-0.1934242695569992,
-0.12664131820201874,
0.48876136541366577,
0.28626224398612976,
-0.4530481994152069,
-0.03490111976861954,
0.0729348361492157,
-0.36682239174842834,
-0.10588576644659042,
-0.3440389931201935,
-0.6863481998443604,
0.1825503557920456,
0.053576067090034485,
-0.32860302925... | |
I am looking to provide a better way of managing the distribution and storage of binary dependencies for a large VC++ project.
Currently we have the situation where externally and internal built libraries are stored within the the source control repository resulting in the .cpp and .h files forming less than 3% of th... | [
0.31141847372055054,
0.16630402207374573,
0.14775729179382324,
0.04155199974775314,
0.12643280625343323,
-0.08213698863983154,
0.15904925763607025,
-0.05675695464015007,
-0.24164515733718872,
-0.5364328026771545,
-0.324593186378479,
0.3555490970611572,
-0.1648414433002472,
0.22674608230590... | |
the binary dependencies.
This is currently achieved for some libraries using are existing Source Control, by mounting different repositories containing the built files. This could be one approach (which I don't favour).
Has anybody got experience of using Ivy or Maven in a VC++ environment?
The [maven-nar-plugin](htt... | [
0.24351535737514496,
-0.2924376130104065,
0.08363011479377747,
-0.004604659974575043,
0.22472979128360748,
-0.25784382224082947,
0.32271215319633484,
0.030896104872226715,
-0.08266136795282364,
-0.5279738903045654,
-0.11731056123971939,
0.8235840797424316,
-0.14419202506542206,
0.040176898... | |
I'm using the Jquery date/datetimepicker add-on(s), as well as JQgrid.
I'd like the onShow for the date/datetimepicker to be 'button', but when tabbing through the modal, the date/datetime button mustn't get focus.
Iv'e written a function to create the datepicker for me.
```
function CreateDatePicker(elem, ShowOn) {
... | [
0.2953978180885315,
-0.2602543830871582,
0.7607095837593079,
-0.11474228650331497,
0.39014506340026855,
0.135783851146698,
0.026277540251612663,
-0.16653507947921753,
-0.022680019959807396,
-0.62185138463974,
-0.12198445200920105,
0.7348439693450928,
-0.2163008153438568,
0.2516326904296875... | |
changeYear: true,
changeMonth: true,
showButtonPanel: true,
showWeek: true,
onClose: function (dateText, inst) {
$(this).focus();
}
}); | [
0.3257792592048645,
-0.2796395719051361,
0.7766974568367004,
-0.47941291332244873,
0.35746780037879944,
0.04981444031000137,
0.28099721670150757,
0.09202447533607483,
0.19818809628486633,
-0.36374881863594055,
-0.3004685044288635,
0.6576146483421326,
-0.41987931728363037,
0.116621010005474... | |
}, 100);
$(elem).mask("9999/99/99", { placeholder: "_" });
}
```
**I call it like this.**
```
initDateEdit = function (elem) {
CreateDatePicker(elem, 'button');
};
```
**JQgrid code**
```
{ name: 'Date', index: 'Date', editable: true, formoptions: { rowpos: 1, colpos: 2 }, formatter: 'date', formatop... | [
-0.3413054347038269,
-0.5645828247070312,
0.7577002644538879,
-0.016945406794548035,
0.1757473349571228,
0.11880756914615631,
-0.0653289407491684,
0.1465434432029724,
-0.22122982144355774,
-0.5931339263916016,
-0.20530569553375244,
0.31645819544792175,
-0.17882762849330902,
-0.221096828579... | |
(input) element on the page, regardless of what it is.
I've tried a couple of things, all yielding either incorrect/no results at all...
**My last failed attempt...**
```
$(document).delegate('.ui-datepicker-trigger', 'focus', function (event) {
$(this).next().focus();
});
```
Any help will be appr... | [
-0.1998680830001831,
-0.17587341368198395,
0.829525887966156,
-0.10391068458557129,
-0.026964403688907623,
0.03533574193716049,
0.2276262491941452,
-0.1283554583787918,
-0.30560851097106934,
-0.7616698145866394,
-0.2837614417076111,
0.429585337638855,
-0.4519839286804199,
0.117191329598426... | |
"-1");
```
Try to use `Tab` in the searching toolbar of [the demo](http://www.ok-soft-gmbh.com/jqGrid/DatepickerWithShowOnButton1_small3.htm) and compare the results with [another demo](http://www.ok-soft-gmbh.com/jqGrid/DatepickerWithShowOnButton1_small2_.htm) created for [the answer](https://stackoverflow.com/a/962... | [
-0.3685398995876312,
-0.17797747254371643,
0.37311434745788574,
0.2110040783882141,
-0.03081347420811653,
0.060851097106933594,
0.02779349684715271,
-0.3351801037788391,
-0.13981993496418,
-0.3371484875679016,
-0.5315749049186707,
0.331010103225708,
-0.16783644258975983,
-0.043030459433794... | |
I wanted to create a link that would show content before showing a direct link on my forum.
1. Show link to download attachment
2. After clicking, it shows html content with 5 second countdown below
3. When countdown has finished, it shows a direct link.
I have tried the following code:
```
$("button").click(functio... | [
0.2249806970357895,
-0.14494559168815613,
1.0630545616149902,
-0.3926992416381836,
-0.042398497462272644,
0.3077092468738556,
0.08091457188129425,
-0.23721785843372345,
-0.4812999665737152,
-0.47657206654548645,
-0.03982405737042427,
0.6144756078720093,
-0.45828747749328613,
0.155951112508... | |
}
count--;
}, 1000);
});
});
```
What about a magic function?
To talk about @Bradley Foster's answer, calling several times `setTimeout` is not reliable. `setTimeout` will stop if your browser lags, so with four differents, you're not sure the order is going to be the right one. Nesting the `setTimeout... | [
0.37481391429901123,
-0.20027832686901093,
0.3532315492630005,
-0.11226262152194977,
0.11132004112005234,
-0.02881750650703907,
0.5588066577911377,
-0.3952854871749878,
-0.27325090765953064,
-0.6086655259132385,
0.012720370665192604,
0.6293681859970093,
-0.365945965051651,
0.47895076870918... | |
a five!
// Name your function so that you can call it later
setTimeout(function countdown() {
// Your countdown is already at 5, so decrement it
// Remember that you've already waited for 1000ms before reaching this line the first time
seconds--
el.text(seconds) // Set the new ti... | [
0.15807504951953888,
-0.44296059012413025,
0.6161313056945801,
-0.0048765819519758224,
0.14398784935474396,
0.17396530508995056,
0.24101191759109497,
-0.14545795321464539,
-0.2956629991531372,
-0.6760953664779663,
-0.009844344109296799,
0.4880374073982239,
0.32747745513916016,
0.3966000080... | |
after 1000ms
if (seconds > 0) {
setTimeout(countdown, 1000)
}
// If it is over, display the link
// Note that js will stop there and not try to call itself another time as it would with setInterval()
else {
el.html('<a href="link">Download</a>') | [
0.10790466517210007,
-0.3541471064090729,
1.1963069438934326,
0.037069208920001984,
0.2685982882976532,
-0.09650249034166336,
0.3814871907234192,
-0.038895465433597565,
-0.22411026060581207,
-0.8219238519668579,
-0.19226573407649994,
0.4217958152294159,
0.18633310496807098,
0.2211169153451... | |
}
}, 1000)
})
```
Btw, in your question, when you're doing `$(function() {...`, you're actually doing `$(document).ready(function() {...`. I guess this is not what you wanted :)
Jsfiddle here: <http://jsfiddle.net/Ralt/kTbcm/> | [
0.21425838768482208,
0.13279496133327484,
0.4292805790901184,
-0.2780149579048157,
0.18233349919319153,
-0.10464154183864594,
0.3446681797504425,
-0.41160887479782104,
-0.23849697411060333,
-0.3042493760585785,
-0.14440059661865234,
0.6354604363441467,
-0.3207206130027771,
0.10793437063694... | |
Here is my code:
```
$("#myCheckBox").click(function () {
if (!$(this).is(':checked')) {
$('#txtDateFrom').attr('readonly', true);
$('#txtDateTo').attr('readonly', true);
$('#txtDateFrom').val('01/01/2012');
$('#txtDateTo').val('31/12/2012');
$('#txtD... | [
0.2510524094104767,
-0.1105005070567131,
0.8109487295150757,
-0.3152768015861511,
0.2870657444000244,
0.05017055571079254,
0.3714791536331177,
-0.09263814985752106,
0.02028202824294567,
-0.668752908706665,
-0.11215152591466904,
0.43143701553344727,
-0.14580519497394562,
0.32072165608406067... | |
}
else {
$('#txtDateFrom').attr('readonly', false);
$('#txtDateTo').attr('readonly', false);
$('#txtDateFrom').datepicker(this.checked ? "disable" : "enable");
$('#txtDateTo').datepicker(this.checked ? "disable" : "enable");
$('#txtDateFrom').datepicke... | [
0.3282495141029358,
-0.4476509988307953,
0.5112258195877075,
-0.09403816610574722,
0.7248929738998413,
0.1859743446111679,
0.31149646639823914,
-0.03541361913084984,
-0.0017908470472320914,
-0.4128947854042053,
-0.2891041338443756,
0.7450019121170044,
-0.5674787759780884,
0.154931560158729... | |
dateFormat: 'dd/mm/yy' });
}
});
```
After uncheking the checkBox, and checking it again, the textboxes are still disabled. Why?
This might be your problem:
```
$('#txtDateFrom').datepicker(this.checked ? "disable" : "disable");
$('#txtDateTo').datepicker(this.checked ? "disable" : "disable");
```
Shou... | [
0.285558819770813,
-0.34359967708587646,
0.5230340957641602,
-0.20677857100963593,
0.5512491464614868,
-0.08221270889043808,
0.4435959458351135,
-0.056179966777563095,
-0.1994636058807373,
-0.5812609791755676,
-0.4658457338809967,
0.7149107456207275,
-0.8003077507019043,
0.0481660440564155... | |
I'm creating a jigsaw application. When each piece is touched, the idea is that a bool (`droppedInPlace`) is assigned `YES` if it is put in its correct place, and `NO` if it is dropped in the wrong place. I then think I need to create an array of 40 bools (the number of jigsaw pieces), each of these entries will be ini... | [
0.18022185564041138,
0.43897560238838196,
0.42023468017578125,
-0.15178190171718597,
-0.07128648459911346,
0.3694150149822235,
0.16346445679664612,
-0.3175205588340759,
-0.2500968873500824,
-0.5217607021331787,
-0.037842944264411926,
0.12340714782476425,
-0.26118725538253784,
0.06766727566... | |
some trouble doing this. I can't figure out how to code my idea above. Below is my code:
```
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
UIView *touchedView = [touch view];
// filename to be read from
NSString *filePath = [[NSBundle mainBundle]
... | [
0.01962951570749283,
-0.0694160908460617,
0.6855828762054443,
-0.1784018725156784,
0.061049044132232666,
-0.10568194836378098,
0.4779435098171234,
-0.03777199611067772,
-0.271206259727478,
-1.0361095666885376,
0.2529992461204529,
0.5053712129592896,
0.027612140402197838,
0.0260706543922424... | |
ofType:@"plist"];
// array of cgpoints in string format
NSArray *jigsawHomeCentersArray = [NSArray arrayWithContentsOfFile:filePath];
// the tag number of the selected image
int tag = touchedView.tag;
NSLog(@"tag: %i", tag);
// says that the piece has not been dropped in it's holder
bool droppedInPlace = NO;
// if what... | [
-0.04669623821973801,
-0.10397350043058395,
0.7869557738304138,
-0.16343051195144653,
0.005219094455242157,
0.1986706256866455,
-0.22895793616771698,
-0.5736347436904907,
-0.21312734484672546,
-0.5671622157096863,
-0.20857907831668854,
0.1696322113275528,
-0.19561661779880524,
-0.120457716... | |
the process easier
CGPoint newcenter = CGPointFromString([jigsawHomeCentersArray objectAtIndex:tag-1]);
// the location of the current touch
CGPoint location = [touch locationInView:self.view];
// call the animate method upon release
[self animateReleaseTouch:touchedView withLocation:location];
... | [
-0.1730801910161972,
-0.17615708708763123,
1.559814691543579,
-0.08743022382259369,
0.15587347745895386,
-0.027156757190823555,
0.001686856965534389,
-0.38126325607299805,
-0.21157622337341309,
-0.8273917436599731,
-0.19285725057125092,
0.6246270537376404,
0.08453376591205597,
0.1397196650... | |
touchedView.center = newcenter;
touchedView.alpha = 1.0;
droppedInPlace = YES;
} else {
touchedView.alpha = 0.5;
droppedInPlace = NO;
}
NSLog(@"True or false: %i", droppedInPlace);
[self checkJigsawCompleted:droppedInPlace withTag:tag];
}
}
```
And the check function:
```
... | [
-0.12239088118076324,
0.09753509610891342,
0.7847090363502502,
-0.16498976945877075,
-0.05372340977191925,
0.026585452258586884,
0.5209073424339294,
-0.3237292766571045,
-0.2147958129644394,
-0.7203488349914551,
-0.011761140078306198,
0.3494330048561096,
-0.1484394520521164,
-0.00745666259... | |
want to know how to loop through an array? You can use a `for(;;)` loop or a `for(.. in ..)` loop or, my favourite for this sort of thing: [-enumerateObjectsUsingBlock:](http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/20000137-SW19)
... | [
0.400423526763916,
-0.008961296640336514,
0.2965072989463806,
-0.004884675610810518,
0.014408964663743973,
-0.1473604440689087,
0.7313783168792725,
-0.011046229861676693,
-0.4544714391231537,
-0.28885313868522644,
-0.1655220091342926,
0.27666908502578735,
-0.39980778098106384,
-0.229209959... | |
hi I've setup (well inflated) a bunch of buttons, which are built from a relativelayout containing buttons, textviews etc.. I want the ability to Delete/hide/Gone a whole button set. I'm assuming I can just do a `setVisibility(View.GONE)` on the RelativeLayout but I'm not sure how I am to reference this layout. I have ... | [
0.12593378126621246,
-0.14532411098480225,
0.824866533279419,
-0.05964690074324608,
-0.06520849466323853,
0.12114021927118301,
0.21022868156433105,
-0.20486456155776978,
-0.0341288298368454,
-0.5093231797218323,
0.2137048840522766,
0.5752103328704834,
-0.24256914854049683,
0.30088052153587... | |
well(crash).
can anyone point me in the right direction?
here the getparent code I tried.
```
RelativeLayout dropping = (RelativeLayout) ((Activity) v.getParent()).findViewById(R.id.tp_container);
dropping.setVisibility(View.GONE);
```
I was hoping for something like this though where id co... | [
0.1732395738363266,
-0.005884161219000816,
0.6614179015159607,
0.062152404338121414,
-0.08059412986040115,
-0.0618632473051548,
0.16973178088665009,
-0.1749718189239502,
-0.2794647812843323,
-0.46598905324935913,
0.07139897346496582,
0.7291882634162903,
-0.09521644562482834,
0.059079643338... | |
textView;
RelativeLayout layout = new RelativeLayout (this);
setContentView(layout);
for(int i=0;i<10;i++){
textView = new TextView(this);
textView.setId(i);
layout.addView(textView);
}
/* FOR LOOP THAT ONE */
TextView referencedTextView = (TextView) layout.findViewById(5);
referencedTextView.... | [
-0.014780334196984768,
-0.43467938899993896,
1.0451407432556152,
-0.44183385372161865,
0.08201080560684204,
0.3745507001876831,
0.4826743006706238,
-0.6177572011947632,
-0.12028304487466812,
-0.7914923429489136,
-0.25174856185913086,
0.7410804629325867,
-0.3406713604927063,
-0.008674509823... | |
instanceof Button){
((Button)layout.getChildAt(i)).setVisibility(View.GONE);
}
}
``` | [
-0.13201619684696198,
-0.13853253424167633,
0.5572148561477661,
-0.2964255213737488,
0.25296148657798767,
-0.0019288914045318961,
0.39122793078422546,
-0.18641214072704315,
-0.2255132794380188,
-0.9283760190010071,
-0.3227309584617615,
0.5683819651603699,
-0.590688943862915,
0.299618244171... | |
Did android device supports playing iis smooth streaming (.ism)?
I'm trying to play a video stream in this format, and get an error about "Bad parameter"
> Without naming the function is there any way in strict mode that I can get a reference to the function whose scope I'm currently within?
In 2012 when [this answer... | [
-0.07895822823047638,
-0.16018900275230408,
0.465179443359375,
-0.04526301845908165,
0.019868193194270134,
-0.2112811654806137,
0.2370743602514267,
-0.060202695429325104,
-0.43719515204429626,
-0.6790818572044373,
0.10431238263845444,
0.6086414456367493,
-0.5768606662750244,
0.075903929769... | |
approach is just fine:
```
UsageGraph = Graph.extend({
generateScale: function GS() {
var parentMethod = this.constructor._super.generateScale;
if(parentMethod === GS) {
parentMethod = this.constructor._super.constructor._super.generateScale;
}
parentMethod.call(this); // run ... | [
-0.23766307532787323,
-0.10807190090417862,
0.31519702076911926,
-0.14650294184684753,
-0.01787496544420719,
0.023746877908706665,
0.4413764178752899,
-0.20736980438232422,
-0.1724795252084732,
-0.552086353302002,
0.011941535398364067,
0.43077173829078674,
-0.40083807706832886,
0.199737340... | |
name was to assign an anonymous function to a variable:
```
UsageGraph = Graph.extend(function(){
var GS = function() {
var parentMethod = this.constructor._super.generateScale;
if(parentMethod === GS) {
parentMethod = this.constructor._super.constructor._super.generateScale;
}
... | [
-0.12081094086170197,
-0.24617823958396912,
0.3713553845882416,
-0.16791602969169617,
-0.0972614511847496,
-0.013229028321802616,
0.22130033373832703,
0.026492957025766373,
-0.15989191830158234,
-0.25987353920936584,
-0.08056268841028214,
0.30648520588874817,
-0.7552914023399353,
0.3808459... | |
inferred from the name of the variable it's assigned to:
```js
var GS = function() { };
console.log(GS.name); // "GS"
```
If you **really** don't want it to have a name, it's possible to avoid it, but you have to make an effort to defeat the automatic naming defined by the specification, for instance by making the fu... | [
-0.12199492007493973,
0.001630887622013688,
0.4471927285194397,
-0.23961475491523743,
0.00825508963316679,
-0.14242145419120789,
0.10069089382886887,
-0.18787498772144318,
-0.17976409196853638,
-0.43745654821395874,
-0.43067196011543274,
0.5401467680931091,
-0.5587347745895386,
0.083445236... | |
if(parentMethod === generateScale) {
parentMethod = this.constructor._super.constructor._super.generateScale;
}
parentMethod.call(this); // run the parent's method
//do additional stuff
})();
return {generateScale};
}());
``` | [
0.24887967109680176,
-0.1973089724779129,
0.2392643541097641,
-0.06320491433143616,
0.5260475873947144,
-0.25147661566734314,
0.30344751477241516,
-0.3117295801639557,
0.06301864981651306,
-0.33806687593460083,
-0.4582715332508087,
0.430425226688385,
-0.33788567781448364,
0.431032180786132... | |
I have a need to create a diagram viewer. There is hierarchical tree that I want to visualize in Eclipse plugin. I manage to know GEF, and there is Zest. But in Zest, I don't success in creating custom shape in graphic nodes and there is no tutorial to create the custom node (I have been searching all day). So I want t... | [
0.41307181119918823,
0.18104632198810577,
0.20720814168453217,
-0.061721321195364,
-0.46856120228767395,
0.20516857504844666,
0.03923030570149422,
0.026471495628356934,
-0.18254560232162476,
-1.0538495779037476,
0.3636789321899414,
0.42942705750465393,
-0.09590540826320648,
0.0380231291055... | |
function whose scope I'm currently within?
In 2012 when [this answer was originally written](https://stackoverflow.com/revisions/10009764/2), there were implementation bugs with the named function expressions you were using in your linked solution. There aren't now, it's been **years** since browsers with those bugs w... | [
0.06313405185937881,
-0.20647336542606354,
0.6078407764434814,
-0.16310681402683258,
-0.06902264058589935,
-0.11240100115537643,
0.3442753553390503,
-0.25700607895851135,
-0.42315295338630676,
-0.496407151222229,
-0.023766782134771347,
0.4554991126060486,
-0.5176115036010742,
0.07559631019... | |
this.constructor._super.constructor._super.generateScale;
}
parentMethod.call(this); // run the parent's method
//do additional stuff
}
});
```
But the question asks if you can avoid having a name. In 2012, my solution if you really didn't want the function to have a name was to assign an anon... | [
-0.034375425428152084,
-0.21293792128562927,
0.34023258090019226,
-0.07171211391687393,
0.046607013791799545,
-0.18019314110279083,
0.34685951471328735,
0.028972184285521507,
-0.3530048727989197,
-0.3858412206172943,
0.00645067822188139,
0.4021131694316864,
-0.6939317584037781,
0.216679230... | |
parentMethod = this.constructor._super.constructor._super.generateScale;
}
parentMethod.call(this); // run the parent's method
//do additional stuff
};
return {generateScale: GS};
}());
```
But that doesn't work anymore; since ES2015, even that function has a name, inferred from the name o... | [
-0.1078750342130661,
-0.2155490666627884,
0.3152140974998474,
-0.0026197752449661493,
0.07594070583581924,
0.010650522075593472,
0.2677764892578125,
0.028368815779685974,
-0.06502019613981247,
-0.40351051092147827,
-0.29406991600990295,
0.34686166048049927,
-0.35031944513320923,
0.38313567... | |
by the specification, for instance by making the function the return value of another function:
```js
var GS = (() => function() { })();
console.log(GS.name); // ""
```
So if avoiding the name is important, you'd do something like this:
```
UsageGraph = Graph.extend(function(){
const generateScale = (() => functi... | [
0.11745526641607285,
-0.22414422035217285,
0.656468391418457,
-0.07026808708906174,
0.15949809551239014,
-0.1225188672542572,
0.14909134805202484,
-0.3210010826587677,
-0.3128952383995056,
-0.5129442811012268,
-0.3102087676525116,
0.40068191289901733,
-0.39397111535072327,
0.13239453732967... | |
//do additional stuff
})();
return {generateScale};
}());
``` | [
0.2930707335472107,
-0.1846625804901123,
0.42406532168388367,
-0.17631974816322327,
0.48042595386505127,
-0.347557932138443,
0.41637492179870605,
-0.3072670102119446,
-0.08238548040390015,
-0.1479341983795166,
-0.7496176362037659,
0.789054274559021,
-0.3369828164577484,
0.0314522348344326,... | |
I have a model called "Customer" in google app engine with python:
```
class Customer(db.Model):
name = db.StringProperty()
age = db.IntegerProperty()
```
before I create any instance/object of the Customer model, I would like to check if the model is empty(no object has been created), I tried something in P... | [
-0.22214484214782715,
0.3111664056777954,
0.21035344898700714,
-0.12500284612178802,
0.021215947344899178,
0.4278956651687622,
-0.028667759150266647,
0.16431444883346558,
-0.29905155301094055,
-0.5019195079803467,
0.014982390217483044,
0.40668538212776184,
-0.23842327296733856,
0.315431028... | |
model, "customers" in above snippet is not "None", while the line "for customer in customers:" always jumps out(means there is nothing in "customers"?), any idea? in addition, can I check this in Django template?
thank you in advance.
you could use count()
```
customers = Customer.all()
if customers.count(1):
... | [
0.2609696388244629,
-0.039755117148160934,
0.10190577059984207,
-0.09490708261728287,
0.2395664006471634,
-0.16068394482135773,
-0.1518375426530838,
-0.1470433473587036,
-0.5163378119468689,
-0.30377262830734253,
-0.2007293999195099,
0.763563334941864,
-0.3694435656070709,
-0.0716785117983... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.