Posts

Showing posts from June, 2011

ios - Filter an NSArray based on distance from certain point and longitude and latitude -

i have entity objects in it. these objects have longitude , latitude . want following. i want objects 5000 meters current location. question is, best way off doing , keeping in mind entity can contain 5000 records. i thinking on making nspredicate , somehow longitude can have deviation of 0.005 or something? don't have idea of or bad ?

array's key match with another array php -

ex : first array: array ( [0] => id [1] => address [2] => address1 [3] => name ) second array: array ( [id] => 1 [name] => ankit [city] => surat ) required output : [id] => 1 [address]=> [address1]=> [name] => ankit here can see value of first array address,address1 doesn't exist in array 2 key, need value set null address,address1 , unnecessary field of array 2 city key doesn't exist in first array values need unset result array code : $field_arr= array('0'=>"id", "1"=>"address", "2"=>"address1", '3'=>"name", ); $arr=array("id"=>"1", 'name'=>"ankit", "city"=>"ahmedabad"); $matching_fields =(array_diff_key(array_flip($field_arr),(array_intersect_key($arr,array_flip(...

Disable developer mode extensions pop up in Chrome -

Image
since latest release of chrome (34.0.1847.116) last week, have been receiving “disable developer mode extensions" when running automated tests using watir-webdriver. this seems offensive extension doesn't make sense me potentially hazardous extension given used chromedriver. anyone has found fix this, unable roll previous version or find installer older version roll , playing havoc tests. while creating chrome driver, use option disable it. working without extensions. use following code snippet chromeoptions options = new chromeoptions(); options.addarguments("chrome.switches","--disable-extensions"); system.setproperty("webdriver.chrome.driver",(system.getproperty("user.dir") + "//src//test//resources//chromedriver_new.exe")); driver = new chromedriver(options);

java - Log4j file appender for each instance of a class -

i have scenario class, has list of test cases. there way can save each test case execution separate file name: testcasename.log ? i have done before java.util.logging adding file handler in code, have no idea how log4j. you can configuring separate org.apache.log4j.rollingfileappender each test case class. can check link http://logging.apache.org/log4j/2.x/manual/configuration.html configuring this.

php - Can't replace table name with variable in SQL query -

i've little problem. here request ( work ): $reponse = $bdd->prepare('select * student username = ? , password = ? '); $reponse->execute(array($name,$pass)); it's work when want replace 'student' php variable it's doesn t works :/ : $table="stackoverflow" $reponse = $bdd->prepare('select * '$table' username = ? , password = ? '); $reponse->execute(array($name,$pass)); have idea ? more simple if can replace table name variable. sorry bad english. time spend me. in php, join 2 strings or variables period character (.). therefore, concatenate table name , statements before , after table name, should changing line $reponse = $bdd->prepare('select * '$table' username = ? , password = ? '); to $reponse = $bdd->prepare('select * '.$table.' username = ? , password = ? ');

handling dependencies for iOS Framework project -

i've created ios framework project using method: https://github.com/jverkoey/ios-framework works pretty neat i'm little confused on how include libraries/frameworks needed framework work and, in particular, how in case 3rd party client app uses framework can include these libs without conflicts. let's framework code needs these 2 things: facebooksdk.framework libflurry.a the first 1 ios framework. when add "link binary libraries" phase in framework , try compile the client project uses framework linker complains missing symbols - need add facebooksdk client project great: there no possibility of conflicts if client apps wants use facebook. however when same flurry static library duplicate symbols error when compiling client project. confuses me bit, because isn't facebooksdk.framework packaged static library? ukaszs-imac:facebooksdk.framework lukasz$ file versions/a/facebooksdk versions/a/facebooksdk: mach-o universal binary 3 architecture...

Websocket SignalR does not start -

i deployed mvc web app windows server 2012. has windows 8 , iis v8 installed. application uses signalr, , use websockets, gives errors. in every browser (chrome ff, ie) error same: "networkerror: 500 internal server error - https://domain.com/signalr/connect?transport=websockets&connectiontoken=wiir333%2bkbku0ex2spzle9w9x6eam5lbssbjxbqcvl0qpjaigthkn1xiiqhygi3o4ddliv7whtahvb8ll5kfwjnrzazadycapwj5awm6d1czzxh89k%2bouhzibh7dct9i&connectiondata=%5b%7b%22name%22%3a%22charthub%22%7d%5d&tid=8" the detailed error message be: exception information: exception type: invalidoperationexception exception message: not valid web socket request. @ microsoft.aspnet.signalr.transports.websockettransport.acceptwebsocketrequest(func`2 callback) @ microsoft.aspnet.signalr.persistentconnection.processrequest(hostcontext context) @ microsoft.aspnet.signalr.hubs.hubdispatcher.processrequest(hostcontext context) @ microsoft.aspnet.signalr.persistentconnecti...

Unable to send value of variable from android to php -

i want send username edittext php code inserts table.so far code unable so.code below: loginstudent.java public class loginstudent extends activity { button b1; edittext e1, username;@ override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.loginstudent); b1 = (button) findviewbyid(r.id.button1); e1 = (edittext) findviewbyid(r.id.edittext1); username = (edittext) findviewbyid(r.id.phone_no); b1.setonclicklistener(new view.onclicklistener() {@ override public void onclick(view arg0) { // todo auto-generated method stub if (e1.gettext().length() == 0 || username.gettext().length() == 0) { toast.maketext(getbasecontext(), "please enter fields!!", toast.length_long).show(); } else { //toast.m...

regex - java regular expression for parsing log file -

i trying parse log file, , want extract parameters lines entered. here example, line: "apr 8 07:13:10 kali gnome-screensaver-dialog: gkr-pam: unlocked login keyring" the program gives me: date&time: apr 11 00:06:30 hostname: kali program name: gnome-screensaver-dialog log: gkr-pam: unlocked login keyring but line: "apr 8 07:13:45 kali gnome-screensaver-dialog: pam_unix(gnome-screensaver:auth): authentication failure; logname= uid=0 euid=0 tty=:0.0 ruser= rhost= user=root" i have error java. error " regular expression not matching ", code, indicates reges bogus. basically, want extract date&time, hostname, program name, , log message problem @ extracting program name, first thing before first colon, example line above should give me: date&time: apr 8 07:13:45 hostname: kali program name: gnome-screensaver-dialog log: pam_unix(gnome-screensaver:auth): authentication failure; logname= uid=0 euid=0 tty=:0.0 ruse...

Java String predefine -

i'm sure question has allready been answered somewhere, i' ve searched half hour , i'm running out of keywords, because have absolutly no idea how this. i have constructor class public myclass (string name) {} what want define strings strings can entered. i assume has static final strings, there quite lot found , dont know how narrow down search. please tell me how thing want called, can search it. edit: example want: want somehow define number of strings. (or somethig else has same effect, said dont know how it) string 1 = "exampleone"; string 2 = "exampletwo"; so when call constuctor myclass myclass = new myclass("somethingelse"); the constructor wont take it. or better eclipse allready showing options have whit "color. " yes have right can not override string class because final can create own stringwrapper class wraps string. public class stringwrapper{ private string content; public string...

html - Full screen background for start of page -

i'm wanting make website has full screen background start of webpage no background rest. there link of example below. thank you. example: http://band-theme.tumblr.com/ you can : fiddle html : <div id="home">... home content ...</div> <div id="content">... website content ...</div> css : html, body, #home { width:100%; height:100%; margin:0; } #home { background: url(http://lorempixel.com/output/nature-q-g-1278-873-9.jpg); background-position:center center; background-size:cover; }

ios - Pass double to Viewcontroller then to UIView -

full code viewcontroller.h #import <uikit/uikit.h> @interface viewcontrollerimage : uiviewcontroller { iboutlet uilabel *datum; iboutlet uilabel *debug; } @property (nonatomic, assign) double thicknessvalue1; @property (nonatomic, assign) double capwidthvalue1; @end viewcontroller.m - (void)viewdidload { [super viewdidload]; // additional setup after loading view. [datum settransform:cgaffinetransformmakerotation(m_pi / 2)]; nsstring *value = [[nsstring alloc] initwithformat:@"%f", self.thicknessvalue1]; debug.text = value; draw2d *myview = [[draw2d alloc]initwiththickness: self.thicknessvalue1 andcapwidth: self.capwidthvalue1]; nslog(@"first logs"); nslog(@"%f",myview.thicknessvalue2); nslog(@"%f",myview.capwidthvalue2); nslog(@"end first logs"); } draw2d.h #import @interface draw2d : uiview - (id)initwiththickness:(double)thickness andcapwidth:(double)c...

c# - adding new properties in expando object in foreach loop -

i have add new properties in expando object in foreach loop not able see way it. here example: var allproperties = new list { "name", "email", "roles" }; allproperties.addrange(metadatamodel.getformattedfolders()); dynamic expando = new expandoobject(); foreach (var s in allproperties) { expando.s = string.empty; } it consider 's' property instead of considering value of 's' property name. thanks var expando = new expandoobject() idictionary<string, object>; foreach (var s in allproperties) { expando.add(s, string.empty); }

regex - Oracle regexp_substr, regexp_replace -

i need extract substring via oracles regexp_substr method. so far use select regexp_substr('td_schemaneu_576','[^td_]+[a-za-z]') dual ; which works fine, since returns expected sub string between 'td_' && '_576': schemaneu but if the source string doesn't contain string 'td_' regex returns string instead of null the following returns abc instead of null select regexp_substr('abc_def_ghi1024','[^td_]+[a-za-z]') dual ; [^td_] means "any character, except t , d or _ ". you might want use regex_replace , capturing groups: regex_replace('td_schemaneu_576', 'td_([a-za-z]+)', '\1') the \1 backreference, pointing in first capturing group, ie first set of parenthesis in regex.

mysql - How does the Like operator behave with an empty argument (%%)? -

using like operator select first_name, last_name student_details first_name 's%'; will provide name start s. but select first_name, last_name student_details **first_name '%%';** %% - didn't have string constraints. query returning complete list. how like %% processed in sql? can clarify this? the % sign considered zero-or-more repetition wildcard character in sql . way works pretty same in other areas of computing, can have wide definition , explaination of how works putting in google. that's why returns all entries in database, because matches if isn't repeated time (by way, same behavior you'll achieve like '%' ). the 1 , 1 repetition wildcard in sql represented _ .

jquery - Rail 4 populating select field with val of other select field -

after read lot of samples.. still have mistake in code. cant figure out whats wrong. can give me hint? view: form 2 select fields <%= select_tag "ops_group_id", options_from_collection_for_select(@groups, "id", "name"), :prompt => "select group"%> <%= render :partial => 'oncalls' %> route: "/projects/update_oncalls/:id" => 'projects#update_oncalls' controller: def update_oncalls @oncalls = oncall.where(:group_id => params[:id]) render :partial => "oncalls", oncalls: @oncalls end partial oncalls: <%= form.input :oncall_id, :as => :select, :collection => @oncalls, :label => false %> coffee: $(document).on "change", "select#ops_group_id", -> opsgroup = $("select#ops_group_id :selected").val() opsgroup = "0" if opsgroup "" jquery.get "/projects/update_oncalls/" + opsgroup, ...

jQuery Mobile 1.4+ Mobile widgets - native look and feel on devices iOS, Android WP8+ -

do jquery mobile widgets supports , feel of native device ios7, android , wp8+. there way in jquery mobile widgets framework develop such widgets , feel of native device? by widget's , feel of native device, mean on ios7 device widget datepicker should open in ios7 style, it's interface selection date same native ios7 style. if same page accessed on android should , feel android's style. there couple of answers here. first, easiest thing take ios device, open mobile safari, , go jquery mobile. site has online demos of widgets , can see how things look. second - jqm automatically enhances widgets nicer on mobile, if not want enhance, can use data attribute tell jqm leave alone. if have input type=date , wanted native date picker fire, use option. (fyi, data-enhance="false" on page level, can turn off globally.)

java - JavaFX binding between TextField and a property -

if create binding between javafx textfield , property, binding invalidated on every keystroke, causes change text. if have chain of bindings default behavior cause problems, because in middle of editing values may not valid. ok, know create uni-directional binding property textfield , register change listener informed when cursor leaves field , update property manually if necessary. is there easy, elegant way change behavior binding invalidated when editing complete, e.g. when cursor leaves field? thanks i think you've pretty described way it. here's cleanest way can see implement (using java 8, though it's easy enough convert lambdas javafx 2.2 compatible if need): import javafx.application.application; import javafx.beans.binding.bindings; import javafx.beans.binding.stringbinding; import javafx.event.actionevent; import javafx.scene.scene; import javafx.scene.control.textfield; import javafx.scene.layout.vbox; import javafx.stage.stage; public...

android - How to send a JSONArray message to a device using GCM from php server? -

i trying send notification device. can send normal string message bu wonder if possible send jsonarray message , if possible how can parse message on device? thanks, İsmail. it's possible send json array. there no difference in sending text/json, both of them texts. you parse in mobile using simple parser. follow this tutorial . helps parsing json easily.

android - drag image over screen -

hi have create 1 project in want move image around screen, have done below code <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaletype="matrix" android:src="@drawable/img_lock_normal" /> </relativelayout> and java code public class mainactivity extends activity { int windowwidth; int windowheight; private static final int none = 0; private static final int drag = 1; private static final int zoom = 2; private matrix matrix = new matrix(); private matrix savedmatrix = new matrix(); private layoutparams layoutparams; private int mode = none; private float[] lastevent = null; // ...

javascript - Parent directive transclusion does not work when content generated by child directive -

i have 2 directives outer 1 using transclusion. should attaching attr content inside outer directive being generated inner directive attach attr not seem work: plunker link 1 i getting error: typeerror: cannot read property 'childnodes' of undefined which assume has this. if don't use inner directive , manually place html in outer directive generated inner directive, works fine: plunker link 2 the use case here have 2 directives. 1 of them in search query component lets build search specific syntax , validates type letting know if have syntax errors. have extend text component 1 of features in auto complete. both of these components work fine separately try combine functionality can have query builder auto complete. running issue none of functionality of extend text component being added search query component (just none of functionality of outer directive being added inner directive here). is there doing wrong here (why getting childnodes error)? ...

python - Coinflip bot infinite loop -

i trying create infinite loop coin flip bot keep pumping out results, totally new python lost. have done reading looping , nothing jumping out @ me. thank help. from random import randint import random heads = 0 tails = 0 cointoss = 0 while true: coinresult = random.randint(1,2) cointoss +=1 #end loop if cointoss greater 100 if cointoss > 101: break if coinresult == 1: heads +=1 cointoss +=1 elif coinresult == 2: tails +=1 cointoss +=1 print("heads came up", heads, "times") print("tails came up", tails, "times") your exact code of equivivalent to import random def coinflip(maxtosses=-1): tosses = 0 while tosses != maxtosses: tosses += 1 yield random.choice([true, false]) heads, tails = 0 toss in coinflip(100): if toss: heads += 1 else: tails += 1 if wish infinite loop - pass nothing or negative value param...

ios7 - iOS 7.1 UINavigationBar backgroundImage behaviour -

Image
is there specific documentation uinavigationbar backgroundimage ios 7.1? becuase behave differently ios 7. what want achieve , achieved on ios 7. this achieved putting uiimage on uinavigatioinbar using [[uinavigationbar appearance] setbackgroundimage:img forbarmetrics:uibarmetricsdefault]; but when on ios 7.1, changed screenshoot ios < 7 , ios 7 positioning works using delta. on ios 7, changed , ui broken. because on ios 7.1, uinavigationbar seems opaque when set backgroundimage. how make uinavigationbar become translucent in ios 7? don't need more position adjustment each ios version. self.navigationcontroller.navigationbar.translucent = yes;

Silverlight wcf service - change return value of method -

in service had method returning bool, later changed ilist, updated service right clicking on service reference , made update. update did not update method return value. code error message says "cannot implicitly convert type bool system.collection.generic.ilist<..>" patientservice.savepatient(personid, firstname, lastname, causeofvisit,(s, e) => patientdata = e.result); the method in service: [operationcontract] public ilist<patient> savepatient(string personid, string firstname, string lastname, datetime timeofarrival, string causeofvisit) { patientrepository.savepatient(personid, firstname, lastname, timeofarrival, causeofvisit); return patientrepository.patients; } how can solve problem? when changed returning bool ilist did build solution in build @ top menu before made update service reference? because seems me still returning bool since forgot step, needed 2 steps 1 update in server side(projectname.web...

ruby - A good way to check for inclusion of several items in an array -

i have options hash , method update - options hash change , if want tests fail. what's way write this? raise runtimeerror, msg unless options.keys.include?( :external_uid, :display_name, :country_code ) if options.keys doesn't include 3 items, error should raised. solution almost used (thanks bjhaid ) : def ensure_correct_options!(options) msg = "only 'external_uid', 'display_name' , 'country_code' can " msg += "updated. given attributes: #{options.keys.inspect}" raise runtimeerror, msg unless options.keys == [ :external_uid, :display_name, :country_code ] end the options have value, write: unless options[:external_uid] && options[:display_name] && options[:country_code] raise argumenterror, ":external_uid, :display_name , :country_code required" end (i've replaced runtimeerror argumenterror because seems arguments)

c# - HubConnection could not be loaded from SignalR Assembly in Raspberry Pi Mono Project -

i trying build project in raspberry pi communicates azure server via signalr. have used signalr in .net client side in mono project while working on xamarin project , successful. test purpose, have written small block of code. using system; using microsoft.aspnet.signalr.client; namespace testsignalr1 { class program { static void main() { var hubconnection = new hubconnection("******"); var serverhub = hubconnection.createhubproxy("hubtest"); serverhub.on("broadcastmessage", message => system.console.writeline(message)); hubconnection.start().wait(); serverhub.invoke("testmethod").wait(); system.console.read(); } } } i compiling using mcs mono compiler. sudo mcs test.cs /r: /usr/lib/mono/4.5/microsoft.aspnet.signalr.client.dll the program compiles successfully. when run, following exception could not load type 'microsoft.aspnet.signalr.client.hubconnection...

Passing ArrayList from jsp to servlet on form submit -

i trying pass arraylist object jsp page on submitting form servlet. code of jsp page :- <form action="newservlet"> <% arraylist al=new arraylist(); al.add("abc"); al.add("xyz"); request.setattribute("allproducts", al); %> <input type="submit" value="show"></form> code of newservlet :- protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { arraylist al=(arraylist)request.getattribute("allproducts"); system.out.print(al.get(0)); } when run code , getting nullpointerexception @ line "system.out.print(al.get(0))". can tell me why happening? also should if want use al object in servlet ? you getting nullpointerexception because request.getattribute("allproducts"); returns null and calling method al.get(0) on null object. why did al null ? when submi...

node.js - Oracle with node-oracle: Error while trying to retrieve text for error ORA-01804 -

i'm trying use node-oracle connect oracle 11g database in unix. can connect fine database using toad, want application queries , did: nodejs code: var oracle = require('oracle'); var connectdata = { hostname: "host.com", port: 1521, database: "db0000", user: "me", password: "password" } oracle.connect(connectdata, function(err, connection) { if (err) { console.log("error connecting db:", err); return; } connection.execute("select systimestamp dual", [], function(err, results) { if (err) { console.log("error executing query:", err); return; } console.log(results); connection.close(); }); }); then command on unix box: sh-3.2$ oci_lib_dir= /oracle/client/v11.2.0.2-64bit/client_1/lib/ oci_include_dir=/client/v11.2.0.2-64bit/client_1/rdbms/public/ oci_home=/oracle/clien t/v11.2.0.2-64bit/client_1/ nls_lang=.utf8 ld_library_path=/client/v11.2.0.2-64bit/client_1/lib/ ...

permissions - Does mysql require two users in the users table for local and remote access? -

i noticed in our databases there 2 copies of every user, 1 "from host" set % , other "from host" set localhost. necessary? seems can cause confusion have different set of permissions user depending on it's coming from. it seems odd % wouldn't match localhost. from host@% allow access locations. from host@localhost allow access localhost. just check this: http://dev.mysql.com/doc/refman/5.1/en/connection-access.html

ruby on rails - how to pass unknown number of arguments to a function in R programming -

i parsing csv multiple columns. number of columns not fixed in csv file. varies 5 10. need recreate data.frame these columns inside function. wondering if there multiple arguments functionality in r 1 in ruby(*args). if not, how achieve this??? searched bit , found if have col name as col1 col2 i can use: list <- ls(pat="^col\\d$") and pass list argument function, pass column names, characters, not values these column names carrying. any suggestions???? edit: parsing file ror app , using rinruby gem call r functions. parsing csv ruby , passing individual column contents single variable in r. in r, need create data.frame. not data frame originally. in method cal_norm below assigning variables in r using loop names col1, col2, col3....and on. here rails code: class uploadscontroller < applicationcontroller attr_accessor :calib_data, :calib_data_transpose, :inten_data, :pr_list def index @uploads = upload.all @upload = upload.new re...

android - View.postDelayed why is it an instance method? -

in android platform, view object has instance method postdelayed , according documentation: causes runnable added message queue, run after specified amount of time elapses. runnable run on user interface thread. my questions: why method has instance method of view? would different if call postdelayed in 1 view instead of another? thanks. why method has instance method of view? it references mattachinfo data member, in current implementation, , in turn data member's mhandler , handler postdelayed() work (if mattachinfo not null ). welcome read of in the source code . would different if call postdelayed in 1 view instead of another? in theory, 2 view instances work separate handler instances. however, standpoint of documented behavior, there should no difference.

javascript - Script isn't answering any more error using morris.js in firefox -

i using library morris.js http://www.oesmith.co.uk/morris.js/ in order create charts website. works on opera, internet explorer , google chrome. in firefox, randomly crashes instantly. script panel tells me, crashes here: secondsspechelper = function(interval) { return { span: interval * 1000, start: function(d) { return new date(d.getfullyear(), d.getmonth(), d.getdate(), d.gethours(), d.getminutes()); }, fmt: function(d) { return "" + (morris.pad2(d.gethours())) + ":" + (morris.pad2(d.getminutes())) + ":" + (morris.pad2(d.getseconds())); }, incr: function(d) { return d.setutcseconds(d.getutcseconds() + interval); } }; any ideas, if of functions not working in firefox? or cause crash? i standard firefox error: script isn't answering anymore.. fixed! morris.js , mozilla tries parse "xlabels" attribute datetime, , goes forever-loop then. fixed attribute ...

c++ - gls library,Find the minimum distance between a point and a sets of points? -

how can find minimum distance between point (x0, y0) , sets of points {p0, ..., pn} gsl library in c++ ? have polygon containing sets of points {p0 (x0, y0), ..., p (xn, yn)} , point c (x0, y0), want calculate minimum distance between c , sets of points . thanks double min_dist = dbl_max; // large number point pointc; // set point want compare vector<point> pointlist; // push_back points (auto = pointlist.begin(); != pointlist.end(); ++it) { point temppoint = *it; // calculate distance between c , current point double newdist = sqrt(pow((temppoint.x - pointc.x),2) + pow((temppoint.y - pointc.y),2)) // update min_dist if necessary min_dist = min(min_dist, newdist) } using c++11 features, can written as double min_dist = *std::min_element(begin(pointlist), end(pointlist), [pointc](const point& lhs, const point& rhs){ return std::hypot(lhs.x - pointc.x, lhs.y - poin...

python - Django 1.6.2 will not serve static content -

i unable serve static content (for development purposes) using django==1.6.2 there no error message available go this. i end 404 message on browser , 404 message in dev server [14/apr/2014 16:50:29] "get /static/resource/css/bootstrap.min.css http/1.1" 404 1697 this set-up: installed_apps = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', # django 'django.contrib.webdesign', ) # directories below have been checked , exist on disk. static_url = '/static/' media_url = '/media/' static_root = os.path.join(site_root, 'site_media/static') media_root = os.path.join(site_root, 'site_media/media') content of main urls.py file: from django.conf import settings django.conf.urls import patterns, include, url django.contrib.staticfiles.urls import staticfile...

Deserialized JSON data returning properties of "Nothing" in VB.NET -

this has been driving me mad past few days. connecting shopify api , downloading json data. have been able deserialize data object using class , code below. however, object "customer" comes properties (as per class) equal "nothing". going on? appreciated!! p.s. should mention using newtonsoft json.net. partial public class parsedjson public class customer2 public property accepts_marketing boolean public property created_at datetime public property email string public property first_name string public property id integer public property last_name string public property last_order_id integer public property multipass_identifier object public property note object public property orders_count integer public property state string public property total_spent string public property updated_at datetime public property verified_email boolean publ...

c# - XML Comments for nullable 2D Array -

how correct specify xml comments 2d array of nullable doubles? following gives me syntax error. /// <returns>the <see cref="double[,]"/>.</returns> public double?[,] get2darray() { ... } if 2d array of doubles i'd use: /// <returns>the <see cref="double{t,t}]"/>.</returns> public double[,] get2darray() { ... } and if single value i'd use: /// <returns>the <see cref="nullable{double}"/>.</returns> public static double? getnullabledouble() { i can't seem combine these 2 concepts correct comments. after reading here , perhaps want, /// <summary> /// gets 2d array /// </summary> /// <returns>the <see cref="t:double?[,]"/>.</returns> public double?[,] get2darray() { ... } as commented, rather multi-dimensional array ( double?[,] ) should consider jagged, internal .net implementation superior. additionaly, if think ...

c++ - How to Fix SYSTEM_PROCESS_INFORMATION Errors -

help me fix error #include <windows.h> #include <stdio.h> #include <psapi.h> td_ntquerysysteminformation ntquerysysteminformation = null; td_ntqueryobject ntqueryobject = null; td_ntduplicateobject ntduplicateobject = null; bool init() { hmodule hntdll = getmodulehandle(text("ntdll.dll")); if(!hntdll) return false; ntquerysysteminformation = (td_ntquerysysteminformation)getprocaddress(hntdll, "ntquerysysteminformation"); ntqueryobject = (td_ntqueryobject)getprocaddress(hntdll, "ntqueryobject"); ntduplicateobject = (td_ntduplicateobject)getprocaddress(hntdll, "ntduplicateobject"); return (ntquerysysteminformation && ntqueryobject && ntduplicateobject); } bool acquiredebugprivilege() { handle htoken = null; if(!openprocesstoken(getcurrentprocess(), token_adjust_privileges, &htoken)) return false...

Zend Framework 2 - BjyAuthorize Entity was not found. in /vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php on line 177 -

i started project zend framework 2 , set modules zfcuser , bjyauthorize. zfcuser part works correctly when active bjyauthorize error occurs doctrine\orm\entitynotfoundexception: entity not found. in /vendor/doctrine/orm/lib/doctrine/orm/proxy/proxyfactory.php on line 177 call stack here config file : - comper.json { "name": "zendframework/skeleton-application", "description": "skeleton application zf2", "license": "bsd-3-clause", "keywords": [ "framework", "zf2" ], "homepage": "http://framework.zend.com/", "require": { "php": ">=5.3.3", "zendframework/zendframework": "2.3.*", "zf-commons/zfc-user": "dev-master", "zendframework/zftool": "dev-master", "doctrine/doctrine-orm-module": "0.8.0", "gedmo/doctrine-extension...

javascript - Where to call _gaq.push Google Analyticss in MVC form? -

i have mvc form in razor view using html.beginform , in submit button adding code google analytics in onclick event this: onclick="_gaq.push(['_trackevent', 'mystuff', 'aperturaform', 'veintemasled']);" but problem if forms submits gets error, click event fired , push made if form fail. question is, have perform _gaq.push in onsubmit form event @using (html.beginform("20mil", "product", null, formmethod.post, new { @class = "small", onsubmit = "_gaq.push(['_trackevent', 'mystuff', 'aperturaform', 'veintemasled']);" })) ? what choices? i guess use default button onclick event , call function this: $.ajax({url: '@url.action("myaction", "mycontroller")', data: { field1 : $('#txtexample').val() }, type: 'post', success: function (data) { if (data.actioncompleted) { _gaq.push(['_tr...

c# - Is there a way to make a drop down menu like this? -

Image
is there know how make drop down menu this? http://puu.sh/88oll.png i put in if me: private void richtextbox1_textchanged(object sender, eventargs e) { //in here } yes , can use listbox control. or you can use combobox control setting dropdownstyle property simple . edit: if want search string listbox , select item if matching you need have textbox receive serach string input. you need handle textbox key_down event handler start searching. note: in below code have started searching when user enters enter key after entering input search string. try this: private void textbox1_keydown(object sender, keyeventargs e) { if (e.keycode == keys.enter) { var itemsearched = textbox1.text; int itemcount = 0; foreach (var item in listbox1.items) { if (item.tostring().indexof(itemsearched,stringcomparison.invariantcultureignorecase)!=-1) { ...

ShellTile not updating data on windows phone -

i want schedule multiple tile notifications while app running, when app in background, schedule tile notifications appear 1 one using respective occurrence time. somehow when schedule multiple (3) notifications last 1 appears. string message = ""; string key = "familyfarm" + count; if (string.isnullorempty(duration) || string.isnullorempty(name)) return; isolatedstoragesettings setting = isolatedstoragesettings.applicationsettings; if (setting.contains(key)) { setting.remove(key); } setting.add(key, name); count++; shelltileschedule sampletileschedule = new shelltileschedule(); bool tileschedulerunning = false; // update happen 1 time. sampletileschedule.recurrence = updaterecurrence.onetime; // start update schedule now. sampletileschedule.starttime = datetime.now; sampletileschedule.remoteimageuri = new uri(@"http://www.weather.gov/forecasts/graphical/images/conus/maxt1_conus.png"); sampletileschedule.start(); tileschedulerunning = t...