text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
);
ContentDefinitionManager.AlterPartDefinition(
typeof(AddressPart).Name, cfg => cfg.Attachable());
return 1;
}
}
}
@model ArealAds.ViewModels.EditStreetViewModel
<fieldset>
<legend>Улица</legend>
<div class="editor-label">
@Html.LabelFor(model =>... | [
-0.08039697259664536,
-0.39282840490341187,
0.8923878073692322,
-0.047465793788433075,
-0.06537464261054993,
0.19306710362434387,
0.05220581591129303,
-0.5073514580726624,
-0.33038750290870667,
-0.5597888827323914,
-0.3796713650226593,
0.375002384185791,
-0.37623128294944763,
0.27322325110... | |
@Html.ValidationMessageFor(model => model.Street.Name)
</div>
<ul>
@for (int i = 0; i < Model.Areas.Count; i++) {
<li>
<input type="hidden" value="@Model.Areas[i].Area.Id"
name="@Html.FieldNameFor(m => m.Areas[i].Area.Id)"/>
<label for="@Html.FieldNameFor(m => m.Areas[i].IsCheck... | [
0.03866409882903099,
-0.15295876562595367,
0.6654537916183472,
-0.07660268992185593,
-0.2186776101589203,
0.06985870748758316,
0.30624958872795105,
-0.8212135434150696,
-0.29591941833496094,
-0.157670795917511,
-0.1554708331823349,
0.29633310437202454,
-0.14795982837677002,
-0.108654558658... | |
id="@Html.FieldNameFor(m => m.Areas[i].IsChecked)"
@if (Model.Areas[i].IsChecked) {<text>checked="checked"</text>}/>
@Model.Areas[i].Area.Name
</label>
</li>
}
</ul>
</fieldset>
```
I had been beating my head against the wall on this for days, please make any suggestions you f... | [
0.03652316704392433,
-0.1383262574672699,
0.32868441939353943,
0.08218412846326828,
0.2636753022670746,
0.25252610445022583,
0.17349104583263397,
-0.6583614945411682,
-0.07815629243850708,
-0.8626450896263123,
0.08454003930091858,
0.5563163757324219,
-0.26419010758399963,
0.093203917145729... | |
public StreetHandler(IRepository<StreetRecord> repository) {
Filters.Add(StorageFilter.For(repository));
}
}
}
```
There is an exception on the log:
```
2012-04-10 00:07:58,515 [7] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - IdentifierGenerationException thro... | [
-0.43291422724723816,
0.11124610155820847,
0.2577398121356964,
-0.003010287182405591,
-0.12940284609794617,
0.34894612431526184,
0.6351654529571533,
-0.40365949273109436,
-0.15253578126430511,
-0.5831261873245239,
-0.23196092247962952,
0.5279504060745239,
-0.35929757356643677,
0.3548296093... | |
â NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event)
â NHibernate.Impl.SessionImpl.Save(Object obj)
â Orchard.Data.Repository`1.Create(T entity) â d:\TeamCity\Projects\Orchard-Default\src\Orchard\Data\Repository.cs:ñòðîêà 96
â Orchard.Data.Repository`1.Orchard.Data.IRepository<T>.Create(T entity) â ... | [
-0.4928533434867859,
0.06000930443406105,
0.11603917181491852,
-0.23785392940044403,
-0.05270964652299881,
0.5074083805084229,
0.34076938033103943,
-0.3631743788719177,
-0.33715417981147766,
-0.8111552596092224,
-0.47358953952789307,
0.2465466409921646,
-0.2109784334897995,
0.0801639482378... | |
public class AreaRecord : ContentPartRecord {
public virtual string Name { get; set; }
public virtual DistrictRecord DistrictRecord { get; set; }
}
public class AreaPart : ContentPart<AreaRecord> {
[Required]
public string Name {
get { return Record.Name; }
... | [
0.04479728266596794,
-0.1574569046497345,
0.6574262380599976,
0.19467678666114807,
0.30613207817077637,
-0.2647860050201416,
0.23309694230556488,
-0.06517616659402847,
-0.26731008291244507,
-0.2718040943145752,
-0.5887414813041687,
0.4782663583755493,
-0.2705925703048706,
0.490569263696670... | |
}
}
[Required]
public DistrictRecord DistrictRecord {
get { return Record.DistrictRecord; }
set { Record.DistrictRecord = value; }
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using Orchard.ContentMa... | [
-0.17898724973201752,
-0.23834696412086487,
0.5446783900260925,
0.12500299513339996,
0.3873704671859741,
0.03517644852399826,
0.2791804373264313,
-0.18697801232337952,
-0.3044368028640747,
-0.4159017503261566,
-0.4172549843788147,
0.4579008221626282,
-0.2533532977104187,
0.6248634457588196... | |
{ get; set; }
public virtual IList<StreetAreaRecord> Areas { get; set; }
public StreetRecord() {
Areas = new List<StreetAreaRecord>();
}
}
public class StreetPart : ContentPart<StreetRecord> {
[Required]
public string Name {
get { return Record.N... | [
0.19857041537761688,
-0.2570059895515442,
0.4598550796508789,
0.006029273848980665,
-0.031852588057518005,
0.1233104020357132,
0.2526152729988098,
-0.15273143351078033,
-0.09242093563079834,
-0.7701136469841003,
-0.3602726459503174,
0.42829376459121704,
-0.22513864934444427,
0.355088114738... | |
set { Record.Name = value; }
}
public IEnumerable<AreaRecord> Areas {
get {
return Record.Areas.Select (r => r.AreaRecord);
}
}
public IEnumerable<DistrictRecord> Districts { | [
-0.018201153725385666,
-0.18257619440555573,
0.47671228647232056,
0.08691354840993881,
0.46229469776153564,
-0.15613678097724915,
0.1457236409187317,
-0.33773067593574524,
-0.44424158334732056,
-0.7149603962898254,
-0.4912138283252716,
0.07964380085468292,
-0.2344249188899994,
0.3976089656... | |
get {
return Record.Areas.Select (r => r.AreaRecord.DistrictRecord).Distinct();
}
}
}
}
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Records;
namespace ArealAds.Models {
public class StreetAreaRecord : Content... | [
-0.2900030314922333,
-0.17807018756866455,
0.4693469703197479,
0.04603327065706253,
0.13362981379032135,
0.20489805936813354,
0.3444892168045044,
-0.2921306788921356,
-0.19523680210113525,
-0.6575966477394104,
-0.47760695219039917,
0.36643752455711365,
-0.09120481461286545,
0.4056098461151... | |
}
}
}
using ArealAds.Models;
using Orchard.ContentManagement.Handlers;
using Orchard.Data;
namespace ArealAds.Handlers {
public class AreaHandler : ContentHandler {
public AreaHandler(IRepository<AreaRecord> repository) {
Filters.Add(StorageFilter.For(repository));
}
}
}
using... | [
-0.04981973394751549,
-0.213829904794693,
-0.011404566466808319,
-0.15563412010669708,
0.4040347933769226,
0.3160598576068878,
0.16947099566459656,
-0.42169708013534546,
-0.37052544951438904,
-0.5897616744041443,
-0.47261902689933777,
0.5459780097007751,
-0.41074568033218384,
0.31457617878... | |
}
}
```
Your StreetAreaRecord model is missing an Id property. Since it's not a ContentPartRecord, you have to set up the property manually.
```
public virtual int Id { get; set; }
``` | [
0.30142900347709656,
0.2509545683860779,
0.22466029226779938,
0.04720350727438927,
0.07884521782398224,
-0.06749812513589859,
0.336953341960907,
0.026752371340990067,
0.18121452629566193,
-0.8207827210426331,
-0.23238925635814667,
0.6081317067146301,
-0.2494804710149765,
0.3030212223529815... | |
How can I rewrite this code to coffeescript:
```
$('.delete_action').click(function(event) {
$.get('/delete_action?name=' + event.target.name + '&date=' + $(this).attr('date'), function(data) {
});
$(this).parent().remove();
return false;
});
```
Humm, that's an easy task if you know coffeescrip... | [
0.14316242933273315,
0.1043037548661232,
0.6682093143463135,
-0.1022910550236702,
0.13429872691631317,
-0.07379314303398132,
0.23842646181583405,
-0.2699505388736725,
-0.2875683009624481,
-0.6078314185142517,
-0.131121426820755,
0.6153623461723328,
-0.4743596613407135,
0.11420204490423203,... | |
I am developing **RSS Feeds** application from the basic google resource folder.
Right now I am display all three contents as suggested into example.
1.Contacts.
2.Photos.
3.RSS Feed
here is link:
[RSS FIELD -xmladapters](http://developer.android.com/resources/samples/XmlAdapters/src/com/example/android/xmladapters/... | [
0.07762424647808075,
0.2552439570426941,
0.5869349837303162,
-0.1911870241165161,
0.011816658079624176,
-0.017271017655730247,
0.40555429458618164,
-0.5476568937301636,
-0.05321701243519783,
-0.6971202492713928,
-0.1610124260187149,
0.7560396790504456,
-0.365723580121994,
-0.00976598914712... | |
android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-09 17:40:02.894: E/AndroidRuntime(770): at android.os.Handler.dispatchMessage(Handler.java:99)
04-09 17:40:02.894: E/AndroidR... | [
-0.37225764989852905,
0.2565847933292389,
0.5956696271896362,
-0.4139491021633148,
0.22508490085601807,
0.30213698744773865,
0.6876944899559021,
-0.32672178745269775,
-0.36608344316482544,
-0.7172780632972717,
-0.21951913833618164,
0.9606572985649109,
-0.5156732201576233,
-0.04972788318991... | |
exist
04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters$XmlCursorAdapterParser.parse(Adapters.java:219)
04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters.createCursorAdapter(Adapters.java:168)
04-09 17:40:02.894: E/AndroidRuntime(770): at com.saty... | [
0.2607284486293793,
0.3227275013923645,
0.9212629795074463,
-0.15064465999603271,
0.13562044501304626,
-0.14597009122371674,
0.594782829284668,
-0.4076363742351532,
-0.20416076481342316,
-0.8656284809112549,
-0.20573468506336212,
0.6335703134536743,
-0.459605872631073,
0.34983280301094055,... | |
version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.satyamdswt.agreader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses... | [
-0.24203146994113922,
-0.09982456266880035,
0.6954572200775146,
-0.2600304186344147,
0.13696563243865967,
0.02281748317182064,
-0.019887657836079597,
-0.2541601061820984,
-0.20578651130199432,
-0.9471798539161682,
-0.37228667736053467,
0.46542930603027344,
-0.5006459951400757,
-0.190567731... | |
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="PhotosListActivity"
android:label="@string/photos_list_activity">
<intent-f... | [
0.177972212433815,
-0.39442363381385803,
0.2975544333457947,
-0.4415000379085541,
-0.3712399899959564,
0.22651362419128418,
0.24365633726119995,
-0.4654839038848877,
-0.47263503074645996,
-0.22109583020210266,
-0.13612698018550873,
0.3881274163722992,
-0.633526086807251,
-0.564471244812011... | |
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AGRssReaderActivity">
<intent-filter>
<action android:name="android.intent.act... | [
-0.20078200101852417,
-0.37895938754081726,
0.2567644417285919,
-0.5343707799911499,
-0.3867539167404175,
0.4905582368373871,
0.4663133919239044,
-0.3558740019798279,
-0.381441205739975,
-0.3111441433429718,
-0.1726621687412262,
0.4481792747974396,
-0.6598297357559204,
-0.4166979193687439,... | |
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
```
Please guide me where is Error.
**ContactListActivity.java**
```
public class ContactsListActivity extends ListActivity {
@Override
protected void onCreate(Bund... | [
-0.02277844026684761,
0.02738347463309765,
0.9269518852233887,
-0.13833199441432953,
0.0006601434433832765,
0.16614869236946106,
0.23855774104595184,
-0.6370158791542053,
-0.12755274772644043,
-0.6204466819763184,
-0.25071603059768677,
0.8048690557479858,
-0.4928271472454071,
-0.1719628870... | |
app:selection="has_phone_number = 1 "
app:uri="content://com.satyamdswt.contacts/contacts" >
<bind
app:from="display_name"
app:to="@id/name"
app:as="string"/>
<bind
app:as="drawable"
app:from="starred"
app:to="@id/star" >
<map
app:from... | [
-0.3070555031299591,
0.07101583480834961,
1.062095284461975,
-0.02410995401442051,
-0.1592039316892624,
0.1390574723482132,
0.11234961450099945,
-0.2736090421676636,
-0.3474631607532501,
-0.6170742511749268,
-0.1850546896457672,
0.5512722730636597,
-0.3188266456127167,
-0.09034256637096405... | |
app:toValue="@android:drawable/star_big_off" />
<map
app:fromValue="1"
app:toValue="@android:drawable/star_big_on" />
</bind>
<bind
app:as="com.satyamdswt.agreader.ContactPhotoBinder"
app:from="_id"
app:to="@id/name" />
</cursor-adapter>
```
I've recreat... | [
-0.35847344994544983,
0.24461042881011963,
0.9781302809715271,
-0.159064382314682,
0.14261823892593384,
0.3912813365459442,
0.29845932126045227,
-0.5513482689857483,
-0.254334419965744,
-0.7489035129547119,
-0.393319696187973,
0.8578779697418213,
-0.5723113417625427,
-0.23499560356140137,
... | |
the `<cursor-adapter>` tag. Right form:
```
<cursor-adapter xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.satyamdswt.agreader"
app:uri="content://com.android.contacts/contacts"
app:selection="has_phone_number=1"
app:layout="@layout/contact_... | [
-0.6833159923553467,
0.17681434750556946,
1.120279312133789,
0.0022943688090890646,
-0.1305604726076126,
0.2513923645019531,
-0.14344358444213867,
-0.5084775686264038,
-0.19570428133010864,
-0.5813452005386353,
-0.39907723665237427,
0.7880417108535767,
-0.5913907289505005,
-0.1262436956167... | |
I want my AbstracttableModel subclass `data()` method to return html i.e.
```
PreText<b>Text</b>PostText
```
And this text must be displayed int table as in html:
PreText**Text**PostText
How can I do this?
You can create a delegate for the view that will display the html.
```
class HtmlDelegate : public QItemDeleg... | [
0.06320180743932724,
-0.011011688970029354,
0.6201043128967285,
-0.18439458310604095,
-0.25579214096069336,
0.23684988915920258,
0.17577823996543884,
-0.35975518822669983,
0.023129960522055626,
-0.7147260308265686,
0.21104305982589722,
0.40191784501075745,
-0.33434203267097473,
0.102135650... | |
&text) const
{
QTextDocument doc;
// Since the QTextDocument will do all the rendering, the color,
// and the font have to be put back inside the doc
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
? QPalette::Normal | [
-0.22576116025447845,
-0.11888863891363144,
0.7019716501235962,
-0.1628503054380417,
0.44962337613105774,
0.1873210370540619,
0.4349533021450043,
-0.009014149196445942,
0.16814428567886353,
-0.5967673063278198,
-0.700594961643219,
0.7794458866119385,
-0.4170210063457489,
-0.163359999656677... | |
: QPalette::Disabled;
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
cg = QPalette::Inactive;
QColor textColor = option.palette.color(cg, QPalette::Text);
doc.setDefaultStyleSheet(QString("body { color: %1}")
.arg(textColor.name... | [
-0.2034013569355011,
-0.14692527055740356,
0.5594490170478821,
-0.26116490364074707,
-0.1293366253376007,
0.34300458431243896,
0.44950366020202637,
-0.3286786675453186,
-0.0672040805220604,
-0.42021942138671875,
-0.5527433156967163,
0.40352872014045715,
-0.437605082988739,
-0.0662071704864... | |
doc.setHtml(text);
doc.setDocumentMargin(1); // the default is 4 which is too much
painter->save();
painter->translate(rect.topLeft());
doc.drawContents(painter);
painter->restore();
}
// bold and underlined characters take more space
// so you have to redefine this... | [
-0.27229800820350647,
-0.20393744111061096,
0.5580556392669678,
-0.10821924358606339,
-0.016995064914226532,
0.10842439532279968,
0.5793296694755554,
-0.40973585844039917,
-0.07773298770189285,
-0.6198123693466187,
-0.5338987708091736,
0.7998647689819336,
-0.320099800825119,
-0.11576206982... | |
// to include their size to the returned value)
QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QTextDocument doc;
doc.setDefaultFont(option.font);
doc.setHtml(index.data(Qt::DisplayRole).toString());
doc.setDocumentMargin(1... | [
-0.1773378700017929,
-0.24148601293563843,
0.7596701979637146,
-0.1806943267583847,
-0.020268000662326813,
0.36726608872413635,
0.09761908650398254,
-0.37364330887794495,
-0.16264721751213074,
-0.6287218928337097,
-0.42160502076148987,
0.5415025353431702,
-0.2875882685184479,
-0.0535751767... | |
I need to make something(i call it a scheduler) that checks the time of the sytem every minute and if the time has changed suppose it is 17:52 and the next moment it is 17:53so at 17:53 it calls a function logupdated
How do i make this simply i m not known to the mutex and all.
Thanks
I am not sure I understand the r... | [
0.7140350341796875,
-0.06539050489664078,
0.4048449993133545,
-0.26945507526397705,
0.315398633480072,
-0.07632581889629364,
0.5363455414772034,
-0.29224446415901184,
-0.12343908846378326,
-0.513725757598877,
-0.0691387802362442,
0.43200013041496277,
-0.15319541096687317,
0.149947255849838... | |
// call your c++ code
}
}
``` | [
0.26137128472328186,
0.39055874943733215,
0.009793325327336788,
-0.17838434875011444,
0.18539442121982574,
-0.4050839841365814,
0.3318701982498169,
0.3806067109107971,
0.14877445995807648,
-0.5089347958564758,
-0.37672990560531616,
0.6923987865447998,
-0.20590034127235413,
0.05595645681023... | |
I just want to know if the cookies are created while I try to access websites on localhost in Google Chrome.
Only if the page on localhost creates a cookie (client-side or server-side).
External resources (images, frames) may also create cookies, depending on your preferences.
You can check it yourself by opening t... | [
0.8610762357711792,
0.038028232753276825,
0.23193764686584473,
0.15001755952835083,
0.08906442672014236,
-0.14777372777462006,
0.49385932087898254,
0.1260024756193161,
-0.24655723571777344,
-0.8435018062591553,
0.01637943834066391,
0.7231015563011169,
-0.021515097469091415,
-0.016322670504... | |
So i am preety new with this SQLite i finaly managed to create base and work with it etc. Now i created ContextMenu thath you will be able to delete item from listView on which context menu was opened. Here is my current code.
```
import java.util.List;
import java.util.Random;
import android.app.ListActivity;
import... | [
0.024128777906298637,
-0.01680903322994709,
0.884179413318634,
-0.23014044761657715,
-0.15522193908691406,
0.3435218930244446,
0.4220329225063324,
-0.6315535306930542,
-0.07593629509210587,
-0.7629044055938721,
-0.4247080683708191,
0.5516693592071533,
-0.37243637442588806,
0.12699079513549... | |
setContentView(R.layout.ann);
datasource = new CommentsDataSource(this);
datasource.open();
List<Comment> values = datasource.getAllComments();
ArrayAdapter<Comment> adapter = new ArrayAdapter<Comment>(this,
android.R.layout.simple_list_item_1, values);
s... | [
-0.0005146590992808342,
-0.5871933102607727,
0.8083868026733398,
-0.24377334117889404,
0.07460451126098633,
0.2099500149488449,
0.3028008043766022,
-0.6018026471138,
-0.31624650955200195,
-0.5616627335548401,
-0.47964322566986084,
0.7465450763702393,
-0.6349685788154602,
0.0327200032770633... | |
@SuppressWarnings("unchecked")
ArrayAdapter<Comment> adapter = (ArrayAdapter<Comment>) getListAdapter();
Comment comment = null;
switch (view.getId()) {
case R.id.add:
edit = (EditText)findViewById(R.id.editTxt);
Editable txt=(Editable)edit.getText()... | [
0.12350478768348694,
-0.45392659306526184,
0.5568335056304932,
-0.3874134421348572,
-0.024696586653590202,
0.020074376836419106,
0.5784657597541809,
-0.6758050918579102,
-0.08641871809959412,
-0.3885078430175781,
-0.45452165603637695,
0.8899691104888916,
-0.5240321159362793,
0.126518383622... | |
String vnos = txt.toString();
comment = datasource.createComment(vnos);
adapter.add(comment);
edit.setText("");
break;
}
adapter.notifyDataSetChanged();
}
@Override
public void onCreateContextMenu(ContextMenu menu, | [
0.08862482011318207,
-0.3769998550415039,
0.4208216667175293,
-0.14182306826114655,
0.3189731240272522,
0.16618770360946655,
0.4513247311115265,
-0.28966981172561646,
-0.09234724193811417,
-0.4919142425060272,
-0.5220271348953247,
0.5717957615852356,
-0.5418788194656372,
0.1518463641405105... | |
View v, ContextMenuInfo menuInfo){
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.context_menu, menu);
}
@Override
protected void onResume() {
datasource.open();
super.onResume();
}
@Override
... | [
0.039706043899059296,
-0.09644603729248047,
0.9615374803543091,
-0.31832340359687805,
0.4413341283798218,
0.17962829768657684,
0.5163226127624512,
-0.2273387461900711,
-0.19292128086090088,
-0.5562825202941895,
-0.6079312562942505,
0.8899282217025757,
-0.3456934988498688,
0.399533003568649... | |
i know thath i need to make method for `public boolean onContextItemSelected(MenuItem item)`
but how to manage now to delete item which was selected.
Can I ask why you don't use a SimpleCursorAdapter to create the list? It looks like you're getting a cursor and turning into an array... why take that extra step? It's u... | [
0.007345122750848532,
-0.029400333762168884,
0.1399281919002533,
0.01666950434446335,
-0.013483833521604538,
-0.12841199338436127,
0.14798131585121155,
-0.13390971720218658,
-0.3930165767669678,
-0.6267684698104858,
0.014828396961092949,
0.5967376828193665,
-0.49715250730514526,
0.41379997... | |
item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
if (item.getTitle() == "Delete Member") {
mDbHelper.deleteMember(info.id);
mMemberCursor.requery();
return true;
}
return super.onContextItemSelected(item);
}
```
Note that I created my menu view programatic... | [
-0.22208017110824585,
-0.19800154864788055,
0.906177818775177,
-0.11995220184326172,
0.09641393274068832,
0.3019208312034607,
0.39765751361846924,
-0.37277472019195557,
-0.3252648711204529,
-0.5568927526473999,
-0.25664806365966797,
0.6216497421264648,
-0.36097243428230286,
0.3730637431144... | |
The fragments I use in my `ViewPager` instance are quite resource intensive, so I'd only like to load one at a time. When I try the following:
```
mViewPager.setOffscreenPageLimit(0);
mViewPager.setAdapter(mPagerAdapter);
```
My `FragmentStatePagerAdapter.getItem(int position)` override function is called 3 times, w... | [
0.07243149727582932,
-0.04081690311431885,
0.5131452083587646,
-0.17214153707027435,
-0.3556142747402191,
0.014643946662545204,
0.6163699626922607,
-0.5615337491035461,
-0.22339293360710144,
-0.6970760822296143,
-0.19924885034561157,
0.4365979731082916,
-0.41290605068206787,
0.073573060333... | |
of 1 offscreen pages
Yes. If I am reading the source code correctly, you should be getting a warning about this in LogCat, something like:
```
Requested offscreen page limit 0 too small; defaulting to 1
``` | [
0.013215296901762486,
-0.007600206416100264,
0.6781408190727234,
0.028195062652230263,
0.2570703327655792,
-0.2566559910774231,
0.2863095700740814,
-0.021507972851395607,
-0.3016621768474579,
-0.5947925448417664,
-0.29653826355934143,
0.6242989301681519,
-0.3859656751155853,
-0.03968440741... | |
I have a MFC project which contains many project inside. now i want to make a dll file of this project can anyone provide information how to **create dll from existing mfc project** ?
**EDIT**
I have tried following
* Project Properties > Configuration > General > Configuration Type, should be changed from Applicati... | [
0.2631993293762207,
-0.1661253571510315,
0.5713679194450378,
-0.12866973876953125,
-0.15705876052379608,
-0.071107879281044,
-0.15827296674251556,
0.024028748273849487,
-0.4039321541786194,
-0.837674617767334,
-0.21391341090202332,
0.5050113797187805,
-0.4989100396633148,
0.108310289680957... | |
source code correctly, you should be getting a warning about this in LogCat, something like:
```
Requested offscreen page limit 0 too small; defaulting to 1
``` | [
0.08652277290821075,
0.16907958686351776,
0.33271393179893494,
0.010276530869305134,
0.36091357469558716,
-0.5187603831291199,
0.47789520025253296,
0.29104283452033997,
-0.25163838267326355,
-0.6630292534828186,
-0.41583943367004395,
0.5823617577552795,
-0.2955000102519989,
-0.043173093348... | |
I have a asp.net form with 5 HTML file input controls with runat=server and a submit button. after user selects the files and clicks the submit button, the files are upload in the server.
Problem is the HTML file input controls are editable, and user can edit the path after he has already selected the file from the br... | [
0.24800042808055878,
-0.04113902151584625,
0.6834441423416138,
0.14749738574028015,
-0.2896598279476166,
-0.05307290703058243,
0.29034700989723206,
-0.16431771218776703,
-0.10177268832921982,
-0.9371761083602905,
0.11317843198776245,
0.2454119473695755,
-0.3014533817768097,
0.1811418682336... | |
also.
you could try something like having a hidden field and when the user selects the file from browse, it populates to the hidden field as well. Then when they upload, you either read from the hidden field for your upload or using JS replace the values back to the original control and read from that. | [
0.3441183865070343,
-0.20086733996868134,
0.012239658273756504,
0.4614288806915283,
0.1977979838848114,
-0.21704499423503876,
0.05385344475507736,
0.1821780800819397,
-0.09921782463788986,
-0.5881736278533936,
-0.138914555311203,
0.5047682523727417,
-0.09195395559072495,
0.1269699633121490... | |
I am developing a VB application in which i need to know the native resolution of the monitor and not the one set by the user(current resolution). So i need to read the EDID (extended display identification data) directly from the monitor.
I did try to find the resolution of monitor through some programs...but all it... | [
0.26867374777793884,
-0.022957103326916695,
0.7601963877677917,
0.17072372138500214,
-0.028764892369508743,
-0.168248251080513,
0.020695051178336143,
-0.0311362836509943,
-0.16384342312812805,
-0.784065306186676,
-0.10726717114448547,
0.544904351234436,
-0.17008188366889954,
0.074042618274... | |
through [Windows Setup API](http://msdn.microsoft.com/en-us/library/cc185682%28VS.85%29.aspx).
For an EDID format description see for example [here](http://en.wikipedia.org/wiki/Extended_display_identification_data). | [
0.6032593846321106,
-0.31491318345069885,
0.7168785333633423,
-0.03908364847302437,
-0.0013316746335476637,
-0.25182440876960754,
-0.09985379874706268,
-0.10600726306438446,
-0.38595589995384216,
-0.8473110198974609,
-0.42893049120903015,
0.328197717666626,
-0.12199528515338898,
-0.1346616... | |
I am trying to create a icon and a short description below it. I have created a customised View class with a ImageView and a TextView and i integrated it with my xml file, now the imageView and the default text appears in the screen,i don't know how to change the text content of the textview or the source of the imagev... | [
0.28246384859085083,
-0.12424357980489731,
0.6342775225639343,
-0.19074709713459015,
-0.042722415179014206,
0.19460542500019073,
0.4816925525665283,
-0.30934199690818787,
0.19042076170444489,
-0.582675576210022,
0.02866300195455551,
0.6448259353637695,
-0.2536942958831787,
0.12532062828540... | |
LayoutInflater li=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v= li.inflate(R.layout.myview, this);
}
}
```
myview.xml
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_p... | [
-0.30918797850608826,
-0.2237597405910492,
0.9476413130760193,
-0.2516481578350067,
-0.12490040063858032,
0.31482216715812683,
-0.10725484788417816,
-0.3497524857521057,
-0.10863164812326431,
-0.49294593930244446,
-0.0565030500292778,
0.31894007325172424,
-0.23606659471988678,
0.0426585860... | |
android:text="my view"/>
</LinearLayout>
```
main.xml
```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/sda.jk"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<sda.jk.My... | [
-0.34790554642677307,
-0.007348145358264446,
0.9285886287689209,
-0.3141469359397888,
-0.05881596356630325,
0.45937687158584595,
-0.15485011041164398,
-0.36590972542762756,
-0.12938249111175537,
-0.5874437093734741,
-0.11180400103330612,
0.3972941040992737,
0.00453751627355814,
0.070896811... | |
android:layout_height="wrap_content"
android:background="@drawable/ic_launcher"
/>
<TextView
android:id="@+id/myText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="my view"/>
</LinearLayout>
```
**Step-2**
initialize your o... | [
-0.14123505353927612,
0.02527916617691517,
0.9442145228385925,
-0.452173113822937,
-0.13098029792308807,
0.5506260991096497,
0.22878649830818176,
-0.743922233581543,
-0.024227244779467583,
-0.7048324346542358,
-0.2109186202287674,
0.6362841129302979,
-0.21949505805969238,
-0.05399302020668... | |
mv.findViewById(R.id.myImage);
```
**step-4**
set text to text view using setText method
```
textView.setText("Sunil Kumar Sahoo");
```
set background image to image view using
```
imageView.setBackgroundResource(R.drawable.ic_launcher);
```
Your oncreate method will be like the following (from step-2 to step-... | [
0.06279782205820084,
-0.015824686735868454,
1.0082803964614868,
-0.33081862330436707,
-0.05398531258106232,
0.2929610013961792,
0.4686163067817688,
-0.6569775342941284,
-0.14791832864284515,
-0.6417905688285828,
-0.7352865934371948,
0.8612394332885742,
-0.5135025978088379,
0.10170552134513... | |
imageView.setBackgroundResource(R.drawable.ic_launcher);
}
``` | [
0.13641463220119476,
-0.1564478725194931,
0.3228396773338318,
-0.002086870139464736,
-0.17876239120960236,
-0.14426027238368988,
0.09634183347225189,
0.10240012407302856,
-0.1704167127609253,
-0.6726358532905579,
-0.3617492616176605,
0.7615914344787598,
-0.3591679334640503,
0.0976597592234... | |
I have a problem with Eclipse. It is very slow for me. My PC is an old PC and I'm not comfort with the performance. Is there any lightweight alternative to Eclipse (Available for Windows and Linux)? I want SPEED!
My ideal is to write my code in an editor like Notepad and supplement with the command line! How can I com... | [
0.393514484167099,
0.3483496606349945,
-0.1256222426891327,
-0.03371024131774902,
0.013022635132074356,
0.05458516255021095,
0.18878930807113647,
-0.10199449211359024,
-0.15984293818473816,
-0.8794620037078857,
0.17705637216567993,
0.6308742165565491,
-0.028589755296707153,
-0.123548083007... | |
could also use a more advanced editor than notepad (Notepad++ for example).
However, if you have a slow machine, you would suffer during development anyway. You should also forget about using the emulator for debugging. The emulator would take ages to load. | [
-0.494215726852417,
-0.041133761405944824,
0.559812605381012,
0.2269376665353775,
0.18432831764221191,
0.031009122729301453,
0.2794465124607086,
0.1047654002904892,
0.14857244491577148,
-0.8005434274673462,
0.20409467816352844,
0.4536912441253662,
-0.22865410149097443,
-0.06848090142011642... | |
What is the best way to check in a vimscript which visual mode is currently active (visual or visual block)?
I've read about `mode()` but I can't make it work.
`echo mode()` doesn't work for me
`if mode() == "v"` doesn't work for me as well.
Look at the help for `mode()`. The relevant part:
> ```
> v... | [
0.29597386717796326,
-0.11151698231697083,
0.5478984117507935,
-0.10361039638519287,
-0.23799294233322144,
0.01466170884668827,
0.4432545602321625,
-0.06648021936416626,
-0.08290906995534897,
-0.5964089035987854,
0.040501173585653305,
0.6027088761329651,
-0.29282069206237793,
-0.1022939234... | |
CTRL-V Visual blockwise
>
> ```
You need to be checking `mode() == "\<C-V>"` (literal `^V` character), not `mode() == "v"`, to check for blockwise visual mode. | [
-0.08603224158287048,
-0.0002793480234686285,
0.7303621172904968,
0.03285663202404976,
-0.0053114090114831924,
-0.16076156497001648,
0.20537514984607697,
-0.24619343876838684,
-0.06578340381383896,
-0.4625563621520996,
-0.11515136063098907,
0.9676836133003235,
-0.22774337232112885,
-0.1343... | |
Is there any way to animate uiview moving with cicle trajectory?
Look at the help for `mode()`. The relevant part:
> ```
> v Visual by character
> V Visual by line
> CTRL-V Visual blockwise
>
> ```
You need... | [
0.10471776872873306,
-0.2783481776714325,
0.7613767981529236,
0.24870164692401886,
-0.12196819484233856,
-0.08360790461301804,
0.16953325271606445,
-0.10119573771953583,
-0.2550261914730072,
-0.7086162567138672,
-0.15304720401763916,
0.6205244660377502,
-0.057392846792936325,
-0.1962475180... | |
In Xcode, in the navigation area on the left, next to a few files, on the right there is a little icon badge, `M` or sometimes `A`.
What is that for?
Is there any option that I left selected while creating New Project or are any project settings responsible for this?
this responds to your git/svn repository
source:... | [
0.4091258645057678,
0.32559865713119507,
0.2076726257801056,
0.012873980216681957,
0.04518776386976242,
-0.02182476781308651,
0.04861802980303764,
-0.008848744444549084,
-0.12326894700527191,
-0.7325484752655029,
-0.16150179505348206,
0.10331925749778748,
-0.425657719373703,
0.208860576152... | |
I have a query that returns an anonymous type and the query is in a method. How do you write this:
```
public "TheAnonymousType" TheMethod(SomeParameter)
{
using (MyDC TheDC = new MyDC())
{
var TheQueryFromDB = (....
select new { SomeVariable = ...., | [
0.14157406985759735,
0.03698763623833656,
0.7104339003562927,
0.043485287576913834,
0.27302083373069763,
-0.25975534319877625,
0.05645561218261719,
-0.05114942044019699,
-0.09726528078317642,
-0.4827091693878174,
0.1014343723654747,
0.25295552611351013,
0.005571845453232527,
0.834112823009... | |
AnotherVariable = ....}
).ToList();
return "TheAnonymousType";
}
}
```
You can't.
You can only return `object`, or container of objects, e.g. `IEnumerable<object>`, `IList<object>`, etc. | [
-0.2586807310581207,
-0.1818026751279831,
0.15150298178195953,
-0.19898419082164764,
0.07696410268545151,
-0.144160196185112,
0.2922569513320923,
-0.0063680619932711124,
0.024672551080584526,
-0.4269458055496216,
-0.29125064611434937,
0.5567975044250488,
-0.7518076300621033,
0.181262090802... | |
Trying to change this:
```
"The basketball-player is great! (Kobe Bryant)"
```
into this:
```
"the basketball player is great kobe bryant"
```
Want to downcase and remove all punctuation but leave spaces...
Tried `string.downcase.gsub(/[^a-z ]/, '')` but it removes the spaces
You can simply add `\s` (whitespace)... | [
-0.0419912189245224,
0.2856936454772949,
-0.24440011382102966,
-0.08706780523061752,
-0.25094786286354065,
0.1597982943058014,
0.21501950919628143,
0.2476043552160263,
-0.45538610219955444,
-0.667399525642395,
-0.3467009961605072,
0.32743677496910095,
-0.4932449460029602,
-0.25922974944114... | |
How to start the chronometer with a specific time other than default 00:00? Is it possible to set chronometerObj.setBase(startTime) ?
`ch.setBase(SystemClock.elapsedRealtime()-anylongvalue);
ch.start();` can I set start time, if I put anylongvalue?
You can simply add `\s` (whitespace)
`string.downcase.gsub(/[^a-z0-9... | [
0.1877358853816986,
0.21391749382019043,
1.1939642429351807,
0.005838782526552677,
0.38557806611061096,
-0.13145582377910614,
0.13623355329036713,
-0.10080140084028244,
-0.25816863775253296,
-0.4507980942726135,
-0.06193710118532181,
0.4914921820163727,
0.13128802180290222,
0.1432694345712... | |
I am trying to create a delegate with expressiontrees for reading custom attributes. The sample code is
```
[AttributeUsage(AttributeTargets.Class)]
public class TestAttribute : Attribute
{
public string Description { get; set; }
}
[TestAttribute(Description="sample text")]
public class TestClass
{
}
```
I... | [
0.4147513806819916,
-0.0408385768532753,
-0.18837517499923706,
0.18497921526432037,
-0.060187213122844696,
-0.0639115646481514,
0.16695861518383026,
-0.4390629529953003,
0.04605378583073616,
-0.6414529085159302,
0.0339023731648922,
0.478001207113266,
-0.3052201569080353,
0.1559830904006958... | |
//TestAttribute attribute = typeof(T).GetCustomAttributes(typeof(TestAttribute), false)[0];
//return attribute.Description;
ParameterExpression clazz = Expression.Parameter(typeof(T),"clazz");
ParameterExpression description = Expression.Variable(typeof(string),"description");
Parameter... | [
-0.007828863337635994,
-0.14505186676979065,
0.46019572019577026,
-0.057482536882162094,
0.26551270484924316,
0.19667348265647888,
0.5432766675949097,
-0.6334401965141296,
0.24159109592437744,
-0.2490849643945694,
-0.540261447429657,
0.675778865814209,
-0.2696159780025482,
-0.0686544552445... | |
getAttributesMethod, testAttribute, result);
Func<T, string> lambda = Expression.Lambda<Func<T, string>>(body, clazz).Compile();
return lambda;
}
```
But when i call this method, i get an AmbiguousMatchException at getAttributesMethod line and it says "Ambiguous match found." So how ... | [
-0.02538313902914524,
-0.08873336017131805,
0.3339155316352844,
-0.04512636736035347,
0.03352152928709984,
0.044117316603660583,
0.09545864164829254,
-0.6895815134048462,
0.3537873327732086,
-0.5239153504371643,
-0.25432994961738586,
0.8820809125900269,
-0.27116337418556213,
0.130255520343... | |
a.PurchaseRequestID)
select a;
``` | [
0.08812378346920013,
0.0003443825407885015,
0.2963946759700775,
-0.14088132977485657,
0.32811135053634644,
-0.0480649471282959,
-0.0823846235871315,
-0.32938840985298157,
0.2727603614330292,
-0.5286630392074585,
-0.4233221411705017,
0.6227154731750488,
-0.17739474773406982,
0.4899936616420... | |
Lets say I have a list where the `li` are created dynamically, via AJAX :
```
<ul id="demo-list">
<li data-test="test1" >Test 1</li>
<li data-test="test2" >Test 2</li>
<li data-test="test3" >Test 3</li>
</ul>
```
When ... | [
0.4546903669834137,
-0.08851104229688644,
0.006525576580315828,
-0.05291511118412018,
-0.1593676507472992,
-0.2331000417470932,
0.07904357463121414,
-0.365134060382843,
0.15552681684494019,
-0.8310773372650146,
-0.09918110072612762,
0.707787036895752,
-0.3111209273338318,
-0.14118987321853... | |
via `.on()`
You have to remove the find from after your `$(this)` call:
```
$('#demo-list').on('click', 'li', function() {
console.log($(this).data('test'));
})
```
You can find the working example bellow:
> <http://jsfiddle.net/P356B/2/>
EDIT:
if you have a widget/plugin that generates that content perhaps you c... | [
0.18052327632904053,
-0.07838133722543716,
0.4187421202659607,
0.06056055799126625,
0.2874082922935486,
-0.3442104756832123,
0.3192015290260315,
-0.20259201526641846,
-0.06840766221284866,
-0.6087459921836853,
-0.4430617690086365,
0.8194313049316406,
-0.40110641717910767,
0.278741061687469... | |
I'm writing a function that will call itself up to about 5000 times. Ofcourse, I get a `StackOverflowError`. Is there any way that I can rewrite this code in a fairly simple way?:
```
void checkBlocks(Block b, int amm) {
//Stuff that might issue a return call
Block blockDown = (Block) b.getRelative(BlockFace... | [
0.30552658438682556,
0.26605144143104553,
0.5056598782539368,
-0.278992235660553,
0.1192016452550888,
0.22722962498664856,
0.6816553473472595,
-0.5460476875305176,
-0.4661884009838104,
-0.6028261184692383,
-0.12979385256767273,
0.7712636590003967,
-0.42905259132385254,
0.02128772810101509,... | |
more times for each side
}
```
By the way, what is the limitation of how deep we may call the functions?
Use an explicit stack of objects and a loop, rather than the call stack and recursion:
```
void checkBlocks(Block b, int amm) {
Stack<Block> blocks = new Stack<Block>();
blocks.push(b);
while (!blocks.isEm... | [
0.11391457915306091,
-0.1426517516374588,
0.4435338079929352,
-0.2576051354408264,
0.15365685522556305,
0.18497854471206665,
0.31400957703590393,
-0.5925288796424866,
-0.31363746523857117,
-0.4769114553928375,
-0.4486449956893921,
0.5149956941604614,
-0.299454003572464,
0.159912109375,
0... | |
I am trying to send json-rpc request to remote server with jquery getJSON method. Here is my code:
```
json_string=JSON.stringify(obj);
var jqxhr = $.getJSON("https://91.199.226.106/ssljson.php?jsoncallback=?", json_string, function(data){
alert("aaaaaa");
});
jqxhr.error(function() { alert("error"); })
```
Here... | [
-0.031061548739671707,
0.2818302512168884,
0.49661460518836975,
-0.3515871465206146,
-0.15952959656715393,
0.1957971155643463,
0.660010814666748,
-0.15657806396484375,
0.044991880655288696,
-0.6125296950340271,
-0.21029159426689148,
0.5581573247909546,
-0.3220091164112091,
0.24570663273334... | |
{
// process response
}, 'json');
```
but this will only work if your page is on the same server, unless you use CORS. | [
-0.3008868396282196,
0.17828235030174255,
0.5973460674285889,
-0.13022033870220184,
-0.007990089245140553,
-0.22188213467597961,
0.16341565549373627,
0.11738059669733047,
-0.21531932055950165,
-0.8100053668022156,
-0.3727344870567322,
0.3027750849723816,
-0.3581133186817169,
0.152360513806... | |
I'm tring to setup the title for my navigation controller to the text "Settings". I'm testing it in iOS 5.0 and it displays "Item" instead. If I specify any other dummy string (for the Settings key value in my resource bundle file for en) it is displayed correct.
```
[self setTitle:[NSString stringWithFormat:@"%@", NS... | [
-0.12796607613563538,
0.0676417127251625,
0.970750629901886,
-0.11665529012680054,
0.30722057819366455,
-0.06409187614917755,
0.41297677159309387,
-0.11053475737571716,
0.033317167311906815,
-0.7428996562957764,
-0.0473475456237793,
0.9094683527946472,
-0.19215649366378784,
0.0459615066647... | |
I have some RDL reports created with SQL Server BI Development Studio and now I need to render them using the ASP.NET Report Viewer. Even though my RDLs contain references to the SQL server and the SELECT query, it keeps saying I need to specify a datasource for the report. Is there a way to make the datasource from th... | [
0.39483606815338135,
0.22382265329360962,
0.18711689114570618,
0.13550734519958496,
-0.23777122795581818,
-0.2317878007888794,
0.29722312092781067,
-0.19435088336467743,
-0.2039339244365692,
-0.7012428641319275,
0.1780429631471634,
0.48228538036346436,
-0.25284111499786377,
0.0994347110390... | |
contain a full folder path (for
> example, /SampleReports/AdventureWorks) or a relative path (for
> example, AdventureWorks). Relative paths start in the same folder as
> the report. The shared data source must be on the same server as the
> report.
Verify the DataSourceID too. Take a look at the [answer on this q... | [
-0.1157197505235672,
-0.22613926231861115,
0.49506908655166626,
0.2889821231365204,
0.0053493557497859,
-0.32539278268814087,
0.20804674923419952,
-0.3649236857891083,
-0.3434028625488281,
-0.5868237614631653,
-0.38836389780044556,
0.5699257850646973,
-0.18243177235126495,
-0.1554986685514... | |
Server.MapPath("~/Reporting/MyReport.rdlc");
ReportParameterCollection col = new ReportParameterCollection();
ReportParameter startAtParam = new ReportParameter("StartAt", startAt.ToString("MMM, dd yyyy"));
col.Add(startAtParam);
ReportParameter endAtParam = new ReportParameter("EndAt", endAt.ToString("MMM, dd yyyy"))... | [
-0.29749131202697754,
-0.3331294059753418,
0.8781578540802002,
-0.10407821089029312,
-0.518417477607727,
0.13276711106300354,
0.31012436747550964,
-0.21024906635284424,
-0.4883590638637543,
-0.9366756081581116,
-0.2018042653799057,
0.22211229801177979,
-0.2539125680923462,
0.24490603804588... | |
This code works as expected:
```
$(function() {
$("tr:odd").css("background-color","#dddddd");
})
```
And this doesn't:
```
function temp() {
$("tr:odd").css("background-color","#dddddd");
}
$(temp());
```
Why?
because you should write
```
$(temp)
```
since temp is a callback
what you are doing in t... | [
-0.13496024906635284,
-0.20519967377185822,
0.4601631164550781,
-0.10512824356555939,
0.0169812124222517,
-0.08200990408658981,
0.2763284742832184,
0.0481967031955719,
-0.13935045897960663,
-0.42736533284187317,
-0.47665730118751526,
0.70476895570755,
-0.6248123645782471,
-0.14399999380111... | |
<http://jsfiddle.net/udit_sharma/GFknc/>
I have created this fiddle. which have a input box and it has hint-Text. When i am focused in this input box it's hint-Text is being cleared properly. and when i focused-out of this input box hint-Text is being showed again if there is nothing entered by user.
But there is an ... | [
-0.3015338182449341,
0.17017145454883575,
0.4179103672504425,
-0.31548288464546204,
-0.6084749102592468,
0.02432807721197605,
0.2465193122625351,
-0.3490675985813141,
-0.3729493319988251,
-0.8004305362701416,
0.381473183631897,
0.4494261145591736,
-0.02267337404191494,
0.16657599806785583,... | |
of the input box. ?
So the issue i found is when i click on another tab onblur is not being called so that variable "valueChanged" is not being set to false. So while focusing again it is not clearing the default hint-Text value.
So i am not getting why onBlur is not being called. If any one have clue about this, pl... | [
0.07099949568510056,
-0.00106026791036129,
0.09202691167593002,
0.04586120322346687,
-0.20892564952373505,
-0.13487157225608826,
0.30609214305877686,
0.2497749626636505,
-0.1152670606970787,
-0.6382575631141663,
0.13716618716716766,
0.7094333171844482,
-0.38281014561653137,
-0.107693754136... | |
them. The most common way to do this is [JSON](http://www.json.org/), which is a simple lightweight data-interchange format.
Use the [python json library](http://docs.python.org/library/json.html) to convert (or dump) your python dict into a JSON string. Then in the javascript parse the JSON string into a javascript d... | [
0.24701035022735596,
-0.1434352546930313,
0.24726662039756775,
0.11540009826421738,
-0.25818976759910583,
-0.011459752917289734,
-0.15800270438194275,
0.019936377182602882,
-0.23676009476184845,
-0.669690728187561,
-0.3478757441043854,
0.6456167101860046,
-0.42503616213798523,
-0.117389515... | |
> **Possible Duplicate:**
>
> [How to write a UTF-8 file with Java?](https://stackoverflow.com/questions/1001540/how-to-write-a-utf-8-file-with-java)
I want to create a csv file using java and write into it which supporting UTF-8.
How can I do this.?
```
new OutputStreamWriter(new FileOutputStream("path/to/file"), ... | [
0.1825585514307022,
0.1851341873407364,
0.49157631397247314,
-0.16746294498443604,
0.1315106749534607,
-0.125179722905159,
0.2542056441307068,
-0.26103705167770386,
-0.33995193243026733,
-0.7943371534347534,
0.11694291979074478,
0.33896827697753906,
-0.39315998554229736,
-0.064548969268798... | |
Is it possible to use custom routes handling code?
For example client requests server on `http://server.com/api/v1/json/profile/` and my code calls `ApiController`, `MyAction` action with parameters `version=1`, `format=json`, `action=profile`.
You'll have a better chance with a `[Range(SomeValue, LastValue)]` const... | [
0.3435637652873993,
-0.19101718068122864,
0.35126450657844543,
0.00450357049703598,
0.12815721333026886,
0.1853838562965393,
0.15893307328224182,
-0.3438146412372589,
-0.35161739587783813,
-0.592189610004425,
-0.015855146571993828,
0.5631453394889832,
-0.2285342663526535,
0.036992225795984... | |
can anyone help me find out what the problem is? I'm trying to make the active state of the css sprite work.
At the moment, it is not doing anything
**HTML**
```
<ul id="nav">
<li id="Contact"><a href="contact.html">Contact</a></li>
<li id="Manual"><a href="manual.html">Manual</a></li>
<li id="FAQ"><a hr... | [
-0.33481401205062866,
0.07877460867166519,
0.7821735739707947,
0.01869683898985386,
-0.3517197370529175,
0.18973012268543243,
0.2378234565258026,
-0.3293617367744446,
-0.22038082778453827,
-0.6505010724067688,
-0.15698233246803284,
0.5139422416687012,
-0.1534154713153839,
0.008845605887472... | |
list-style: none;
display: inline;
text-indent: -9999em;
}
#Contact { width: 120px; }
#Manual { width: 140px; }
#FAQ { width: 112px; }
#Contact a:hover, #Contact a:active { background:url("../img/nav_final.png") 0px -47.5px no-repeat; }
#Manual a:hover, #Manual a:active { background:url("../img/nav_final.pn... | [
-0.15221849083900452,
-0.16740506887435913,
0.7755387425422668,
-0.15853038430213928,
-0.0290723517537117,
0.33371105790138245,
0.4207039773464203,
-0.10551809519529343,
-0.6116306781768799,
-0.43122604489326477,
-0.590810239315033,
0.4382452368736267,
-0.3352797031402588,
0.05906002223491... | |
default action on regionMouseOut for your selected country, or setting the colour again on mouse out (I could only get the later to work for me).
```
// Prevent selected country colour being changed on mouseOut event
$('#map').bind('regionMouseOut.jvectormap', function(event, code){
if( code == selectedCountry ) ... | [
-0.3516162931919098,
-0.8426383137702942,
0.7192102670669556,
-0.19912348687648773,
0.21494293212890625,
0.005254531744867563,
0.4375600814819336,
-0.045245226472616196,
-0.5887139439582825,
-0.7366521954536438,
-0.6353843808174133,
0.3561047315597534,
-0.2851581275463104,
0.00026641730801... | |
need to modify your original slightly:
```
$(function () {
function showSelectedCountry(event, code) {
viewModel.selectedCountry(code);
var data = {};
data[code] = "#f00";
$('#map').vectorMap('set', 'colors', data);
}
$('#map').vectorMap({
hoverColor: '#... | [
-0.01176535151898861,
-0.8533763289451599,
1.0693776607513428,
0.14240750670433044,
0.20377196371555328,
0.11698044091463089,
-0.1122545450925827,
-0.08774910867214203,
-0.35428011417388916,
-0.7665959000587463,
-0.025353601202368736,
0.38080352544784546,
-0.4585127830505371,
-0.0362066701... | |
showSelectedCountry
});
});
``` | [
-0.10099582374095917,
-0.08956459164619446,
0.6711632609367371,
-0.13633912801742554,
0.007616519462317228,
-0.14990144968032837,
0.33886149525642395,
0.10125400871038437,
-0.07140567898750305,
-0.6007845401763916,
-0.48309656977653503,
0.41394293308258057,
-0.6378002762794495,
0.262598067... | |
Does the standard define what happens with this code?
```
#include <iostream>
template <typename Func>
void callfunc(Func f)
{
::std::cout << "In callfunc.\n";
f();
}
template <typename Func>
void callfuncref(Func &f)
{
::std::cout << "In callfuncref.\n";
f();
}
int main()
{
int n = 10;
// n i... | [
-0.1946100890636444,
0.07215018570423126,
0.499489963054657,
-0.3977985680103302,
0.41587033867836,
0.16577328741550446,
0.10998532921075821,
-0.1997554898262024,
-0.24688273668289185,
-0.320514053106308,
-0.39792799949645996,
0.7908088564872742,
-0.5327736139297485,
-0.03748638182878494,
... | |
n << '\n';
++n;
::std::cout << "After increment n == " << n << '\n';
};
callfunc(foo);
callfunc(foo);
callfuncref(foo);
callfunc(foo);
return 0;
}
```
The output of this with g++ is:
```none
$ ./a.out
In callfunc.
Before increment n == 10
After increment n == 11
In callfunc.
Be... | [
-0.4910201132297516,
0.08966553211212158,
0.33108842372894287,
-0.8182607293128967,
0.16417551040649414,
0.22044986486434937,
0.3118871748447418,
-0.43424010276794434,
-0.17681953310966492,
-0.30299124121665955,
-0.36155328154563904,
0.8217019438743591,
-0.5137916207313538,
-0.110869117081... | |
output required by the standard?
In particular it appears that if a copy of the lambda object is made, all of the captured values are also copied. But if the lambda object is passed by reference none of the captured values are copied. And no copies are made of a captured value just before the function is called, so mu... | [
0.27229470014572144,
-0.09027311205863953,
0.1908668726682663,
0.017602302134037018,
0.11361552774906158,
-0.1863509565591812,
0.0331447497010231,
-0.5257244110107422,
0.023659564554691315,
-0.10639194399118423,
-0.28839531540870667,
0.790069043636322,
-0.4844316244125366,
-0.2230285853147... | |
to copy-initialize (/21) it to a non-static data member (/14) of this class, and each use of that variable is replaced by the corresponding data member (/17). After this transformation, the lambda expression becomes only an instance of this class, and the general rules of C++ follows.
That means, your code shall work... | [
0.27503204345703125,
0.22648300230503082,
0.43982890248298645,
-0.4361362159252167,
0.3510814309120178,
-0.16089923679828644,
0.2219589352607727,
-0.3786033093929291,
-0.09900438785552979,
-0.14848794043064117,
-0.18172287940979004,
0.5372200012207031,
-0.6370963454246521,
0.19912485778331... | |
// §5.1.2/14
public:
void operator()() // §5.1.2/5
{
std::cout << "Before increment n == " << __n__ << '\n';
++ __n__; // §5.1.2/17
std::cout << "After increment n == " << __n__ << '\n'; | [
-0.11163581907749176,
-0.07115218043327332,
0.5382637977600098,
-0.554448664188385,
0.24133498966693878,
0.26853036880493164,
0.31520891189575195,
-0.158610537648201,
0.054263629019260406,
-0.42394721508026123,
-0.5896690487861633,
0.5922159552574158,
-0.4426051676273346,
0.015468383207917... | |
}
__Foo__() = delete;
__Foo__(int n) : __n__(n) {}
//__Foo__(const __Foo__&) = default; // §5.1.2/19
}
foo {n}; // §5.1.2/21
callfunc(foo);
callfunc(foo);
callfuncref(foo);
callfunc(foo);
}
```
And it is obvious what `callfuncref` does here. | [
-0.12497510015964508,
0.04824414104223251,
0.5371501445770264,
-0.5712050795555115,
0.3462377190589905,
-0.03956865146756172,
0.3651088774204254,
-0.2747285068035126,
-0.1893533617258072,
-0.1887086033821106,
-0.5265890955924988,
1.0685253143310547,
-0.39769405126571655,
0.268623948097229,... | |
For my program I need to make a list of lists, with each sublist containing 2 numbers, X and Y along with the sum and product of these 2 numbers.
So far I have the following:
```
genList(95, X,[]):-!.
genList(N, X,[[X,Y,Sum,Product]|Xs]):-
Y is N+1,
Sum is X+Y,
Sum<101,
Product is X*Y,
N1 is N+1,
... | [
-0.2681295573711395,
0.018832145258784294,
0.3394480347633362,
-0.19222328066825867,
-0.1291169673204422,
0.4206133484840393,
0.18829074501991272,
-0.4445699155330658,
-0.2550639510154724,
-0.7312861084938049,
-0.1731938123703003,
0.516767680644989,
-0.3763469457626343,
0.00039689094410277... | |
100. So running through the above for one starting value, X would find every pair 1 < X < Y, where sum<=100, and running through it with all numbers 2-N would give a complete list of possible pairs.
For those interested, the problem I'm working through is the sum/product problem, described [here](http://www.mathematik... | [
-0.13768497109413147,
0.28886815905570984,
0.3527982532978058,
-0.11234462261199951,
-0.13964085280895233,
0.732684314250946,
0.33329835534095764,
-0.6707116365432739,
-0.276600182056427,
-0.31156590580940247,
-0.1543833315372467,
0.14223119616508484,
-0.21443840861320496,
-0.0024103003088... | |
so after some editing, here is the latest version of my code.
I think it's very close, but there's still something not quite right.
It cycles through number pairs, but requires the use of ";" to view all the answers, which isn't what I want. Additionally, it returns false after all the answers are exhausted. I just c... | [
-0.2685415744781494,
0.32244282960891724,
0.07483025640249252,
0.14479690790176392,
-0.18567590415477753,
0.7698153257369995,
0.6003312468528748,
-0.3789999186992645,
-0.3059903383255005,
-0.7118136882781982,
-0.054060548543930054,
0.019248487427830696,
-0.2628838121891022,
0.0902097225189... | |
why!
It is better for various reasons, including:
* In most Swing components, custom painting is achieved by overriding the `paintComponent(Graphics)` method. Top-level Swing containers (e.g. `JFrame`, `JApplet`, `JWindow`) have only `paint(Graphics)`. As a result of the common method for painting, people who answer o... | [
0.7238690853118896,
-0.24990509450435638,
0.29461684823036194,
0.0063814022578299046,
-0.0029227822087705135,
-0.1852421909570694,
0.09255019575357437,
-0.3498438894748688,
-0.33716824650764465,
-0.4107486307621002,
-0.19568051397800446,
0.45610612630844116,
-0.2464371770620346,
-0.3444713... | |
be great to throw in a tool-bar & offer it as an applet as well?" The `JComponent` approach adapts easily to that.
* As explained (complete with code!) by Richante, it is easier to calculate the co-ordinates required for painting the custom component, and if it has a preferred size, to size the `JFrame` to be 'exactly ... | [
0.7302335500717163,
-0.18906696140766144,
0.15739192068576813,
-0.1091337651014328,
0.2267114222049713,
0.20328250527381897,
0.09774740040302277,
-0.2374279946088791,
-0.3791767954826355,
-0.7588937282562256,
0.036038581281900406,
0.6457948088645935,
-0.19445180892944336,
-0.53493964672088... | |
an `ImageIcon`/`JLabel` combo. Here is an example of [painting to an image](https://stackoverflow.com/a/10055672/418556).
When it comes time to update it:
1. Call `getGraphics()` for a `Graphics` or `createGraphics()` for a `Graphics2D`
2. Draw the custom painting to that graphics instance
3. Dispose of the graphic... | [
0.5642957091331482,
-0.3440172076225281,
0.6592231392860413,
0.05621841177344322,
-0.2615039646625519,
-0.2757396697998047,
0.16770537197589874,
-0.30575311183929443,
-0.3339858055114746,
-0.7637876868247986,
-0.07470426708459854,
0.9974851012229919,
-0.20285086333751678,
0.011815534904599... | |
I have read the Adobe's docs [Using FXG](http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WSda78ed3a750d6b8f26c150d412357de3591-8000.html) and [Embedding application assets](http://www.adobe.com/devnet/flex/quickstarts/embedding_assets.html#UsingFXGDocuments), but can only embed the FXG through MXML -
![enter image desc... | [
0.3444300889968872,
0.363677978515625,
0.5941084027290344,
-0.27261000871658325,
-0.008721880614757538,
0.19809795916080475,
-0.07078273594379425,
-0.5302544832229614,
0.11286673694849014,
-0.8179133534431458,
-0.12524926662445068,
0.6361123919487,
0.1977243423461914,
-0.1295449435710907,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.