Posts

Showing posts from August, 2014

javascript - How to force Atmosphere.js to use the preferred transport when reconnecting to the Server? -

when preferred transport fails, atmosphere tries use fallback transport. tried reconnect maxreconnect times. after calls onclose , onerror. when try subscribe again atmosphere uses fallback transport connection. here client configuration: atmosphererequestconfig jsonrequestconfig = // ... jsonrequestconfig.settransport(atmosphererequestconfig.transport.websocket); jsonrequestconfig.setfallbacktransport(atmosphererequestconfig.transport.long_polling); jsonrequestconfig.setloglevel("debug"); jsonrequestconfig.setmaxreconnectonclose(1); atmosphere atmosphere = atmosphere.create(); clientrequest = atmosphere.subscribe(jsonrequestconfig); when server running , client connects first time (page reload) connection on websockets. stopped server client shows this: atmosphere.js:3252 sat jan 30 2016 22:17:14 gmt+0100 (cet) atmosphere: websocket.onclose atmosphere.js:3252 websocket closed, reason: normal closure; connection completed whatever purpose created. - wasclean: t

Running Python on Android in ADB Shell -

i have python script (2.7, can make python 3 work) part of bigger testing framework, i'd able run on android. i know there various projects creating applications based on python, that's not i'm interested in. i'm interested in simplest way make python command line executable available running on android platform i'm connected via adb shell. workflow i'm aiming @ this: <host> $ adb shell <and. device>$ <path1>/python <path2>/script.py <arguments> i know crystax ndk offers python environment consistently crashes memory errors when script ends.

dataframe - R, create new column that consists of 1st column or if condition is met, a value from the 2nd/3rd column -

b c d 1 boiler maker <na> <na> 2 clerk assistant <na> <na> 3 senior machine setter <na> 4 operated <na> <na> <na> 5 consultant legal <na> <na> how create new column takes value in column 'a' unless of other columns contain either legal or assistant in case takes value? here base-r solution. use apply , any test every column @ once. df$col <- as.character(df$a) df$col[apply(df == "legal",1,any)] <- "legal" df$col[apply(df == "assistant",1,any)] <- "assistant"

Copy row from one MySQL DB to another -

how it's possible copy 1 entry row of table same data (same id, same data values) database -> same table? example: table units: uid department name item 67 hr john doe table if both tables equal no. of columns , in same order want insert use below simple query- insert mytable select * units uid=67; if want insert selected column in table's selected columns , in order use below- insert mytable(col1,col2,col3,col4) select uid,department,`name`,item units uid=67;

javascript - Sweet alert html option -

i'm trying make sweet alert html option: swal({ title: "html <small>title</small>!", text: "a custom <span style="color:#f8bb86">html<span> message.", html: true }); but instead of text put button, have tried one: var boton = "button"; swal({ title: "html <small>title</small>!", text: "<input type=" + boton + ">", html: true }); but doesn't work! (i want make menu options(the buttons)) know how that? thanks! you can use button tag instead of input . like this: var boton = "button"; swal({ title: "html <small>title</small>!", text: '<button type="' + boton + '">button</button>', html: true }); <link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesh

c# - Regular Expression to replace one letter surrounded with dashes -

i try replace specific letter surrounded 1 or 2 dashes letter examples : modif-i-ed => modifyed (-i- replaced y) a-im => eim (a- replaced e) i tried regex.replace(word, "-?([a-za-z])-", new_letter) but generates example modiyyed first example. the problem once first - becomes optional, there 2 matches inside modif-i-ed : f- , i- . thus, there 2 replacements. i suggest matching , capturing letters before -x- pattern , return them in match evaluator, , use -?[a-z]- match , replace: (\b[a-z](?=-))|-?[a-z]- c#: var myletter = "y"; var str = " modif-i-ed a-im y-i-eld"; var res = regex.replace(str, @"(\b[a-z](?=-))|-?[a-z]-", m => m.groups[1].success ? m.groups[1].value : myletter); console.writeline(res); // => modifyed yim yyeld see ideone demo

ios - share text and image using QLPreviewController -

i have implemented qlpreviewcontroller social sharing i.e. what's app, facebook etc. working great whenever send particular image or text. requirement send image , text simultaneously 1 click. , didn't find method send both @ once. following method 1 data can shared either text or image. qlpreviewcontroller *previewcontroller = [[qlpreviewcontroller alloc] init]; previewcontroller.datasource = self; previewcontroller.delegate = self; previewcontroller.currentpreviewitemindex = indexpath.row; [[self navigationcontroller] pushviewcontroller:previewcontroller animated:yes]; if use uiactivityviewcontroller doesn't allow user share content what's app. please upon issue, if has solution, please share me. thanks!

Xml Schema Explorer option is not found after loading xsd file in vs 2015 -

i try see xsd file in xml schema explorer using vs 2015. when load not getting xml schema explorer option under view menu. how that. right click inside .xsd file select "show in xml schema explorer" menu. xmlschema explorer appears. drop down menu @ top right of window can select "dock" , drag window in order dock desired location. hope helps.

condition - Regex - Only ONE special char -

i'm working regex created password. it have respect conditions : 8 characters at least 1 maj (a-z) at least 1 min (a-z) at least 1 digit (0-9) one special char following : .,:;'!@#$%^&*_+=|(){}[?-]/\ prohibit following characters : <>` here regex : (?=.*[a-z])(?=.*[a-z])(?=.*[0-9])(?=.*[.,:;'!@#$%^&*_+=|(){}[?\-\]\/\\])(?!.*[<>`]).{8} all works fine, now, want accept only 1 special char . i searched , tried lot of things (with {1} @ end of group example), doesn't work @ ! results aa1;;aaa still matching.. could tell me how can ? what about: ^(?=.{8}$)(?=.*[a-z])(?=.*[a-z])(?=.*[0-9])(?!.*[<>`])([^.,:;'!@#$%^&*_+=|(){}[?\-\]\/\\]*)[.,:;'!@#$%^&*_+=|(){}[?\-\]\/\\](?1)$ demo it check length lookahead, makes sure has 1 special char, different before , after it (?1) reference 1st group pattern, can replace [^.,:;'!@#$%^&*_+=|(){}[?\-\]\/\\]* if wish or not supported tool demo

sql server - DB refresh & DB migration (MSSQL) -

i newbie sql dba, wanted understand following concepts what difference between database migration & database refresh in sql? suppose want migrate database 1 instance other instance, can follow below method create new db in destination instance same name source instance refresh destination db source db, & copy user access database migration: moving database 1 server other database upgrades. database refresh in sql: overwrite existing data in database other database data using backup files. refresh production data uat or dev data/issue analysis. suppose want migrate database 1 instance other instance, can follow below method? yes can follow. if using sql server 2012 , above can go contained database options.

jquery - Add row in datatable is working but edit a row or inline edit not working -

i using datatable , add dynamic row it's working want edit row not working editing code. var t= $('#example').datatable({ //dom: "bfrtip", //ajax: "../php/staff.php", 'fncreatedrow': function (nrow, adata, idataindex) { $(nrow).attr('id', 'row_' + adata[0]); // or whatever choose set id } $('#add_company').click(function(e){ if(result) { t.row.add( [ counter, $("#payment_company ").val(), $("#payment_date").val(), $("#payment_type").val(), $("#payment_amount").val() ] ).draw( true ); //$('#amount_form').trigger("reset"); counter++; } editing code below editor = new $.fn.datatable.editor( { //ajax: "../php/staff.php", table: "#example" } ); $('#example').on( 'cl

python - Pandas: group by index value, then calculate quantile? -

i have dataframe indexed on month column (set using df = df.set_index('month') , in case that's relevant): org_code ratio_cost month 2010-08-01 1847 8.685939 2010-08-01 1848 7.883951 2010-08-01 1849 6.798465 2010-08-01 1850 7.352603 2010-09-01 1847 8.778501 i want add new column called quantile , assign quantile value each row, based on value of ratio_cost month. so example above might this: org_code ratio_cost quantile month 2010-08-01 1847 8.685939 100 2010-08-01 1848 7.883951 66.6 2010-08-01 1849 6.798465 0 2010-08-01 1850 7.352603 33.3 2010-09-01 1847 8.778501 100 how can this? i've tried this: df['quantile'] = df.groupby('month')['ratio_cost'].rank(pct=true) but keyerror: 'month' . update : can reproduce bug. here csv file: http://pastebin.com/raw/6xbjvel0 an

Pushing to a JavaScript array via key -

i have object formatted follows; $scope.data = [ { key: "control", values: [ ] }, { key: "experiment", values: [ ] } ]; i want able push either 1 of these arrays giving key value. i've tried; $scope.data.keys("experiment").values.push(thing); but undefined. sure isn't hard i'm having trouble finding answer on here or via js documentation the reason i'm doing in way because js library i'm using expects data in specific way not efficiant short: $scope.data.filter(function(v){return v.key == "experiment"})[0].values.push(thing) a fast way it: for (var = $scope.data.length; i--;) { if ($scope.data[i].key == "experiment") { $scope.data[i].values.push("one more thing") break } } how should have done it: $scope.data = { "control": [], "experiment": [] } $scope.data["experiment"].push(&

Horizontal Layout in Polymer -

Image
i building app using polymer. i've found layout system tricky. currently, i'm trying layout buttons this: +----------------------------------------------------------------+ | [ok] [more info] [cancel] | +----------------------------------------------------------------+ the gap left of "ok" button 25% of entire width of page. remaining 75% used buttons. in attempt build above, put this plunk , includes following code: <paper-toolbar class="statusbar"> <div style="width:25%;"></div> <div style="width:75%;" class="fit"> <div class="layout horizontal flex" style="padding-bottom:12px;"> <paper-button raised>ok</paper-button> <div class="flex"></div> <paper-button raised>more info</paper-button> <paper-button raised>cancel</p

angularjs - Angular sort by a calculated value -

i have app display list of elements, every 1 different properties, , 1 of properties used value factory, , want able sort list calculated value. i know can save calculated value in list , sort, way? this fiddle , code angular .module("app", []) .controller('controller', controller) .factory('factory', factory) .directive('val', val) .controller('valcontroller', valcontroller) directivecontroller.$inject = [ 'factory']; function controller() { var vm = this; vm.results = [{ "id": "1", "pos": 1 }, { "id": "2", "pos": 2 }, { "id": "3", "pos": 3 }, { "id": "4", "pos": 4 }]; console.info(json.stringify(vm.results)); } function val() { return { replace: true, scope: {}, bindtocontroller: { id: 

java - simple adapter cant update database -

hey guys have made listview of data database using simple adapter dont know how update everytime database changes.any help?the notifydatasetchanged(); method doesnt work , cant find out do. mainactivity @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_general_discussion); db = new sqlitehandler(this); arraylist<hashmap<string, string>> emaillist = db.getmessage(); if (emaillist.size() != 0) { listadapter adapter = new simpleadapter(mainactivity.this, emaillist, r.layout.raw_layout, new string[]{"user_posted", "post", "posted_at", "post_id"}, new int[]{ r.id.text_user_name, r.id.text_user_post, r.id.text_user_date, r.id.text_user_number}); setlistadapter(adapter); } helperclass public arraylist<hashmap<string, string>> getmessage()

Javascript cookies duration -

i using function read , write cookie little php in , working fine. need add duration of 7 days in it. can plz let me know , how can add beginner in javascript , dont have clue update code. <script language="javascript"> writecookie(); function writecookie() { the_cookie = document.cookie; if(the_cookie) { the_cookie = "pixelratio="+window.devicepixelratio+";"+the_cookie; document.cookie = the_cookie; if(window.devicepixelratio > 1) { location = '<?php echo $_server['php_self']?>'; } } } </script> you can use 1 of following attribute set duration cookie . expires - date when cookie expire , thrown away. example, today 26th march 2013, if want set duaration 7 days, code below document.cookie="acookie=avalue;

php - Artisan command not recognized -

i trying artisan update . says command artisan not recognized command. using xampp, have added path c:\xampp\php command still not working. ideas on how this? i'ts simple: navigate directory of artisan, because can have multiple laravel installations artisan version run php artisan update

osx - What would be the most basic Mac Mini to test LibGDX apps on for iPhone? -

i developing apps android using libgdx, , publish them iphone well. not own mac , heard mac mini cheap solution develop iphone. what minimum requirements mac mini test apps on? developing on windows, idea it's okay if mac not fastest one. need testing. i know minimum cpu, memory, o/s, , software necessary testing. i bought second hand mac mini ssd , 8gb ram can run latest version of mac osx: el capitan. works perfectly, although not fastest, not terribly slow either. this important: mac mini needs able run latest version of mac osx , xcode. for more information, see: https://github.com/libgdx/libgdx/wiki/deploying-your-application#deploy-to-ios

sql - Populating table B with data from table A if data in table B is different to table A -

apolgies confusing heading , long winded post. i attempting populate (oracle) sql table data can monitor on regular basis , build picture of users use application modules. i have table 'forms_sessions_log' created follows: create table stuman.forms_sessions_log ( select a.sid, a.serial#, a.logon_time, a.client_identifier, a.module,a.username, a.schemaname, b.spriden_last_name, b.spriden_first_name gv$session a, spriden b program 'frmweb%' , a.username=b.spriden_id) this creates 'snapshot' of 'forms' sessions connected database @ point in time. from on, each minute via job scheduler, i'd continue populate table new or different sessions. i came following: insert stuman.forms_sessions_log (sid,serial#,logon_time,client_identifier,module,username,schemaname,spriden_last_name,spriden_first_name) select a.sid, a.serial#, a.logon_time, a.client_identifier, a.module , a.username, a.s

aws lambda - POST url encoded form to Amazon API Gateway -

i'm creating webhook receive notifications 3rd-party service, sent data in body of post content type application/x-www-form-urlencoded . but generates same error: {"message": "could not parse request body json: unrecognized token \'name\': expecting \'null\', \'true\', \'false\' or nan\n @ [source: [b@456fe137; line: 1, column: 6]"} i reproduce error following curl call: % curl -v -x post -d 'name=ignacio&city=tehuixtla' https://rl9b6lh8gk.execute-api.us-east-1.amazonaws.com/prod/mandrilllistener * trying 54.230.227.63... * connected rl9b6lh8gk.execute-api.us-east-1.amazonaws.com (54.230.227.63) port 443 (#0) * tls 1.2 connection using tls_ecdhe_rsa_with_aes_128_gcm_sha256 * server certificate: *.execute-api.us-east-1.amazonaws.com * server certificate: symantec class 3 secure server ca - g4 * server certificate: verisign class 3 public primary certification authority - g5 > post /prod/mandrilllistener

primefaces - Server side HTML sanitizer/cleanup for JSF -

is there html sanitizer or cleanup methods available in jsf utilities kit or libraries primefaces/omnifaces? i need sanitize html input user via p:editor , display safe html output using escape="true" , following stackexchange style. before displaying html i'm thinking store sanitized input data database, ready safe use escape="true" , xss not danger. in order achieve that, need standalone html parser . html parsing rather complex , task , responsibility of beyond scope of jsf, primefaces , omnifaces. you're supposed grab 1 of many existing html parsing libraries. an example jsoup , has separate method particular purpose of sanitizing html against whitelist : jsoup#clean() . example, if want allow basic html without images, use whitelist.basic() : string sanitizedhtml = jsoup.clean(rawhtml, whitelist.basic()); a different alternative use specific text formatting syntax, such markdown (which used here). of parsers sanitize html under co

css - Position fixed is not working on ipad -

i trying fix background of website , have place div "bgdiv" on website having position fixed. working on desktop. on ipad position fixed not working scrolls whole website. , background image repeating. there way avoid scrolling bgdiv. .bgdiv{ background: url("test.jpg") repeat scroll 0 0 transparent; background-size: 100% 100%; bottom: 0; left: 0; position: fixed; right: 0; top: 0; z-index: -2; height: inherit; } <body> <div class="bgdiv"></div> <div class="wrapper"> content </div> </body> update css this, .bgdiv{ background: url("test.jpg") repeat scroll 0 0 transparent; background-size: 100% 100%; left: 0; position: fixed; top: 0; z-index: -2; height: auto; width:100%; } if not added, add code above, <meta name="viewport" content="width=device-width, user-scalable

jvm - When upgrade to oracle11g-x64,we get into trouble -

we ran java web application server weblogic10.3+bea jdk1.6+hibernate3+c3p0 0.9.1.2+oracle 9.2.8. when upgraded database oracle11gx64 cluster ojdbc6, met many errors. first following error message appeared , application can't connect database @ intervals of hours: *com.mchange.v2.async.threadpoolasynchronousrunner$deadlockdetector@2a01aa -- apparent deadlock!!! creating emergency threads unassigned pending tasks! 2016-01-28 18:09:55 com.mchange.v2.async.threadpoolasynchronousrunner$deadlockdetector@2a01aa -- apparent deadlock!!! complete status: managed threads: 3 active threads: 3 active tasks:* then changed config "hibernate.c3p0.max_statements"=0,this error disappeared,but other outofmemoryerror arose: caused by: javassist.cannotcompileexception: java.lang.outofmemoryerror: class allocation, 188463944 loaded, 187957248 footprint jvm@check_alloc (src/jvm/model/classload/classalloc.c:118). 67744 bytes @ javassist.util.proxy.factoryhelper.tocl

c# - WCF service + SvcUtil generating unexpected object structure -

i trying create wcf application listen requests suppliers system. supplier has provided me wsdl need create service , expose its' endpoint them. i have used svcutil.exe generate c# classes, outputs rather odd-looking types. this snippet of wsdl has been given me: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textmatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/xmlschema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementformdefault="qualified"> <s:element name="submit">

How do merge specific svn revisions from branch to trunk in Android Studio 2.0 -

Image
some time ago there great window choose revisions want merge. , new dialog started appear. says : this make branch ' https://my_branch ' no longer usable further work. not able correctly absorb new trunk ( https://my_trunk ) changes, nor can branch reintegrated trunk again. are sure? but don't want reintegrate it. want merge few revisions. can still in android studio thanks i've find out wrong. it doesn't depend on version of android studio. the problem in wrong path trunk location: my trunk folder contains multiple folders (yes, it's bad) , in configuration of svn there was: https://my_trunk instead of https://my_trunk/my_concrete_trunk_folder after specified location of trunk got dialog wanted:

regex - Regular expression for splitting a string and add it to an Array -

i have string in following format: [0:2]={1.1,1,5.1.2} my requirement here split values inside curly braces after = operator, , store them in string array. had tried split part using substring() , indexof() methods, , worked. needed cleaner , elegant way achieve via regular expressions. does having clues achieve requirement? here regex solution: dim input string = "[0:2]={1.1,1,5.1.2}" dim match = regex.match(input, "\[\d:\d\]={(?:([^,]+),)*([^,]+)}") dim results = match.groups(1).captures.cast(of capture).select(function(c) c.value).concat(match.groups(2).captures.cast(of capture).select(function(c) c.value)).toarray() don't think more readable standard split: dim startindex = input.indexof("{"c) + 1 dim length = input.length - startindex - 1 dim results = input.substring(startindex, length).split(",")

php - Login app using MySQL database with Android Studio -

as title says, i'm trying make first android app simple login feature fetching username , password mysql database i'm getting following error in logcat , app crashes when click on login button 01-27 12:35:11.787 2509-2525/? e/androidruntime: fatal exception: asynctask #2 process: com.example.klm.sql, pid: 2509 java.lang.runtimeexception: error occurred while executing doinbackground() @ android.os.asynctask$3.done(asynctask.java:309) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:354) @ java.util.concurrent.futuretask.setexception(futuretask.java:223) @ java.util.concurrent.futuretask.run(futuretask.java:242) @ android.os.asynctask$serialexecutor$1.run(asynctask.java:234) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1113) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:588) @ java.lang.thread.run(thread.java:818) caused by: java.lang.classcastexception: com.android.okhttp.internal.huc.httpur

javascript: window.document returns null -

i have html document named 'welcome.html' uses iframe referring 'main.html'. inside 'inner.html' file iframe used referring 'inner.html'. inside 'inner.html' want access elements of / or communicate between elements of main.html. used following way in javascript, method 1: .. .. var top_window = window.top; alert(top_window) // gives top window object var main_window = top_window.frames['main-frame'] // assuming 'main-frame' name given @ iframe declaration 'main.html' alert(main_window) // gives main window object var main_document = main_window.document alert(main_document) // gives 'undefined' .. .. method 2: .. .. var parent_window = window.parent; alert(parent_window) // gives parent window object, is, 'main.html' window object var parent_document = parent_window.document alert(parent_document) // gives 'null' .. .. i want document object of 'main.html's wind

javascript - Angular 2 - Handling multiple subscriptions on a single observable -

i'm working on angular 2 app , need guidance on how handle authentication errors cleanly. my end goal able centrally handle authentication errors (specifically 401 , 403) every http request. i found this question super helpful getting me started, i'm stuck proper way register error handler each observable returned custom http implementation. here sample of i'm working with: import {injectable} 'angular2/core'; import {http, connectionbackend, request, requestoptions, requestoptionsargs, response} 'angular2/http'; import {observable} 'rxjs/observable'; @injectable() export class clauthhttp extends http { constructor(backend: connectionbackend, defaultoptions: requestoptions) { super(backend, defaultoptions); } get(url: string, options?: requestoptionsargs): observable<response> { var response = super.get(url, options); return this._handlesecurityresponse(response);

ajax - Typo3 - Extbase Bootstrap->run ignores content element's record storage page -

i have extension adds custom content element called "products". i'm trying make ajax pagination. when try products list styles.content.get, products rendered correctly, when i'm using extbase way, no products. the custom page type: ajaxproductlist = page ajaxproductlist { typenum = 6 config { disableallheadercode = 1 additionalheaders = content-type:text/html } # working 10 < styles.content.get 10.where = ctype='products_main' # not working 10 = user 10 { userfunc = typo3\cms\extbase\core\bootstrap->run extensionname = products pluginname = main vendorname = vendor } } any idea why? edit: adding storagepid manually under vendorname fixes issue, there way considered automatically? persistence.storagepid = 116

ruby on rails - Is it possible to have a select box with an input field option? -

i want have select box besides given options allows set value manually. not hundred percent sure if possible think have seen before. on w3school page select couldn't find relevant. as working rails, checked apidock page select_tag form helper, there couldn't find anything. while it's common functionality, looking not part of standard html (5 or not) controls. to achieve desired effect have use javascript framework. the news there lot of frameworks and/or plugins doing this. bad news have spend time playing couple until find 1 you're happy with. the 2 used js frameworks, jquery , bootstrap , have dozens of plugins this, search them.

matlab - Import csv file with values within quotation marks -

i want import csv file (data.csv) structured follows area,mtu,biomass mw,lignite mw cta|de(50hertz),"01.01.2015 00:00 - 01.01.2015 00:15 (cet)","1227","6485" cta|de(50hertz),"01.01.2015 00:15 - 01.01.2015 00:30 (cet)","","6421" cta|de(50hertz),"01.01.2015 00:30 - 01.01.2015 00:45 (cet)","1230","n/e" cta|de(50hertz),"01.01.2015 00:45 - 01.01.2015 01:00 (cet)","n/a","6299" i've tried use textscan works pretty well, process stops once empty quotation marks reached. argument 'emptyvalue',0 not work. file = fopen('data.csv'); data = textscan(file, '%q %q "%f" "%f"', 'delimiter', ',',... 'headerlines', 1,'treatasempty', {'n/a', 'n/e'}, 'emptyvalue',0); fclose(file); any idea, on how import whole file. textscan(file,'%q%q%q%q%[^\n\r]',

android - CursorLoader not refreshing on data change -

i'm having bit of problem android's cursorloader. i'm using cursorloader load data own contentprovider. loads data , keeps on orientation changes not update on data change. way using cursorloader comes in compatibility library. i think have done documentation , several tutorials tell me do, still not working. have checked several posts on site nothig seems fix it. here's create loader: @override public loader oncreateloader(int id, bundle args) { switch (id) { case todo_evidences_loader_id: { return new cursorloader(this, buildertodocontentprovider.todo_evidences_content_uri, null, null, new string[]{token_id}, null); } } return null; } this method call on query method on contentprovider: private cursor gettodoevidences(string selection){ string evidencequery = "select " + buildertodocontract.evidence.table_name + "." + buildertodocontract.evidence._id + ", " +

javascript - migration of Ext.Net 1.6 to Ext.Net 2.1 with MVC destroys renderer functionality -

so have large project creating sample of migration ext.net 1.6 ext.net 2.1 mvc 4. doing have stumbled upon error, (after making web-application conform master page) renderer gridcolumn throws following errors: uncaught typeerror: object function string() { [native code] } has no method 'format' uncaught typeerror: cannot call method 'removechild' of null the renderer in "headcontent" placeholder while gridpanel in "maincontent" renderer function looks follows: <script type="text/javascript"> var template = '<span style="color:{0};">{1}</span>'; var listname = function (value, meta, record) { return string.format(template, (record.data.blockstatus == "free") ? "green" : "red", value); }; </script> a general sample page use of ext.net work without problems. any ideas on how fix this? in ext js 4, string.format removed , repl

does entity framework require a mapping for every model? I am creating my model and map by hand -

when adding view entity framework, there such thing model without map? how specify primary key property view in map? i trying add view entity framework can simple select table populate ddl. yes, don't think hurts add model, did.

asp classic - Error when querying a CSV file -

i have server running windows server 2003 iis 6.0. classic asp application works there. i've been trying application work on iis 7 , windows server 2008 in new server provide company wants migrate, i've been struggling when querying csv file. the code same in both enviroments, , while works on iis 6 machine, refuses let me access recordset generated query. here code: set conexcel = server.createobject("adodb.connection") conexcel.open "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("xls\") &";extended properties=""text;hdr=yes;imex=1; importmixedtypes=text;fmt=delimited(;)""" strsql="select * ["& strfile &"]" set sql = server.createobject("adodb.recordset") sql.open strsql,conexcel the csv file has several columns. 1 of them called name. code store in variable following: strname = sql("name") the error when running on iis 7 cla

Facebook login for web and device generate different uid for same user -

we trying update facebook login device , found out different uid generated while login via pc browser , device login method. uid generated browser can user feeds, return empty uid generated device login. know why there different uid same user? it's design unrelated apps can't correlate users. straight from upgrade docs , emphasis mine; app-scoped user ids facebook begin issue app-scoped user ids when people first log instance of app coded against v2.0 of api. with app-scoped ids, id same user different between apps . no matter version used sign app, id remain same people have logged app. change backwards-compatible has logged app @ point in past. if you're not mapping ids across apps, no code changes should required. if need map same user ids across multiple apps or run cross-app promotions, we've added new api called business mapping api. lets map logged-in user's ids across apps long apps owned same business.

c# - MVC - Joining multiple table using LINQ / lambda - Using EF -

i implementing controller , need staff members have risktypeid, selected user when click on navigation item. here how create joins in sql sql select rthg.risktypeid, sm.fullname risktypehasgroup rthg inner join riskgroup rg on rthg.riskgroupid = rg.id inner join riskgrouphasgroupmembers rghgm on rg.id = rghgm.riskgroupid inner join groupmember gm on rghgm.groupmemberid = gm.id inner join groupmemberhasstaffmember gmhsm on gm.id = gmhsm.groupmemberid inner join staffmember sm on gmhsm.staffmemberid = sm.id rthg.risktypeid = 1 i’ve pulled data before using linq , lambda using simple expressions, need able make call bring same data sql outlined above, i’ve searched online can’t find similar requirement. here controller, placed comments inside guidance controller public actionresult viewrisktypes(int selectedrisktypeid) { var risktypes = _dbcontext.risktypes.tolist(); // of current items held in risktypes tables, store them list in var risktypes var viewmodel

c# - How can set absolute position on stackpanel or grid in xaml WPF -

Image
is possible set stackpanel or grid position absolute css. in css have property position of elements , can set relative, absolute , working good. in xaml can make grid, stackpanel use position absolute. you have use canvas in order set absolute position in wpf. in case of buttons in window, here sample : <window x:class="tobedeleted.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" title="mainwindow" height="350" width="525"> <canvas> <button canvas.left="10" canvas.bottom="20">bottom left</button> </canvas> </window> the output :

Element-wise sum of arrays in Scala -

how compute element-wise sum of arrays? val = new array[int](5) val b = new array[int](5) // assign values // desired output: array -> [a(0)+b(0), a(1)+b(1), a(2)+b(2), a(3)+b(3), a(4)+b(4)] a.zip(b).flatmap(_._1+_._2) missing parameter type expanded function try: a.zip(b).map { case (x, y) => x + y }

c# - Dynamic Checkboxlist in repeater, ASP.NET -

i have checkboxlist in repeater , code have here dynamic dropdownlist in repeater, asp.net . if this: <asp:checkboxlist id="chklworktype" runat="server" ondatabinding="chklworktype_databinding"></asp:checkboxlist> protected void chklworktype_databinding(object sender, system.eventargs e) { checkboxlist chk = (checkboxlist)(sender); chk.items.add(new listitem("nem 1", "1")); chk.items.add(new listitem("num 2", "2")); chk.selectedvalue = chk.datavaluefield; } this error message: system.argumentoutofrangeexception: 'chklworktype' has selectedvalue invalid because not exist in list of items. datavaluefield gets or sets field of data source provides value of each list item. name of column or that. using name selectedvalue doesn't exist because haven't assingned one, it's string.empty . you use this, if want first item selected: chk.selec

how to create dynamic form in angularjs? -

my error description: step 1: appending template using directive. step 2: remove appended template using scope function "removemilestonediv". step 3: after submit form. but, can't submitted. i think have add template bind scope variable. but, have remove template scope variable can't unbind. create directive add milestone: app.directive('addmilestone', ['$compile', function ($compile) { // inject $compile service dependency return { restrict: 'a', link: function (scope, element, attrs) { // click on button add new input field element.find('a').bind('click', function () { // i'm using angular syntax. using jquery have same effect // create input element // var input = angular.element('<div id="scope.milestoneid_'+ scope.milestonecounter +'" class="form"