text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
an Access Token" section of <http://csharpsdk.org/docs/web/getting-started.html> | [
0.08242712914943695,
-0.21576474606990814,
0.4378370940685272,
0.2558686435222626,
0.2568979263305664,
-0.19281908869743347,
-0.28006282448768616,
-0.07542918622493744,
-0.2674553096294403,
-0.6390141844749451,
-0.18828308582305908,
-0.18094812333583832,
0.34394967555999756,
0.135636642575... | |
I am new in objective c. I understand that `-init()` is an `instance method` and return an object
e.g. `myObj=[myObj init];` will return an object `myObj.`
However, if `self =[super init];` normally `super refer to parent` class e.g. `NSObject` which is a `class, not instance`.
So, `Is -init() instance method or clas... | [
-0.07341010868549347,
0.08964964747428894,
0.21560713648796082,
-0.05466633662581444,
-0.36613669991493225,
-0.5144619941711426,
0.3335684537887573,
0.09349130094051361,
-0.043560609221458435,
-0.5093311667442322,
-0.14758256077766418,
0.6207606792449951,
-0.29602038860321045,
-0.003807663... | |
init];` — you call `myObj = [[MyObj alloc] init]`. Notice the case difference between `myObj` (a variable) and `MyObj` (the class of which this variable is an instance). | [
-0.42464837431907654,
0.03248370811343193,
-0.1884363293647766,
-0.11765331774950027,
-0.12491423636674881,
-0.10496439784765244,
0.05323261395096779,
0.3537101149559021,
0.02074163779616356,
-0.26431143283843994,
-0.38181501626968384,
0.29030734300613403,
-0.4475976824760437,
0.0342627242... | |
I have to print the hover box information content on to stdout and i tried it in the below fashion it didn't work for me .
```
data = $browser.div(:class => "homeSectionLabel textWidget",:text => /Pool A/ ).hover
print "Data #{data} \n"
```
And the other problem that i have other widget called Pool B with same cla... | [
0.11633534729480743,
0.1618894636631012,
0.859457790851593,
0.2806859314441681,
-0.12160534411668777,
-0.13643456995487213,
-0.2557985782623291,
-0.32341083884239197,
0.06310924887657166,
-0.6938799619674683,
0.2759692370891571,
0.49949702620506287,
0.28144922852516174,
0.12881073355674744... | |
directory path.
#define kDOCSFOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
//Delete files by iterating items of the folder.
NSFileManager* fm = [[[NSFileManager alloc] init] autorelease];
NSDirectoryEnumerator* en = [fm enumeratorAtPath:kDOCSFOLDER];
NSError* err = nil;
BOOL res;
NSStrin... | [
-0.10534778237342834,
-0.27202293276786804,
0.5621626377105713,
-0.2669837176799774,
0.23906974494457245,
0.11214353889226913,
0.31449249386787415,
-0.3890666365623474,
-0.12394574284553528,
-0.8402858376502991,
-0.3828776478767395,
0.595130980014801,
-0.06334289908409119,
0.17253577709197... | |
res = [fm removeItemAtPath:[kDOCSFOLDER stringByAppendingPathComponent:file] error:&err];
if (!res && err) {
NSLog(@"oops: %@", err);
}
}
}
``` | [
-0.06276680529117584,
-0.004333470016717911,
0.7012119889259338,
-0.6035350561141968,
0.24725855886936188,
0.26135727763175964,
0.7083534002304077,
-0.6090147495269775,
-0.0733049139380455,
-0.4248639643192291,
-0.34904709458351135,
1.009973406791687,
-0.13006213307380676,
0.24015651643276... | |
I wrote a sorting algorithm in python.
It returns a Python Dictionary object.
How do i get the dictionary from Python into my PHP code as an associative arr ?
Will I have to write the whole sorting algorithm again in PHP?
Serializing to JSON would be the simplest thing to do:
python:
```
import json
fp = open('/tm... | [
-0.08917456865310669,
0.14869767427444458,
0.3802814781665802,
-0.21397507190704346,
-0.4348924160003662,
0.31770139932632446,
0.089579276740551,
-0.29153555631637573,
-0.17739105224609375,
-0.5005366802215576,
0.08878546953201294,
0.22998295724391937,
-0.5509489178657532,
0.01404739916324... | |
I would like to ask a question on theming in liferay. What would be easier and better? Create a New Theme or Modify a Theme that is already present for liferay pages?
Thanks for any suggestions.
That is the same: by creating a new theme with Liferay SDK the default theme will be cloned and then you can override some c... | [
0.7188685536384583,
-0.1507035195827484,
0.843712568283081,
0.2546064555644989,
-0.2944691777229309,
0.19911964237689972,
0.041323281824588776,
0.054146550595760345,
-0.5099998116493225,
-0.4245828092098236,
0.04471156373620033,
0.6284943222999573,
-0.3669206202030182,
0.5384162068367004,
... | |
How can I get the input for an editable `JComboBox`. When user gives an input to the combo how I can get the input text from it?
You need to get the edited text from the combobox editor via [`combo.getEditor().getItem()`](http://docs.oracle.com/javase/7/docs/api/javax/swing/ComboBoxEditor.html#getItem%28%29). | [
0.5070520639419556,
-0.159175843000412,
0.3413153886795044,
-0.021911749616265297,
0.058401864022016525,
0.11023008823394775,
0.04711747169494629,
-0.37952688336372375,
-0.060042090713977814,
-0.6685490012168884,
0.022770695388317108,
0.5371534824371338,
-0.2669612765312195,
-0.37617358565... | |
Is it possible to create variable for variable Names ? like this
```
class example {
String VAR1 = "id";
String VAR2 = "mark";
public foo()
{
int VAR1;
int VAR2;
}
}
```
Or Say I'm having nested class Parent and Child.
```
class Parent {
char a;
//some variables
class child ... | [
0.22229236364364624,
0.11803775280714035,
-0.04038778692483902,
-0.16421373188495636,
0.029012253507971764,
0.08597759157419205,
0.14129638671875,
-0.13287588953971863,
-0.12467805296182632,
-0.36996975541114807,
-0.05555720254778862,
0.423012912273407,
-0.3146398961544037,
0.4978666603565... | |
in 'Parent.a' with something like a MACRO so that I don't want to change every 'Parent' in its child classes individually.
Is there any possible solution for this ?
In this case, `IEnumerable<MyClass> obj = new Collection<MyClass>()` makes no sense at all because you have an empty collection that you cannot add items ... | [
0.16815415024757385,
-0.1510685533285141,
-0.21832428872585297,
0.17946068942546844,
0.16575071215629578,
0.020877394825220108,
0.00023674583644606173,
0.07363950461149216,
-0.17964264750480652,
-0.6802791357040405,
0.05468563735485077,
0.32865217328071594,
-0.10286925733089447,
0.37828430... | |
using an equivalent of the first form:
```
var obj = new Collection<MyClass>();
```
If the object *is* exposed to outside code (e.g. through a property, or if it's returned by a method) then you should choose the type that makes the best sense given the public interface of your class. This means that as a rule of th... | [
0.053920552134513855,
-0.051465343683958054,
0.1102658212184906,
-0.035729192197322845,
-0.11432813853025436,
-0.18249893188476562,
0.31522610783576965,
-0.004740256350487471,
-0.12324479967355728,
-0.853056013584137,
-0.3833783268928528,
0.5540191531181335,
-0.607550323009491,
0.296681225... | |
still not enough then `IList`. | [
0.03919520229101181,
-0.09583927690982819,
0.24677611887454987,
-0.10488235205411911,
-0.547241747379303,
0.2106286734342575,
0.4540228545665741,
-0.26149410009384155,
0.21102678775787354,
-0.4973241984844208,
0.3601987957954407,
0.6215256452560425,
-0.1478056162595749,
0.18385766446590424... | |
I have beans which have Objects which can contain different types. Now when I create XML it will add class attribute to serialized object. I would like to change that for example class simple name.
Example Java:
```
public class MyParentClass {
private Object childObjectAttribute; // Can be any instance of any inter... | [
0.2236064374446869,
0.2338133156299591,
0.6464717984199524,
-0.11424390971660614,
0.08954471349716187,
0.10759072005748749,
-0.0947825238108635,
-0.11678557097911835,
-0.0708441510796547,
-0.821066677570343,
0.09995387494564056,
0.4192623496055603,
-0.33114638924598694,
0.3673895001411438,... | |
class="com.example.PossibleClass"/>
</myParentClass>
```
I would like to change com.example.PossibleClass to PossibleClass or something else. Is that possible?
Yes you can! It's helps to reduce the size of generated document. It's a good practice to do so.
Use [XStream.alias()](http://x-stream.github.io/javadoc/co... | [
-0.1895519345998764,
-0.24893899261951447,
0.2039880007505417,
0.023695819079875946,
0.37165528535842896,
0.05999288335442543,
0.36231574416160583,
-0.24592679738998413,
-0.00488721439614892,
-0.733825147151947,
-0.09671226888895035,
0.3006906807422638,
-0.2475973665714264,
0.1363637447357... | |
I have the following `perl` script:
```
$myVariable = "some value";
//... some code ...
$myVariable =~ s/\+/ /g;
$myVariable =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
//.. some more code ...
```
Reading from `perl` documentation, I think that `=~` operator returns a `boolean` value, namely `true` or `fal... | [
-0.05511056259274483,
0.12263110280036926,
0.5075268745422363,
-0.18941959738731384,
0.15345357358455658,
-0.10979433357715607,
0.1195603534579277,
-0.10699023306369781,
-0.09311750531196594,
-0.38434404134750366,
-0.07829740643501282,
0.7203807234764099,
-0.25147774815559387,
0.2039846926... | |
you are doing substitutions (`s///`), not because the result of a match or substitution is a boolean; `=~` is not like `=`, it is like `==`. If you want the boolean result of the action, you need to assign it.
```
$result = $myVariable =~ s/\+/ /g;
``` | [
-0.07142294943332672,
-0.15474413335323334,
0.008277476765215397,
-0.06858908385038376,
0.13545730710029602,
-0.09381493926048279,
0.1662069857120514,
-0.21167850494384766,
-0.026554878801107407,
-0.31867486238479614,
-0.3861168920993805,
0.5775043964385986,
-0.5165895223617554,
-0.0522741... | |
I am trying my hands on WPF MVVM. I have written following code in XAML
```
<UserControl x:Class="Accounting.Menu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/... | [
0.057887569069862366,
0.48029637336730957,
0.4694949686527252,
-0.49235230684280396,
-0.3010076582431793,
0.04570802301168442,
0.19349408149719238,
-0.3969828188419342,
-0.035412754863500595,
-0.5180733799934387,
-0.08624354004859924,
0.45434871315956116,
0.0238919947296381,
0.074018821120... | |
d:DesignHeight="105" d:DesignWidth="300">
<UserControl.DataContext>
<local:MenuViewModel/>
</UserControl.DataContext>
<StackPanel>
<StackPanel>
<TextBlock Text="{Binding Path=MenuHeader}"/>
</StackPanel>
<ListBox ItemsSource="{Binding Path=MenuItems}" Height="70"... | [
-0.027821429073810577,
-0.00642348499968648,
0.7669563293457031,
-0.5658748745918274,
-0.18076308071613312,
0.31216660141944885,
0.09075377136468887,
-0.4734163284301758,
-0.09445018321275711,
-1.162563681602478,
-0.014261677861213684,
0.2178286761045456,
0.007930734194815159,
-0.058138631... | |
with properties `MenuHeader` and `MenuItems`. I get values in both the properties during runtime. Former is bound to text of `TextBlock` and latter to ItemSource of `ListBox`. But when I run the solution, TextBlock and ListBox are empty.
**Edit: Code of ViewModel**
```
public class MenuViewModel: ViewModelBase
... | [
-0.2410014569759369,
0.13937291502952576,
0.4680069386959076,
-0.31921103596687317,
-0.06932990998029709,
0.30615895986557007,
0.16842426359653473,
-0.4606095850467682,
0.002972822403535247,
-0.6298820972442627,
-0.1808224469423294,
0.5696486234664917,
-0.22303767502307892,
0.0658363774418... | |
public MenuViewModel()
{
}
public MenuViewModel(string menuType)
{
this._menuType = menuType;
db = new AccountingDataClassesDataContext();
if (menuType == "Vouchers")
{ | [
0.06974559277296066,
0.03577650338411331,
0.24867743253707886,
-0.2706264555454254,
-0.003247555810958147,
0.23084570467472076,
0.4674017131328583,
-0.34654131531715393,
0.1490013599395752,
-0.7032085061073303,
-0.2762483060359955,
0.534001350402832,
-0.30395153164863586,
0.146762043237686... | |
var items = db.Vouchers.OrderBy(t => t.VoucherName).Select(v => v.VoucherName).ToList<string>();
if (items.Any())
{
MenuItems = new ObservableCollection<string>(items);
MenuHeader = "Vouchers"; | [
-0.136129230260849,
-0.39261361956596375,
0.7066263556480408,
-0.17083129286766052,
0.003544899169355631,
0.4626677930355072,
0.2675881087779999,
-0.33705613017082214,
-0.33413946628570557,
-0.5899496674537659,
-0.40682539343833923,
0.4146639406681061,
-0.3725290894508362,
0.51797658205032... | |
}
}
else
{
System.Windows.MessageBox.Show("Menu not found");
}
}
}
```
Thanks in advance.
You are creating your ViewModel in | [
0.02922489121556282,
-0.06566824018955231,
0.5554090142250061,
0.007484217174351215,
0.22407159209251404,
-0.1479283720254898,
0.2187301218509674,
0.272331178188324,
0.09795476496219635,
-0.8902948498725891,
-0.2854001820087433,
0.6139058470726013,
-0.05511501803994179,
-0.1491473764181137... | |
the XAML using your ViewModel's default contructor which does nothing. All your population code is in the non-default contructor which is never called.
The more usual way is to create the ViewModel in code, and inject it into the view either explicitly using `View.DataContext = ViewModel`, or impllcitly using a DataTe... | [
0.08309558779001236,
-0.06351570039987564,
0.5108144283294678,
0.018042802810668945,
0.02953738160431385,
0.0069136894308030605,
0.009546567685902119,
0.1045338436961174,
-0.03663082793354988,
-0.5675446391105652,
-0.3948860466480255,
0.22649537026882172,
-0.5737168788909912,
0.04818885773... | |
I have some experience writing parsers with ANTLR and I am trying (for self-education :) ) to port one of them to PEG (Parsing Expression Grammar).
As I am trying to get a feel for the idea, one thing strikes me as cumbersome, to the degree that I feel I have missed someting: How to deal with whitespace.
In ANTLR, th... | [
0.02732989378273487,
-0.06014709919691086,
-0.27240073680877686,
-0.20562037825584412,
-0.5487875938415527,
0.2537497580051422,
0.20231245458126068,
0.11875169724225998,
-0.06355459988117218,
-0.7131695747375488,
0.20077215135097504,
0.2879495322704315,
-0.3780969977378845,
-0.295568645000... | |
like to "hide" the comments right away, but since the comments may have semantic meaning (for example when generating code documentation, class diagrams, etc), one would not just like to discard them.
So, is there a way to deal with this?
Because there is no separate tokenization phase, there is no "time" to discard c... | [
0.007266268599778414,
-0.1063595563173294,
0.014958514831960201,
0.38370564579963684,
-0.31874287128448486,
0.18100255727767944,
0.10509572178125381,
0.057937704026699066,
-0.4034179151058197,
-0.7007004618644714,
-0.009004618972539902,
-0.040526390075683594,
-0.2650207281112671,
-0.181277... | |
litter your grammar with space-rules in the PEG:
### ANTLR
```
add_expr
: Num Add Num
;
Add : '+';
Num : '0'..'9'+;
Space : ' '+ {skip();};
```
### PEG
```
add_expr
: num _ '+' _ num
;
num : '0'..'9'+;
_ : ' '*;
``` | [
0.23461437225341797,
0.15198121964931488,
-0.024480581283569336,
-0.005224423483014107,
0.02315882034599781,
0.194000244140625,
0.4669046401977539,
0.10221121460199356,
-0.4250568449497223,
-0.6129310131072998,
-0.18972882628440857,
-0.021891452372074127,
-0.6017704606056213,
0.10821681469... | |
Is it possible that add colorful items in dropdown in Wicket? Dropdown will take its values from enum class.
For example, enum class has 'red,yellow,green' elements. Sections of dropdown will be green, red, yellow colors according to element.
How can i make that?
Is it possible to use an AttributeModifier on the DropDo... | [
-0.03221634402871132,
-0.7170689702033997,
0.002622641157358885,
0.3455411493778229,
-0.10470574349164963,
0.21019774675369263,
-0.2737314701080322,
-0.22078567743301392,
-0.2659320533275604,
-0.45248156785964966,
-0.06988804787397385,
0.14423558115959167,
-0.2450776994228363,
-0.162836953... | |
When installing an app via the Market app on a phone, the app will correctly receive the referrer information passed to it (as described here: <http://code.google.com/mobile/analytics/docs/android/#android-market-tracking>).
However, when installing the same app with the same referrer via the web-based Market, the ref... | [
0.5884910225868225,
0.0555102564394474,
0.5834240913391113,
-0.0042615956626832485,
-0.13843363523483276,
0.1502535492181778,
-0.11236836016178131,
-0.2018042355775833,
-0.218591570854187,
-0.3906247317790985,
0.1382015198469162,
0.6974856853485107,
-0.2171448916196823,
-0.3143751323223114... | |
does not currently support web-to-device
> installs initiated from the web Play Store. | [
0.16583150625228882,
-0.15032880008220673,
0.4305668771266937,
0.11985788494348526,
0.6030049920082092,
-0.3678184449672699,
0.17395049333572388,
0.23933957517147064,
0.005042837932705879,
-0.47861674427986145,
-0.1549457162618637,
0.5060127973556519,
-0.26126226782798767,
0.33384761214256... | |
I have an Android application with a ListView in it, the ListView will setup fine but now I want a image in the ListView to be clickable. I do this by using 2 classes, the Activity class (parent) and an ArrayAdapter to fill the list. In the ArrayAdapter I implement a OnClickListener for the image in the list that I wan... | [
0.3559184670448303,
-0.3130631744861603,
0.5573878288269043,
-0.02390582486987114,
-0.19372230768203735,
0.007615157403051853,
0.07081609219312668,
-0.027606356889009476,
-0.278800904750824,
-0.883078932762146,
0.1386776715517044,
0.6251780986785889,
-0.3594823181629181,
-0.015792051330208... | |
classes that I use.
First the Activity class:
```
public class parent_class extends Activity implements OnClickListener, OnItemClickListener
{
child_class_list myList;
ListView myListView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
... | [
0.5523236393928528,
-0.43839606642723083,
0.6833497881889343,
-0.29142722487449646,
0.2732226848602295,
0.13438285887241364,
0.30483654141426086,
-0.5935938954353333,
-0.035042621195316315,
-0.6532789468765259,
-0.32832857966423035,
0.4785235524177551,
-0.3529450595378876,
0.23421415686607... | |
// set the HomeList
myListView.setAdapter( myList );
myListView.setOnItemClickListener(this);
}
void function_to_run()
{
// I want to run this function from the LiscView Onclick
}
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3)
{
//... | [
-0.00466280709952116,
-0.21546319127082825,
0.8399268984794617,
-0.5249671339988708,
0.1270795464515686,
0.14612308144569397,
0.4763067364692688,
-0.4594798982143402,
-0.1296830177307129,
-0.7157416343688965,
-0.128501757979393,
0.6979662775993347,
-0.2497992217540741,
0.16768114268779755,... | |
the Activity class:
```
public class child_class_list extends ArrayAdapter<String>
{
// private
private final Context context;
private String[] mName;
private String[] mDate;
public child_class_list (Context context, String[] Name, String[] Date)
{
super(context, R.layou... | [
0.277343213558197,
-0.3025163412094116,
0.23571984469890594,
-0.33972233533859253,
0.3953905999660492,
-0.005875535774976015,
0.24155938625335693,
-0.3510439395904541,
-0.1285867840051651,
-0.4701290726661682,
-0.5212147235870361,
0.6066552996635437,
-0.3415917158126831,
0.1874857991933822... | |
= Name;
this.mDate = Date;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.l_home... | [
-0.3068450093269348,
-0.34134334325790405,
0.8597714900970459,
-0.37476855516433716,
0.05512610450387001,
0.35804834961891174,
0.5379764437675476,
-0.5166464447975159,
-0.27369415760040283,
-0.7446823716163635,
-0.17431914806365967,
0.5775870680809021,
-0.1444878876209259,
0.41627886891365... | |
{
public void onClick(View v)
{
// I want to run the function_to_run() function from the parant class here
}
}
);
// | [
0.32306721806526184,
-0.16903920471668243,
0.350780189037323,
-0.19251064956188202,
0.3596852719783783,
0.09938060492277145,
0.45136579871177673,
-0.0038493035826832056,
-0.000747844111174345,
-0.25126156210899353,
-0.1415678858757019,
0.7734073996543884,
-0.5255998373031616,
0.26225987076... | |
get the textID's
TextView tvName = (TextView) rowView.findViewById(R.id.l_name);
TextView tvDate = (TextView) rowView.findViewById(R.id.l_date);
// set the text
tvName.setText (mName[position]);
tvDate.setText (mDate[position]);
return rowView;
}
}
```
If an... | [
0.2526620626449585,
-0.32708507776260376,
0.9796158671379089,
-0.48230308294296265,
0.01366937905550003,
-0.09738515317440033,
0.3746299147605896,
-0.42784661054611206,
-0.17981429398059845,
-0.7533425092697144,
-0.459421843290329,
0.8777894377708435,
-0.4070190489292145,
-0.04268492385745... | |
I would greatly apriciate the help.
Inside `onClick()` Do something like this:
```
((ParentClass) context).functionToRun();
``` | [
-0.20688028633594513,
-0.014842599630355835,
0.21881318092346191,
-0.2889099717140198,
0.03839500620961189,
-0.3541609048843384,
0.34485650062561035,
0.05815046280622482,
0.30362460017204285,
-0.4923689663410187,
-0.42615488171577454,
0.8932404518127441,
-0.301382839679718,
-0.046070989221... | |
I am trying to retrieve the last 5 inserted data in the 'Vulcano' table from the 'Execution' table, am using EclipseLink, Facade class which calls this query at the moment;
Here is part of the Facade class am using;
```
public ArrayList<ExecutionPOJO> getLatestsVulcanoExecutions() {
ArrayList<ExecutionPOJO> v... | [
0.10095713287591934,
0.2979525923728943,
0.6051886081695557,
-0.20131835341453552,
0.031238341704010963,
0.12722083926200867,
0.47580981254577637,
-0.6631284952163696,
0.10844030231237411,
-0.6117295622825623,
-0.09988007694482803,
0.4850275218486786,
-0.24540208280086517,
0.15390244126319... | |
a query in EntityManager:
Exception Description: Syntax error parsing the query [select s from Execution s order by s.vulcano desc limit 2], line 1, column 50: syntax error at [limit].
Internal Exception: MismatchedTokenException(80!=-1)
```
But if I remove the limit tag I get this error;
```
Caused by: Exception [... | [
-0.26570525765419006,
-0.02295973338186741,
0.4797087609767914,
0.08191145211458206,
0.030606059357523918,
0.008868187665939331,
0.4274236559867859,
-0.4560893774032593,
-0.08318153768777847,
-0.2733042538166046,
-0.1247851625084877,
0.46641626954078674,
-0.4777023494243622,
0.264470309019... | |
others @ManyToOne
//also @oneToMany*
public Vulcano getVulcano() {
return vulcano;
}
public void setVulcano(Vulcano vulcano) {
this.vulcano = vulcano;
}
//other getter and setter
}
```
Here is another entity;
```
@Entity
public class Vulcano implements Serializable {
...
@Id
@GeneratedValue(stra... | [
0.2301536202430725,
-0.2360861748456955,
0.520532488822937,
-0.1609850525856018,
0.035050660371780396,
0.11609333008527756,
0.283049076795578,
-0.4886353313922882,
-0.18821436166763306,
-0.6236248016357422,
0.15090340375900269,
0.37882357835769653,
-0.518917977809906,
0.21675683557987213,
... | |
I normally debug my apps by pressing the little "bug" icon in Eclipse.
But now I have inserted an intent filter like this in my manifest:
```
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
```
While the app launches now automatically when the USB cable is plugged in - I cannot debug it a... | [
0.402499258518219,
-0.008604026399552822,
0.6521363854408264,
-0.10962942987680435,
0.053350768983364105,
-0.1082061305642128,
0.2612522840499878,
-0.045474354177713394,
-0.07345791161060333,
-0.6455362439155579,
-0.06377258151769638,
0.8119915723800659,
-0.5266570448875427,
-0.20495270192... | |
app process and viola you may debug the app like before | [
0.19147749245166779,
0.11879748106002808,
0.5866233706474304,
0.22552375495433807,
0.05708848685026169,
-0.03746147081255913,
0.3402853012084961,
-0.13063763082027435,
-0.5107616186141968,
-0.40990716218948364,
-0.29966187477111816,
0.7492653131484985,
-0.25661808252334595,
0.4549666345119... | |
I currently have this piece of code:
```
NSString *strURL = [NSString stringWithFormat:@"http://www.sample.com /phpFile.php?firstname=%@",txtfirstName.text];
NSString *strURL2 = [NSString stringWithFormat:@"http://www.sample.com/phpFile.php?lastname=%@",txtlastName.text];
```
But the problem is that this creates ... | [
0.06606518477201462,
0.2871473431587219,
0.574883759021759,
-0.2936777174472809,
-0.037761982530355453,
0.19108480215072632,
0.13617539405822754,
-0.2687676250934601,
-0.1399247795343399,
-0.6428213119506836,
0.09066449105739594,
0.4088159501552582,
-0.1267247498035431,
0.2724829912185669,... | |
After using this code to get my link to show me 3 database entrys as link in table i get undefined method `+' for nil:NilClass error this error for companies without these fields.
```
<td><%= link_to @company.office_adress_street + ", " + @company.office_adress_city + ", " + @company.office_adress_postcode, "http://m... | [
-0.014433537609875202,
0.40348806977272034,
0.6473578214645386,
0.056642815470695496,
-0.0687914714217186,
0.1902998983860016,
0.12937234342098236,
-0.21498699486255646,
-0.14405572414398193,
-0.697276771068573,
0.024635137990117073,
0.4138229489326477,
-0.2505699694156647,
0.5861253738403... | |
I have some problem with reading from sqlite3 database.
```
-(void) readMessengesFromDatabase {
sqlite3 *database;
messenges = [[NSMutableArray alloc] init];
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
NSLog(@"Connection OK");
const char *sqlStatement = "select *... | [
-0.09161164611577988,
0.3308967351913452,
0.541770875453949,
-0.021597405895590782,
-0.0890183076262474,
0.09824534505605698,
0.6823583841323853,
-0.26594963669776917,
-0.0114428186789155,
-0.838489830493927,
-0.035548970103263855,
0.3428906500339508,
-0.29407966136932373,
0.18218898773193... | |
sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { //не проходит условие
NSLog(@"Connection to table OK");
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
NSLog(@"Read rows OK");
NSString *dbMessageID = [NSString stringWithUTF8String:(char *)sqlite... | [
-0.3622186481952667,
-0.11724068969488144,
0.634131908416748,
-0.2380552440881729,
-0.054852407425642014,
0.2352956086397171,
0.48483556509017944,
-0.42032086849212646,
-0.18821634352207184,
-0.25950413942337036,
-0.275050550699234,
0.3944333493709564,
-0.2778984010219574,
0.14191317558288... | |
*)sqlite3_column_text(compiledStatement, 1)];
NSString *dbMessageDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
NSString *dbMediaOrNot = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
Message ... | [
-0.10037081688642502,
-0.16231583058834076,
0.5028171539306641,
-0.37327295541763306,
-0.2065909057855606,
0.3013516366481781,
0.4512802064418793,
-0.2715684175491333,
-0.1879066824913025,
-0.7955488562583923,
-0.5010518431663513,
0.3999655544757843,
-0.3299877345561981,
0.394877552986145,... | |
[messege release];
}
}
sqlite3_finalize(compiledStatement);
}
sqlite3_close(database);
}
```
My first NSLog shows me what connection to database is ok. But next step "select \* from MessagesData" and `if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) =... | [
-0.3459031879901886,
0.25869759917259216,
0.7430534958839417,
-0.3171654939651489,
-0.023721987381577492,
0.004180766176432371,
0.6075020432472229,
-0.4108509123325348,
-0.2362862080335617,
-0.8139441013336182,
-0.3578121066093445,
0.4520614743232727,
-0.4357774555683136,
0.177421391010284... | |
. Where is my mistake? I don't see any problems in my code...
If you print the error code returned by `sqlite3_prepare_v2` it will be a lot easier to diagnose the problem. The numeric values can be found on [this page](http://www.sqlite.org/c3ref/c_abort.html).
```
int errorCode = sqlite3_prepare_v2(database, sqlState... | [
0.2818213403224945,
0.6410301923751831,
0.006931189447641373,
-0.04358402267098427,
0.21552187204360962,
0.02487761341035366,
0.5510327219963074,
-0.4362349510192871,
0.004449976608157158,
-0.6541998982429504,
-0.0035159813705831766,
0.6688706278800964,
-0.1551908552646637,
0.0541514046490... | |
database file to your computer e.g. using Organizer). Try to run the query using `sqlite3` (I know you did try that, but make sure you are checking the following).
If you are getting the message `Error: file is encrypted or is not a database`, it means that the database file is corrupt. If you get `Error: no such tabl... | [
0.0685909315943718,
0.13656781613826752,
-0.020561352372169495,
0.24957886338233948,
0.07538725435733795,
-0.3217235505580902,
0.5699893832206726,
0.24970504641532898,
-0.12878118455410004,
-0.7602183222770691,
0.10803390294313431,
0.513593852519989,
-0.2769610583782196,
0.4087480008602142... | |
that sqlite cannot read the file (for example permissions). | [
0.2525956928730011,
0.1265047788619995,
-0.29493090510368347,
0.21465256810188293,
0.15915866196155548,
-0.3889980912208557,
-0.0001865420927060768,
0.13597774505615234,
-0.0776786059141159,
-0.011247560381889343,
-0.4775448441505432,
0.34306520223617554,
-0.4228615462779999,
0.14559058845... | |
In my Windows Phone Application I have a login Page. When I put some text into Pass `TextBox`, the data should be hide with this symbols: "\*". How can I hide info from my custom text box?
```
<ValidationControl:ValidationControl x:Name="txtPIN" GotFocus="PinTextBox_GotFocus" Margin="0,0,45,0" TextWrapping="Wrap" Val... | [
-0.06651203334331512,
0.23588688671588898,
0.7039303779602051,
-0.14074169099330902,
0.34024354815483093,
0.18075186014175415,
0.3210071325302124,
-0.49674952030181885,
0.05011199042201042,
-0.5182656645774841,
-0.20000958442687988,
0.6303271055221558,
-0.13247781991958618,
-0.245830908417... | |
MaxLength="4" Foreground="Black" Background="#DEFFFFFF" ValidationRule="{StaticResource pinValidationRule}" TextChanged="txtPIN_TextChanged">
```
It doesn't work
Create a `Activity` in your application and start `Activity` from your `BroadcastReceiver`
and now launch `AlertDialog` within `onCreate` method of `Activi... | [
0.27737152576446533,
-0.3859453797340393,
0.9272750616073608,
-0.0585671104490757,
-0.0923323929309845,
-0.2164512574672699,
0.29073843359947205,
-0.3529176712036133,
-0.18914084136486053,
-0.5858873724937439,
-0.3419480621814728,
0.6043323874473572,
-0.4542544484138489,
-0.256740152835845... | |
I am just a new beginner in MySQL and I wanted to write the a SELECT statement that returns customers IDs and customer names(alphabetical order) for customers who live in Indiana, Ohio,Michigan, and Illinois, and whose names begin with the letters A or B.
Here is the CUSTOMER\_TBL structure using the DESCRIBE CUSTOMER... | [
0.3800309896469116,
0.30084937810897827,
0.4339129626750946,
-0.3026837110519409,
0.07915624231100082,
0.15103204548358917,
0.060949936509132385,
0.17934080958366394,
-0.055540382862091064,
-0.4617004990577698,
0.22659073770046234,
0.04278796911239624,
-0.34796905517578125,
0.2758511900901... | |
Type
-------------------------------------------------------------
CUST_ID NOT NULL VARCHAR2(10)
CUST_NAME NOT NULL VARCHAR2(30)
CUST_ADDRESS | [
-0.7212426662445068,
0.014869856648147106,
0.43683502078056335,
-0.08153122663497925,
0.01118199061602354,
0.1663227379322052,
0.17819274961948395,
0.08484518527984619,
-0.0028839551378041506,
-0.40381094813346863,
-0.3026295304298401,
0.6163102984428406,
-0.40959569811820984,
-0.009121603... | |
NOT NULL VARCHAR2(20)
CUST_CITY NOT NULL VARCHAR2(12)
CUST_STATE NOT | [
0.07574551552534103,
-0.06631824374198914,
0.35964691638946533,
0.11605675518512726,
-0.013391156680881977,
-0.2178776115179062,
0.6473016738891602,
-0.03303155303001404,
-0.05042189359664917,
-0.387018084526062,
-0.39595070481300354,
0.3173481523990631,
-0.5235220193862915,
0.299330860376... | |
NULL CHAR(2)
CUST_ZIP NOT NULL CHAR2(5)
CUST_PHONE | [
0.13173507153987885,
0.00715835252776742,
0.33050990104675293,
-0.03785282000899315,
0.2924796938896179,
0.16348300874233246,
0.494008868932724,
0.1528652161359787,
0.07540646940469742,
-0.15147864818572998,
-0.14608508348464966,
0.6305781006813049,
-0.5055307745933533,
-0.2178809344768524... | |
NUMBER(10)
CUST_FAX NUMBER(10)
```
Here is my solution.I just need to know if I am correct. thanks
```
SELECT CUST_ID,CUST_NAME FROM CUSTOMER_TBL
WHERE IN('Indiana','Ohio','Ohio','Michigan','Illinois') AND WHERE LIKE(A% OR B%)
ORDER BY CUST_ID,CUST_NAME
```... | [
-0.2957172989845276,
0.6196165680885315,
0.5785326361656189,
0.010189888067543507,
0.10687292367219925,
0.6539967060089111,
-0.10893166065216064,
0.256648451089859,
-0.07574751228094101,
-0.529714822769165,
-0.1969931274652481,
0.20261912047863007,
-0.23828236758708954,
0.13878107070922852... | |
column so I assume that it contains state codes, not state names. So instead of Indiana, Ohio etc you should use state codes:
```
SELECT CUST_ID, CUST_NAME
FROM CUSTOMER_TBL
WHERE CUST_STATE IN ('IN','OH','MI','IL') AND (
CUST_NAME LIKE 'A%' OR
CUST_NAME LIKE 'B%'
)
ORDER BY CUST_NAME
```
Correct the state c... | [
-0.10784674435853958,
0.4173830449581146,
0.5649932622909546,
0.10276292264461517,
0.04157818853855133,
0.3797542154788971,
-0.15895365178585052,
0.45128607749938965,
0.012710435315966606,
-0.42030346393585205,
-0.0836043432354927,
0.016826502978801727,
-0.1131872907280922,
0.4613050818443... | |
I'm so confused because after **enabling anonymous access** in central administration panel on SharePoint 2010, I can't see the **Anonymous access** in the **Site Setting** -> **Site Permissions**
Any idea?
when you have a tick on `Enable to anonymous access` from Central Administration of your web application.
than... | [
0.05357085168361664,
-0.055844083428382874,
0.4749673008918762,
0.11325763911008835,
-0.2837665379047394,
-0.23604078590869904,
0.1561865210533142,
-0.0028794954996556044,
-0.5501623749732971,
-0.619192361831665,
0.12311897426843643,
0.501731276512146,
-0.16353368759155273,
0.4752750992774... | |
I have an output:
```
<artifactId>prj-parent</artifactId>
<version>1.11.1-Beta01-SNAPSHOT</version>
```
How to extract only the 1.11.1-Beta01-SNAPSHOT using linux commands ?
Thanks!
GNU sed:
```
sed -nr '/<\/?version>/s///gp'
``` | [
0.2007979452610016,
0.20324787497520447,
0.37946486473083496,
0.017045557498931885,
-0.1138266772031784,
0.13125449419021606,
-0.07716187089681625,
-0.13148397207260132,
-0.0026290947571396828,
-0.6202589869499207,
-0.05270455777645111,
0.43772396445274353,
-0.14588823914527893,
0.11193755... | |
I want to generate a beep sound with a specific frequency and length (for different sound signals) using the system beeper (and only the speakers if beeper is not available / accessible). I know it is possible to do this by using ioctl, but that requires root access, which I don't want.
I know I could just use the "be... | [
0.479763001203537,
0.24162739515304565,
0.22141890227794647,
-0.1009954959154129,
0.06140782684087753,
-0.35209181904792786,
0.3901614248752594,
-0.19179768860340118,
0.2084173560142517,
-0.6739950776100159,
-0.005224085412919521,
0.8542113900184631,
-0.5443286299705505,
0.3281852900981903... | |
<linux/kd.h>
int main(int argc, char *argv[])
{
int fd = open("/dev/console", O_RDONLY);
if (fd == -1 || argc != 3) return -1;
return ioctl(fd, KDMKTONE, (atoi(argv[2])<<16)+(1193180/atoi(argv[1])));
}
```
If there is no other way to do this, then I will use beep, but I would really like to avoid dependencies and... | [
0.05841894820332527,
0.10268837213516235,
0.3393702507019043,
-0.22060325741767883,
0.16588746011257172,
-0.11235127598047256,
0.5624402761459351,
-0.0700145810842514,
-0.08501555025577545,
-0.4915952980518341,
-0.1749991774559021,
0.832096517086029,
-0.6313967108726501,
0.2516627013683319... | |
`beep`, which already has suid. I suppose I will just add one more dependency, then, as `beep` is not too big anyway.
Thank you for all the answers, I'm sure other libraries are great for more complex signals, but I need a very simple one!
I think this question can be marked as solved / closed, then.
If anybody find... | [
0.07081735134124756,
0.24376079440116882,
0.37621062994003296,
0.34080132842063904,
-0.08474298566579819,
-0.2737565338611603,
0.5115671157836914,
0.29478442668914795,
-0.4139464199542999,
-0.4696621000766754,
-0.1297553926706314,
0.6951425671577454,
-0.18950825929641724,
0.171533018350601... | |
how can insert a record if only a specific value doesn't exist in a field
```
INSERT INTO `users` (fb_id, username)
SELECT '.$id_signed_in.', '.$user_signed_in.' FROM `users`
WHERE NOT EXISTS (SELECT * FROM `users`
WHERE fb_id='.$id_signed_in.')
LIMIT 1'
```
this does not see... | [
0.24021369218826294,
-0.024131985381245613,
-0.03608666732907295,
0.1611274778842926,
0.7820748686790466,
-0.15700460970401764,
-0.19282346963882446,
-0.1355726420879364,
-0.31101876497268677,
-0.21451063454151154,
0.19999876618385315,
0.5559445023536682,
-0.30533498525619507,
0.1093253940... | |
WHERE fb_id='.$id_signed_in.')
LIMIT 1'
``` | [
0.004285059869289398,
0.1450510025024414,
0.5444272756576538,
-0.40701591968536377,
0.28638043999671936,
-0.38704437017440796,
-0.05542311817407608,
-0.4519222378730774,
-0.16573931276798248,
-0.12462500482797623,
-0.24940530955791473,
0.6259158253669739,
-0.46912023425102234,
0.0365630313... | |
I am writing a document editor using JQuery, and have implemented basic formatting: select text, click a button and the text is surrounded in the appropriate tag.
To improve this, I now need to examine the text before and after the selection, to see whether a tag has already been opened etc. Is there any simple way of... | [
0.10392624139785767,
-0.04228910058736801,
0.059974245727062225,
-0.1115182489156723,
-0.1855650693178177,
-0.07961709052324295,
0.06394988298416138,
-0.1438685953617096,
-0.056734975427389145,
-0.5918883681297302,
-0.2622612714767456,
0.44777408242225647,
-0.25947707891464233,
-0.35012668... | |
jumps over the lazy dog</strong>.
```
> To improve this, I now need to examine the text before and after the selection, to see whether a tag has already been opened etc. Is there any simple way of checking whether the selection is a part of a larger node?
(Tags are opened [in HTML, with `<`], but what you really mean... | [
0.12704020738601685,
-0.33220577239990234,
0.006239630281925201,
0.16092580556869507,
0.04081060737371445,
-0.18017122149467468,
0.13242776691913605,
-0.23205247521400452,
-0.6027213335037231,
-0.3765782117843628,
-0.24721123278141022,
0.23058952391147614,
-0.37542617321014404,
-0.21026310... | |
of one non-text node, *every* text selection is "part of a larger node". However, whether you can find out what that node is, and whether it is *easy* to do depends both on your abilities and on the browser, as it depends on the DOM implementation used by the layout engine of the browser.
For example, in Gecko-based b... | [
-0.0945749580860138,
-0.15890957415103912,
0.15917141735553741,
0.1698169708251953,
-0.10702729225158691,
-0.0776958093047142,
0.32552915811538696,
-0.12352590262889862,
-0.2150009274482727,
-0.8850096464157104,
-0.49626708030700684,
0.35504013299942017,
-0.3081812262535095,
0.025812624022... | |
`anchorNode` that refer to an object implementing the `Text` interface (see the [Gecko DOM Reference at MDN](https://developer.mozilla.org/en/DOM/window.getSelection) for that).
That object, which represents the text node that the start of the selection is part of, has a `parentNode` property which gets you the elemen... | [
-0.21226724982261658,
-0.11695071309804916,
0.6726897358894348,
-0.1400384157896042,
0.07378405332565308,
-0.07803460955619812,
0.03387172147631645,
-0.1724373698234558,
-0.2948603630065918,
-0.5313476920127869,
-0.5966010093688965,
0.6793476939201355,
-0.24419444799423218,
0.0240930058062... | |
spans not only several text nodes but several elements. That is, in a table the user could have easily selected the text "foobar" as in `<td>foo</td><td>bar</td>`.
With runtime feature tests and exception handling you can determine which interface is supported without resorting to error-prone browser sniffing.
> For ... | [
0.2894413471221924,
0.03933647274971008,
0.28432315587997437,
0.04640381783246994,
-0.25279316306114197,
-0.09211500734090805,
0.21022801101207733,
-0.3575204312801361,
-0.33039793372154236,
-0.5147602558135986,
-0.07455354928970337,
0.27091699838638306,
-0.3979192078113556,
0.045723728835... | |
the inner element's CSS properties are not necessarily redundant. Another example is emphasizing text already in an `em` element for which the user might want to use the `strong` element then.
Avoid jQuery; you do not need it and on closer inspection you would not even want it. | [
0.0865822583436966,
0.08573804795742035,
0.1468762755393982,
-0.0990334153175354,
-0.17053678631782532,
-0.31827783584594727,
0.6421053409576416,
0.11223173141479492,
-0.1607835292816162,
-0.5847524404525757,
-0.5837804079055786,
0.44291722774505615,
-0.10611999779939651,
-0.27724668383598... | |
I have two function and I need to execut in one `onClick`. The first one is to confirm the submit, if the user press `yes` it should execute the second function. It is not working with me. Any help please.
below my code:
```
<Script>
function checkSubmit(){
if(confirm('Are you sure you want to submit the data?');)
... | [
0.21837270259857178,
-0.08839135617017746,
0.6904659867286682,
0.09770440310239792,
-0.06686107814311981,
-0.2235405296087265,
0.13562683761119843,
-0.2828935384750366,
0.1625441610813141,
-0.789337694644928,
0.017160559073090553,
0.5618835091590881,
-0.18563704192638397,
0.044711098074913... | |
the data?'))
sendData();
}
function sendData() { alert("data sent"); }
``` | [
0.00971764512360096,
-0.2812783718109131,
0.5123245120048523,
-0.16856230795383453,
0.18766003847122192,
-0.19543999433517456,
0.2020585983991623,
-0.2711016535758972,
-0.05089394748210907,
-0.29229092597961426,
-0.6797835826873779,
0.7871872782707214,
-0.7152109146118164,
0.13000053167343... | |
I'm using the guide to creating n-to-n relations in Orchard (ocs.orchardproject.net/Documentation/Creating-1-n-and-n-n-relations) with some slight modifications. While the sample code works well my own content part is always blank after I create or edit the item. I can't figure it out, because I *swear* my code is almo... | [
0.23708006739616394,
0.3674590289592743,
-0.16143280267715454,
-0.16351088881492615,
-0.12992943823337555,
0.3776814043521881,
0.05259491503238678,
0.13905994594097137,
-0.250449538230896,
-0.48759225010871887,
0.3419105112552643,
0.503259003162384,
-0.02218969725072384,
0.2089451402425766... | |
with all fields blank.
The original sample works fine, so it has to be something I did or didn't do, but I just can't figure out what it is.
Some relevant classes:
```
using System.Linq;
using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using ArealAds.Models;
usin... | [
0.12956032156944275,
0.08772146701812744,
0.4429020285606384,
0.07358357310295105,
0.0016725838650017977,
0.2845064401626587,
0.3773893415927887,
-0.4483136534690857,
-0.021640634164214134,
-0.7261099815368652,
-0.17671515047550201,
0.5941268801689148,
-0.23662832379341125,
0.2094522267580... | |
streetService;
}
// this one gives a runtime error with blank description,
// other values produce result with all fields blank
protected override string Prefix {
get { return "Area"; }
}
protected override DriverResult Display(StreetPart part, string displa... | [
0.08257520198822021,
-0.33577004075050354,
0.18502271175384521,
0.06270501017570496,
-0.18761365115642548,
0.2877778112888336,
0.4018579423427582,
-0.3299718201160431,
0.09217087179422379,
-0.675961434841156,
-0.043562643229961395,
0.3649759590625763,
-0.32299500703811646,
0.11174494773149... | |
return ContentShape("Parts_Street",
() => shapeHelper.Parts_Street(
ContentPart: part, | [
-0.2001311182975769,
-0.13276652991771698,
0.4218340218067169,
0.07486527413129807,
0.3260951638221741,
0.3269309997558594,
0.18047970533370972,
0.06277246028184891,
0.07653297483921051,
-0.7009150981903076,
-0.4302479326725006,
-0.05025630071759224,
0.018733123317360878,
0.299951583147048... | |
Name: part.Name,
Areas: part.Areas,
Districts: part.Districts));
}
protected override DriverResult Editor(StreetPart part, dynamic shapeHelper) { | [
-0.38267630338668823,
-0.32858148217201233,
0.27377384901046753,
0.1341007649898529,
0.11906515061855316,
0.08570953458547592,
0.46412307024002075,
-0.21272383630275726,
0.23642125725746155,
-0.35799112915992737,
-0.4389568865299225,
0.5776966214179993,
-0.22920753061771393,
0.008110847324... | |
return ContentShape("Parts_Street_Edit",
() => shapeHelper.EditorTemplate(
TemplateName: TemplateName,
Model: BuildEditorViewModel(part), | [
-0.2398930937051773,
-0.23303116858005524,
0.4555135667324066,
0.027844084426760674,
0.17482206225395203,
0.3302350342273712,
0.05565997585654259,
-0.18437786400318146,
0.14084559679031372,
-0.9153566360473633,
-0.21149404346942902,
0.25120699405670166,
-0.0779215469956398,
0.0499173887073... | |
Prefix: Prefix));
}
protected override DriverResult Editor(StreetPart part, IUpdateModel updater, dynamic shapeHelper) {
var model = new EditStreetViewModel();
updater.TryUpdateModel(model, Prefix, null, null);
if (part.ContentItem.Id != 0) {
_street... | [
-0.42808958888053894,
-0.313153475522995,
0.5136990547180176,
-0.017093205824494362,
-0.3406859338283539,
0.29692375659942627,
0.48201337456703186,
-0.3724321722984314,
0.059565361589193344,
-0.6703126430511475,
-0.37673306465148926,
0.5846381187438965,
-0.37473270297050476,
0.404099881649... | |
}
return Editor(part, shapeHelper);
}
private EditStreetViewModel BuildEditorViewModel(StreetPart part) {
var itemAreas = part.Areas.ToLookup(r => r.Id);
return new EditStreetViewModel {
Areas = _streetService.GetAreas().Select(r => new AreaEntry { | [
-0.14262261986732483,
-0.247308611869812,
0.6467118859291077,
-0.1356496512889862,
0.05184086412191391,
0.37506574392318726,
0.40429648756980896,
-0.4119705855846405,
-0.07364118099212646,
-0.731717586517334,
-0.38888871669769287,
0.4225676357746124,
-0.19551204144954681,
0.260850638151168... | |
Area = r,
IsChecked = itemAreas.Contains(r.Id)
}).ToList()
};
}
}
}
using System.Collections.Generic;
using System.Linq;
using Orchard;
using Orchard.ContentManagement;
using Orchard.Data;
using ArealAds.Models;
using ArealAds.ViewModels;
namespace ArealAds.... | [
-0.31093883514404297,
-0.26103776693344116,
0.4091421961784363,
-0.10999021679162979,
0.23934835195541382,
0.26008251309394836,
-0.000987447565421462,
-0.4769185483455658,
-0.2729610204696655,
-0.6433433890342712,
-0.5571469664573669,
0.35997483134269714,
-0.28008368611335754,
0.3112520277... | |
void UpdateAreasForContentItem(ContentItem item, IEnumerable<AreaEntry> areas);
IEnumerable<AreaRecord> GetAreas();
}
public class StreetService : IStreetService {
private readonly IRepository<AreaRecord> _areaRepository;
private readonly IRepository<StreetAreaRecord> _streetAreaReposit... | [
-0.3170647919178009,
-0.05037257820367813,
0.3523971736431122,
0.0067520467564463615,
0.1338590830564499,
0.23799657821655273,
0.5368582010269165,
-0.17314188182353973,
0.21352703869342804,
-0.8814845085144043,
-0.6564158201217651,
0.5569971799850464,
-0.2867368757724762,
0.105374611914157... | |
_streetAreaRepository = streetAreaRepository;
}
public void UpdateAreasForContentItem(ContentItem item, IEnumerable<AreaEntry> areas) {
var record = item.As<StreetPart>().Record;
var oldAreas = _streetAreaRepository.Fetch(
r => r.StreetRecord == record);
... | [
0.02118106372654438,
0.1712801456451416,
0.4041655957698822,
-0.16327762603759766,
0.10119833052158356,
0.38641753792762756,
0.5052894353866577,
-0.38471174240112305,
-0.1509472131729126,
-0.7073938250541687,
-0.31914085149765015,
0.42846888303756714,
-0.18845254182815552,
0.53595590591430... | |
areas
.Where(e => e.IsChecked)
.Select(e => e.Area)
.ToDictionary(r => r, r => false);
// Delete the areas that are no longer there and mark the ones that should stay
foreach(var streetAreaRecord in oldAreas) | [
-0.07237987965345383,
0.022199131548404694,
0.5690916776657104,
-0.42106950283050537,
0.292884886264801,
0.22865107655525208,
0.26440000534057617,
-0.2612052261829376,
-0.08605416864156723,
-0.8868919014930725,
-0.6161487698554993,
0.0022931243292987347,
-0.15544359385967255,
0.20374427735... | |
{
if (lookupNew.ContainsKey(streetAreaRecord.AreaRecord)) {
lookupNew[streetAreaRecord.AreaRecord] = true;
}
else {
_streetAreaRepository.Delete(streetAreaRecord); | [
-0.15275181829929352,
0.06775464862585068,
0.4651549458503723,
-0.3861674666404724,
0.3372761905193329,
0.1890811175107956,
0.6238293647766113,
-0.47742611169815063,
0.2132057100534439,
-0.6808086633682251,
-0.5405487418174744,
0.4158538579940796,
-0.1122182235121727,
0.3108212947845459,
... | |
}
}
// Add the new areas
foreach(var area in lookupNew.Where(kvp => !kvp.Value).Select(kvp => kvp.Key)) {
_streetAreaRepository.Create(new StreetAreaRecord {
StreetRecord = record, | [
0.08054130524396896,
-0.03256920725107193,
0.44458919763565063,
-0.18940532207489014,
0.14341264963150024,
0.3179897964000702,
0.4296599328517914,
-0.37754955887794495,
-0.14892444014549255,
-0.786275327205658,
-0.341692715883255,
0.21695923805236816,
-0.148827463388443,
0.3143075704574585... | |
AreaRecord = area
});
}
}
public IEnumerable<AreaRecord> GetAreas() {
return _areaRepository.Table.ToList();
}
}
}
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Records;
namespace Areal... | [
-0.33833569288253784,
-0.26599007844924927,
0.5019582509994507,
-0.03262694925069809,
0.32514747977256775,
0.06043444201350212,
0.21761955320835114,
-0.38450887799263,
-0.3747139573097229,
-0.5290859341621399,
-0.5204585194587708,
0.4407765865325928,
-0.28297945857048035,
0.292512267827987... | |
public class StreetAreaRecord : ContentPartRecord {
public virtual StreetRecord StreetRecord { get; set; }
public virtual AreaRecord AreaRecord { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManageme... | [
-0.1279498189687729,
-0.1347348690032959,
0.25578346848487854,
0.05227993428707123,
0.25917017459869385,
0.45924970507621765,
0.13568805158138275,
-0.2924497425556183,
-0.34985384345054626,
-0.818669855594635,
-0.5329864025115967,
0.3725745379924774,
-0.2584241032600403,
0.5764666795730591... | |
//
SchemaBuilder.CreateTable("DistrictRecord", table => table
.ContentPartRecord()
.Column<string>("Name")
);
ContentDefinitionManager.AlterPartDefinition(
typeof(DistrictPart).Name, cfg => cfg.Attachable()); | [
-0.21749889850616455,
0.027123186737298965,
0.7144967317581177,
-0.16081395745277405,
0.08386543393135071,
-0.1139037013053894,
0.2496693730354309,
-0.5599074363708496,
-0.26689663529396057,
-0.2507336735725403,
-0.48092585802078247,
0.18075406551361084,
-0.49656203389167786,
0.36623948812... | |
ContentDefinitionManager.AlterTypeDefinition(
"District", cfg => cfg
.WithPart("CommonPart")
.WithPart("DistrictPart")
.Creatable()
); | [
-0.04878510907292366,
0.15081948041915894,
0.7402684092521667,
0.08165046572685242,
-0.04349625110626221,
-0.23810259997844696,
0.12079061567783356,
-0.2051907479763031,
-0.11415358632802963,
-0.4270099103450775,
-0.45243963599205017,
-0.05109152942895889,
-0.3145584464073181,
0.4835208952... | |
SchemaBuilder.CreateTable("AreaRecord", table => table
.ContentPartRecord()
.Column<string>("Name")
.Column<int>("DistrictRecord_Id")
);
ContentDefinitionManager.AlterPartDefinition(
typeof(AreaPart).Name, cfg => cfg.Attachable()); | [
-0.28057488799095154,
-0.1149529218673706,
0.5888681411743164,
-0.0806427001953125,
-0.17393141984939575,
-0.19344717264175415,
0.23830443620681763,
-0.6337032914161682,
-0.35491329431533813,
-0.389651358127594,
-0.48843085765838623,
0.05592638999223709,
-0.5233943462371826,
0.328324198722... | |
ContentDefinitionManager.AlterTypeDefinition(
"Area", cfg => cfg
.WithPart("CommonPart")
.WithPart("AreaPart")
.Creatable()
);
SchemaBuilder.CreateTable("StreetRecord", table => | [
0.3185465633869171,
0.06269163638353348,
0.4062284231185913,
0.11350665986537933,
-0.2299443483352661,
-0.22678087651729584,
0.3139394521713257,
-0.30137914419174194,
-0.10112599283456802,
-0.7107807397842407,
-0.4241058826446533,
0.1323508769273758,
-0.3003372848033905,
0.2273558378219604... | |
table
.ContentPartRecord()
.Column<string>("Name")
);
ContentDefinitionManager.AlterPartDefinition(
typeof(StreetPart).Name, cfg => cfg.Attachable());
ContentDefinitionManager.AlterTypeDefinition( | [
0.04426921159029007,
0.0019926554523408413,
0.7030406594276428,
-0.13185003399848938,
0.0948183462023735,
0.0513358972966671,
0.151607483625412,
-0.3895539343357086,
-0.2345990389585495,
-0.6574822664260864,
-0.2127673625946045,
0.23738513886928558,
-0.47339800000190735,
0.2416459023952484... | |
"Street", cfg => cfg
.WithPart("CommonPart")
.WithPart("StreetPart")
.Creatable()
);
SchemaBuilder.CreateTable("StreetAreaRecord", table => table
.Column<int>("Id", column => | [
0.36125680804252625,
0.22641219198703766,
0.3390156924724579,
-0.05375612527132034,
-0.1725618839263916,
0.26456692814826965,
0.3347017765045166,
-0.46110740303993225,
0.12205574661493301,
-0.7763710021972656,
-0.18063205480575562,
0.3098781704902649,
-0.381320983171463,
-0.031042143702507... | |
column.PrimaryKey().Identity())
.Column<int>("StreetRecord_Id")
.Column<int>("AreaRecord_Id")
);
//
// Address-Ad
//
SchemaBuilder.CreateTable("AddressRecord", table => table | [
-0.15715472400188446,
0.0008928824681788683,
0.44348180294036865,
-0.20739690959453583,
0.03435150533914566,
0.14440089464187622,
0.14059826731681824,
-0.4454440474510193,
-0.0921286940574646,
-0.6013241410255432,
-0.40384989976882935,
0.27080559730529785,
-0.4260145425796509,
0.3108528554... | |
.ContentPartRecord()
.Column<int>("StreetRecord_Id")
.Column<int>("Building")
.Column<int>("Kor")
.Column<int>("Str")
.Column<int>("Vl") | [
0.43638095259666443,
-0.02156738191843033,
0.7804812788963318,
0.15201419591903687,
-0.4280548691749573,
0.15240974724292755,
0.21785968542099,
-0.33581048250198364,
-0.16094665229320526,
-0.7024491429328918,
-0.2820620536804199,
0.11193115264177322,
-0.2624594569206238,
0.323898583650589,... | |
.Column<string>("Note")
.Column<int>("AreaRecord_Id")
.Column<int>("DistrictRecord_Id")
.Column<string>("Phone1")
.Column<string>("Phone2")
.Column<string>("Phone3") | [
-0.16023744642734528,
-0.005614894907921553,
0.39994391798973083,
-0.387478768825531,
0.2267068773508072,
0.2631727159023285,
0.3374938666820526,
-0.359474778175354,
0.03445212170481682,
-0.5767055153846741,
-0.36831602454185486,
0.07884147763252258,
-0.5662308931350708,
-0.296221017837524... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.