text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
{
// Append to this html element
$('#output').append(index + ': ' + value + '<br />').fadeIn(300);
});
});
});
});
```
The following PHP code....
```
function qry_select_account($pk_account) {
// Global variables
Global $db_host, $db_user, $db_pass, $db_name;
// ... | [
-0.33655214309692383,
0.19395148754119873,
0.6854340434074402,
-0.14975237846374512,
-0.08268166333436966,
0.23892313241958618,
0.17425617575645447,
-0.03215629234910011,
-0.23587526381015778,
-0.5523519515991211,
-0.23353004455566406,
0.296825647354126,
-0.6335903406143188,
0.393713474273... | |
// Run query
$sql_qry = mysql_query("SELECT * FROM tblaccount
WHERE pk_account = '$pk_account'") or die(mysql_error());
// SQL Criteria AND acc_confirmed = 'y' AND acc_locked = 'n'
// Fetch table row for this user
$row = mysql_fetch_row($sql_qry);
print json_encode($row);
mysql... | [
0.08773349970579147,
0.2596795856952667,
0.7726582884788513,
-0.1358986794948578,
0.05545809492468834,
0.2310907393693924,
0.32616400718688965,
-0.37289926409721375,
-0.13182617723941803,
-0.44870513677597046,
-0.4014291763305664,
0.36051809787750244,
-0.40741896629333496,
0.36147984862327... | |
following PHP code...
```
function qry_select_last5_entries_for_user($ent_user) {
// Global variables
Global $db_host, $db_user, $db_pass, $db_name;
// Connect to database server
$dbc = mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
// Select target database
mysql_select_db($db_na... | [
-0.24602921307086945,
0.21711952984333038,
0.6994257569313049,
-0.12051241099834442,
-0.12615738809108734,
0.18722321093082428,
0.22709892690181732,
-0.2759230434894562,
-0.24488388001918793,
-0.5208161473274231,
0.09635592997074127,
0.1493602693080902,
-0.5378696918487549,
0.5276058316230... | |
LIMIT 5") or die(mysql_error());
// Fetch table rows for this user
while ($row = mysql_fetch_array($sql_qry, MYSQL_NUM)) {
print json_encode($row);
}
mysql_free_result($sql_qry);
// Close Connection
mysql_close($dbc);
}
["20","1","suchislife801","Happy","My first entry title.","Body of my first ... | [
-0.07106705009937286,
0.10474415868520737,
0.8969537615776062,
-0.1182049810886383,
0.0011141557479277253,
0.29924285411834717,
0.0317242406308651,
-0.44196662306785583,
-0.1299118995666504,
-0.27351394295692444,
0.05995529145002365,
0.5061303377151489,
-0.30686941742897034,
0.195328161120... | |
first entry title.","Body of my first entry.","2012-04-03","15:06:37","n","0"],["18","1","suchislife801","Happy","My first entry title.","Body of my first entry.","2012-04-03","15:06:36","n","0"],["17","1","suchislife801","Ugly","My first entry title.","Body of my first entry.","2012-04-03","15:06:35","n","0"],["15","1... | [
-0.37643900513648987,
-0.18268528580665588,
0.6998331546783447,
0.004506273195147514,
-0.09447269886732101,
0.042352259159088135,
0.04243676736950874,
-0.4582415819168091,
-0.1524771749973297,
-0.6720970869064331,
-0.30808308720588684,
0.5047804713249207,
-0.07714242488145828,
0.0107897836... | |
array();
// Fetch table rows for this user
while ($row = mysql_fetch_array($sql_qry, MYSQL_NUM)) {
array_push($out,$row);
}
print json_encode($out);
``` | [
-0.15860341489315033,
-0.0369754284620285,
0.5166859030723572,
-0.6403793096542358,
0.023085156455636024,
0.247377410531044,
0.17890648543834686,
-0.48914629220962524,
-0.23436953127384186,
-0.3138170838356018,
-0.1165115162730217,
0.4835488498210907,
-0.4835231602191925,
0.065331429243087... | |
I have the following and I am trying to figure out how to search the array of objects - the `call()` function is called multiple times ?
```
var arr = [];
var newData;
function call() {
newData = $('a').attr('href');
if($.inArray(newData, arr) == -1) {
$.post('/blah', function(data) {
arr.pus... | [
0.1860584318637848,
-0.09975618124008179,
0.5702751278877258,
-0.4353770613670349,
0.14651325345039368,
0.17201001942157745,
0.2409878820180893,
-0.5085294246673584,
-0.32511723041534424,
-0.561928391456604,
-0.3377669155597687,
0.49529269337654114,
-0.3129121959209442,
0.5286439657211304,... | |
the `arr` ?
If the array contains objects, `$.inArray` will not work. This is because objects are only equal if they are the same object, not just contain the same values.
`$.inArray` won't work here also because `newData` is a string. It's not gonna search inside each object for you, you need to that yourself, with y... | [
0.04062380641698837,
-0.10787514597177505,
0.5517193675041199,
-0.34765222668647766,
-0.09535031020641327,
0.17590908706188202,
0.36790773272514343,
-0.6000407338142395,
-0.0886797159910202,
-0.3304429054260254,
-0.12985371053218842,
0.7025985717773438,
-0.6623015999794006,
0.4066206216812... | |
return false; // break once a match is found
}
});
``` | [
-0.032295383512973785,
0.10501120984554291,
0.011734343133866787,
-0.3720444440841675,
0.31203243136405945,
-0.39581528306007385,
0.6100524663925171,
-0.05325472354888916,
0.17584945261478424,
-0.18937231600284576,
-0.4931643009185791,
0.811944305896759,
-0.5348440408706665,
0.281462907791... | |
I have a "view" page in Yii.
It is cached with page cache.
Now, I want to insert some dynamic content:
```
$this->renderDynamic('renderPartial','view_name');
```
The rendered view looks like this:
```
<?php some code ?>
<div>...some html...</div>
```
The code works fine, but there is this error:
> <#... | [
0.199698343873024,
-0.01748635247349739,
0.5701918005943298,
-0.15685057640075684,
-0.43181270360946655,
0.15159988403320312,
0.286953866481781,
-0.2366497963666916,
0.20789702236652374,
-0.662569522857666,
-0.044645048677921295,
0.7635889053344727,
-0.1668235808610916,
0.05098797008395195... | |
time();
```
I think that You forgot to add return in callback function (step 2). | [
-0.11976944655179977,
-0.05913776904344559,
0.5165606141090393,
-0.34076738357543945,
0.2566046416759491,
-0.06269112229347229,
0.24645590782165527,
-0.33219584822654724,
0.11414716392755508,
-0.4443072974681854,
-0.16932570934295654,
0.9412214756011963,
-0.3007414937019348,
0.044965554028... | |
Im using PHP to output the category information from an RSS feed:
```
foreach(item_category()) as $category) {
$source = $category->cat_name;
echo $source.'.png';
}
```
Where `item_category` is an array of category names. I then have a set of corresponding images I've like to display against each item.
At... | [
-0.1327020227909088,
0.057596344500780106,
0.5164190530776978,
-0.12170001119375229,
-0.4509626626968384,
0.0845586434006691,
0.07603345811367035,
-0.4981030821800232,
-0.2878185212612152,
-0.19660428166389465,
-0.2195761352777481,
0.36266928911209106,
-0.5800870060920715,
0.14948332309722... | |
I am returning some stored contacts to view for DropDownList and I am not able to include multiple dataTextFields on my SelectList.
Currently I have:
```
@Html.DropDownListFor(model => model.Account.AccountContacts,
new SelectList(ViewBag.DDContacts, "Contact.ContactID", "Contact.FirstName"),
ne... | [
-0.18560479581356049,
-0.05848013237118721,
0.8765391111373901,
-0.2313893735408783,
-0.038976676762104034,
0.2982667088508606,
0.1540955901145935,
-0.13993221521377563,
-0.2630982995033264,
-0.8565582633018494,
-0.004064672626554966,
0.6777902841567993,
0.05236006900668144,
0.287604510784... | |
= "width: 100px;" })
```
which combines both FirstName and LastName properties.
UPDATE: I am aware of extending contact property, I was curious was there a streamline way to accomplish this in the View or Controller. I tried the two solutions [here](https://stackoverflow.com/questions/2758734/how-can-i-combine-two-f... | [
-0.07359250634908676,
-0.21226364374160767,
0.30340924859046936,
-0.28965485095977783,
0.23153510689735413,
-0.16876667737960815,
0.149124413728714,
-0.42631593346595764,
-0.21793769299983978,
-0.543375551700592,
-0.25928813219070435,
0.6659225225448608,
-0.33147957921028137,
-0.0647693648... | |
I manage a live music venue's newsletter and the show listings/calendar on the main site are generated using PHP. Is there a way to generate content in newsletters via php?
Example, I create the newsletter.php file, upload the code to our newsletter service provider, and when someone opens the message, the latest lis... | [
1.1087881326675415,
0.36239153146743774,
0.11321909725666046,
-0.12209632992744446,
-0.0799143984913826,
-0.36305323243141174,
0.11727242171764374,
0.14529109001159668,
-0.12175643444061279,
-0.46727675199508667,
0.22186607122421265,
0.8160983324050903,
0.1308913379907608,
-0.0125712184235... | |
has to be in a format that e-mail clients understand (such as plain text or HTML). | [
0.3294602334499359,
0.21672822535037994,
0.04264972358942032,
0.2410287857055664,
0.37612515687942505,
-0.35521480441093445,
0.09416760504245758,
0.20639604330062866,
0.1927005797624588,
-0.7706433534622192,
-0.7907220721244812,
0.21217717230319977,
0.08943197876214981,
-0.3280104398727417... | |
Lets say I have a modestly sized text file (~850kb, 10,000+ lines)
And I want to replace a particular line (or several) spread out amongst the file.
Current methods for doing this include re-writing the whole file. The current method I use is read through the entire file line by line, writing to a .tmp file, and once... | [
0.5232502818107605,
0.024816220626235008,
0.37475910782814026,
0.09938981384038925,
-0.23911263048648834,
0.24367958307266235,
0.39659038186073303,
-0.15511485934257507,
-0.21897654235363007,
-0.7427456378936768,
0.009459235705435276,
0.2643740475177765,
-0.06756090372800827,
0.04665915295... | |
entire file every time a line or two need to be replaced or removed?
Thanks! I looked around and could not find an answer to this on stackoverflow.
If the replacement is EXACTLY the same size as the original line, then you can simply `fwrite()` at that location in the file and all's well. But if it's a different lengt... | [
0.340560644865036,
-0.18755680322647095,
0.4791308343410492,
0.08065887540578842,
0.20844997465610504,
-0.10351746529340744,
0.34392035007476807,
0.0669018030166626,
-0.6396214365959167,
-0.4921109974384308,
-0.3821468651294708,
0.4170655608177185,
-0.23687897622585297,
0.33217963576316833... | |
of the next line.
Basically, you're asking if it's possible to insert a piece of wood in the middle of another board without having to move the original board around. | [
0.39816364645957947,
-0.057025983929634094,
0.02490388974547386,
0.21579988300800323,
0.1923179030418396,
0.45943519473075867,
-0.3636866807937622,
-0.18336865305900574,
-0.4466814398765564,
-0.3897029757499695,
0.040115837007761,
0.14288780093193054,
0.06787045300006866,
-0.00668544135987... | |
(I'm using Rails 3.2.3 on Ruby MRI 1.9.2)
Everything is stored centrally in UTC. This is good. Each User has a 'timezone' property. My ApplicationController has a before filter to adjust Time.zone to the User's stored timezone. This is also good.
Given the above, if my User completes a datetime select with a time, th... | [
0.11654452979564667,
-0.18677206337451935,
0.4257858097553253,
-0.09668246656656265,
0.04033506661653519,
-0.014662420377135277,
0.493813157081604,
0.14533324539661407,
-0.04618166759610176,
-0.9027058482170105,
0.047218576073646545,
0.14954409003257751,
-0.020061014220118523,
0.0370964743... | |
the completed date time select to have been filled out in the (previously set by ApplicationController) Time.zone. Therefore Rails adjusts to UTC **incorrectly**.
**How do I achieve my goal of saving a time that has been input as being in a third time zone?**
Illustration:
My usage scenario is a User in Florida adju... | [
0.26873844861984253,
-0.06882435083389282,
0.8127651810646057,
-0.024027207866311073,
0.8433839678764343,
0.02753346972167492,
0.371900737285614,
0.0046617877669632435,
-0.3380034267902374,
-0.5972605347633362,
-0.06210729852318764,
0.2186809480190277,
0.003938194829970598,
0.1502945721149... | |
=> adjusted_to_hotel_time(@document.created_at), :class => 'text datetime_picker') %>
def adjusted_to_hotel_time(time)
time.in_time_zone(@current_hotel.timezone).to_s(:admin_jquery) # formatted for the jQuery datetime_picker text fields.
end
```
This is working perfectly, but Rails adjusts to UTC incorrectly when ... | [
0.08752794563770294,
0.008260486647486687,
0.9104731678962708,
0.1847715973854065,
0.4081310033798218,
-0.07433570176362991,
0.16330809891223907,
-0.2710389792919159,
-0.11223602294921875,
-0.4636242091655731,
-0.06263095885515213,
0.7344317436218262,
-0.11222189664840698,
0.17796820402145... | |
that Hotel's.
We then pass the method a block where we produce the value that Rails is expecting, by using the timezone of the Hotel, rather than the User. That means that Rails' conversion to UTC results in the correct time in the db - as the time entered on the form has been converted to the Users timezone. The offs... | [
0.22114470601081848,
0.02166200615465641,
0.6421258449554443,
0.1100519523024559,
0.29443877935409546,
-0.21575218439102173,
0.4735788106918335,
-0.4346187710762024,
-0.10543724149465561,
-0.5254470705986023,
-0.17234556376934052,
0.555752694606781,
-0.20641683042049408,
0.3450472354888916... | |
fine for me, but I've been looking at this for too long and I'd love to see a better way/more Rails-ey way of doing this! | [
0.6263903379440308,
-0.2503190338611603,
0.16391399502754211,
0.44990190863609314,
0.3194836974143982,
-0.07670814543962479,
0.6433534622192383,
0.16909663379192352,
-0.011467223055660725,
-0.4790351092815399,
0.56145840883255,
0.4520440697669983,
0.058430932462215424,
0.023169567808508873... | |
A client credential grant does not return a refresh token (DotNetOpenAuth.OAuth2.AuthorizationServer.PrepareAccessTokenRequest forbids it). But ClientBase.AuthorizeRequest requires it.
Is this a bug in DotNetOpenAuth or am I doing something wrong?
I suppose I can work around by inheriting ClientBase and overriding Aut... | [
0.14219267666339874,
0.26387059688568115,
0.6192245483398438,
0.07440952956676483,
0.08130823820829391,
-0.5449345707893372,
0.5299122929573059,
-0.4373481273651123,
-0.14756359159946442,
-0.36662569642066956,
0.1312599927186966,
0.5169894695281982,
-0.10447592288255692,
0.1126620694994926... | |
it?
I'm not sure why you say that `ClientBase.AuthorizeRequest` requires it. Firstly, there is an overload that only takes an access token, so it doesn't even *ask* for a refresh token. The overload you may have tried accepts an `IAuthorizationState` object, which may or may not include a refresh token, and it appears ... | [
0.19858777523040771,
-0.1713259369134903,
0.26806771755218506,
0.15846526622772217,
0.15758442878723145,
-0.13585036993026733,
0.004407027270644903,
0.1021268293261528,
0.007328282576054335,
-0.29486533999443054,
-0.1453120857477188,
0.7216026186943054,
-0.440701961517334,
0.15347070991992... | |
either avoid using expired access tokens or be prepared to respond to the exceptions that are thrown when DotNetOpenAuth or the resource server determines that they are expired or revoked. In fact since tokens can be revoked before they expire, it's a good idea to always be prepared for that.
The OAuth 2 spec draft 25... | [
-0.007568927947431803,
-0.00029547204030677676,
0.7912006974220276,
0.10316448658704758,
0.22453071177005768,
-0.4792627692222595,
0.3085743188858032,
-0.2697429358959198,
-0.3748392164707184,
-0.6036838293075562,
-0.429153174161911,
0.47405585646629333,
0.10907205939292908,
-0.11383145302... | |
as described in Section 5.1. **A refresh token SHOULD NOT be included**. If the request failed client authentication or is invalid, the authorization server returns an error response as described in Section 5.2. | [
-0.06439276784658432,
-0.034550219774246216,
0.49454373121261597,
-0.1791934221982956,
0.12219150364398956,
-0.10386084765195847,
0.600891649723053,
-0.17433595657348633,
-0.1731625199317932,
-0.42299532890319824,
-0.45338475704193115,
0.2779177129268646,
-0.1620549112558365,
0.01360043883... | |
Here is an example:
```js
$(function() {
$('#test').change(function() {
$('#length').html($('#test').val().length)
})
})
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<textarea id=test maxlength=10></textarea>
length = <span id=length>0</span>
```
... | [
-0.13437744975090027,
-0.10308381170034409,
0.8984085917472839,
-0.15465641021728516,
-0.46794870495796204,
0.3756848871707916,
0.33782175183296204,
-0.3521096408367157,
-0.09504057466983795,
-0.7903540134429932,
0.0072906422428786755,
0.4800848066806793,
-0.1592322438955307,
-0.1689184457... | |
I want to add custom attribute settings to a generated anchor link of Wordpress.
This is to let Jquery Mobile find the attributes and makes a button out of it.
Every anchor link, which is generated in Wordpress via PHP, contains the page\_item class. So my guess is to search for the needed 'page\_item' class and just ... | [
0.027192531153559685,
0.12881767749786377,
0.7157906889915466,
-0.07882512360811234,
-0.12930409610271454,
0.28312742710113525,
-0.13234007358551025,
-0.24445660412311554,
-0.249605193734169,
-0.681446373462677,
0.028187498450279236,
0.49346452951431274,
-0.2144673615694046,
-0.06956069171... | |
let it work. (This code is placed in the header of the header.php file)
```
<script type="text/javascript">
$('.page_item').ready(function(){
$(this).attr('data-transition', 'pop');
$(this).attr('data-icon', 'arrow-r'); | [
0.2043699473142624,
-0.13636718690395355,
0.768302857875824,
-0.13796277344226837,
0.2212531417608261,
-0.16082358360290527,
0.3970400393009186,
-0.5280216932296753,
0.21358619630336761,
-0.39646318554878235,
-0.4648495316505432,
0.7940562963485718,
-0.56606125831604,
-0.26907700300216675,... | |
$(this).attr('data-iconpos', 'left');
$(this).attr('data-role', 'button');
});
</script>
```
When checking the code via firebug Wordpress generates the following code:
```
<ul>
<li class="page_item page-item-5"><a href="http://localhost/ddwp/?pag... | [
-0.31547215580940247,
0.16395330429077148,
0.7343983054161072,
-0.1471233069896698,
-0.0023731430992484093,
0.47479256987571716,
0.1359177529811859,
-0.45197415351867676,
-0.08271520584821701,
-0.974154531955719,
-0.5428838133811951,
0.3508213758468628,
-0.16253313422203064,
0.108352154493... | |
href="http://localhost/ddwp/?page_id=23">Link4</a></li>
<li class="page_item page-item-62 current_page_item"><a href="http://localhost/ddwp/?page_id=62">Link5</a></li>
</ul>
```
Thanks in advance!
Kind regards
Dragon54
There's a few reasons your script isn't working. Here's some suggestions, and some... | [
-0.2176576852798462,
0.04307105392217636,
0.7767028212547302,
0.03760005533695221,
-0.17744116485118866,
0.011121269315481186,
0.14555373787879944,
-0.5038561820983887,
-0.026668891310691833,
-0.7436526417732239,
-0.2721848785877228,
0.5742042064666748,
-0.20933622121810913,
0.020534358918... | |
is ONLY the navigation links - it will not apply to any links in the content of the pages/posts.
3. Jquery in WordPress is not always safe to run using `$`. By wrapping the calls in a document ready called with `jQuery`, you can still use `$` within the function to call the jQuery functions.
```
jQuery(function($) {
... | [
-0.29609444737434387,
-0.13829411566257477,
1.2309104204177856,
0.060635700821876526,
-0.1841849386692047,
0.057965587824583054,
0.43242916464805603,
-0.17830462753772736,
-0.08401501923799515,
-0.6287345886230469,
-0.5679370164871216,
0.631409227848053,
-0.581515371799469,
0.0289786756038... | |
:**
Per the excellent comments by @Jasper the **much better** way to do this would be:
```
jQuery(function($) {
$('.page_item a').attr({ 'data-transition' : 'pop',
'data-icon' : 'arrow-r',
'data-iconpos' : 'left',
'data-role' : 'button' });
});
``` | [
-0.23950670659542084,
-0.18194328248500824,
0.8251492977142334,
0.12361588329076767,
-0.05789226293563843,
0.18764662742614746,
0.06068494915962219,
-0.045743428170681,
-0.1698841154575348,
-0.6636074781417847,
-0.450886607170105,
0.4352715313434601,
-0.39719417691230774,
0.054228540509939... | |
I need to pass a couple bits of info through the URL just by clicking a link, rather than by using action="GET" with a form and input button. Is this possible? This is *client-side only*, there is no server, so suggestions regarding PHP etc. will not be useful in this circumstance.
You're gonna need to use JavaScript t... | [
0.545914888381958,
0.1490629017353058,
0.47906720638275146,
0.22578105330467224,
-0.15281549096107483,
-0.1685267686843872,
0.15107287466526031,
-0.40662336349487305,
0.04266788810491562,
-0.6154344081878662,
0.052707452327013016,
0.24590137600898743,
-0.16086271405220032,
0.19772969186306... | |
e.preventDefault(); // Stop the browser from following the link
location.href = $(this).attr('href')+'?id='+id+'&name='+name; // Build the URL
});
});
</script>
``` | [
-0.11494274437427521,
0.1602669507265091,
0.5865541100502014,
-0.24226601421833038,
0.1422279179096222,
-0.32539623975753784,
0.7538889646530151,
-0.07694259285926819,
0.11797766387462616,
-0.7211954593658447,
-0.6761283278465271,
0.40486812591552734,
-0.43612033128738403,
0.47428968548774... | |
I created a simple, 2 frame sprite animation based off a few tutorials that I found across the web. I took my 2 images, created a sprite sheet with plist and png file, and incorporated them into my code as seen below. This setup worked fine in Cocos2d V 1.0.1. I just upgraded my project to 2.0rc0a and now my app crashe... | [
0.5752619504928589,
0.13629338145256042,
0.5864626169204712,
0.10291334986686707,
-0.1373578906059265,
-0.17907366156578064,
0.3944564163684845,
-0.13726715743541718,
-0.2402367740869522,
-0.6423783898353577,
0.09832825511693954,
0.7317078113555908,
-0.4027416706085205,
0.0480784997344017,... | |
sure if it's the same thing that I'm doing wrong, and because I'm still very new to Cocos2d, am unsure how to correctly adjust my code. Is this something that was changed in 2.0 that I didn't see in the notes, a bug that I should report, or just incorrect coding on my part? I still have a copy of the 1.0.1 project with... | [
0.01939990371465683,
0.14775003492832184,
0.3282807171344757,
0.19465401768684387,
-0.12760385870933533,
0.18709571659564972,
0.5129743218421936,
-0.035600580275058746,
-0.5084053874015808,
-0.7718084454536438,
0.06403752416372299,
0.305774986743927,
-0.26370641589164734,
0.200158312916755... | |
stringWithFormat:@"chameleon%d.png", i]]];
}
CCAnimation *mouthAnim = [CCAnimation animationWithSpriteFrames:chameleonFrames delay:0.3f];
chameleon = [CCSprite spriteWithSpriteFrameName:@"chameleon1.png"];
CCAnimate *chameleonAction = [CCAnimate actionWithAnimation:mouthAnim];
CCDelayTime *chameleonDelay = [CCDelayTim... | [
0.0214619729667902,
0.03307273983955383,
0.35137149691581726,
0.2810828685760498,
-0.29303911328315735,
0.6528491973876953,
0.43304362893104553,
0.2739150822162628,
-0.47258609533309937,
-0.289842814207077,
-0.3223811089992523,
0.29529690742492676,
-0.11290890723466873,
0.21942514181137085... | |
the code to this and the animation goes from frame 1, to frame 2, then stays on 2 indefinitely. However, if I make the delay anything longer than 1.0, I receive the same error I was getting before. If I re-include `chameleonDelay` prior to the action without the repeat forever statement, I also get the same crash. It a... | [
0.3134865164756775,
-0.1492369920015335,
0.5076894760131836,
0.24396249651908875,
0.06980442255735397,
0.16669036448001862,
0.7808057069778442,
0.13624493777751923,
-0.5452086925506592,
-0.272161602973938,
-0.13659323751926422,
0.1529283970594406,
-0.2627287209033966,
0.23073527216911316,
... | |
back to frame 1 and sit for a while again.
Attempted code #2:
```
CCAnimation *mouthAnim = [CCAnimation animationWithSpriteFrames:chameleonFrames delay:0.3f]; //<--- maxes out at 1.0. Anything more causes crash
chameleon = [CCSprite spriteWithSpriteFrameName:@"chameleon1.png"];
CCAnimate *chameleonAction = [CCAnimate... | [
0.14722302556037903,
0.3416527509689331,
0.41618141531944275,
0.24269823729991913,
-0.3338536322116852,
0.41881170868873596,
0.530310869216919,
-0.14655539393424988,
-0.538208544254303,
-0.4819900691509247,
-0.22979339957237244,
0.41473230719566345,
-0.11437666416168213,
0.1631796360015869... | |
addSpriteFramesWithFile:@"front page/mainchameleon.plist"];
mainChameleon = [CCSpriteBatchNode batchNodeWithFile:@"front page/mainchameleon.png"];
[self addChild:mainChameleon z:7];
NSMutableArray *chameleonFrames = [NSMutableArray array];
//Frame 1 - closed mouth
[chameleonFrames addObject:[CCSpriteFrame frameWithTex... | [
-0.14311330020427704,
0.17141662538051605,
0.578042209148407,
0.11604808270931244,
-0.46943768858909607,
0.7661827802658081,
0.20738519728183746,
-0.15684914588928223,
-0.5091911554336548,
-0.6369158625602722,
-0.18420863151550293,
0.2566297948360443,
0.11656899005174637,
0.094913110136985... | |
adjustment to the if statement. This way requires coding each individual frame which seems counter-intuitive to using a plist. If no one is able to provide a better solution, or "real" answer in the next few days, I will post this as an answer and accept it to close out the question.
Here's the code I ended up with tha... | [
0.3770311772823334,
0.20657853782176971,
0.48268017172813416,
0.022466246038675308,
-0.029301049187779427,
0.14682164788246155,
0.21988604962825775,
-0.09391328692436218,
0.0053303842432796955,
-0.5217550992965698,
0.07156916707754135,
0.21703164279460907,
-0.23938876390457153,
-0.06068462... | |
apparent). To anyone else finding this thread, my original code was based on [Ray Wenderlich's sprite sheet tutorial](http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d).
```
CCSpriteBatchNode *chameleonBN = [CCSpriteBatchNode batchNodeWithFile:@"chameleonimages.png"];
[self addCh... | [
-0.28272077441215515,
0.1858963817358017,
0.5748786926269531,
0.008372452110052109,
-0.45736557245254517,
0.34848716855049133,
0.3876293897628784,
-0.325808048248291,
-0.20429247617721558,
-0.6071355938911438,
0.018082046881318092,
0.45166298747062683,
-0.16224917769432068,
0.1318890303373... | |
ccp(512,384);
CCAnimate *chameleonAnimate = [CCAnimate actionWithAnimation:mouthAnim];
CCDelayTime *chameleonDelay = [CCDelayTime actionWithDuration:10];
CCDelayTime *chameleonDelay2 = [CCDelayTime actionWithDuration:0.1];//Had to use this to ge tthe mouth to close. Using restore original frame doesn't work for me.
CC... | [
0.01936543732881546,
0.17007876932621002,
0.3674364686012268,
-0.07598153501749039,
-0.10934654623270035,
0.761552095413208,
0.617527961730957,
-0.05142400413751602,
-0.4130565822124481,
-0.3535398542881012,
-0.35472923517227173,
0.14529284834861755,
-0.04279089346528053,
0.286618024110794... | |
This works:
```
#sList li:visible {
background: rgba(255,255,136,0.5);
}
```
This works:
```
#sList li:nth-of-type(odd) {
background: rgba(255,255,136,0.5);
}
```
This doesn't:
```
#sList li:visible:nth-of-type(odd) {
background: rgba(255,255,136,0.5);
}
```
Hmm... any help?
**EDIT**: To elaborat... | [
0.003782072337344289,
-0.13674721121788025,
0.41384458541870117,
0.00502068130299449,
0.12960712611675262,
0.008348135277628899,
0.20228613913059235,
-0.11698643863201141,
-0.35895735025405884,
-0.8407185077667236,
0.0006320315296761692,
0.44711291790008545,
-0.5397565960884094,
-0.0865317... | |
I wanted to do something where on every `.keyup` of the search field the zebra striping is re-applied so that the list remains consistently striped.
Make sense?
How about this method to generate your random number:
```
srand(floor(time()/60/60/24/2));
$key = rand(0,count($pages)-1);
```
It fixes the seed for two da... | [
0.33760637044906616,
-0.23578691482543945,
0.08919712156057358,
0.11271658539772034,
0.36972054839134216,
0.17663636803627014,
0.16004177927970886,
-0.2655279040336609,
-0.2703225016593933,
-0.6339571475982666,
0.3247053921222687,
0.2989119589328766,
-0.303898423910141,
0.34260785579681396... | |
hi i have a while loop:
```
var i = 0;
while(i < 20)
{
function showi()
{
document.getElementById('tablei').style.display = 'block';
document.getElementById('hidei').style.display = 'block';
document.getElementById('showi').style.display = 'none';
}
function hidei()
{
... | [
0.037718515843153,
0.10836217552423477,
0.7817969918251038,
-0.42006415128707886,
0.04603911563754082,
-0.07466061413288116,
0.719622015953064,
-0.3585335910320282,
0.3653196394443512,
-0.3481941223144531,
-0.6011235117912292,
0.2485577017068863,
-0.3272145688533783,
0.293156236410141,
-... | |
know how I can get the i variable to show in the function names and getElementById.
```
function show(i)
{
document.getElementById('table' + i).style.display = 'block';
document.getElementById('hide' + i).style.display = 'block';
document.getElementById('show' + i).style.display = 'none'... | [
0.17434829473495483,
0.3198869228363037,
0.26831671595573425,
-0.42467743158340454,
0.2335519790649414,
-0.1317727267742157,
0.4694594442844391,
-0.29154956340789795,
0.1913684606552124,
-0.4699462056159973,
-0.47620218992233276,
0.47593939304351807,
-0.3786155879497528,
0.340696781873703,... | |
document.getElementById('show' + i).style.display = 'block';
}
```
It's better to make one function, which you can call by for example "show(1)" or "show(42)" | [
0.30424052476882935,
0.16999849677085876,
0.23123429715633392,
-0.31185272336006165,
-0.13237535953521729,
-0.24347208440303802,
0.08810020238161087,
-0.4397628605365753,
-0.08216296136379242,
-0.6129355430603027,
-0.33090120553970337,
0.3738296627998352,
-0.5834397077560425,
0.14297822117... | |
Is anyone else having this problem? <http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html> When i try to use an image and i upload the image it just turns out to be a grey box. I have tried in all different browsers and still no luck.
You probably have one of two issues.
1) To verify if the image is ... | [
0.46872517466545105,
0.21333354711532593,
0.0951976403594017,
0.018156398087739944,
-0.1207486167550087,
0.2262769341468811,
0.37060728669166565,
0.06293677538633347,
-0.3845687806606293,
-0.6329124569892883,
0.07661642134189606,
0.464108943939209,
-0.42540135979652405,
-0.1682158559560775... | |
guidelines](http://developer.android.com/design/patterns/actionbar.html). If you see your icon, but it is square instead of it's native 'shape' you have the second issue.
2) Use gif (or png) as your original and make sure you set the transparent color when you created it. | [
0.49692589044570923,
-0.3397061824798584,
0.3373076617717743,
-0.048026762902736664,
0.0026299229357391596,
-0.15603500604629517,
-0.08589127659797668,
-0.6910852193832397,
-0.33210256695747375,
-0.8554316163063049,
0.0179855078458786,
0.4311937987804413,
-0.5431591868400574,
-0.4437478184... | |
I've got UDPserver which waits for clients' requests and the sends response to them. In order to chech whether clients are online or not I need to send message to them.(to check it).
But!On client's pc user can choose some message and send it to server and then wait for response from server. How to make such a thing - ... | [
0.2642226219177246,
-0.24528571963310242,
0.5887556076049805,
-0.14413799345493317,
-0.3112686276435852,
-0.05291701480746269,
0.052993785589933395,
0.0355735644698143,
-0.2502742409706116,
-0.8032545447349548,
0.16487710177898407,
0.4361385405063629,
-0.33835265040397644,
0.42790070176124... | |
try{
//variable client we use it in every condition
Client obj = null;
ds = null;
//REGR - registration FNDI - find ip FNDM - find mask GETL - get all CHKA - check all
System.out.println("PORT - "); | [
-0.1513420045375824,
-0.33537501096725464,
0.2592329680919647,
-0.07122015953063965,
0.15622852742671967,
0.17249034345149994,
0.4511164724826813,
-0.25073832273483276,
0.17041142284870148,
-0.5030249357223511,
-0.2689116299152374,
0.5943090319633484,
-0.592070460319519,
0.1189485192298889... | |
int port = Integer.parseInt(new BufferedReader(new InputStreamReader(System.in)).readLine());
ds = new DatagramSocket(port);
//wait for user's choice
System.out.println("Commands - REGR,FNDI,FNDM,GETL,CHKA");
String cmd = new BufferedReader(new InputStreamReader(System.in... | [
-0.5728948712348938,
-0.36888495087623596,
0.7707993984222412,
-0.27108195424079895,
0.21316248178482056,
0.44531741738319397,
0.13341295719146729,
-0.20817911624908447,
-0.20272286236286163,
-0.5571879148483276,
-0.3379240334033966,
0.5436046719551086,
-0.3302987217903137,
0.3150844275951... | |
//sending data to server and waiting for its response
}
else if (cmd.equals("FNDI"))
{
//same
} | [
-0.12034668773412704,
-0.4577527344226837,
0.44184187054634094,
0.04865498095750809,
-0.08430837094783783,
0.1996546983718872,
-0.17772981524467468,
-0.22175629436969757,
-0.2432001680135727,
-0.5960131883621216,
0.10559335350990295,
0.32949593663215637,
-0.3004649579524994,
0.260919362306... | |
else if (cmd.equals("FNDM"))
{
//same
}
else if (cmd.equals("GETL"))
{
//same | [
-0.28899329900741577,
-0.15114304423332214,
0.5140932202339172,
-0.22784915566444397,
0.22438345849514008,
0.0021955722477287054,
-0.008413923904299736,
-0.3290383517742157,
-0.13915643095970154,
-0.5350958704948425,
-0.13404500484466553,
0.5223257541656494,
-0.2472301870584488,
0.05678763... | |
}
else if(cmd.equals("CHKA"))//CHKA
{
//same
}
}catch(Exception exc)
{
System.out.println(exc);
return; | [
-0.14258694648742676,
-0.22408191859722137,
0.07886795699596405,
-0.2998402714729309,
0.1805996149778366,
0.05701516568660736,
0.20335692167282104,
-0.2801688611507416,
-0.2036370187997818,
-0.257415771484375,
-0.3361265957355499,
0.38245144486427307,
-0.38045135140419006,
0.18804894387722... | |
}
finally
{
if (ds!=null)
ds.close();
}
}
```
Main server's loop
```
while(!stop){
myfile.write(aam.InputMsg.name());
System.out.println(aam.InputMsg);
DatagramPacket pack = new DatagramPacket(buf,buf.length);
socket.receive(pack); | [
-0.1394442468881607,
-0.30008238554000854,
0.7174456715583801,
-0.4855796694755554,
0.10681513696908951,
0.04125905781984329,
0.4969024658203125,
-0.17873473465442657,
-0.07953015714883804,
-0.5518829226493835,
-0.3959609866142273,
0.48070028424263,
-0.4033636152744293,
0.23934853076934814... | |
//ports.add(pack.getPort());
//object from pack
Object o = Deserialize.Deserialization(buf);
//ok. first - REGR - so check on Client
if (o instanceof Client)//registration
{
//perform some task
}
else if (o instanceof InetAddress)//find client by IP | [
0.014523737132549286,
-0.16819413006305695,
0.24883829057216644,
-0.1924940049648285,
0.07326283305883408,
-0.1272098571062088,
0.1997607797384262,
-0.47860535979270935,
-0.4136776924133301,
-0.5745832324028015,
-0.21055588126182556,
0.4557848572731018,
-0.5351389646530151,
0.3646670877933... | |
{
//same
}
else if (o instanceof String)//different messages - name to find, start test.
{
//same
}
else
{ | [
0.14683961868286133,
0.050669360905885696,
0.11069837957620621,
-0.1073538213968277,
-0.03282037749886513,
0.180625781416893,
0.36207231879234314,
-0.20670337975025177,
-0.13458062708377838,
-0.3746119439601898,
0.17920443415641785,
0.4787275791168213,
-0.21142740547657013,
0.1213061362504... | |
throw new Exception("SOME WRONG DATA FROM CLIENT");
}
}
System.out.println("Server stopped");
}
catch(Exception exc)
{
System.out.println(exc);
}
finally{
if (socket!=null){
socket.close();
}
}
}
```
In C/C++ sockets, you'd typically use a "select()" call to process whatever input h... | [
0.03261410817503929,
-0.14228776097297668,
0.14129918813705444,
-0.30272799730300903,
-0.053058136254549026,
-0.13425341248512268,
0.07412591576576233,
-0.20625558495521545,
-0.30605360865592957,
-0.5440641641616821,
-0.5176229476928711,
0.4823039472103119,
-0.3213678002357483,
0.237543061... | |
I'm using CCCrypt for encryption/decryption string values. It seems to work fine, because decrypted value equals initial one, but the problem is I can't extract proper NSString object from decrypted data.
```
@implementation NSData (AES256)
- (NSData *)AES256EncryptWithKey:(NSString *)key
{
char keyPtr[kCCKeySi... | [
-0.25807368755340576,
0.01968657225370407,
0.37303584814071655,
-0.14145375788211823,
0.16931943595409393,
0.05461172014474869,
0.40343067049980164,
-0.4762786030769348,
-0.3026742935180664,
-0.41345852613449097,
-0.2869371771812439,
0.48890987038612366,
-0.2729964256286621,
0.292686134576... | |
size_t numBytesEncrypted = 0;
CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding,
keyPtr, kCCKeySizeAES256,
NULL /* initialization vector (optional) */, | [
-0.2341700941324234,
-0.12142659723758698,
0.21407869458198547,
0.02170221507549286,
0.2480963170528412,
0.08359744399785995,
0.3125954866409302,
-0.21310515701770782,
-0.33384832739830017,
-0.18942447006702423,
-0.1886771023273468,
0.43730008602142334,
-0.3133695721626282,
0.2713576257228... | |
[self bytes], dataLength, /* input */
buffer, bufferSize, /* output */ | [
-0.1221316009759903,
-0.11698581278324127,
0.2254614233970642,
-0.15416474640369415,
-0.11416379362344742,
0.4547375440597534,
-0.12089776992797852,
-0.14308953285217285,
-0.20581020414829254,
-0.3765483796596527,
0.11295340955257416,
0.3891860544681549,
-0.3297060430049896,
0.011568579822... | |
&numBytesEncrypted);
if (cryptStatus == kCCSuccess) {
return [NSData dataWithBytesNoCopy:buffer length:numBytesEncrypted];
}
free(buffer); //free the buffer;
return nil;
}
- (NSData *)AES256DecryptWithKey:(NSString *)key {
char keyPtr[kCCKeySizeAES256+1]; // room for terminator (unused)
... | [
-0.3350711762905121,
-0.06988409161567688,
0.43955159187316895,
0.00820047315210104,
0.14047199487686157,
0.24470087885856628,
0.49522969126701355,
-0.7929642200469971,
-0.1860540211200714,
-0.06452225893735886,
-0.2636635899543762,
0.20780591666698456,
-0.1269788295030594,
0.3803316950798... | |
getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
NSUInteger dataLength = [self length];
size_t bufferSize = dataLength + kCCBlockSizeAES128;
void *buffer = malloc(bufferSize);
size_t numBytesDecrypted = 0;
CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, kCCAlgorithmAES... | [
-0.4828295409679413,
-0.1945115178823471,
0.37302088737487793,
0.03784385323524475,
0.23571625351905823,
0.3191356360912323,
0.35916668176651,
-0.2121228128671646,
-0.335167795419693,
-0.4937856197357178,
-0.4050503671169281,
0.36880728602409363,
-0.27225562930107117,
0.18382547795772552,
... | |
NULL /* initialization vector (optional) */,
[self bytes], dataLength, /* input */ | [
-0.11040548235177994,
-0.23286062479019165,
-0.029133155941963196,
0.008778193965554237,
-0.1818716675043106,
0.49407655000686646,
-0.03245373070240021,
-0.06480938196182251,
-0.061489809304475784,
-0.3141366243362427,
-0.1436145305633545,
0.40238988399505615,
-0.29144832491874695,
-0.1324... | |
buffer, bufferSize, /* output */
&numBytesDecrypted);
if (cryptStatus == kCCSuccess) {
//the returned NSData takes ownership of the buffer and will free it on deallocation
return [NSData dataWithBytesNoCopy:buffer length:numBytesDecrypted]; | [
-0.2693812847137451,
-0.2116462141275406,
0.4238415062427521,
-0.20109869539737701,
0.3425636291503906,
0.04191545769572258,
0.28245866298675537,
-0.43409907817840576,
-0.1770479679107666,
-0.2811034619808197,
-0.37844422459602356,
0.20525851845741272,
-0.15704551339149475,
0.3209340572357... | |
}
free(buffer); //free the buffer;
return nil;
}
```
I can't get what is done wrong so if anyone can help, I'll highly appreciate that.
And the second part of question - how can I set the CBC mode for AES encryption method. It's said in documentation that this mode is used by default but what should I pass... | [
0.4123552739620209,
0.2081940472126007,
0.16844598948955536,
0.2452690303325653,
0.07336226105690002,
-0.3445562720298767,
0.22001437842845917,
-0.11805297434329987,
-0.298573762178421,
-0.6484110951423645,
-0.016877027228474617,
0.6287018060684204,
-0.4614020884037018,
0.16115455329418182... | |
it is encrypted.
Same question with thorough answer: [Why does my initWithData return nil indicating an error after converting NSData to NSString returning from encrypting via CommonCrypto?](https://stackoverflow.com/questions/8815570/why-does-my-initwithdata-return-nil-indicating-an-error-after-converting-nsdata) tho... | [
-0.36349231004714966,
0.029685568064451218,
0.32902267575263977,
0.16757184267044067,
-0.19268041849136353,
-0.28482452034950256,
0.49424266815185547,
0.18374696373939514,
-0.15152038633823395,
-0.45104697346687317,
-0.05417824164032936,
0.29519692063331604,
-0.13867782056331635,
0.0170858... | |
How to sort this kind of input?
```
0.00159265291648695254
-0.00318530179313823899
0
0.00999983333416666468
0.00362937767285478371
0.00477794259012844049
-0.00637057126765263261
0.00681464007477014026
-0.00840724736714870645
-0.00522201549675090458
```
Either `sort -n data` and `sort -g data` procudes this:
```
0
0... | [
-0.3881119191646576,
0.3418232202529907,
0.3338329493999481,
0.08453735709190369,
-0.12894617021083832,
0.5106145739555359,
0.06092757731676102,
0.10914445668458939,
-0.3336246609687805,
-0.4610856771469116,
0.023927010595798492,
0.09497269243001938,
0.04447990655899048,
0.1908786147832870... | |
>
> 0,4 >
0,03 >
```
If you are writing a bash script, set the sorting routine to use the "normal" settings.
```
export LC_ALL=C
``` | [
-0.0124294338747859,
0.18176813423633575,
0.27752330899238586,
-0.3526187837123871,
0.3175559341907501,
-0.1510860025882721,
-0.009173390455543995,
-0.38245970010757446,
-0.29104742407798767,
-0.7145392894744873,
-0.4660526216030121,
0.5308743119239807,
-0.41898491978645325,
-0.06066462397... | |
I am trying to play with `jQuery` `mouseenter` and `mouseleave` events but failing.
Here is what I am trying to do
```
$("#selector").mouseenter(function(){
some code....
jQuery(this).off('mouseenter');
}
);
$("#selector").mouseleave(function(){
some code....
jQuery(this).on('mouseenter')... | [
0.20169438421726227,
-0.007052607834339142,
0.31310296058654785,
-0.14267441630363464,
0.4422909915447235,
-0.14238594472408295,
0.5023519992828369,
0.03910462558269501,
-0.06834183633327484,
-0.8154191970825195,
0.039115775376558304,
0.8929139971733093,
-0.38319745659828186,
0.02579677104... | |
I try to click on button in the tooltip it calls `mouseenter` event and so tooltip is appended again in the div.
So I am calling `.off()` event once tooptip is called till mouse doesn't leave selector.
Let me know if you need more information.
Thx again.
You need to rebind the event to a handler. `$(this).on('mousee... | [
-0.07824140042066574,
-0.4039607346057892,
0.30737197399139404,
-0.3383455276489258,
0.29078438878059387,
-0.12634526193141937,
0.4075041711330414,
-0.2368493378162384,
-0.1604422777891159,
-0.7276368737220764,
-0.21570204198360443,
0.8014034032821655,
-0.4474249482154846,
-0.0758918449282... | |
code....
}
```
**Edit:** what you are trying to do can be achieved using `.hover` or simply implementing `.mouseenter` and `.mouseleave` functions. No need to `bind/unbind` as these function called once on mouseenter and mouseleave. | [
0.2603066563606262,
0.09031570702791214,
0.3158521056175232,
0.1604962944984436,
0.08014810085296631,
-0.4314979016780853,
0.4300880432128906,
-0.04085936397314072,
0.04689548909664154,
-0.7335407733917236,
-0.19642779231071472,
0.5745349526405334,
-0.17321304976940155,
-0.0636625438928604... | |
I understand the theory behind the factory design pattern now, but can't seem to find any realistic examples of it's use. Can someone be as kind enough as to provide one?
There are a few variants of factory designs: abstract factory, factory method, etc... Since you're interested in a real-world example, I thought I'd ... | [
0.692802369594574,
0.04189563915133476,
-0.4122627377510071,
0.1730082780122757,
-0.18673425912857056,
0.5332214832305908,
-0.016703739762306213,
0.03262324631214142,
-0.25705352425575256,
-0.5588144659996033,
0.3529629409313202,
0.31362080574035645,
-0.42687147855758667,
0.410174995660781... | |
data class.
This is the method within my DataAccessFactory class. It is responsible for determing which data class to use, and returning it to the caller:
```
public static T GetDataInterface<T>() where T : class
{
Assembly assembly = Assembly.GetExecutingAssembly();
T theObject = (from t in assembly.GetType... | [
0.24866384267807007,
-0.2852538228034973,
0.4030500650405884,
-0.20390921831130981,
-0.08380882441997528,
-0.002244489034637809,
0.5330113172531128,
-0.41639137268066406,
0.13537172973155975,
-0.5638033747673035,
-0.2416200339794159,
0.7952483892440796,
-0.5070188045501709,
0.4062124788761... | |
&& t.Namespace == _namespace
select Activator.CreateInstance(t) as T).FirstOrDefault() as T;
return theObject as T;
}
```
And this is how one of my business logic classes makes a DAL request:
```
return DataAccessFactory.GetDataInterface<IApplicationData>().GetAll();
```
The business logic ... | [
0.1077931821346283,
-0.2538072466850281,
0.3836205303668976,
-0.10157239437103271,
0.10820253193378448,
0.22220908105373383,
0.13620351254940033,
-0.3576471209526062,
0.010380702093243599,
-0.4339051842689514,
-0.25607040524482727,
0.3777559995651245,
-0.19665832817554474,
0.18570429086685... | |
Like the title says, I need a way to detect if the build is in adhoc, release or distribution since I am using keychain-access-groups for each type of build I am using a different provisiong so the bundle seed id are different. I just need an effective way to switch this on certain build.
Go to the target you want to t... | [
0.7077332735061646,
-0.10652061551809311,
0.2787338197231293,
-0.04370361566543579,
0.03383326157927513,
-0.22216035425662994,
0.22895996272563934,
-0.19448605179786682,
-0.33361122012138367,
-0.6394708752632141,
-0.17637689411640167,
0.5090580582618713,
-0.19841240346431732,
0.19706746935... | |
in your code drop in an if statement like this:
```
#if DEBUG==1
// do debug build settings stuff there
#endif
#if RELEASE==1
// do release build settings stuff there
#endif
``` | [
0.47785335779190063,
0.10116694867610931,
0.08118025213479996,
-0.21369963884353638,
0.31320199370384216,
-0.12284848093986511,
0.44281667470932007,
-0.0012579711619764566,
-0.08994942158460617,
-0.2429007887840271,
-0.4344787299633026,
0.4926120936870575,
-0.24166695773601532,
-0.06921254... | |
I have error in line 2 and 13 in PHP 5.2, I have no idea to make the correction, I tried using create\_function but not working, can anyone help with this?
```
function _process_special_keyword($str){
$callback = function($match){
$ret = $match[1] . '[' . $match[2] . ']';
if(!empty($match[3])){
$r... | [
-0.05789128690958023,
0.13091020286083221,
0.7400722503662109,
-0.4928530752658844,
0.03840231895446777,
0.10237354040145874,
0.8191027641296387,
-0.32749271392822266,
0.066363625228405,
-0.3482150733470917,
-0.31603682041168213,
0.9598162174224854,
-0.4872880280017853,
0.10254716873168945... | |
};
$strSQL = preg_replace_callback('/([\s\(\.,])(' . SPECIAL_KEYWORDS . ')(?:\.(' . SPECIAL_KEYWORDS . '))?([\s\)\.,])/i', $callback, $str);
$callback = function($match){
return 'CASE WHEN ' . $match[1] . ' THEN ' . $match[2] . ' ELSE ' . $match[3] . ' END';
};
$strSQL = preg_replace_callback('/if\s... | [
-0.4425392746925354,
-0.14858224987983704,
0.6490359902381897,
-0.580284833908081,
-0.00561827328056097,
0.11924111843109131,
0.285818874835968,
-0.3337501287460327,
0.14842775464057922,
-0.30628055334091187,
-0.6078953146934509,
0.9148487448692322,
-0.5848761200904846,
0.04186088964343071... | |
}
$ret .= $match[4];
return $ret;
}
function _callback_two($match){
return 'CASE WHEN ' . $match[1] . ' THEN ' . $match[2] . ' ELSE ' . $match[3] . ' END';
}
function _process_special_keyword($str){
$strSQL = preg_replace_callback('/([\s\(\.,])(' . SPECIAL_KEYWORDS . ')(?:\.(' . SPECIAL_KEYWORDS ... | [
-0.46411943435668945,
-0.10238882154226303,
0.6950769424438477,
-0.5153206586837769,
-0.028621915727853775,
0.2679401934146881,
0.09081098437309265,
-0.49722039699554443,
-0.24061238765716553,
-0.37917444109916687,
-0.7371073365211487,
0.9350212216377258,
-0.4461677074432373,
0.00794222019... | |
preg_replace_callback('/([\s\(\.,])(' . SPECIAL_KEYWORDS . ')(?:\.(' . SPECIAL_KEYWORDS . '))?([\s\)\.,])/i', array($this, '_callback_one'), $str);
$strSQL = preg_replace_callback('/if\s*\((.+),(.+),(.+)\)/i', array($this, '_callback_two'), $strSQL);
return $strSQL;
}
``` | [
-0.19340233504772186,
0.012900643050670624,
0.8069588541984558,
-0.5483041405677795,
0.14015762507915497,
0.257932186126709,
0.20124945044517517,
-0.2954551875591278,
-0.07773839682340622,
-0.41181936860084534,
-0.6802377104759216,
0.9855228066444397,
-0.5661762952804565,
0.019570510834455... | |
This feature is available in [MySQL as shown in this post](https://stackoverflow.com/questions/4067113/how-to-insert-multiple-rows-in-single-insert-statement) and according to the [Sybase documentation](http://dcx.sybase.com/1200/en/dbreference/insert-statement.html) it should also be supported, however Sybase don't pr... | [
0.2526959478855133,
0.053848374634981155,
0.17738471925258636,
0.00874265655875206,
0.1628635674715042,
0.014627723023295403,
0.28889769315719604,
-0.17320303618907928,
-0.22304514050483704,
-0.5611940622329712,
-0.2079268991947174,
0.746048092842102,
-0.49374058842658997,
-0.1877958327531... | |
',' on line 7
```
I'm using Sybase ASE 15 and cannot see any reference to inserting multiple rows [on this support page for the INSERT statement](http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.commands/html/commands/commands62.htm)
Is this feature available in Sybase?
Your first Sybase d... | [
0.1431259959936142,
-0.09509540349245071,
0.36174276471138,
-0.11666461825370789,
0.030081897974014282,
0.4055103361606598,
-0.09432193636894226,
-0.06133073940873146,
-0.6207781434059143,
-0.5030028223991394,
-0.03481646627187729,
0.565818190574646,
-0.3915584087371826,
-0.053001426160335... | |
I want to get the function that only refreshes one cell of GridView
Currently I am using baseAdapter.notifyDataSetChanged() which refreshes whole grid , and I have to do this even I have only cell having different data
How can I do it
have you ever tried something like:
```
<input name="header[]" />
<input name="heade... | [
0.3859471380710602,
-0.26846328377723694,
0.17649038136005402,
-0.01929413713514805,
-0.3932933807373047,
-0.20752473175525665,
0.5456468462944031,
-0.40653863549232483,
-0.24597124755382538,
-0.5317206978797913,
0.3406828045845032,
0.30542701482772827,
-0.4371541440486908,
0.1142861843109... | |
using the code you showed above.
```
$fieldCount = count($_POST['header']);
for ($i = 0; $i < $fieldCount; $i++) {
$sql = 'UPDATE about SET about_header = \''.$_POST['header'][$i].'\', about_content = \''.$_POST['post'][$i].'\' WHERE about_id = \''.$_POST['id'][$i].'\'';
mysql_query($sql);
}
``` | [
0.46123507618904114,
-0.013883552514016628,
0.5418334603309631,
-0.10481316596269608,
0.16511887311935425,
-0.22203510999679565,
0.22586767375469208,
-0.4080761969089508,
0.10059510916471481,
-0.5104228854179382,
-0.2703477740287781,
0.7641646862030029,
-0.5468851923942566,
0.2453309148550... | |
I am having some problems getting only a date to show in my table..
I got some help on a previous question, but ran into another problem. These are the things we have added:
```
((BoundField)gvEmployeeReview.Columns[1]).DataFormatString = "{0:d}"; //date hired column
((BoundField)gvEmployeeReview.Columns[8]).DataForm... | [
-0.16506876051425934,
-0.0457579605281353,
0.6487635970115662,
-0.13707643747329712,
-0.00036613381234928966,
0.07548071444034576,
0.0763334259390831,
-0.3692634105682373,
-0.3227703869342804,
-0.53194659948349,
-0.03534737601876259,
0.026247913017868996,
-0.31713083386421204,
0.0548436008... | |
current web request. Please review the stack trace for more information about the error and where it originated in the code.
>
>
> Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
>
> Parameter name: index" and its on th... | [
-0.06697313487529755,
-0.08590487390756607,
0.7775810956954956,
0.13638171553611755,
0.006241772789508104,
0.08387676626443863,
0.4017433226108551,
-0.10276181995868683,
-0.33016932010650635,
-0.8141518235206604,
-0.01605699211359024,
0.1809021681547165,
-0.23979754745960236,
0.34821304678... | |
easier..had to change a bit of the code...but it all turned out good..thanks for all the input | [
0.23702259361743927,
0.22943049669265747,
-0.0932130292057991,
0.48258498311042786,
0.16232775151729584,
0.21057403087615967,
0.44691717624664307,
0.008202841505408287,
-0.11568956822156906,
-0.38755935430526733,
0.1730259209871292,
0.6326902508735657,
0.11707240343093872,
-0.2614016234874... | |
I want to be able to parse a string to an object that I can access using the dot notation e.g. myobject.property, instead of the array notation e.g. myobject['property']. The array notation works fine. Here's what I have so far.
I have some XML:
```
<level1 name="level1name">
<level2 type="level2Type">
<entry>l... | [
-0.16034401953220367,
-0.042803119868040085,
0.36035221815109253,
-0.004699843470007181,
-0.01304253563284874,
-0.22483445703983307,
0.1210164874792099,
-0.18103717267513275,
0.03802326321601868,
-0.866716206073761,
-0.21733331680297852,
0.41036996245384216,
0.011577668599784374,
-0.138141... | |
"level2entry"
]
}
}
}
```
I have the following Dart code:
```
Object jsonObject = JSON.parse("""{
"level1": {
"name": "level1name",
"level2": {
"type": "level2Type",
"entry": [
"level2entry",
"level2entry" | [
-0.46944671869277954,
-0.03683791309595108,
0.4282265305519104,
-0.37019309401512146,
0.3252458870410919,
-0.21212251484394073,
0.27032262086868286,
-0.21292589604854584,
-0.05293569713830948,
-0.6745489239692688,
-0.08203529566526413,
0.5148641467094421,
-0.2937026023864746,
-0.2455610185... | |
]
}
}
}
""");
print("my test 1 == ${jsonObject}");
print("my test 2 == ${jsonObject['level1']}");
print("my test 3 == ${jsonObject['level1']['name']}");
```
which produce the (desired) output:
```
my test 1 == {level1: {name: level1name, level2: {type: level2Type, entry: [level2entry, level2... | [
-0.00016007115482352674,
0.04976397380232811,
0.3942979574203491,
0.05066820606589317,
0.3544926047325134,
-0.015757085755467415,
0.5793775916099548,
-0.4046829640865326,
0.16071948409080505,
-0.6736175417900085,
-0.2422347217798233,
0.6035030484199524,
-0.047450460493564606,
-0.2213818728... | |
0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:717 col:3
```
Ideally, I want an object that I can access using the dot notation and without the compiler giving warning about Object not having property. I tried the following:
```
class MyJSONObject extends Object{
Level1 _level1;
Level1 get level1() => ... | [
-0.36207062005996704,
-0.25105834007263184,
0.710494875907898,
-0.14853902161121368,
0.3154533803462982,
-0.3658488392829895,
0.5257436633110046,
-0.36187654733657837,
-0.0003295229107607156,
-0.8235660195350647,
-0.4712623953819275,
0.3254498243331909,
-0.30583053827285767,
0.103724896907... | |
"level2": {
"type": "level2Type",
"entry": [
"level2entry",
"level2entry"
]
}
}
}
""");
...
print("my test 1 == ${jsonObject.level1.name}");
```
but instead of giving me 'level1name' as hoped, I get:
```
Exception: type 'LinkedHashMapImplementat... | [
-0.02216986007988453,
-0.06874337792396545,
0.3377089202404022,
-0.08515676110982895,
0.3951636850833893,
-0.30484476685523987,
0.6391172409057617,
-0.1958284080028534,
0.1136462390422821,
-0.4554898142814636,
-0.20025292038917542,
0.2989349067211151,
-0.3564547002315521,
0.198613494634628... | |
of 'jsonObject'.
```
What am I doing wrong here? Is there any way to do what I'm trying? Thanks.
At the moment, JSON.parse only returns Lists (array), Maps, String, num, bool, and null
([api ref](http://api.dartlang.org/json/JSON.html#parse)).
I suspect that until reflection makes it way into the language, it won't ... | [
-0.1045842319726944,
-0.004466695711016655,
0.16360704600811005,
-0.35318782925605774,
-0.39294153451919556,
-0.16920489072799683,
0.4512757658958435,
-0.26496872305870056,
-0.17110268771648407,
-0.5771854519844055,
-0.03226625174283981,
0.7187207341194153,
-0.5152851939201355,
-0.31738251... | |
var level2;
}
class MyJSONObject {
Level1 level1;
MyJSONObject(jsonString) {
Map map = JSON.parse(jsonString);
this.level1 = new Level1();
level1.name = map['level1']['name'];
level1.level2 = new Level2();
level1.level2.type = map['level1']['level2']['type'];
//etc...
}
}... | [
-0.43003880977630615,
-0.4608876407146454,
0.450124055147171,
-0.23536185920238495,
0.2004327028989792,
-0.11740098148584366,
0.8100612163543701,
-0.21483595669269562,
-0.3124164640903473,
-0.8260407447814941,
-0.3931405246257782,
0.39227190613746643,
-0.6042240858078003,
-0.05036668479442... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.