text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
},
add: function() {
this.model.increase();
},
render: function() {
$("#counter span").text(this.model.get("count")); | [
0.12931974232196808,
-0.3343208134174347,
0.7528365850448608,
-0.3641742765903473,
0.19723546504974365,
0.25394877791404724,
0.2429477572441101,
-0.5971284508705139,
-0.1728208214044571,
-0.5022348761558533,
-0.3356761932373047,
0.8129351139068604,
-0.37324726581573486,
0.00990479066967964... | |
return this;
},
initialize: function(){
this.render = _.bind(this.render, this);
this.render();
this.model.bind('change:count', this.render);
}
}); | [
-0.28901344537734985,
-0.3555113673210144,
0.6424410939216614,
-0.5011788010597229,
0.32839420437812805,
0.3092035949230194,
0.3915025591850281,
-0.4401127099990845,
0.04451770335435867,
-0.566677987575531,
-0.43103641271591187,
0.5396287441253662,
-0.5468446612358093,
0.26408815383911133,... | |
var counterItem = new Counter();
var counterView = new CounterView({model: counterItem});
}(jQuery)); // function($)
</script>
```
The button must be a descendant of the view's `el`
Update your html like below and it should work
```
<div id="counter">
<button id="add-button">... | [
0.2608667016029358,
-0.15155526995658875,
0.9965659379959106,
-0.34409627318382263,
-0.2785005271434784,
0.4556574821472168,
0.19669969379901886,
-0.6948831677436829,
-0.1438339352607727,
-0.7322681546211243,
-0.14964307844638824,
0.5708233714103699,
-0.18836334347724915,
-0.06403562426567... | |
function() {
this.$('#count').text(this.model.get("count"));
return this;
}
``` | [
0.16245099902153015,
-0.01535721030086279,
0.36088767647743225,
-0.301095187664032,
0.414897084236145,
-0.0946395993232727,
0.3668043315410614,
-0.2905661463737488,
-0.05287712812423706,
-0.2663007974624634,
-0.37930136919021606,
0.9139696359634399,
-0.6227399110794067,
0.18680870532989502... | |
I would like to use the Hibernate3 plugin for Maven (developed by Codehaus) but according to the last release date (2009-01-21), it seems that it's not actively supported. I need to use the hbm2ddl tool provided by Hibernate. What do you think?
Where the hbm2ddl tool is provided? I guess this is not the Hibernate3 Mav... | [
0.2647875249385834,
0.12823866307735443,
0.43256574869155884,
-0.49080103635787964,
-0.32561638951301575,
-0.20101046562194824,
0.5163440108299255,
-0.06696213781833649,
0.06180863454937935,
-0.5699760317802429,
0.1380581259727478,
0.5909177660942078,
-0.38557276129722595,
-0.0916666835546... | |
Hibernate 3.5 and it works pretty well, doing what it is supposed to do.
Hibernate doesn't need to be provided to the plugin (at least directly), because under the cover this stuff uses Hibernate3 Ant Tasks (from `hibernate-tools` artifact) with Maven AntRun Plugin. So the plugin has a dependency on Hibernate (3.3.2.G... | [
0.2766359746456146,
-0.28025174140930176,
0.4960194528102875,
-0.26815924048423767,
-0.46638399362564087,
-0.15558531880378723,
0.6096894145011902,
-0.16934971511363983,
0.2397497445344925,
-0.7689917087554932,
0.019345562905073166,
0.7785854935646057,
-0.3858746588230133,
-0.4038618206977... | |
In C, semicolons (`;`) are used to indicate the end of the statement. Why do `#include` lines not need a semicolon?
`#include` (and all other lines beginning with `#` like `#define`) is part of the [*preprocessor*](http://en.wikipedia.org/wiki/C_preprocessor). This is actually a separate programs that runs before the m... | [
-0.03150789067149162,
0.03584333509206772,
0.32280319929122925,
-0.1458827406167984,
0.008427988737821579,
-0.11730242520570755,
-0.12648242712020874,
0.03858400508761406,
0.007426339667290449,
-0.21211807429790497,
-0.8286944627761841,
-0.004900733940303326,
-0.35750746726989746,
0.063669... | |
Can I define multiple static blocks?
If possible, why should I define muliple static blocks?
yes, you can also make multiple initialisation blocks.
This allows you to place code with the thing initialised.
```
private static final Map<String, String> map;
static {
// complex code to initialise map
}
private stat... | [
-0.12268594652414322,
-0.2215447574853897,
0.3080081045627594,
-0.04441280663013458,
-0.14483551681041718,
0.19482602179050446,
0.16844028234481812,
-0.3405469059944153,
-0.21811184287071228,
-0.7077397704124451,
-0.33105677366256714,
0.48416343331336975,
-0.3502717614173889,
0.33671993017... | |
Is it possible to have a switch widget for ICS versions, but a checkbox for pre ICS? If so, how?
I'm not worried about other components, only switch.
***MY SOLUTION***
Seeing as switch and checkbox both inherit from CompoundButton, I just did this
```
((CompoundButton)findViewById(R.id.swTax)).setOnCheckedChangeLis... | [
0.0740460753440857,
-0.3097743093967438,
0.6648750901222229,
-0.035281702876091,
0.22712677717208862,
-0.15543325245380402,
0.46107736229896545,
-0.5351533889770508,
0.014458585530519485,
-1.0082695484161377,
0.27467969059944153,
0.5147308707237244,
-0.09764489531517029,
0.0970005616545677... | |
a lot of duplicate XML, use one main layout file and include the widget. The resulting file structure would look something like this:
* layout
+ mylayout.xml
+ widget.xml
* layout-v14
+ widget.xml
In `mylayout.xml` you would have something like:
```
<include layout="@layout/widget" />
```
In the `Activity` for ... | [
0.7117959856987,
0.2472662776708603,
0.31866228580474854,
-0.00923107285052538,
-0.08142483979463577,
-0.12924760580062866,
0.243179589509964,
-0.25172826647758484,
-0.1604396104812622,
-0.6320793628692627,
0.19462229311466217,
0.48285627365112305,
-0.4381311237812042,
0.19575142860412598,... | |
I have been asked a question that is a little ambiguous for my coursework.
```
The array of strings is regarded as a set, i.e. unordered.
```
I'm not sure whether I need to remove duplicates from this array?
I've tried googling but one place will tell me something different to the next. Any help would be appreciat... | [
0.37069129943847656,
0.3291397988796234,
-0.10523839294910431,
-0.057101376354694366,
-0.19023168087005615,
0.19613555073738098,
0.23891863226890564,
-0.24531711637973785,
-0.3499676287174225,
-0.3697322607040405,
-0.13595837354660034,
0.0743335410952568,
-0.6547271013259888,
0.32531908154... | |
end up being exactly the same as the one without duplicate elements. | [
0.4775048792362213,
-0.276685506105423,
0.2337357997894287,
0.33884111046791077,
0.09556750953197479,
-0.244316965341568,
0.1461641490459442,
0.07703185081481934,
0.24878740310668945,
-0.6994616985321045,
0.12883366644382477,
-0.023826921358704567,
0.0369180329144001,
-0.09997271746397018,... | |
I need to send a post request when the user leaves the page in whichever way. So far this is what i have, but it's not working:
```
$(window).unload(function(){
$.post("http://localhost/project/quizTime.php",{action:"updateTime",userID:userid,quizID:quizid,newTime:currentTime*1000,rand:Math.random()},function... | [
0.00607691565528512,
-0.003253453178331256,
0.5201729536056519,
-0.09409043937921524,
-0.3469342291355133,
0.04075036197900772,
0.43979042768478394,
-0.14277774095535278,
0.01737087033689022,
-0.7847034931182861,
0.13681533932685852,
0.4636625349521637,
-0.31215134263038635,
0.182732000946... | |
data: 'YOUR_DATA'
});
```
In this way browser wait for the request to finish before doing anything else. | [
0.03404369577765465,
0.013896939344704151,
0.4981212317943573,
0.02926604449748993,
0.03147530183196068,
-0.22704967856407166,
0.056367579847574234,
0.20187431573867798,
-0.009799120016396046,
-0.6431716084480286,
-0.32720211148262024,
0.5005154013633728,
-0.1520787477493286,
0.20647434890... | |
I have a php application , and I'm trying to integrate with paypal payment gateway , my pc is under a fortinet firewall , now i'm struggling with a problem, when i'm trying to make payment with paypal it always retun an error
[L\_ERRORCODE0] => 81002
[L\_SHORTMESSAGE0] => Unspecified Method
[L\_LONGMESSAGE0] ... | [
0.25311627984046936,
0.1530294567346573,
0.17268922924995422,
0.18479712307453156,
0.09540972858667374,
0.2079647332429886,
0.29223600029945374,
0.07487224787473679,
-0.25359606742858887,
-0.6340319514274597,
0.40455272793769836,
0.5343109369277954,
-0.008994374424219131,
0.168068453669548... | |
firewall ?
please anyone can give some adivce?
opening 443 should be enough as https uses port 443. I don't know in details how paypal api works. is it possible that other ports are involved during the exchange your application - paypal api? try a tcpdump or watch the firewall log in order to see if there are packet ex... | [
0.4627706706523895,
-0.04860544949769974,
0.3935338854789734,
0.36187347769737244,
-0.029476089403033257,
-0.07086088508367538,
0.3971956670284271,
-0.16522736847400665,
-0.36442285776138306,
-0.7294309139251709,
0.19567249715328217,
0.7126930952072144,
-0.44058430194854736,
0.033569850027... | |
I've been using Delphi (Turbo Pascal before that) and have always been a windows guy. My wife bought me one of the new iPads for my birthday and I used it for the first time last night. Wow!... I had no idea how addicting that thing can be.
So, now I need to think about writing an app or two for this iPad. I'm guessin... | [
-0.00007234995428007096,
0.3428018093109131,
-0.018046854063868523,
-0.13086454570293427,
-0.17532368004322052,
-0.1759583055973053,
0.3576664626598358,
0.4919690787792206,
-0.16612859070301056,
-0.7833989262580872,
-0.040327560156583786,
0.9642565250396729,
-0.14735184609889984,
-0.269934... | |
It is not free, I have no stocks in it, but I can recommend it. | [
0.5078403353691101,
0.16912536323070526,
-0.12849265336990356,
0.14559996128082275,
0.5413652658462524,
-0.4051527976989746,
0.106727734208107,
0.29014822840690613,
0.007541358936578035,
-0.28681549429893494,
0.4741169810295105,
0.3793673813343048,
-0.022334787994623184,
0.1162276864051818... | |
Yesterday there were an update to Jave (1.6.0\_31) in the "Software update", but now when I try to send my updated app, I get this error "An error occurred uploading to the iTunes Store".
Console writes this error...
Java 1.5, 1.6, or 1.7 is required. Currently, java is the default java version. Please upgrade.
Any i... | [
-0.17762038111686707,
0.14695213735103607,
0.4298374354839325,
-0.003519125049933791,
0.27254340052604675,
-0.14120358228683472,
0.757855236530304,
-0.10047727078199387,
-0.13559377193450928,
-1.0051718950271606,
-0.18108028173446655,
0.9925959706306458,
-0.288160502910614,
-0.103896982967... | |
When I do floating point division in Python, if I divide by zero, I get an exception:
```
>>> 1.0/0.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: float division
```
I'd really like to get `NaN` or `Inf` instead (because the `NaN` or `Inf` will propagate through the res... | [
0.09709376096725464,
0.09129376709461212,
-0.20917728543281555,
-0.18028545379638672,
-0.10994125157594681,
-0.07719367742538452,
0.3181104362010956,
0.0015841941349208355,
-0.4098779261112213,
-0.32509681582450867,
0.17500217258930206,
0.5294129252433777,
-0.2598547041416168,
0.3191436827... | |
I'm trying to implement the example outlined here:
<http://www.codeproject.com/Articles/30994/Introduction-to-WPF-Templates>
The author states "The `ContentPresenter` control can be used to display the content of a WPF control."
with the following code:
```
<ContentPresenter VerticalAlignment="Center" HorizontalAli... | [
-0.042441725730895996,
-0.14357027411460876,
0.8937790989875793,
-0.16024444997310638,
-0.025291917845606804,
-0.14656823873519897,
0.007520103361457586,
-0.49704015254974365,
-0.06917821615934372,
-0.589257001876831,
-0.027393806725740433,
0.24546951055526733,
-0.14491990208625793,
-0.142... | |
a TemplateBinding if not in a template.
```
How can I resolve this?
You need to put the ContentPresent in the ControlTemplate, like that
```
<ControlTemplate x:Key="buttonTemplate" TargetType="{x:Type Button}">
<Grid>
<Ellipse Name="el1" Fill="Orange" Width="100" Height="100">
... | [
-0.10480201244354248,
-0.1515204757452011,
0.7984119057655334,
0.18923518061637878,
0.16599692404270172,
-0.20064221322536469,
-0.15466412901878357,
-0.3655414283275604,
0.03772467374801636,
-0.7527767419815063,
-0.21870100498199463,
0.22772271931171417,
-0.19210436940193176,
-0.1454904973... | |
Content="{TemplateBinding Button.Content}" />
</Grid>
</ControlTemplate>
``` | [
0.2153255194425583,
-0.335782527923584,
0.15061946213245392,
0.06916114687919617,
-0.056311894208192825,
-0.2544330656528473,
-0.058892540633678436,
-0.19363264739513397,
0.1328064203262329,
-0.6719125509262085,
-0.23170046508312225,
0.2463805228471756,
-0.503028929233551,
0.20007443428039... | |
Is there any way to save session of crawler in mysql database or in any way and resume this session using PHP? <http://phpcrawl.cuab.de/>
You need to put the ContentPresent in the ControlTemplate, like that
```
<ControlTemplate x:Key="buttonTemplate" TargetType="{x:Type Button}">
<Grid>
<El... | [
-0.23584899306297302,
-0.20942960679531097,
0.8475723266601562,
0.3755100667476654,
0.14468881487846375,
0.11798558384180069,
-0.2131715565919876,
0.054989252239465714,
-0.02250179648399353,
-0.6614890098571777,
0.03759714961051941,
0.3485413193702698,
0.002919516060501337,
-0.103221200406... | |
VerticalAlignment="Center" HorizontalAlignment="Center"
Content="{TemplateBinding Button.Content}" />
</Grid>
</ControlTemplate>
``` | [
-0.15453442931175232,
-0.35014018416404724,
0.4740937650203705,
0.17438727617263794,
0.22719955444335938,
0.1759488880634308,
-0.06457321345806122,
-0.13141365349292755,
-0.10775913298130035,
-0.6349835395812988,
-0.20432297885417938,
0.07625587284564972,
-0.3426438868045807,
0.29027917981... | |
I'm trying to setup an offline map in an iPhone app, but the result is not very good.
I'm using the route-me framework, I've got an offline file .db (created by tiles2sqlite) and the map view is constrained with coordinates (using setConstraintsSW:NE:).
My problem is appearing when zooming out (pinch gesture), this e... | [
-0.07311137020587921,
-0.05330192670226097,
0.6824812889099121,
-0.11567242443561554,
-0.017284872010350227,
0.003341792616993189,
0.30157437920570374,
-0.053013235330581665,
0.09647361934185028,
-0.8610103726387024,
0.22275039553642273,
0.4117410182952881,
-0.20606277883052826,
0.04444790... | |
nice scrollview behavior?
Cheers.
Cyril
Do you somewhere have a class or interface named `T`, or are you using `T` as a concrete type name somewhere instead of as a type parameter (which means you might have forgotten somewhere else, for example in an enclosing class, to specify that `T` is a type parameter)? I can r... | [
0.2916700839996338,
-0.15092799067497253,
0.22657614946365356,
0.18627837300300598,
-0.237015962600708,
-0.41914060711860657,
0.32120200991630554,
0.30306732654571533,
-0.0110725536942482,
-0.497702419757843,
0.12364889681339264,
0.7438964247703552,
-0.24615028500556946,
0.1013874188065528... | |
getObject();
}
```
If I remove class `T`, it disappears. | [
-0.3869812786579132,
-0.1436421126127243,
0.09496620297431946,
-0.1736137568950653,
0.2209215760231018,
-0.3011796474456787,
0.3890369236469269,
0.19159844517707825,
0.2541850209236145,
-0.49768611788749695,
-0.638512372970581,
0.594997227191925,
-0.564511775970459,
0.30392035841941833,
... | |
Can I drag&drop a folder from my home folder that has many subdirs and even .svn subdirs into my Navigator view in my subclipsed Ecplipse?
Do you somewhere have a class or interface named `T`, or are you using `T` as a concrete type name somewhere instead of as a type parameter (which means you might have forgotten som... | [
0.2718677818775177,
-0.14538051187992096,
-0.003420095657929778,
0.11803881824016571,
0.09833656996488571,
-0.1440950334072113,
0.20369283854961395,
0.17684487998485565,
-0.4051128625869751,
-0.6672540307044983,
-0.002727113664150238,
0.6279552578926086,
-0.3842562735080719,
0.055460665374... | |
type T
}
interface A<T> extends B<T> { // warning: The type parameter T is hiding the type T
T getObject();
}
```
If I remove class `T`, it disappears. | [
0.12907639145851135,
-0.3795774281024933,
-0.011001208797097206,
-0.2621173560619354,
0.2432541847229004,
-0.14598120748996735,
0.40432214736938477,
-0.0486375093460083,
0.22593903541564941,
-0.576848566532135,
-0.5747297406196594,
0.5703690648078918,
-0.6914940476417542,
0.249685466289520... | |
Im trying to use Nets/HTTP to use `POST` and put in a custom user agent. I've typically used `open-uri` but it cant do `POST` can it?
I use
```
resp, data = Net::HTTP.post_form(url, query)
```
How would I change this to throw custom headers in?
Edit my query is:
```
query = {'a'=>'b'}
```
You can try this, for ... | [
0.3108895719051361,
0.025909097865223885,
0.43537384271621704,
-0.07354503124952316,
-0.23778694868087769,
0.017235590144991875,
0.10614137351512909,
-0.3147321343421936,
-0.0555107556283474,
-0.7196267247200012,
-0.14715693891048431,
0.39724284410476685,
-0.6838592886924744,
0.20658090710... | |
Is there a way without using extra space to find LCA of nary tree.
I did it using a string saving the preorder of both the nodes and finding common prefix
If nodes "know" their depth - or you're willing to allow the space to compute the depth of your nodes, you can back up from the lower node to the same depth of the h... | [
0.0014786837855353951,
-0.41905760765075684,
0.3826436698436737,
0.3004211187362671,
0.14624817669391632,
0.40103960037231445,
-0.08011061698198318,
-0.41653573513031006,
-0.4111804962158203,
-0.5660195350646973,
0.34445688128471375,
0.2887131869792938,
0.014536428265273571,
0.153233572840... | |
nodes. Is that too much space?
Another possibility is given you don't have a parent pointer, you can use pointer reversal - every time you traverse a pointer, remember the location from which you came, remember the pointer you will next traverse, and then just before the next pointer traversal, replace that pointer wi... | [
-0.48215389251708984,
-0.24460428953170776,
0.6365401148796082,
0.2291627824306488,
0.3036532998085022,
0.26774758100509644,
0.3121159076690674,
0.2876555025577545,
-0.4047206938266754,
-0.7677814960479736,
0.1214972510933876,
0.22491613030433655,
-0.16794531047344208,
0.3421923518180847,
... | |
nodes you seek, so that you can work your way back up from the lower one until you're at the same height in both traversals, and then work back up from both until you're at the common node. This takes three extra pieces of memory - one for each of the current depths, one for the temporary used during a pointer reversal... | [
-0.06312808394432068,
-0.2162528932094574,
0.6214737892150879,
0.40596553683280945,
0.36899739503860474,
0.3694230318069458,
0.08644434064626694,
-0.21074678003787994,
-0.5073896646499634,
-0.6521209478378296,
0.018699347972869873,
0.5299405455589294,
0.11765540391206741,
-0.25390726327896... | |
Every other preference I have fires its OnPreferenceChangeListener. However, my RingtonePreference it doesn't:
```
p = getPreferenceScreen().findPreference("pref_tone");
String rname = preferences.getString("pref_tone",Settings.System.DEFAULT_RINGTONE_URI.toString());
String name = ringtoneToName(rname);
p.setSummary(... | [
-0.23644420504570007,
-0.20321127772331238,
0.8865023255348206,
-0.20961490273475647,
0.13112224638462067,
0.26280686259269714,
0.29288676381111145,
-0.5911868214607239,
0.14755716919898987,
-0.30133873224258423,
-0.049775999039411545,
0.7542735934257507,
-0.17936007678508759,
0.1587872803... | |
THere is a oracle query that I am trying to recreate using OpenJPA. I am writing a service in Websphere integration developer, and I am using OpenJPA as my ORM tool of choice. Previously this query was performed using a stored proc, a ref cursor was used and the information was retrieved like that. Now we are trying to... | [
-0.1695598065853119,
0.3042198121547699,
0.3335994780063629,
0.07262865453958511,
-0.11060145497322083,
0.4267042875289917,
-0.22172078490257263,
-0.06637468189001083,
-0.5043418407440186,
-0.42221373319625854,
-0.07674376666545868,
0.1242227554321289,
-0.3283722698688507,
0.02781652472913... | |
S.col6,
PC.col7,
P.col8,
A.ADDRESS_1,
A.ADDRESS_2,
A.ADDRESS_3,
A.CITY,
A.COUNTY,
A.STATE,
A.ZIP_CODE,
P.CONFIRMED_BY,
P.CONFIRMED_DATE,
P.MOD_USERID,
P.MOD_DATE
FROM EPCD13.PROVIDER P, EPCD13.provider_channel PC, EPCD13.provider_channel_link pcl,
EPCD13.provider_specialty ps... | [
0.09656480699777603,
-0.08002083748579025,
1.1447701454162598,
0.14573533833026886,
0.4382765293121338,
0.48672720789909363,
-0.10040443390607834,
-0.07627839595079422,
-0.43297773599624634,
-0.8692097663879395,
-0.3841814398765564,
0.19568070769309998,
0.07238182425498962,
0.0565858706831... | |
= pc.channel_type_id (+)
AND PC.CHANNEL_ADDRESS NOT LIKE '%@%'
AND P.RESOURCE_ID = AL.RESOURCE_ID (+)
AND AL.ADDRESS_ID = A.ADDRESS_ID (+)
AND 1 = A.ADDRESS_TYPE_ID (+)
AND 1 = AL.PREFERENCE (+);
```
Notice all those inner Joins and so forth. I am thinking right now of putting a named query in one my metho... | [
0.0653071179986,
0.25943759083747864,
0.5710079073905945,
-0.2711263597011566,
0.07734555006027222,
0.12101811915636063,
-0.18933142721652985,
-0.08304514735937119,
-0.04621405526995659,
-0.7650132179260254,
0.46235623955726624,
0.5846636295318604,
-0.40399792790412903,
0.2888532280921936,... | |
thinking there has to be a simpler way to do this? Maybe not. Can I just call a stored proc using JPA?
You can create a JPA entity for each table and then join the entities by doing something similar to this:
<http://openjpa.apache.org/builds/1.1.1-SNAPSHOT/docs/jpa_overview_mapping_full.html>
Look at the `@OnetoMany a... | [
0.40723732113838196,
-0.20012012124061584,
0.005719580687582493,
0.29866930842399597,
-0.39419421553611755,
-0.10290364921092987,
0.02008429542183876,
0.03856760263442993,
-0.25611233711242676,
-0.5431309938430786,
0.4122740626335144,
0.32426461577415466,
-0.1842329055070877,
0.07836791872... | |
This question is about overriding a virtual method in a derived class with a different return type.
For the following code:
```
class father {
public:
virtual father* ref() { return this; }
};
class child : public father {
virtual child* ref() { return this; }
};
```
When I try to get a pointer directly, g++ (F... | [
-0.04101881757378578,
0.2565454840660095,
0.15589569509029388,
-0.06641945987939835,
0.348857581615448,
0.29995331168174744,
0.20104995369911194,
-0.1630544513463974,
-0.13436667621135712,
-0.6757963299751282,
-0.15850980579853058,
0.47286197543144226,
-0.10621251165866852,
0.5947313904762... | |
cast?
Extra description:
I understand the reason why compiler report this error. What I need is something out of the box which can access the data in derived object without explicitly convert a pointer.
The father class is used to put different derived child objects into lists or vectors, so when an item is fetch fro... | [
0.49959796667099,
0.15702007710933685,
-0.2667451500892639,
0.24973897635936737,
-0.14364944398403168,
0.15268678963184357,
0.1318354606628418,
-0.3789553642272949,
0.15477482974529266,
-0.6079500913619995,
0.2573281228542328,
0.349788099527359,
-0.2859937250614166,
0.2924143373966217,
-... | |
assuming pf is pointer pointed to an item fetch from a vector
switch(fp->get_type()) {
case child_type1: fp->ref()->list1.push(data); break;
case child_type2: fp->ref()->list2.push(data); break;
case child_type3: fp->ref()->list3.push(data); break;
}
```
Right now, I need to explicitly declare a new variable or expli... | [
0.039585042744874954,
-0.10900010913610458,
0.47908005118370056,
-0.12295939028263092,
0.30328819155693054,
0.18656593561172485,
0.07203637808561325,
-0.504459798336029,
-0.09638934582471848,
-0.45383065938949585,
-0.31015339493751526,
0.5038962364196777,
-0.24409890174865723,
-0.031978193... | |
the extra information (`child*` rather than `father*`) about `ref` when you threw away `m_child`s type information, by storing it as pointer to base (`pf`).
One reason why it will never be possible without a cast is this example:
```
class father {
public:
virtual father* ref() { return this; }
};
class childA : p... | [
0.22712452709674835,
0.16899465024471283,
0.09435111284255981,
-0.23239560425281525,
0.34719565510749817,
0.2453390508890152,
0.28964924812316895,
-0.3569699227809906,
0.020640278235077858,
-0.6670134663581848,
-0.1480616182088852,
0.19834844768047333,
-0.13591255247592926,
0.6185381412506... | |
}
// This is evil and will not compile
childA * pa = pf->ref();
//But this is OK:
childA * pa = dynamic_cast<childA*>(pf->ref() );
}
```
If you really want to make this doable without the dynamic cast you can just hide the dynamic cast (but it scares me a little)
```
class father {
public:
virtual fa... | [
-0.009086999110877514,
0.05826064571738243,
0.2646580636501312,
-0.2153398096561432,
0.45139312744140625,
0.16299320757389069,
0.515263020992279,
-0.11070308834314346,
-0.027099762111902237,
-0.5369877219200134,
-0.037517789751291275,
0.684185266494751,
-0.4792941212654114,
0.3882532417774... | |
I have this code that doesn't work in IE8:
```
$("#intro-screenshot").hover(
function(){
$(".img-action").show();
},
function(){
if(!$(".img-action").is(":hover")) {
$(".img-action").hide();
}
}
);
```
It breaks on this line: `if(!$(".img-action").is(":hover"))`
HTML:
```
<a ... | [
0.2179163247346878,
0.13411159813404083,
0.639529287815094,
-0.252676784992218,
-0.03523203730583191,
-0.2566312253475189,
0.32667213678359985,
-0.11192657798528671,
-0.18141573667526245,
-0.6876482963562012,
-0.17792324721813202,
0.36522218585014343,
-0.39119696617126465,
0.13035036623477... | |
solve, and more elegantly too.
```
#inner {
display: none;
}
#outer:hover #inner {
display: block;
}
```
jsFiddle: <http://jsfiddle.net/7xMpr/>
**EDIT:**
And a jsFiddle using your code <http://jsfiddle.net/QeLSJ/1/> | [
-0.21219584345817566,
0.22459964454174042,
0.5705091953277588,
-0.22968535125255585,
-0.09973802417516708,
0.12546396255493164,
0.08301277458667755,
-0.4222019910812378,
-0.3832307457923889,
-0.9353054165840149,
-0.14716605842113495,
0.26138702034950256,
-0.6649796366691589,
-0.12115215510... | |
The following code which is displaying a value from within an array is presenting different results when wrapped in a foreach() as opposed to when I use a simple for-loop. The for-loop is presenting the correct data but the foreach() appears to be amending the input array with every iteration.
```
$arr = array_merge($... | [
0.13052113354206085,
0.13148437440395355,
0.36134952306747437,
-0.6471974849700928,
-0.011502367444336414,
0.42734846472740173,
0.297861784696579,
-0.9117069840431213,
-0.2631494104862213,
-0.22625359892845154,
-0.12459331750869751,
0.39243993163108826,
-0.5112716555595398,
-0.065716408193... | |
array is changing with each iteration:
```
56256.00
45652.00
50726.00
317896.00
...
```
How can this be?
Note: I know the code above is contrived (obviously within the foreach() I'm actually wanting to do further processing and refer to each element of the array that I'm iterating through, not just look at the 91st... | [
0.23828138411045074,
0.18638546764850616,
0.41415783762931824,
-0.5924763679504395,
-0.16804227232933044,
0.24935509264469147,
0.38358598947525024,
-0.3328818678855896,
-0.25401607155799866,
-0.589846670627594,
0.21166381239891052,
0.5128474831581116,
-0.4730381965637207,
0.178285077214241... | |
$arr[89]['circread\_value'] or $arr[91]['circread\_value'], I get consistent values from the foreach() too.
* The (seemingly random) values that I see in the foreach() are actually values from other elements in the array (the array as it looks prior to beginning the foreach)
The input arrays ($arr1 and $arr2) can be f... | [
0.0946941077709198,
0.15633736550807953,
0.5765353441238403,
-0.3079414367675781,
-0.2820068299770355,
0.09627814590930939,
0.03396335989236832,
-0.3740901052951813,
-0.33706867694854736,
-0.5842429995536804,
-0.003871087683364749,
0.6139327883720398,
-0.42441368103027344,
-0.2630634307861... | |
I have a web page into a html iframe, the web page has a javascript function to open links, that function use the window.open method to open a new window.
I cannot modify the javascript function (the page is made with mapguide), so I want to catch that call outside of the iframe to put the content of the new window in... | [
0.2604016363620758,
0.20941495895385742,
0.37485700845718384,
-0.07023001462221146,
-0.20431284606456757,
-0.3327582776546478,
0.213853120803833,
-0.08607318997383118,
-0.1065935492515564,
-0.9686229228973389,
-0.007752616889774799,
0.3759912848472595,
-0.47151944041252136,
0.0913728624582... | |
in the same domain to avoid XSS security errors.
HTML:
```
<iframe id="myFrame" src="...">
</iframe>
```
javascript in the parent window:
```
var frame = document.getElementById('myFrame');
if (frame) {
frame.contentWindow.open = function (url, windowName, windowFeatures) {
// do whatever you want her... | [
0.25332319736480713,
0.13824431598186493,
0.5892795324325562,
-0.07541920989751816,
-0.0882256031036377,
-0.20701441168785095,
0.19508729875087738,
-0.16341163218021393,
-0.15517491102218628,
-0.9477237462997437,
-0.513727068901062,
0.30254030227661133,
-0.3295881152153015,
0.1118280664086... | |
I keep getting this error and I have tried putting quotes around the actual array, periods, nothing has worked.
Parse error: syntax error, unexpected T\_ENCAPSED\_AND\_WHITESPACE, expecting T\_STRING or T\_VARIABLE or T\_NUM\_STRING on line 8
```
$id = $_GET['id'];
$record = "SELECT `Name`, `Type`, `Size`, `Content` ... | [
0.048376381397247314,
0.06184839829802513,
0.3563744127750397,
0.04643697291612625,
-0.09828631579875946,
0.2778514623641968,
0.21727320551872253,
-0.2478332370519638,
-0.1719367355108261,
-0.26179271936416626,
-0.3826080858707428,
0.38604268431663513,
-0.5914197564125061,
-0.1702975481748... | |
intval($_GET['id']) : 0;
// Removed quotes from 'id'=...
$record = "SELECT `Name`, `Type`, `Size`, `Content` FROM election_candidates WHERE `ID` = $id";
$result = $db->query($record);
foreach ($result as $results) {
// complex (curly) syntax
header("Content-length: {$results['Size']}");
// simple syntax (w... | [
-0.0647210106253624,
0.17504234611988068,
0.3904605805873871,
-0.20791396498680115,
-0.1675552874803543,
0.3773832321166992,
0.2372109591960907,
-0.5677589178085327,
0.07748059183359146,
-0.3440398871898651,
-0.04114680737257004,
0.5534537434577942,
-0.42643627524375916,
-0.098347380757331... | |
add `LIMIT 1` to the SQL query and remove the `foreach` loop ;) | [
0.008570301346480846,
0.22536791861057281,
0.36688390374183655,
-0.25789979100227356,
0.3672885000705719,
-0.2840246260166168,
0.09414615482091904,
-0.15933658182621002,
0.20841087400913239,
-0.18147748708724976,
-0.41972267627716064,
0.39181074500083923,
-0.532977819442749,
-0.03471135348... | |
I'm working on converting an old define()-based language/translation system to a more flexible one (probably JSON-based, but it's still open).
As part of this conversion, I will need to convert from 42 .php files with several thousand strings each to whatever format I'll be using. Some of the defined strings reference... | [
0.5275941491127014,
0.027153272181749344,
0.3986593186855316,
-0.1394500583410263,
-0.29298678040504456,
0.05856263265013695,
0.14834654331207275,
-0.2385256141424179,
-0.19106505811214447,
-0.7721344828605652,
0.2821873128414154,
0.48234179615974426,
-0.19006645679473877,
0.09029486775398... | |
recognizable 'LNG\_' prefix, converting a single file is trivial. But I'd like to make a small script which handles all 42 in one run.
Ideally I'd be able to either undefine or redefine the define()'s, but I can't find a simple way of doing that. Is this at all possible?
Alternatively, what would be a good way of han... | [
-0.18219943344593048,
-0.03344530612230301,
0.07664719969034195,
-0.18094201385974884,
-0.12410204857587814,
0.15451036393642426,
0.21651138365268707,
-0.13935251533985138,
-0.07766468077898026,
-0.788819432258606,
-0.13700683414936066,
0.5113117694854736,
-0.5628423094749451,
0.0939476639... | |
will contain all constants defined by your script:-)
P.S: I'm not a good php coder, it was just a suggestion :-) | [
0.3475704789161682,
0.0038591946940869093,
0.5473278164863586,
0.10362391173839569,
0.15300242602825165,
-0.09633247554302216,
0.32349294424057007,
-0.1680627465248108,
0.1436852663755417,
-0.5639570951461792,
-0.029819924384355545,
0.448218435049057,
-0.27745553851127625,
-0.4917451143264... | |
I am trying to create a program that approximates e (e=1+1/1!+1/2!+1/3!+...) to a limiting factor epsilon. The program should continue adding terms until the current statement becomes less than epsilon, where epsilon is a small (floating-point) number entered by a user.
I can write the program that approximates e to t... | [
-0.028859911486506462,
-0.02984192781150341,
0.34966111183166504,
-0.3550591468811035,
0.2105148583650589,
0.23186898231506348,
0.48063892126083374,
-0.3274497389793396,
0.26492393016815186,
-0.7602794170379639,
-0.14699718356132507,
0.5403540730476379,
-0.42768001556396484,
0.025258570909... | |
l--)
{
p*=l;
if (1/p<epsilon) {
goto done;
}
}
e+=1/p;
i++;
}
done:
printf("The value of e limited by epsilon is %f\n",e);
return 0;
}
```
Here's my solution:
```
double eulersNumber(double epsilon)
{
double e = 0;
double factorial = 1;
for ... | [
-0.17978514730930328,
-0.37711676955223083,
0.5013706088066101,
-0.44509464502334595,
0.2829541563987732,
0.24586765468120575,
0.2837556004524231,
-0.5987800359725952,
0.2353142350912094,
-0.5897121429443359,
-0.5278516411781311,
0.5472879409790039,
-0.4026050269603729,
-0.1965909004211425... | |
TRUE; i++) {
double add = 1.0 / factorial;
if (add < epsilon)
break;
e += add;
factorial *= i;
}
return e;
}
``` | [
0.2500816583633423,
-0.1895565241575241,
0.3306959271430969,
-0.5042599439620972,
0.20097243785858154,
-0.10557828843593597,
0.6345326900482178,
-0.6746641993522644,
0.18493735790252686,
-0.3795730769634247,
-0.5029420256614685,
0.71608966588974,
-0.49001845717430115,
-0.11575084924697876,... | |
Using log4net 1.2.11.0 w/ .NET, how can I get the RollingFileAppender to output UTC dates?
According to Apache it should be as easy as:
```
<dateTimeStrategy type="log4net.Appender.RollingFileAppender+UniversalDateTime" />
```
Unfortunately this is not working.
The entirety of my log4net configuration is:
```
<... | [
0.2047492116689682,
-0.255599707365036,
0.6522617340087891,
0.046099234372377396,
-0.06772278994321823,
-0.04063602164387703,
0.01616380736231804,
0.16926565766334534,
-0.41838476061820984,
-0.4854966700077057,
-0.10358961671590805,
0.6544691324234009,
-0.15196342766284943,
0.0630700737237... | |
<dateTimeStrategy type="log4net.Appender.RollingFileAppender+UniversalDateTime" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level %logger - %message%newline" />
</layout>
</appender>
<root>
<!-- Options are "ALL", "DEBUG", "INFO", "WARN", "ERROR",... | [
-0.08206046372652054,
-0.40348324179649353,
0.5512903928756714,
-0.16161833703517914,
0.24123629927635193,
0.24373885989189148,
0.011888530105352402,
0.029178472235798836,
-0.35623660683631897,
-0.6167762875556946,
-0.3186401128768921,
0.5003204345703125,
-0.32576897740364075,
0.1625511795... | |
by %utcdate.
Example:
```
<conversionPattern value="%utcdate{ABSOLUTE} UTC %c{1} - %m%n" />
```
In this example, {ABSOLUTE} is a date format specifier: see [The Log4Net PatternLayout documentation](http://logging.apache.org/log4net/release/sdk/?topic=html/T_log4net_Layout_PatternLayout.htm) for more info.
I suspec... | [
0.4772297739982605,
-0.355619877576828,
0.32500407099723816,
0.02027513086795807,
0.17239031195640564,
-0.010033460333943367,
-0.05046924948692322,
0.44565075635910034,
-0.3087266981601715,
-0.34812042117118835,
-0.09855350106954575,
0.40358126163482666,
0.0298127681016922,
0.4084465503692... | |
I am trying to write a login function with dojo. In my case, I need a post request to a extern (!!) server in this case:
login is defined as followed:
> **login**
>
>
> Login is a special action, not handling any data, but authenticating a user. A POST request is to be made, containing a json object with keys 'emai... | [
-0.010397824458777905,
0.054411210119724274,
0.3421666920185089,
-0.21443042159080505,
-0.20192362368106842,
0.008000601083040237,
0.35998743772506714,
-0.14171862602233887,
0.20063379406929016,
-0.5241336226463318,
-0.40000003576278687,
0.30898424983024597,
-0.34219011664390564,
0.0314207... | |
password
>
>
> **Description:** Returns all data for the logged in user in PLIST format. if login fails, false is returned in PLIST format.
Well, I tried to solve that problem with a io.iframe.send call, but i get the following error: Error: Permission denied to access property 'getElementsByTagName'
However, I am ... | [
0.04772358387708664,
0.038576457649469376,
0.5897878408432007,
-0.15023568272590637,
0.18782824277877808,
-0.37831252813339233,
0.5867157578468323,
-0.26158541440963745,
-0.021709544584155083,
-0.822266697883606,
-0.28183096647262573,
0.761208176612854,
-0.25971224904060364,
0.182750910520... | |
var password = dom.byId("logPassword").value;
function JSONreq(){
var jsonpArgs = {
method: 'POST',
handleAs:"json",
content:{
email: email, | [
-0.3655674457550049,
-0.2632543444633484,
0.5390257835388184,
-0.1882130652666092,
0.12087614089250565,
0.19142581522464752,
0.6306684017181396,
-0.028414878994226456,
-0.2310991734266281,
-0.5397503972053528,
-0.37699005007743835,
0.6773236989974976,
-0.3982800841331482,
0.056475859135389... | |
password: password
},
url: "http://---someServerThatIDontWantToName---/api2/login",
load: function (response, ioargs){
//console.log(response) | [
-0.48828762769699097,
-0.050413671880960464,
0.42686787247657776,
0.12302878499031067,
0.24918682873249054,
0.2288440763950348,
0.13725793361663818,
-0.014519700780510902,
-0.0680728554725647,
-0.6215601563453674,
-0.34086596965789795,
0.6607542634010315,
-0.22180543839931488,
0.3257448375... | |
alert('succes');
},
error: function(response, ioargs){
alert("error");
}
}; | [
-0.33100321888923645,
-0.4725274443626404,
0.21443359553813934,
-0.238560751080513,
0.3273327648639679,
0.26364266872406006,
0.155669167637825,
0.08488192409276962,
-0.06782170385122299,
-0.410086065530777,
-0.6850423812866211,
0.727980375289917,
-0.4321150779724121,
0.11389007419347763,
... | |
iframe.send(jsonpArgs);
}
dojo.ready(JSONreq);
});
};
```
---
is there any difference in mobile development? cross server post requests should be possible on a mobile device.
so: can i use io.iframe.send for this reason?
Anser in short is, you cannot at any given time use POST request on a X-do... | [
0.07934790104627609,
-0.1243005022406578,
0.5388554930686951,
-0.21480488777160645,
-0.05369943007826805,
0.04953724890947342,
0.30423054099082947,
-0.2036968618631363,
-0.18891723453998566,
-0.7805059552192688,
-0.13963162899017334,
0.4878314137458801,
-0.2517397105693817,
0.3227011561393... | |
exists, create as such: `dojo.create("input", {type: "hidden", name: name, value: value}, fn);`
* else if it does, set the value on form.element-of-name.
So, first of all DOM lookup will fail in 2) due to security restrictions, meaning 'not exists', then in turn, 2.1) dojo.create will fail with same reason.
Typical ... | [
0.219159334897995,
-0.16624057292938232,
0.7039238810539246,
0.008860238827764988,
0.020287323743104935,
-0.5378612279891968,
0.46002304553985596,
-0.34581249952316284,
-0.17153401672840118,
-0.5312216281890869,
-0.4043722152709961,
0.433639258146286,
-0.26170533895492554,
0.22387196123600... | |
request uri on x-domain, say "form action"
$action = $\_REQUEST["url"];
// Method only looks for POST and defaults GET
$method = $\_REQUEST["method"];
// Query placeholder, filled by rolling through \_REQUEST, will append all but method / url pairs
$fields = "";
// Authorize against allowedDomains or die
foreach ($... | [
-0.261420875787735,
-0.16822212934494019,
1.022414207458496,
-0.11541748046875,
0.0806669294834137,
0.09117441624403,
0.04255193471908569,
-0.47562375664711,
-0.13042263686656952,
-0.41660866141319275,
-0.5438377261161804,
0.23337849974632263,
-0.3266679048538208,
0.4288375973701477,
0.2... | |
. rawurlencode($value) . "&";
}
```
}
$fields = substr($fields, 0, strlen($fields) - 1);
// Setup curl
$ch = curl\_init();
if (strtoupper($method) == "POST") {
curl\_setopt($ch, CURLOPT\_URL, $action);
curl\_setopt($ch, CURLOPT\_POST, 1);
curl\_setopt($ch, CURLOPT\_POSTFIELDS, $fields);
} else {
curl\_setopt($ch... | [
-0.0657273530960083,
-0.18489450216293335,
0.5279408097267151,
-0.10653389245271683,
-0.22205917537212372,
0.2600407004356384,
0.4033504128456116,
-0.28298264741897583,
-0.10637111216783524,
-0.5964887142181396,
-0.5635435581207275,
0.38077476620674133,
-0.39232969284057617,
0.117617420852... | |
I have a decorator and I want to assert that certain methods in my code are decorated with it.
```
import functools
def decorator(func):
def _check_something(*args, **kwargs):
# some logic in here
return func(*args, **kwargs)
return functools.wraps(func)(_check_something)
class MyClass(object... | [
0.6630801558494568,
0.08222527801990509,
0.3573102056980133,
0.004511312581598759,
0.11878091096878052,
0.07897500693798065,
0.25596877932548523,
-0.5360405445098877,
-0.03393614664673805,
-0.757064700126648,
-0.008803043514490128,
0.556324303150177,
-0.1578492373228073,
0.1411199867725372... | |
to mark the wrapper function with an attribute, that you then assert.
A good practice is to have the decorator set a [\_\_wrapped\_\_](https://docs.python.org/3/library/functools.html#functools.update_wrapper) attribute pointing to the original function on the returned wrapper.
thus:
```
def decorator(func):
@fu... | [
0.345939040184021,
0.08304283022880554,
0.3595641255378723,
-0.1224541962146759,
-0.1304437816143036,
0.0028311745263636112,
0.06226788088679314,
-0.5608775019645691,
-0.16507701575756073,
-0.548153817653656,
-0.29077184200286865,
0.5534756779670715,
-0.04032216966152191,
-0.06544416397809... | |
Basically the user should be able to click on one link and download multiple pdf files. But the Catch is I cannot create files on server or anywhere. Everything has to be in memory.
I was able to create memory stream and Response.Flush() it as pdf but how do I zip multiple memory streams without creating files.
Here... | [
0.17151765525341034,
-0.03457840159535408,
0.591399610042572,
-0.0034601532388478518,
-0.16551117599010468,
-0.09772519022226334,
0.20142094790935516,
-0.29310575127601624,
-0.36567386984825134,
-0.8587952256202698,
-0.275809109210968,
0.39329689741134644,
-0.3385959267616272,
0.2270684987... | |
a timestamp in the filename in the content-disposition
byte[] abyBuffer = new byte[4096];
ZipOutputStream outStream = new ZipOutputStream(Response.OutputStream);
outStream.SetLevel(3);
#region Repeat for each Memory Stream
MemoryStream fStream = CreateClassroomRoster();// This returns a memory stream... | [
-0.2253403216600418,
-0.42068877816200256,
0.8513443470001221,
-0.09464382380247116,
0.4054366648197174,
0.16153407096862793,
0.2323814332485199,
-0.3014754056930542,
-0.3311762511730194,
-0.8062348961830139,
-0.6586831212043762,
0.1659473180770874,
-0.23677869141101837,
0.2797887325286865... | |
there's no file inside it
I am using
using iTextSharp.text - for creating pdf
using ICSharpCode.SharpZipLib.Zip - for Zipping
Thanks,
Kavita
This link describes how to create a zip from a MemoryStream using SharpZipLib: <https://github.com/icsharpcode/SharpZipLib/wiki/Zip-Samples#wiki-anchorMemory>. Using this and iT... | [
0.0893000140786171,
-0.07255309820175171,
0.6313284635543823,
0.03519304469227791,
-0.15466651320457458,
-0.06680944561958313,
0.018611222505569458,
-0.38002878427505493,
-0.2107982635498047,
-0.5116941928863525,
0.011035401374101639,
0.32282698154449463,
-0.1862240880727768,
0.03246907144... | |
zipStream.PutNextEntry(newEntry);
bytes = CreatePDF(++i);
MemoryStream inStream = new MemoryStream(bytes);
StreamUtils.Copy(inStream, zipStream, new byte[4096]);
inStream.Close();
zipStream.CloseEntry();
}
zipStream.IsStreamOwner = false; // False stops the Close also Closing the underlying st... | [
-0.16713255643844604,
-0.21267692744731903,
0.8802411556243896,
-0.45936766266822815,
0.28145915269851685,
0.047681670635938644,
0.2703492343425751,
-0.3939770460128784,
-0.201294407248497,
-0.5556089282035828,
-0.44213899970054626,
0.397595077753067,
-0.4679230749607086,
0.278161227703094... | |
Document document = new Document(PageSize.A4, 25, 25, 30, 30);
PdfWriter writer = PdfWriter.GetInstance(document, ms);
document.Open();
document.Add(new Paragraph("Hello World " + i));
document.Close();
writer.Close();
bytes = ms.ToArray();
}
return bytes;
}
``` | [
-0.25989019870758057,
0.11691354215145111,
1.1989599466323853,
-0.19811862707138062,
0.09217236936092377,
0.19819925725460052,
0.3624970018863678,
-0.32484719157218933,
-0.30639979243278503,
-0.8039801120758057,
-0.6261692643165588,
0.2693234980106354,
-0.2866054177284241,
0.50367665290832... | |
I'm new to Rails and am currently working through a guide.
The guide states:
> Use a text editor to update the Gemfile needed by Bundler with the
> contents of Listing 2.1.
>
>
>
> ```
> source 'https://rubygems.org'
>
> gem 'rails', '3.2.3'
>
> group :development do
> gem 'sqlite3', '1.3.5'
> end
>
>
> # G... | [
0.4335583448410034,
0.2925797700881958,
0.2917730510234833,
-0.07173314690589905,
-0.049159497022628784,
-0.23929446935653687,
0.28337806463241577,
-0.5994095802307129,
0.15884917974472046,
-0.7222994565963745,
0.052746664732694626,
0.5625793933868408,
0.145255908370018,
0.1224619895219802... | |
gem 'pg', '0.12.2'
> end
>
> ```
>
> We then install and include the gems using the `bundle install`
> command:
>
>
>
> ```
> $ bundle install --without production
>
> ```
>
> If Bundler complains about `no such file to load -- readline
> (LoadError)` try adding `gem ’rb-readline’` to your Gemfile.)
I fo... | [
0.6741282343864441,
-0.16349877417087555,
0.3448174297809601,
-0.0499749593436718,
-0.2662801146507263,
-0.12090408056974411,
0.22534792125225067,
-0.7044128179550171,
-0.04391087591648102,
-0.20438115298748016,
-0.23831091821193695,
0.8220431804656982,
-0.17422674596309662,
0.021050406619... | |
and my version of Rails is 3.2.1 so I tried changing it to 3.2.1 but that didn't work either.
Any thoughts or advice would be much appreciated.
You just need to change directories to your app, THEN run `bundle install` :) | [
0.44540300965309143,
-0.2955531179904938,
0.15056557953357697,
0.07705634087324142,
0.0008517287205904722,
-0.035362571477890015,
0.45338308811187744,
0.016317473724484444,
-0.0431017205119133,
-0.7759520411491394,
0.07654240727424622,
0.5944055318832397,
-0.4419116973876953,
-0.2550281286... | |
I have this bit of code,
```
public static List<string> GetSentencesFromWords(List<string> words, string fileContents)
{
return fileContents.Split('.')
.Where(s => words.Any(w => s.IndexOf(w) != -1))
.Select(s => s.TrimStart(' ') + ".")
.ToList();
}
```
It works brilliantly, another use... | [
0.11626249551773071,
-0.0032405867241322994,
0.4777619540691376,
-0.06256651878356934,
0.06372764706611633,
-0.15773123502731323,
0.2860977351665497,
-0.26604583859443665,
-0.22377650439739227,
-0.8149268627166748,
-0.26732373237609863,
0.611835777759552,
-0.18266628682613373,
0.0961912795... | |
it a few ways but I am not very experienced with Linq and everything I have tried just seems to sort by sentence length rather than word count.
You already have Excel open so you do not need to open another copy. Try:
```
Set WBookOther = Workbooks.Open(PathCrnt & FileNameCrnt)
:
:
WBookOther.Close SaveChanges:=Fa... | [
0.14975085854530334,
0.23366855084896088,
0.30673447251319885,
-0.09561455249786377,
-0.0020307444501668215,
-0.10644693672657013,
0.31058019399642944,
-0.11066038906574249,
-0.20887961983680725,
-0.6075725555419922,
0.07051987200975418,
0.6103161573410034,
-0.14071211218833923,
-0.0720044... | |
Issue
-----
Zlib cannot be included in any fo my scripts. If it is included, I get this error
```
LoadError: dlsym(0x7f859bc94d90, Init_Zlib): symbol not found - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0/Zlib.bundle
from /System/Library/Frameworks/Ruby.framework/Vers... | [
-0.019529426470398903,
0.5304810404777527,
0.5659710168838501,
-0.1499212086200714,
-0.08502147346735,
-0.1638471782207489,
0.30235555768013,
-0.13001225888729095,
-0.1977279633283615,
-0.5984872579574585,
-0.33753636479377747,
0.6602790951728821,
-0.5321424007415771,
0.12048821151256561,
... | |
I'am having some trouble displaying a custom-control. When the page loads it's not visible, but as soon as I resize the window it appears.
Here's the code I'm using:
```
<UserControl x:Class="KinectBewegingsanalyse.View.UserAnalysisChartView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
... | [
-0.17962639033794403,
0.32432112097740173,
0.6906723380088806,
-0.1572517603635788,
-0.31747910380363464,
0.3314719796180725,
0.1842355728149414,
-0.3617728650569916,
-0.24409393966197968,
-0.5253190398216248,
-0.12593239545822144,
0.28820860385894775,
-0.20201484858989716,
0.2062844336032... | |
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<c:StockChart Name="test" Visibility="Visible" PeriodSelectorVisibility="Hidden" IsEquallySpaced="Fals... | [
-0.10250844061374664,
-0.17435574531555176,
0.22585289180278778,
0.18876293301582336,
0.2169574648141861,
-0.0072266943752765656,
0.13866941630840302,
-0.38177263736724854,
-0.2581658363342285,
-0.6525508165359497,
-0.01500515453517437,
0.3957252502441406,
0.1510222852230072,
0.06275784224... | |
ValuesEnabled="True" Stroke="Transparent" StrokeThickness="0" />
</c:Chart.DateTimeAxis>
<c:Chart.LeftValueAxis>
<c:ValueAxis ValuesFormatString="0°" Stroke="Transparent" StrokeThickness="0" />
</c:Chart.LeftValueAxis>
<c:Chart.Graphs> | [
-0.28088733553886414,
-0.09839925169944763,
0.7964304089546204,
0.21166659891605377,
-0.016888029873371124,
-0.03998337313532829,
0.009866622276604176,
-0.6172751188278198,
-0.21151699125766754,
-0.5395738482475281,
0.28304925560951233,
0.39732101559638977,
-0.040376000106334686,
-0.110808... | |
<c:Graph GraphType="Line" BulletType="RoundOutline" BulletSize="8" LegendItemType="Value" LegendValueLabelText="Gemeten waarde: " LegendValueFormatString="0°" LegendPeriodItemType="Value" />
</c:Chart.Graphs>
<c:Chart.Legend>
<c:Legend PositiveValueForeground="Black"... | [
-0.009228633716702461,
0.04107494652271271,
0.23145201802253723,
-0.09976767748594284,
-0.22480373084545135,
0.16987887024879456,
0.7328700423240662,
-0.47091594338417053,
-0.4132919907569885,
-0.3173098862171173,
-0.23544758558273315,
0.133356973528862,
-0.049101658165454865,
0.1526718288... | |
</c:Chart>
</c:StockChart.Charts>
<c:StockChart.DataSets>
<c:DataSet Brush="{StaticResource TassMagenta}" ItemsSource="{Binding PerformedAnalysis}" DateMemberPath="Date" ValueMemberPath="Angle" />
</c:StockChart.DataSets>
</c:StockChart>
</Grid>
```
The customc control I'm usi... | [
0.07824330776929855,
-0.1432887315750122,
0.7044982314109802,
0.13383440673351288,
0.007550204638391733,
0.3775564432144165,
-0.05518975481390953,
-0.44912925362586975,
-0.47725266218185425,
-0.6002686023712158,
0.27166077494621277,
0.5785625576972961,
-0.03827289119362831,
0.1401184052228... | |
for the chart by doing one of the following:
* base.InvalidateVisual();
* base.UpdateLayout();
* grid.UpdateLayout();
* grid.InvalidateVisual();
* Chart.Focus();
* Chart.UpdateLayout();
* Chart.InvalidateVisual();
* Chart.Refresh();
All without any result.
**Update 3:**
When performing `Chart.Refresh();` on a Button... | [
-0.102530337870121,
-0.24181382358074188,
0.8459569215774536,
-0.20607376098632812,
0.17442843317985535,
0.10602845996618271,
0.3476148247718811,
-0.2672368288040161,
-0.4417230486869812,
-0.5409455299377441,
-0.27411791682243347,
0.8059164881706238,
-0.3159902095794678,
-0.050004310905933... | |
OSX 10.7, XCode 4.
I have a small problem: I need to push back a 2D `vector<vector<float>>` in to a 3D Vector, after a process of selection. It throws the EXC\_BAD\_ACCESS error in the push\_back function in the stl::vector template. It seems like it should be simple (I've worked with complex data structures many tim... | [
-0.08694323152303696,
0.08587010204792023,
0.5099719762802124,
-0.37121084332466125,
-0.08806655555963516,
0.18861863017082214,
0.07797183096408844,
0.027723370119929314,
-0.07802947610616684,
-0.849186897277832,
-0.09299035370349884,
0.7809242010116577,
-0.6183226108551025,
-0.12190809845... | |
my syntax is correct, but at compile time I have issues. Heres some sample code:
Implementation:
```
for(int i=0;i<fdisVec.size();i++){
int j;
if(fdisVec[i] < fdisVec2[i]){
j = 0;
}
else if(fdisVec2[i] < fdisVec[i]){
j = 1;
}
clusters[j].push_bac... | [
-0.06402808427810669,
0.1564631164073944,
0.49219730496406555,
-0.45936092734336853,
0.03777838125824928,
-0.028903916478157043,
0.3775675892829895,
-0.30617931485176086,
-0.04916934296488762,
-0.6467212438583374,
-0.45373180508613586,
0.3961448669433594,
-0.35278984904289246,
0.2248042970... | |
of class):
```
vector< vector <float> > allMfccs;
vector< vector < vector <float> > > clusters;
```
In case it helps, fdisVec and fdisVec2 are also 2d Vectors, however, the "if else" statement responds how I want it to - I highly doubt it would be something to do with that.
For general uses I normally make ... | [
-0.12720847129821777,
-0.07582958787679672,
0.33046385645866394,
0.017157644033432007,
-0.2523208260536194,
-0.1322622150182724,
0.03464660048484802,
-0.21628038585186005,
-0.4530239701271057,
-0.724469006061554,
-0.4402099549770355,
0.47443413734436035,
-0.5798330307006836,
0.139242529869... | |
{
static Logger instance;
return instance;
}
public log(const std::string& txt)
{
//do something
}
private:
Logger() {} | [
-0.07769104093313217,
-0.22244417667388916,
0.108225516974926,
-0.0034316973760724068,
-0.01709807850420475,
0.05680737644433975,
0.23468798398971558,
-0.04917318373918533,
-0.29125428199768066,
-0.2816563546657562,
-0.404685378074646,
0.5715528130531311,
-0.5546976923942566,
0.10089622437... | |
Logger(Logger const&); // Don't Implement.
void operator=(Logger const&); // Don't implement
};
```
And use it in Foo like:
```
Logger::getInstance().log("test");
```
or
```
Logger& logger = Logger::getInstance();
logger.log("test");
```
(Credits for singleton from @Loki Astari : [C++ S... | [
0.0982627347111702,
-0.0016049603000283241,
0.07125701010227203,
0.03541458398103714,
0.05234670266509056,
-0.00504383584484458,
0.3399924635887146,
-0.494830846786499,
-0.3345482647418976,
-0.23654749989509583,
-0.44024813175201416,
0.6299067139625549,
-0.45403310656547546,
0.151923909783... | |
I need to do mimic the functionality of the following Perl code
```
if($file =~ /^([^_]+)_([^_]+)_MA_(\d{4})(\d\d)(\d\d)_(\d\d)(\d\d)(\d\d)\.MA$/) {
my ($radar, $beam, $year, $month, $day, $hour, $min, $sec) =
($1, $2, $3, $4, $5, $6, $7, $8);
my $file_ts = sprintf("%04d-%02d-%02d %02d:%02d:%02d",
$yea... | [
0.1252603530883789,
0.12554602324962616,
0.7097501158714294,
-0.24649807810783386,
0.2723415195941925,
0.23547381162643433,
0.6159185767173767,
0.005270922090858221,
0.07052625715732574,
-0.45904016494750977,
0.030697690322995186,
0.5133576989173889,
-0.22310814261436462,
0.286326438188552... | |
Magento by default includes all the js files.
```
<script type="text/javascript" src="js/prototype/prototype.js"></script>
<script type="text/javascript" src="js/lib/ccard.js"></script>
<script type="text/javascript" src="js/prototype/validation.js"></script>
<script type="text/javascript" src="js/scriptaculous/builde... | [
-0.07147051393985748,
0.1448536068201065,
0.38399845361709595,
-0.07260755449533463,
-0.26662853360176086,
-0.2128472626209259,
-0.1103934720158577,
-0.45453232526779175,
0.13890203833580017,
-0.349336713552475,
-0.1809166669845581,
0.8292146921157837,
0.06926801800727844,
-0.5347964763641... | |
like the examples you have given. But I would suggest you keep both prototype and add JQuery (As many admin features etc use prototype) for the bits you need and there is a work around for the '$' issue when using the two libraries together [see http://docs.jquery.com/Using\_jQuery\_with\_Other\_Libraries] | [
0.5979225039482117,
0.042887695133686066,
-0.2131337970495224,
0.2454921156167984,
-0.08843853324651718,
-0.18154525756835938,
-0.0846824124455452,
0.2394048571586609,
-0.03901214897632599,
-0.5640490651130676,
0.12815533578395844,
0.36989548802375793,
-0.09442614763975143,
-0.030091630294... | |
TomC recommends decomposing Unicode characters on the way in, and recomposing on the way out (<http://www.perl.com/pub/2012/04/perl-unicode-cookbook-always-decompose-and-recompose.html>).
The former makes perfect sense to me, but I can't see why he recommends recomposing on the way out. Potentially you could save a sm... | [
-0.14267590641975403,
0.09259722381830215,
0.014647677540779114,
-0.12934717535972595,
-0.13170580565929413,
0.18601657450199127,
0.222499281167984,
-0.20977115631103516,
-0.2659546434879303,
-0.26667943596839905,
-0.5841382145881653,
0.24786703288555145,
0.0693795308470726,
-0.14764602482... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.