text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
tapes_in_drives=`ssh srv-reg-nbms-01 "echo 's d q'|/usr/openv/volmgr/bin/tldtest -r /dev/smc0|grep 'Barcode'" | awk '{print $3}' && ssh srv-reg-nbms-02 "echo 's d q'|/usr/openv/volmgr/bin/tldtest -r /dev/smc0|grep 'Barcode'" | awk '{print $3}'` if [ $debug -eq 1 ]; then echo "" echo "Tapes in Drives:" echo...
[ 0.13646464049816132, 0.23254141211509705, 0.22002333402633667, -0.10358499735593796, 0.022816583514213562, 0.0890665054321289, 0.42555496096611023, -1.1331977844238281, -0.5597688555717468, -0.15012221038341522, -0.0950801819562912, 0.5554009675979614, -0.28455713391304016, 0.2466733008623...
SP0936 SP0983 SP0995 SP1001 SP1004 SP1008 SP1015 SP1017 SP1026 SP1033 SP1036 SP1038 SP0042 SP0049 SP0150 SP0462 SP0473 SP0517 SP0557 SP0560 SP0642 SP0659 SP0697 SP0712 SP0723 SP0766 SP0777 SP0786 SP0788 SP0792 SP0907 SP0910 SP0923 SP0925 SP0926 SP0940 SP0963 SP0981 SP0986 SP0989 SP0994 SP0999 SP1007 SP1020 SP1021 SP102...
[ -0.45459693670272827, 0.10827668756246567, 0.48682495951652527, 0.5708466172218323, -0.3016924262046814, 0.14003753662109375, 0.2334255427122116, -0.9605574607849121, -0.8477779626846313, -0.013764112256467342, -0.15332017838954926, 0.65817791223526, 0.03279298171401024, 0.2255496382713318...
SP0697 SP0712 SP0723 SP0766 SP0777 SP0786 SP0788 SP0792 SP0907 SP0910 SP0923 SP0925 SP0926 SP0940 SP0963 SP0981 SP0986 SP0989 SP0994 SP0999 SP1007 SP1020 SP1021 SP1027 SP1039 As you can see, the tape names from tapes\_in\_drives are not being removed from the tapes array. As a comment said, it's just syntax errors. S...
[ 0.06499432027339935, 0.10983456671237946, 0.6279065608978271, 0.31018686294555664, 0.08160445094108582, 0.08839862048625946, 0.09299083799123764, -0.6246727108955383, -0.8111650943756104, -0.366003155708313, -0.016518332064151764, 0.6587088704109192, -0.194487527012825, 0.21693859994411469...
tapes=(${tapes[@]//*$i*}) done ``` Results: ``` $ echo ${tapes[0]} SP0001 $ echo ${tapes[1]} SP0002 $ echo ${tapes[2]} SP2000 $ echo ${tapes[3]} SP3000 $ echo ${tapes[4]} $ ``` **EDIT** to respond to the edit in the question This line: ``` export tapes=`vmquery -rn 1 -b | tail +4 | awk '{print \$1}' && vmquery ...
[ 0.24772778153419495, 0.14645333588123322, 0.34583351016044617, 0.04700732231140137, 0.08338072150945663, 0.13250623643398285, 0.006072640884667635, -0.8716740012168884, -0.5064200758934021, -0.26362451910972595, -0.15665635466575623, 0.600409746170044, -0.4354992210865021, 0.04042937234044...
loop won't work. You can also drop the `export`, it isn't necessary unless you want processes spawned by the script to inherit those shell variables as environment variables. ``` tapes=(`vmquery -rn 1 -b | tail +4 | awk '{print \$1}' && vmquery -rn 4 -b | tail +4 | awk '{print \$1}'`) tapes_in_drives=(`ssh srv-reg-nb...
[ 0.2986590564250946, -0.16077283024787903, 0.2627626955509186, -0.044000573456287384, 0.4348684847354889, -0.0426175482571125, 0.6550397276878357, -0.455788254737854, -0.1653178483247757, -0.14469391107559204, -0.17120033502578735, 0.5849488377571106, -0.8444845080375671, 0.252987265586853,...
I have a form with jquery validation. I have some custom rules, but they all check out and work fine on other forms. In fact, it works just fine on THIS form except for one specific situation. We have a text input for a URL. We wrote a regex to disallow script tags. And it works fine. If you fill out the form with err...
[ 0.6130934357643127, 0.1385890692472458, 0.4378437101840973, 0.1770188808441162, -0.1236099824309349, -0.24786286056041718, 0.23196668922901154, -0.009857083670794964, 0.031309012323617935, -0.5571075677871704, 0.08301021158695221, 0.5466085076332092, 0.07583757489919662, -0.057990230619907...
appears but then the form submits anyway. If you tab away from the field first, you see the error message. But clicking "save" still saves the form. I've tried using a page load function to disable the form action and to replace the action with a check if the form is valid. If you leave the form blank and click save, ...
[ 0.3327307403087616, 0.2415497750043869, 0.6075831651687622, -0.2712998688220978, 0.055117107927799225, -0.043018776923418045, 0.5031901597976685, -0.09939011186361313, -0.08494868874549866, -0.7368025183677673, 0.1455739438533783, 0.6062307953834534, 0.11961070448160172, 0.0140689853578805...
action="/some/path" method="post" enctype="multipart/form-data"> <input class="btnSave" type="submit" value="Save" /> </form> ``` Here is my attempt to change the submit action to disable the default action until it is clicked when the form passes validation: ``` //bind custom form action $('#frmCreateNewAd').bind...
[ 0.12439493089914322, -0.25689786672592163, 0.6145390868186951, -0.28947919607162476, -0.03894096240401268, 0.1311427652835846, 0.6353229880332947, -0.742009162902832, -0.2327415943145752, -0.40435996651649475, -0.43026572465896606, 0.57539302110672, -0.239832803606987, -0.03818242251873016...
the exact same results ``` //bind custom form action $('#frmCreateNewAd').bind("submit", function(e){ //disable default action e.preventDefault(); //remove previous validation data $('#frmCreateNewAd').removeData("previousValue"); //validate form $('#frmCreateNewAd').valid(); }); //When user submits form ...
[ 0.2058105319738388, -0.02530916966497898, 0.7025168538093567, -0.3134116530418396, -0.0752246081829071, 0.0808505266904831, 0.6270909309387207, -0.8361307382583618, -0.10889998823404312, -0.4143052399158478, -0.3309481739997864, 0.6327409744262695, -0.10288823395967484, 0.26246967911720276...
to overcome this problem? UPDATE: Validator code: From a global file: ``` if ($.validator) { $.validator.messages.required = 'Required field'; $.validator.addMethod("zipcode", function(postalcode, element) { return this.optional(element) || postalcode.match(/(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXYabceghjkl...
[ -0.25727781653404236, -0.006642542779445648, 0.5430508852005005, -0.09566258639097214, 0.2978091835975647, 0.1884259730577469, 0.3943673372268677, -0.4024811089038849, -0.16942495107650757, -0.5009634494781494, -0.6188821196556091, 0.3468731641769409, -0.5421398878097534, -0.07941261678934...
(\'\"-,_.#/?) are allowed.' ); $.validator.addMethod("alphaspaces", function alphaspaces(value, element) {return this.optional(element) || value.match(/^[A-Za-z]+(\s[A-Za-z]+)*$/); }, 'Only letters and single spaces are allowed.'); $.validator.addMethod("alphaspspaces", function alphaspspaces(value, element) {r...
[ -0.013316510245203972, 0.094704270362854, 0.4315149784088135, 0.09200548380613327, 0.18251970410346985, 0.2802429497241974, 0.22078171372413635, 0.05290260910987854, -0.23732919991016388, -0.3066376745700836, -0.5380847454071045, 0.1519351601600647, -0.507329523563385, -0.02652918174862861...
$.validator.addMethod("isDollars", function isDollars(value, element) {return this.optional(element) || value.match(/[0-9]+(\.[0-9]{2})?$/); }, 'Must be a valid dollar amount, with or without decimal.'); $.validator.addMethod("keywords", function keywords(value, element) {return this.optional(element) || value.matc...
[ 0.06295554339885712, 0.24371963739395142, 0.7063396573066711, -0.09161695092916489, 0.17632454633712769, 0.15299585461616516, 0.14368602633476257, -0.45575764775276184, -0.08145389705896378, -0.14215189218521118, -0.4276092052459717, 0.3753902316093445, -0.26075664162635803, 0.069082118570...
}, 'Please remove leading or trailing quotes'); $.validator.addMethod("phoneNum", function phoneNum(value, element) {return this.optional(element) || value.match(/^(1-|1\.|1)?(\([0-9]{3}\)|[0-9]{3})[\.\-]?[0-9]{3}[\.\-]?[0-9]{4}$/); }, 'Please enter a valid phone number, with or without hyphens (-), periods (.), or...
[ 0.024067699909210205, -0.10395050793886185, 0.36642783880233765, -0.13209128379821777, 0.29996657371520996, 0.14408093690872192, 0.5310119390487671, -0.3569934666156769, 0.18588761985301971, -0.2940589189529419, -0.404448002576828, 0.6341378688812256, -0.3399833142757416, -0.21338014304637...
document.createElement('div'); $(errorTop).addClass('errorTop'); var topSpan = document.createElement('span'); var errorContent = document.createElement('div'); $(errorContent).addClass('errorContent'); var errorBottom = document.createElement('div'); $(errorBottom).addClass('errorBottom'); ...
[ 0.30752095580101013, -0.028077444061636925, 0.7058910727500916, -0.0391797199845314, 0.07762827724218369, 0.34052643179893494, 0.6286547183990479, -0.6848020553588867, -0.17276786267757416, -0.6030790209770203, -0.5393639206886292, 0.5411205291748047, -0.4515667259693146, 0.067125432193279...
errorPlacement: function(error, element) { if ($(element).attr("name") == "remnantList") { $(element).parent().nextAll('.errorWrap').children('.errorContent').append(error); }
[ -0.13036277890205383, -0.07254227250814438, 0.07085227221250534, -0.15564411878585815, 0.755745530128479, 0.5058692097663879, 0.43597179651260376, -0.05891698598861694, -0.12971772253513336, -0.5128986239433289, -0.37329649925231934, 0.46522244811058044, -0.008683967404067516, 0.3597274720...
else { $(element).nextAll('.errorWrap').children('.errorContent').append(error); } }, highlight: function(element) {
[ -0.2579415738582611, -0.16511733829975128, -0.17125315964221954, -0.26558181643486023, 0.5277953743934631, 0.3972029387950897, 0.4019675552845001, -0.18404901027679443, 0.002918063895776868, -0.5640916228294373, -0.35164257884025574, 0.5356831550598145, -0.3132515549659729, -0.114631585776...
if ($(element).attr("name") == "remnantList") { $(element).parent().nextAll('.errorWrap').removeClass('hideError'); } else { $(element).nextAll('.errorWrap').removeClass('hideError');
[ -0.19893279671669006, -0.4180273711681366, -0.1408034861087799, -0.2619985342025757, 0.7217916250228882, 0.08949737995862961, 0.44738706946372986, -0.1384008526802063, 0.03903032839298248, -0.3029029667377472, -0.4798896908760071, 0.4973325729370117, -0.2297269105911255, 0.3825739026069641...
} }, unhighlight: function(element) { if ($(element).attr("name") == "remnantList") { $(element).parent().nextAll('.errorWrap').addClass('hideError');
[ -0.11581557989120483, -0.29925888776779175, 0.007439287379384041, -0.4598237872123718, 0.6338600516319275, 0.16281285881996155, 0.5628999471664429, -0.1852232813835144, 0.058859262615442276, -0.4196104109287262, -0.40568602085113525, 0.5180227160453796, -0.3165005147457123, 0.4065341651439...
} else { $(element).nextAll('.errorWrap').addClass('hideError'); }
[ -0.2989955246448517, -0.38726335763931274, -0.36279183626174927, -0.32888010144233704, 0.4567092955112457, 0.018217556178569794, 0.6187707781791687, -0.23480042815208435, 0.060329124331474304, -0.44699209928512573, -0.24108262360095978, 0.6865631937980652, -0.4278332591056824, -0.080896176...
}, onkeyup: false }); ``` From js file specific to the page: ``` $('form').validate({ errorElement: 'span', onkeyup: true, onfocusout: true, rules: {
[ 0.03262551501393318, -0.013732894323766232, 0.6988949179649353, -0.1261870563030243, 0.15836764872074127, -0.14625763893127441, 0.5646189451217651, -0.4394611418247223, -0.34991714358329773, -0.5397308468818665, -0.5295989513397217, 0.7470924258232117, -0.3391241431236267, -0.0540781095623...
'adName': { required: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } }, maxlength:200 }, 'adText': { alphanumspchars: true, maxlength:1000, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, ...
[ -0.040665410459041595, -0.19086985290050507, 0.5786575675010681, -0.45713984966278076, -0.21028898656368256, 0.23611095547676086, 0.32217010855674744, -0.6625949740409851, 0.3908349871635437, -0.5207067728042603, -0.35831233859062195, 0.8642022609710693, -0.3805695176124573, -0.05729233473...
'thirdPartyClickTrackingUrl': { noScript: true, noQuoteWrap: true, maxlength:1000, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.destinationUrlView': { required: { depends: destinationUrlRequired }, noQuoteWrap: { depends: isBannerAndFi...
[ -0.10505779832601547, -0.49524104595184326, 0.7573607563972473, -0.23896272480487823, -0.03009795770049095, 0.029602879658341408, 0.4354622960090637, -0.24592410027980804, 0.0012357691302895546, -0.589222252368927, -0.059847354888916016, 0.5452864170074463, -0.27121686935424805, -0.0121705...
'bannerAdCommand.destinationFile': { required: { depends: isBannerAndDestinationFile }, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[0].multipartFile': { required: { depends: requiredFileUpload }, accept:'jpg|gif|png', spac...
[ 0.14840932190418243, -0.2490440160036087, 0.5915237665176392, -0.1968904435634613, -0.6039512753486633, -0.0885201245546341, 0.22138051688671112, -0.5353826284408569, -0.1671760380268097, -0.4866124093532562, -0.4538877308368683, 0.5803792476654053, -0.3905109167098999, -0.2275445312261581...
'bannerAdCommand.bannerFiles[2].multipartFile': { required: { depends: requiredFileUpload }, accept:'jpg|gif|png', spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[3].multipartFile': { required: { depends: requiredFileUpload },...
[ 0.18818777799606323, -0.22425960004329681, 0.5663629770278931, -0.09489917010068893, -0.6733106970787048, -0.09550578892230988, 0.18830381333827972, -0.672441840171814, -0.1918100267648697, -0.4840378761291504, -0.4849770963191986, 0.6997703313827515, -0.30226975679397583, -0.2624129056930...
depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[5].multipartFile': { required: { depends: requiredFileUpload }, accept:'jpg|gif|png', spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, ...
[ 0.5197294354438782, -0.23570068180561066, 0.6341168880462646, -0.23077410459518433, -0.24727453291416168, 0.22945784032344818, -0.020477965474128723, -0.6693660020828247, -0.18487168848514557, -0.5299496054649353, -0.03733650967478752, 0.9367353916168213, -0.3017359972000122, -0.1839331984...
'videoAdCommand.interactions[0].destinationUrl': { required: { depends: isVideoAndVisible }, maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'videoAdCommand.interactions[1].destinationUrl': { required: { depends: isVideo...
[ 0.22418414056301117, -0.4485095739364624, 1.020274043083191, 0.18544991314411163, -0.03280645236372948, 0.14082375168800354, 0.03289318457245827, -0.2236313372850418, -0.12493710964918137, -0.4329020082950592, -0.21799251437187195, 0.9599241614341736, -0.4536250829696655, 0.086179763078689...
return false; } } }, 'videoAdCommand.interactions[3].destinationUrl': { required: { depends: isVideoAndVisible }, maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'videoAdCommand.interactions[4].destin...
[ 0.2073044627904892, -0.3408433794975281, 0.7592194676399231, 0.21133266389369965, 0.0781363695859909, 0.21468904614448547, 0.07019422948360443, -0.2028108686208725, -0.265362411737442, -0.4045512080192566, -0.14822661876678467, 0.8642682433128357, -0.3010350465774536, 0.0795682743191719, ...
'bannerAdCommand.bannerFiles[0].destinationUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[1].destinationUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() {...
[ 0.06671677529811859, -0.29325607419013977, 0.759203314781189, -0.29934433102607727, -0.14710673689842224, 0.06991056352853775, 0.284145325422287, -0.1677302122116089, -0.017021600157022476, -0.5212314128875732, -0.30775389075279236, 0.5264946818351746, -0.2972998023033142, -0.0512168481945...
'bannerAdCommand.bannerFiles[3].destinationUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[4].destinationUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() {...
[ 0.061893265694379807, -0.3515900671482086, 0.8374601006507874, -0.3360176980495453, -0.2248927503824234, 0.08864058554172516, 0.3672902584075928, -0.29394933581352234, -0.016203368082642555, -0.5407214760780334, -0.29014724493026733, 0.6009690165519714, -0.31287333369255066, -0.10304382443...
'bannerAdCommand.bannerFiles[1].thirdpartyImpressionUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[2].thirdpartyImpressionUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { dep...
[ 0.1968662589788437, -0.236215740442276, 0.7421137094497681, -0.4883834719657898, -0.3998052477836609, 0.007078885100781918, 0.41350898146629333, -0.5364934206008911, 0.02645088918507099, -0.5461553931236267, -0.3914707899093628, 0.7596616744995117, -0.2961590886116028, -0.19855065643787384...
'bannerAdCommand.bannerFiles[4].thirdpartyImpressionUrl': { maxlength:1000, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[0].thirdpartyClickUrl': { maxlength:1000, noScript: true, noQuoteWrap: true, spaceS...
[ 0.09953224658966064, -0.21221068501472473, 0.7654977440834045, -0.3939940333366394, -0.37903597950935364, -0.00019202350813429803, 0.38383564352989197, -0.4903872311115265, 0.0274298544973135, -0.5612980127334595, -0.37021732330322266, 0.628858745098114, -0.31636616587638855, -0.2133311480...
depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'bannerAdCommand.bannerFiles[2].thirdpartyClickUrl': { maxlength:1000, noScript: true, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'b...
[ 0.5122058987617493, -0.31294697523117065, 0.7591444849967957, -0.39193883538246155, -0.02176104299724102, 0.318227082490921, -0.00978938303887844, -0.5589938759803772, -0.025782428681850433, -0.5135988593101501, -0.02689017355442047, 0.9161040782928467, -0.3208828270435333, -0.162959739565...
'bannerAdCommand.bannerFiles[4].thirdpartyClickUrl': { maxlength:1000, noScript: true, noQuoteWrap: true, spaceStrip: { depends: function() { $(this).val($.trim($(this).val())); return false; } } }, 'videoAdCommand.videoMultipartFile': { required: { depends: isVideoAndNoneExists }, spaceStrip: { dep...
[ 0.43638357520103455, -0.5247909426689148, 0.9040820598602295, 0.0566217377781868, -0.23344090580940247, -0.28504398465156555, 0.15186262130737305, -0.31060791015625, -0.09780184924602509, -0.43988001346588135, -0.3606269359588623, 0.8077133297920227, -0.11856810748577118, 0.044428918510675...
}, messages: { 'bannerAdCommand.destinationUrlView': { url: 'Valid URL is required' }, 'bannerAdCommand.bannerFiles[0].multipartFile': { required: bannerMissing, accept: bannerType }, 'bannerAdCommand.bannerFiles[1].multipartFile': { required: bann...
[ 0.1178027018904686, -0.12328356504440308, 0.7111444473266602, 0.1586349457502365, -0.18699268996715546, -0.1691293716430664, 0.31331518292427063, 0.04723811522126198, -0.16365979611873627, -0.6021199822425842, -0.4103736877441406, 0.22685082256793976, -0.30405786633491516, 0.22174237668514...
'bannerAdCommand.bannerFiles[2].multipartFile': { required: bannerMissing, accept: bannerType }, 'bannerAdCommand.bannerFiles[3].multipartFile': { required: bannerMissing, accept: bannerType }, 'bannerAdCommand.bannerFiles[4].multipartFile': { required: bannerMissing, accept: ban...
[ 0.14773668348789215, 0.0947587788105011, 0.6425443291664124, -0.02243349701166153, -0.5683302283287048, -0.2042560577392578, 0.471998393535614, -0.313404381275177, -0.4112515151500702, -0.5887293815612793, -0.6057583689689636, 0.152035191655159, -0.3547323942184448, -0.08403664082288742, ...
bannerType }, 'bannerAdCommand.bannerFiles[6].multipartFile': { required: bannerMissing, accept: bannerType }, 'videoAdCommand.videoMultipartFile': { required: videoMissing, accept:'mov|mp4|wmv|avi' } } }); ``` As a comment said, it's just syntax errors. Space-d...
[ 0.31564682722091675, 0.05700242891907692, 0.5970467925071716, -0.01875125616788864, -0.17303912341594696, -0.2555682361125946, 0.39918574690818787, -0.21841706335544586, -0.2743266820907593, -0.531589150428772, -0.2723916471004486, 0.5020471811294556, -0.3272443115711212, 0.002638309728354...
entry in `tapes_in_drives`, not just those that match an entry it exactly. ``` tapes=(SP0001 SP0002 SP0434 SP0995 SP1026 SP2000 SP3000) tapes_in_drives=(SP1026 SP0995 SP0434) for i in "${tapes_in_drives[@]}"; do tapes=(${tapes[@]//*$i*}) done ``` Results: ``` $ echo ${tapes[0]} SP0001 $ echo ${tapes[1]} SP...
[ 0.16224293410778046, 0.30023372173309326, 0.43788695335388184, 0.030548928305506706, -0.0007910043932497501, 0.2384965717792511, 0.2663094699382782, -1.017561435699463, -0.3755796253681183, -0.2881351709365845, -0.1533314287662506, 0.4324023723602295, -0.26505595445632935, 0.17019321024417...
| awk '{print $3}'` ``` initialise `tapes` and `tapes)in_drives` as strings, not arrays. You need to add parentheses around the value being assigned to make them into arrays, or the loop won't work. You can also drop the `export`, it isn't necessary unless you want processes spawned by the script to inherit those she...
[ 0.32371559739112854, -0.07745014876127243, 0.19617123901844025, 0.08271627128124237, 0.20247401297092438, 0.011366522870957851, 0.16791678965091705, -0.6018741130828857, -0.19305077195167542, -0.39494049549102783, -0.1219070628285408, 0.6259185075759888, -0.5601063966751099, 0.212588012218...
| awk '{print $3}'`) ```
[ -0.007457698695361614, 0.4105795621871948, 0.08786681294441223, -0.36055076122283936, -0.0759548619389534, 0.019479990005493164, 0.3662203550338745, 0.09446606040000916, 0.04164304956793785, -0.37932783365249634, -0.37319034337997437, 0.4427570104598999, -0.4432124197483063, 0.228000655770...
For some reason, I'm getting unexpected results in the range comparisons of unicode characters. To summarize, in my minimized test code, `("\u1000".."\u1200") === "\u1100"` is `false`, where I would expect it to be `true` -- while the same test against `"\u1001"` is `true` as expected. I find this utterly incomprehens...
[ -0.10309018939733505, 0.3306707441806793, 0.22438441216945648, -0.39671579003334045, -0.16752393543720245, 0.23415139317512512, 0.4026440978050232, -0.4818786084651947, 0.04624741151928902, -0.6501173973083496, -0.23695705831050873, 0.5774238109588623, -0.14472696185112, -0.062812522053718...
x}" puts "a < y = #{a < y}" puts "b > y = #{b > y}" puts "r === x = #{r === x}" puts "r === y = #{r === y}" ``` I would naively expect that both of the `===` operations would produce "true" here. However, the actual output of running this program is: ``` ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11....
[ 0.48862266540527344, 0.45752254128456116, 0.03977372497320175, -0.2606203854084015, -0.09461374580860138, 0.024068355560302734, 0.5687226057052612, -0.5169789791107178, 0.34872427582740784, -0.5590003728866577, -0.2059168815612793, 0.3274473547935486, 0.09832189977169037, -0.02397834695875...
this behavior as [bug #6258 to ruby-lang](http://bugs.ruby-lang.org/issues/6258). There's something odd about the collation order in that range of characters ``` irb(main):081:0> r.to_a.last.ord.to_s(16) => "1036" irb(main):082:0> r.to_a.last.succ.ord.to_s(16) => "1000" irb(main):083:0> r.min.ord.to_s(16) => "1000" i...
[ -0.02131924033164978, 0.08035872876644135, 0.5207696557044983, -0.2845112085342407, 0.16053670644760132, 0.15664565563201904, 0.4609370231628418, -0.6217009425163269, -0.19553549587726593, -0.30695152282714844, -0.3767220377922058, 0.5837289094924927, -0.35520103573799133, 0.09646829217672...
if answer can be determined by string length alone, or all the invloved strings are ASCII, we get simple bounds checks, otherwise we dispatch to super, which means the #include? gets answered by [Enumerable#include?](http://www.ruby-doc.org/core-1.9.3/Enumerable.html#method-i-include-3F) which enumerates using [Range#e...
[ 0.04682295769453049, -0.051723942160606384, 0.5172770023345947, -0.10235947370529175, -0.2288258671760559, 0.054012738168239594, 0.533135712146759, -0.6842588782310486, -0.19614337384700775, -0.04696923866868019, -0.501890242099762, 0.409030020236969, -0.4439752995967865, 0.133534029126167...
information associated with the string. BTW, as a work around, you could use a range of integer ordinals and test against ordinals if you only care about single chars. eg: ``` r = (a.ord..b.ord) r === x.ord r === y.ord ```
[ 0.27891167998313904, 0.14468267560005188, 0.168308824300766, -0.12384162098169327, -0.038629744201898575, 0.18890875577926636, 0.19503150880336761, -0.1162966713309288, -0.09135203808546066, -0.44026997685432434, -0.0816679447889328, 0.19904789328575134, -0.0979011058807373, 0.265019655227...
**Requirements** Intranet web app needs to print jillions of receipts daily. Silent print in either Chrome or Firefox works fine --- consider this part solved. **Fly in ointment** So we use command line options in either chrome or firefox to enable speedy silent printing but these are regular workstations, not POS....
[ 0.6931236386299133, 0.1039949506521225, 0.6973305940628052, 0.12493029236793518, -0.09689709544181824, -0.116453155875206, 0.06743838638067245, -0.1469721496105194, -0.24082531034946442, -0.45911315083503723, -0.054769374430179596, 0.6484624147415161, -0.23199768364429474, -0.2320195734500...
printer on the command line: Eg., ``` firefox -no-remote -P webapp --print-target receipt ``` or - ``` chrome --kiosk --kiosk-printing receipt ``` Is there a plugin, extension or application that will force FF or Chrome to ignore the system default printer for a certain profile, ( or site ) and use a specified ...
[ 0.43029648065567017, 0.3470398485660553, 0.5918554663658142, -0.09956236928701401, 0.08337178081274033, 0.13451780378818512, -0.043304841965436935, 0.0299513079226017, -0.27113696932792664, -0.7612805366516113, 0.07482904195785522, 0.765885055065155, -0.413400799036026, -0.2082115262746811...
UPDATE: you are too late for $$ at this point, I beat you to the punch ]. You can use <https://github.com/edabg/jsprintsetup> extension for FF. Among the options are: setSilentPrint, setPrintersList - Returns comma separated list of available printers, setPrinter - Set current printer, getPrinter - Returns currently ...
[ 0.5004214644432068, -0.2942720353603363, 0.6378917098045349, 0.25279662013053894, 0.17488481104373932, 0.13014377653598785, -0.04996536299586296, -0.05076098069548607, -0.24953779578208923, -0.9780687689781189, 0.009033259004354477, 0.6491773128509521, -0.20923960208892822, -0.157690450549...
Here is the code of my button activity, i managed to add a progressdialog so when the actvity sciencetechnology is loading its shows loading..only it isn't spinning so i'm wondering what im doing wrong, maby someone can look for my mistake here is the code: ``` package net.thinkbin; import android.app.Activity; impor...
[ 0.15789295732975006, -0.2954334020614624, 0.9398984909057617, -0.12415819615125656, -0.10287054628133774, 0.4777836799621582, 0.5397005081176758, -0.6482487916946411, -0.048953618854284286, -0.7695311903953552, -0.22118666768074036, 0.543406069278717, -0.6625603437423706, -0.17021073400974...
public void onClick(View v) { // TODO Auto-generated method stub startActivity(new Intent("net.thinkbin.SHARE")); overridePendingTransition(0, 0); finish(); } }); Button menu = (Button) findViewById(R.id.buttonhome); menu.setOnClickListener(new View.O...
[ -0.14450782537460327, -0.5190722942352295, 0.8034294843673706, -0.30914559960365295, 0.2459476888179779, 0.34745752811431885, 0.6361564993858337, -0.4866677224636078, -0.0511348731815815, -0.4962686002254486, -0.14665117859840393, 0.7468435168266296, -0.24643436074256897, 0.054936639964580...
// TODO Auto-generated method stub progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading..."); Thread th = new Thread(new Runnable() { public void run(){ startActivity(new Intent("net.thinkbin.MENU"));
[ 0.20912985503673553, -0.3529450595378876, 0.5780446529388428, -0.3505324721336365, 0.2934362590312958, 0.2016829401254654, 0.46707919239997864, -0.27393853664398193, -0.0912533551454544, -0.5140453577041626, -0.1628931313753128, 0.48443353176116943, -0.5287377834320068, 0.12520337104797363...
overridePendingTransition(0, 0); progressDialog.dismiss(); finish(); } }); th.start(); }
[ -0.10361064225435257, -0.18716812133789062, 0.5473557114601135, -0.2976730465888977, 0.23655880987644196, 0.09276172518730164, 0.49594974517822266, -0.46848490834236145, -0.05902718007564545, -0.6345421671867371, -0.27035167813301086, 0.26175910234451294, -0.2552831768989563, 0.43469601869...
}); Button culture = (Button) findViewById(R.id.button3); culture.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading..."); Thread th = n...
[ 0.11721581965684891, -0.35803309082984924, 0.8899564146995544, -0.35604774951934814, 0.18880410492420197, 0.3873439431190491, 0.70061194896698, -0.3308453857898712, -0.23922772705554962, -0.43353453278541565, -0.1860443353652954, 0.46973752975463867, -0.46184301376342773, 0.285428673028945...
startActivity(new Intent("net.thinkbin.CULTURE")); overridePendingTransition(0, 0); progressDialog.dismiss(); finish(); }
[ 0.11023140698671341, -0.1178067997097969, 0.4972459673881531, -0.3573065996170044, 0.28147608041763306, 0.1507350206375122, 0.35507020354270935, -0.43955159187316895, 0.15304632484912872, -0.6118220090866089, -0.15919987857341766, 0.26802006363868713, -0.13416419923305511, 0.11981475353240...
}); th.start(); } }); Button entertainment = (Button) findViewById(R.id.button4); entertainment.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub progressDialog = ProgressDialog.show(tutoria...
[ -0.20943278074264526, -0.46788489818573, 0.9663110971450806, -0.37411412596702576, 0.011636978015303612, 0.35705769062042236, 0.7037726640701294, -0.40093374252319336, -0.23536917567253113, -0.538188099861145, -0.31316620111465454, 0.6134093999862671, -0.3971453607082367, 0.079595103859901...
Thread th = new Thread(new Runnable() { public void run(){ startActivity(new Intent("net.thinkbin.ENTERTAINMENT")); overridePendingTransition(0, 0); progressDialog.dismiss();
[ 0.288056880235672, -0.39129701256752014, 0.7249311804771423, -0.24189311265945435, 0.29537680745124817, -0.04040328785777092, 0.45616570115089417, -0.026514196768403053, -0.31525614857673645, -0.4878526031970978, -0.27591535449028015, 0.403251975774765, -0.3889768123626709, 0.6740726232528...
finish(); } }); th.start(); } }); Button philosophy = (Button) findViewById(R.id.button5); philosophy.setOnClickListener(new View.OnClickListener() { public void onClick(View v) {
[ -0.17317081987857819, -0.2942229211330414, 0.9578238725662231, -0.32876989245414734, 0.048089347779750824, 0.35374411940574646, 0.7274423241615295, -0.3946414589881897, -0.16982769966125488, -0.46402934193611145, -0.29888245463371277, 0.765470564365387, -0.017133241519331932, 0.16940231621...
// TODO Auto-generated method stub progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading..."); Thread th = new Thread(new Runnable() { public void run(){ startActivity(new Intent("net.thinkbin.PHILOSOPHY"));
[ 0.27168652415275574, -0.2622634172439575, 0.5540034770965576, -0.20563507080078125, 0.21728001534938812, 0.1814601570367813, 0.45553556084632874, -0.2603295147418976, -0.05701965093612671, -0.43632829189300537, -0.22151318192481995, 0.47951236367225647, -0.4957160949707031, 0.1171121746301...
overridePendingTransition(0, 0); progressDialog.dismiss(); finish(); } }); th.start(); } }); Button
[ -0.2939591407775879, -0.39705315232276917, 0.7154825329780579, -0.30682802200317383, 0.32483017444610596, 0.2260991781949997, 0.39084291458129883, -0.34441664814949036, -0.15062281489372253, -0.7422652244567871, -0.3340853750705719, 0.30189839005470276, -0.263321191072464, 0.42771193385124...
sciencetechnology = (Button) findViewById(R.id.button6); sciencetechnology.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub progressDialog = ProgressDialog.show(tutorial1.this, "", "Loading..."); ...
[ 0.21547864377498627, -0.2488313615322113, 0.5920059680938721, 0.06127164885401726, 0.10116910189390182, 0.1503552347421646, 0.5391225218772888, -0.2106105238199234, -0.11353292316198349, -0.360963374376297, -0.136721670627594, 0.4619912803173065, -0.2510870099067688, 0.19572068750858307, ...
public void run(){ startActivity(new Intent("net.thinkbin.SCIENCETECHNOLOGY")); overridePendingTransition(0, 0); progressDialog.dismiss(); finish();
[ 0.397296667098999, -0.23054082691669464, 0.11135798692703247, -0.11654235422611237, 0.2616612911224365, -0.008453145623207092, 0.4632381796836853, -0.2191879004240036, 0.03732322156429291, -0.41018232703208923, -0.3290575444698334, 0.31868070363998413, -0.25646647810935974, 0.2984031736850...
} }); th.start(); } }); } } ``` Use an Enum and switch on it. Here is a executable stub without getting too deeply into the reflection or the syntax of your example: ``` package com.trip.test; import java.util.HashMap; import java.util.Map; public class ExampleFactory { ...
[ 0.2745216488838196, -0.06150922179222107, 0.34413549304008484, -0.38309547305107117, 0.11307108402252197, 0.023045429959893227, 0.4682658612728119, -0.5749743580818176, -0.10421232879161835, -0.7658571004867554, -0.4008732736110687, 0.5398856401443481, -0.5349748730659485, -0.0175858326256...
hmap.put("Out", OutExpression.class); } public static void getExpo(String key, String expression) { Class aClass = hmap.get(key); ClassMappingEnum myType = ClassMappingEnum.getClassMappingEnum(aClass); switch (myType) { case ECHO_EXPRESSION:{ System.out.println(aC...
[ 0.27939820289611816, -0.2606821060180664, 0.37047749757766724, -0.2511768043041229, 0.45124363899230957, 0.15914012491703033, 0.6035234928131104, -0.6126648187637329, -0.29381516575813293, -0.0767645388841629, -0.45382067561149597, 0.40631482005119324, -0.48532572388648987, 0.1060501039028...
} case OUT_EXPRESSION:{ System.out.println(aClass.getName()); // do something break; } case UNKNOWN: default: System.out.println("Bummer: "
[ -0.022672083228826523, -0.08978582173585892, 0.10014156252145767, -0.31233838200569153, 0.5658956170082092, -0.046156369149684906, 0.5200019478797913, -0.21027997136116028, -0.3604503273963928, -0.14445604383945465, -0.6020584106445312, 0.3699958324432373, -0.43139851093292236, 0.218044072...
+ aClass.getName()); } } public static void main(String[] args) { getExpo("echo", "B"); getExpo("Out", "B"); } } enum ClassMappingEnum { ECHO_EXPRESSION(EchoExpression.class), OUT_EXPRESSION(OutExpression.class), UNKNOWN(null); private Class typeDes; pri...
[ 0.04444609209895134, -0.15558181703090668, 0.22067108750343323, -0.2833562195301056, 0.19012406468391418, 0.19381549954414368, 0.7519835233688354, -0.7067250609397888, -0.1918139010667801, 0.06407979875802994, -0.44500431418418884, 0.4109114110469818, -0.7646002173423767, 0.098862022161483...
compare) { for (ClassMappingEnum cme : ClassMappingEnum.values()) { if (cme.typeDes.equals(compare)) { return cme; } } return UNKNOWN; } } class EchoExpression<T> { private String someString; private Class<T> someClass; public EchoExpress...
[ -0.15468865633010864, -0.10429248213768005, 0.3057096004486084, -0.19424284994602203, -0.09948582947254181, 0.27244341373443604, 0.49274012446403503, -0.6422271728515625, 0.05554261803627014, -0.34459933638572693, -0.13576100766658783, 0.3840685486793518, -0.3714449107646942, -0.0650562569...
someClass) { super(); this.someString = someString; this.someClass = someClass; } public String getSomeString() { return someString; } public void setSomeString(String someString) { this.someString = someString; } public Class<T> getSomeClass() { r...
[ 0.09726864844560623, -0.5791025757789612, 0.40749889612197876, -0.19314223527908325, -0.07291144132614136, -0.053108155727386475, 0.5821772217750549, -0.05010651424527168, -0.1700008660554886, -0.3553917706012726, -0.46780434250831604, 0.5220706462860107, -0.3774392306804657, 0.16450980305...
void setSomeClass(Class<T> someClass) { this.someClass = someClass; } } class OutExpression { private String someString; public OutExpression(String someString) { super(); this.someString = someString; } public String getSomeString() { return someString; } ...
[ -0.06294642388820648, -0.3181094527244568, 0.4544696807861328, -0.18875913321971893, -0.09854632616043091, -0.0003853325906675309, 0.3684711754322052, -0.140464648604393, -0.31740134954452515, -0.3979719281196594, -0.41921356320381165, 0.5069824457168579, -0.5079461336135864, -0.0478022582...
I'm on Windows and Python is (very effectively) preventing me from sending a stand-alone `'\n'` character to STDOUT. For example, the following will output `foo\r\nvar`: ``` sys.stdout.write("foo\nvar") ``` How can I turn this "feature" off? Writing to a file first is not an option, because the output is being piped...
[ 0.20905904471874237, 0.17246970534324646, 0.5267648100852966, -0.28277331590652466, 0.04999559745192528, 0.11736633628606796, 0.43555888533592224, -0.1527775377035141, -0.2414977252483368, -0.8605107665061951, -0.3871595561504364, 0.5327420830726624, -0.2626367509365082, 0.2688998281955719...
msvcrt, os def setmode(mode): f.flush() msvcrt.setmode(f.fileno(), mode) setmode(os.O_BINARY) try: yield finally: setmode(os.O_TEXT) with binary_mode(sys.stdout), binary_mode(sys.stderr): # code ```
[ -0.2011752873659134, -0.06791511923074722, 0.6484964489936829, -0.27485427260398865, 0.30646878480911255, 0.2709346115589142, 0.24468865990638733, -0.1809948980808258, -0.1935170292854309, -0.5652905702590942, -0.6018967628479004, 0.7734384536743164, -0.3854916989803314, -0.181189507246017...
I am assigning some data to html objects by a jquery I'm creating, the thing is that when I call a method from the plugin, the data I have assigned is not in the object anymore. It's useful to understand how `.data()` works to understand how long the data lives. When you store something with `.data()`, it goes into an ...
[ 0.3443326950073242, 0.04650840163230896, 0.514069139957428, 0.03962339460849762, -0.05999844893813133, -0.14403969049453735, 0.1348671168088913, 0.23663055896759033, -0.23763903975486755, -0.4187625050544739, -0.13952206075191498, -0.019735677167773247, -0.3018781840801239, 0.2806098461151...
javascript variables. The other way the data can be removed is if some javascript code specifically removed the data from the data structure. That will normally only happen if you use a jQuery method that intentionally disposes of a DOM object. That can be done with `$(elem).remove()` or with `$(elem).html("some html)...
[ -0.11098010838031769, -0.0362410806119442, 0.022262265905737877, -0.011998914182186127, -0.06852128356695175, -0.32483813166618347, 0.4180455505847931, -0.309445321559906, -0.32234811782836914, -0.48420289158821106, -0.49975305795669556, 0.44712087512016296, -0.4488760232925415, 0.27436736...
info. This is done on purpose to allow you to remove it from the DOM, but preserve it's state presumably so you can put it back in the DOM somewhere else or some time later. Note: if you remove a DOM element from the DOM without using jQuery functions (such as `.removeChild()` or by assigning to `.innerHTML`), jQuery ...
[ 0.2852475941181183, -0.2713884711265564, 0.18160580098628998, 0.11592921614646912, 0.2830922603607178, -0.1967771202325821, 0.20614513754844666, 0.013022045604884624, -0.11263681948184967, -0.44799524545669556, -0.14666086435317993, 0.7110543847084045, -0.3009994626045227, 0.23841312527656...
contains references to other javascript or DOM elements, it could cause even larger memory leaks. If you are using `.data()` it creates one case where you want to stick with jQuery methods for anything that can cause DOM elements to be removed. Normally with jQuery, you are free to mix/match plain javascript and jQuer...
[ 0.4170232117176056, -0.0398656465113163, -0.01609213463962078, 0.35590070486068726, -0.040833353996276855, -0.43936339020729065, 0.12807756662368774, -0.11584014445543289, -0.20052580535411835, -0.474310964345932, -0.019384419545531273, 0.56448894739151, -0.38913795351982117, 0.07688836008...
There is plenty of information throughout the net on how to detect Windows license type and distribution channel using PID (that can be found in `HKLM\SYSTEM\Setup\Pid` registry key) and ProductID (that can be found in `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion`). However, there is quite little information on ...
[ 0.2420455366373062, 0.17965297400951385, 0.6703731417655945, -0.043874550610780716, -0.21372395753860474, -0.23143142461776733, -0.14402826130390167, -0.08329878747463226, 0.03454611077904701, -0.5907060503959656, -0.1503733992576599, 0.5226820111274719, -0.09068585932254791, 0.33361691236...
[Office 2003](http://support.microsoft.com/kb/832672) * [Office 2007](http://support.microsoft.com/kb/928516) * [Office 2010](http://support.microsoft.com/kb/2186281) However, all those articles only distinguish between these release types: * 0 Volume license * 1 Retail/OEM * 2 Trial * 5 Download Furthermore, i coul...
[ 0.03351062163710594, 0.330981582403183, 0.40469154715538025, -0.049373697489500046, -0.01097389031201601, -0.1544020175933838, -0.026888243854045868, -0.23738019168376923, -0.2537285089492798, -0.4204886555671692, -0.5776786208152771, 0.677737295627594, -0.08665589243173599, 0.013395008631...
Extend is for adding the contents of one list to another, append is for adding a single element. Extend is telling python to treat the string as a list of its chars and append each char. ``` >>> lst = [] >>> lst.extend("foo") >>> lst ['f', 'o', 'o'] >>> lst.append("foo") >>> lst ['f', 'o', 'o', 'foo'] ```
[ 0.06694956868886948, -0.06221947818994522, 0.34028488397598267, -0.5687054395675659, 0.014212047681212425, -0.13803116977214813, -0.06928065419197083, -0.4308854043483734, -0.07441411167383194, -0.2707161605358124, -0.4270797669887543, 0.5392706394195557, -0.8870043754577637, -0.4817635118...
<http://jsfiddle.net/J2KuY/> In test2, you can see that instead of removing the node from the array, it is replacing the node with 'null'. What am I doing wrong, and how can I remove it completely? Edit: using Splice instead of delete. Updated fiddle here: <http://jsfiddle.net/J2KuY/1/> [Here's a sample](http://jsfi...
[ 0.2089766561985016, 0.051672618836164474, 0.4175843894481659, 0.06757033616304398, -0.06990274041891098, 0.029954634606838226, 0.2297249138355255, -0.334274560213089, -0.5375880599021912, -0.28400084376335144, 0.36944133043289185, 0.1768498420715332, -0.0983022153377533, -0.070201434195041...
"Country": "USA", "info info1": 7.78805016, "info info2": 26.59681951, "info info3": 9.200900779}]; var test2 = [{ "Country": "Germany", "info info1": 0.329235716, "info info2": 0.447683684, "info info3": 0.447683747}, { "Country": "China", "info info1": 1.302673893, "info info2...
[ 0.1056637093424797, -0.07783408463001251, 0.16475555300712585, 0.5127122402191162, 0.46674588322639465, 0.15270289778709412, 0.1662781536579132, 0.18484047055244446, -0.1403302401304245, -0.5417812466621399, -0.2867566645145416, 0.32990318536758423, -0.15411539375782013, 0.0931146815419197...
$W(param) { var obj = {}; //set data obj.data = param; //augment the object with a remove function obj.remove = function(key, val) { var i = 0; //loop through data while (this.data[i]) { if (this.data[i][key] === val) {
[ 0.2305329591035843, -0.13747331500053406, 0.3023921847343445, -0.2647380530834198, 0.033546123653650284, 0.46940937638282776, 0.68052738904953, -0.7112160921096802, -0.2149026244878769, -0.16592949628829956, -0.25600743293762207, 0.16051821410655975, -0.5736384987831116, 0.2738817036151886...
//if we have that data, splice it //splice changes the array length so we don't increment this.data.splice(i, 1); } else { //else move on to the next item i++;
[ 0.3069028854370117, -0.4082755148410797, 0.6647577285766602, -0.11355946958065033, -0.021737106144428253, 0.05702388659119606, 0.11377609521150589, -0.6155700087547302, -0.0385834276676178, -0.5946321487426758, -0.10383160412311554, 0.03629513457417488, -0.4295523464679718, 0.2416519671678...
} } //be sure to return the object so that the chain continues return this; } //return object for operation return obj } //the following will look strangely similar to jQuery //remove chile, then USA var result1 = $W(test1).remove('Country', 'Chile').remove('Country', 'USA'); //r...
[ 0.3744049072265625, -0.10616441816091537, 0.3709909915924072, 0.04650820419192314, 0.10826274752616882, 0.0797005221247673, 0.24842791259288788, 0.1916247457265854, -0.4495374262332916, -0.04135330766439438, -0.34927496314048767, 0.028275227174162865, -0.3489455282688141, 0.477438330650329...
I want to generate a list of **unique** IDs. Because some of the IDs are duplicates, I need to add a number at the end to make them unique, like so: ID=exon00001 ID=exon00002 ID=exon00003 ID=exon00004 Here's what I have so far. ``` while (loop through the IDs) { # if $id is an exon, then increment the ...
[ 0.31217461824417114, 0.22338803112506866, 0.21039000153541565, 0.043539829552173615, 0.10335958749055862, 0.2937151789665222, 0.14588557183742523, -0.3926279544830322, -0.1842668205499649, -0.5277096629142761, 0.2831001281738281, 0.3834593892097473, -0.24217240512371063, 0.4343342483043670...
$number = pop @exon; # removes the first element of the list $id = $id.$number; print $id."/n" } } ``` Basically I want to dynamically generate an array with a counter. It's supposed to create an array (1, 2, 3, 4, ... ) for the total number of exons, then remove the elements and add it to the string....
[ 0.5420289635658264, 0.005775777157396078, 0.36299529671669006, -0.004579702392220497, 0.012420915998518467, 0.2191651612520218, 0.3092014789581299, -0.07147479802370071, -0.3853696584701538, -0.38039717078208923, 0.08559618890285492, 0.3278765380382538, -0.6161677837371826, 0.3969358503818...
value, so you can't keep resetting it as you are: ``` use v5.10; my $exon_count = 0; while( my $id = <DATA> ) { chomp $id; if( $id =~ m/exon/ ) { $id = sprintf "%s.%03d", $id, $exon_count++; } say $id; } __END__ ID=exon00001 ID=exon00002 ID=exon00003 ID=exon00004 ``` The output look...
[ 0.3581206500530243, -0.10428298264741898, 0.4758760333061218, -0.2581666111946106, 0.29976171255111694, 0.23497794568538666, 0.46696117520332336, -0.06552524119615555, -0.4869162142276764, -0.30619120597839355, -0.16862037777900696, 0.3816540241241455, -0.4627130925655365, 0.15338380634784...
$id; state $exon_count = 0; if( $id =~ m/exon/ ) { $id = sprintf "%s.%03d", $id, $exon_count++; } say $id; } ``` I figure you are new to Perl since your code looks like a mishmash of unrelated things that probably do something much different than you think they do. There's a Perl tutor...
[ 0.5240484476089478, -0.1269315630197525, 0.22554828226566315, 0.09486569464206696, -0.17641176283359528, -0.11623113602399826, 0.05007817596197128, 0.08163821697235107, -0.2815791070461273, -0.3055828809738159, 0.026624128222465515, 0.47760719060897827, -0.14797399938106537, 0.116157867014...
Perl lets you [increment a string](http://www.effectiveperlprogramming.com/blog/1220), but only on the ranges `a-z` and `A-Z`. We can mix numbers and letters by having a numeric tag that we present in base 36: ``` use v5.10; use Math::Base36 'encode_base36'; while( my $id = <DATA> ) { chomp $id; state $exon_...
[ 0.19026178121566772, -0.3352039158344269, 0.7239748239517212, 0.07917983084917068, -0.2841686010360718, 0.23707802593708038, 0.016291003674268723, -0.23336002230644226, -0.23686613142490387, -0.046694401651620865, -0.03509137034416199, 0.2105582356452942, -0.4382420480251312, -0.2164421230...
ID=exon00001.1S ID=exon00002.1T ID=exon00003.1U ID=exon00004.1V ```
[ -0.102814681828022, 0.18442945182323456, 0.15704390406608582, -0.13704811036586761, 0.11443516612052917, 0.2740011513233185, 0.42297694087028503, -0.04726627841591835, 0.01184445433318615, -0.8467837572097778, -0.21640115976333618, 0.42153987288475037, -0.24378006160259247, 0.3314473032951...
I am trying to play a song with pygame and it is not playing the song. *My code:* ``` import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('C:/1.mp3') print "Play" pygame.mixe...
[ 0.48899397253990173, 0.2727530896663666, 0.4356040358543396, -0.2683737277984619, 0.18649181723594666, 0.04000019654631615, 0.4237375855445862, -0.35801956057548523, -0.2505558133125305, -0.7465815544128418, -0.2110385298728943, 0.8402287364006042, -0.0503256618976593, -0.09810511767864227...
thread. This would cause your code to skip the while loop, print "Done", and terminate, deleting the music player object and terminating playback before you got to hear anything. If this is the problem, you could try something like this after `play(0)` and before `print Done`: ``` pygame.mixer.music.set_endevent(pygam...
[ 0.4342260956764221, -0.1288846880197525, 0.3763488531112671, -0.04358119145035744, 0.36852046847343445, -0.3574804961681366, 0.4041869044303894, 0.031783558428287506, -0.3787268102169037, -0.3087104558944702, -0.024544313549995422, 0.782387375831604, -0.38087207078933716, 0.533407032489776...
about any other events print "Playing", pygame.mixer.music.get_pos() # will print -1 on the last iteration ```
[ 0.6819950342178345, -0.0882844477891922, 0.597104549407959, -0.07697712630033493, 0.18621723353862762, -0.4563140869140625, 0.04358399286866188, 0.17293225228786469, -0.4607901871204376, -0.4006895422935486, -0.31847357749938965, 0.7347176671028137, -0.4174386262893677, -0.1027250289916992...
So that's a long title, here's what I'm doing: To avoid having report parameters show up in the URL I'm doing this in a button click handler in the code-behind to show the report: ``` System.Web.HttpContext.Current.Response.Clear(); System.Web.HttpContext.Current.Response.Write("<html><head></head>"); System.Web.H...
[ 0.20980378985404968, 0.05972778797149658, 0.6632104516029358, -0.1458352953195572, -0.3120158016681671, -0.21157099306583405, 0.2988663911819458, -0.5412657260894775, -0.1984356790781021, -0.3371254801750183, -0.0010308547643944621, 0.3374727666378021, -0.15941376984119415, 0.0948974266648...
this isn't ideal. I've tried opening a new window with JavaScript using ClientScript.RegisterStartupScript before writing the html but I don't know how (or if it's even possible) to get the HttpContext for the new window. The ADC pins on the PICs unfortunately are configured as analog inputs on powerup. You need to d...
[ 0.1872299760580063, 0.09131565690040588, 0.6435911655426025, 0.1057344600558281, 0.22492772340774536, -0.08797553926706314, -0.13739611208438873, -0.416141152381897, -0.21454909443855286, -0.4612927734851837, -0.11053519695997238, 0.8356794118881226, -0.2880190908908844, 0.2222872823476791...
Introduction ============ I have some sort of values that I might want to access several times each page is loaded. I can take two different approaches for accessing them but I'm not sure which one is 'better'. Three already implemented examples are several options for the Language, URI and displaying text that I desc...
[ -0.09616357833147049, 0.006198006682097912, 0.37794607877731323, -0.035673756152391434, -0.04137064516544342, -0.0411696694791317, -0.18769767880439758, -0.04846710339188576, -0.06149209290742874, -0.6877695918083191, -0.3401299715042114, 0.4875020384788513, -0.48111432790756226, -0.075362...
things. The code is too long and irrelevant for the case so if anyone wants it just ask for it. Url === The $Url array also returns different values depending on the request. The whole array is fully defined in the beginning of the page and used to get shorter but accurate links of the current page. Example: `echo $...
[ 0.3920549154281616, -0.19461239874362946, 0.5708655118942261, 0.06782877445220947, -0.13994528353214264, -0.21654453873634338, 0.4422966539859772, -0.27378398180007935, -0.41875994205474854, -0.5582759976387024, -0.06165997311472893, 0.3461853563785553, -0.22148913145065308, -0.03548219799...
called $Text that is defined in the same way than $Url. The whole array is defined at the beginning, making a mysql call and defining all `$Text[$i]` for current page with a while loop. I'm not sure if this is more efficient than multiple calls for a single mysql cell. Example: `echo $Text['54']` prints "This is just ...
[ 0.49558091163635254, 0.05024879798293114, 0.2613440454006195, -0.20124760270118713, -0.3690859079360962, -0.26374873518943787, 0.22605983912944794, -0.549540638923645, 0.01918576844036579, -0.1583949774503708, 0.11719692498445511, 0.5690869688987732, -0.5178662538528442, -0.152632892131805...
one for my code. I could create a function called `url()` and other called `text()` to output what I want. I think that working with functions in those cases is better, but I'm not sure why. So I'd really appreciate your opinions and advice. **Should I mix arrays and functions in the way I described or should I just u...
[ 0.2916415333747864, -0.14113754034042358, 0.16804324090480804, 0.3682345449924469, -0.22993265092372894, 0.06668411195278168, -0.31918787956237793, -0.09875556826591492, -0.1136762946844101, -0.7113067507743835, 0.04696948453783989, 0.784276008605957, -0.14390777051448822, -0.3315875530242...
the differences between $Url and $Uri. It sounds like you're implementing ambiguous functions through the array notation. Normally, these would be classes with methods. `$url['full']` would be `$url->getFullPath()`. Methods are preferred over the array accessor because methods are documented, and can be introspected by...
[ 0.06115833297371864, -0.15844732522964478, 0.10510578006505966, 0.13815602660179138, -0.2687861919403076, -0.1963806003332138, 0.1975654810667038, 0.012320754118263721, -0.011911668814718723, -0.6473331451416016, -0.2015925943851471, 0.5533501505851746, -0.2918825149536133, 0.2805841565132...
I'm currently working on my first MVC3 application at work (using the Razor view engine), and decided to use the open source Telerik Q1 2012 controls since they will provide a lot of the functionality I need (and look nice as well). Right now the issue I'm having is using the Telerik Editor control and binding to my vi...
[ 0.2948440611362457, 0.17628690600395203, 0.8253644108772278, -0.053746841847896576, -0.21412889659404755, -0.32472866773605347, 0.23333600163459778, -0.373786062002182, -0.05661993473768234, -0.6075857877731323, 0.16966503858566284, 0.7317481637001038, -0.21657447516918182, 0.1408741623163...
like they answer too many questions on the forum either. My main question is, how do I bind the Telerik MVC3 Editor to a model and have it set the property that's bound to it? My code for the view model is below (thanks for any help you can provide, and keep in mind, I'm brand new to MVC, I'm doing this project on my o...
[ 0.49019408226013184, -0.10074795037508011, 0.5983196496963501, 0.10300592333078384, -0.08441419899463654, -0.13346801698207855, 0.12162415683269501, -0.21259595453739166, -0.23413366079330444, -0.6352135539054871, 0.02982226014137268, 0.70094895362854, -0.2988438904285431, 0.02069901674985...
is required.")] public string TicketSubject { get; set; } [Display(Name = "Support Issue")] [Min(1, ErrorMessage = "You must select a support issue.")] public int SupportIssueID { get; set; } [Display(Name = "Ticket Priority")] [Min(1, ErrorMessage = "You must select a ticket priority.")] ...
[ 0.0812099352478981, -0.3157867193222046, 0.4711529016494751, 0.24236100912094116, 0.20018450915813446, 0.07017478346824646, 0.27915337681770325, -0.25500231981277466, -0.009527924470603466, -0.44458073377609253, -0.4618419110774994, 0.5565965175628662, -0.40337881445884705, 0.0025165111292...