Tuesday, 15 July 2014

sql server - Change Primary Key Master Details Tables SQL -



sql server - Change Primary Key Master Details Tables SQL -

i have master details tables

mastertbl

id name age 12 name1 15 544 name2 15 2544 name3 15

detailstbl

id session masterid 1 test 12 2 test2 12 3 test3 544 4 test4 2544 5 test5 12 6 test6 544

is possible alter id of master table , details table without info conflict :

mastertbl

id name age 1 name1 15 2 name2 15 3 name3 15

detailstbl

id session masterid 1 test 1 2 test2 1 3 test3 2 4 test4 3 5 test5 1 6 test6 2

i used function in master

row_number() on (order id)

but should update details

try this:

declare @temp table (tempid int identity(1,1), id int) insert @temp (id) select id mastertbl set @total = @@rowcount declare @count int = 1 declare @id int while @count <= @total begin set @id = (select id @temp tempid = @count) -- update details table update detailstbl set masterid = @count masterid = @id -- update master table update mastertbl set id = @count id = @id set @count = @count + 1 end

first need update details table, master table.

sql sql-server sql-server-2012

Input FASTA file required after local BLAST database is built? -



Input FASTA file required after local BLAST database is built? -

i've downloaded big fasta file , have built local blast database. i'm trying maintain storage space , wondering if input fasta file can deleted after local blast database has been built?

i removed fasta file , blast still ran fine. worried deleting fasta files big. able find little blast database test on. llopis!

fasta blast

javascript - Getting an error when aborting AJAX request in IE9 -



javascript - Getting an error when aborting AJAX request in IE9 -

i using long polling in project. when project running, 1 of long polling requests waiting response server. now, when user generates new template, have abort previous long polling phone call , run new one.

aborting in ie gives error

couldn't finish operation due error c00c023f

i don't want utilize jquery , aborting previous request important. tried seek , grab prevent showing error didn't work out.

i using abort when normal request(not polling request) request doesn't reach server after few seconds, abort old request , send new one.

i store xmlhttp object in array each request.

like: array_xmlhttp.push(request1);

i abort like: array_xmlhttp[index_of_request].abort();

i couldn't find solution ie9, while works perfect on other browsers.

update:

i check status , readystate xmlhttp object below:

function checkresponse(xmlhttp){ xmlhttp.onreadystatechange=function(){ if(xmlhttp.readystate==4){ if(xmlhttp.status==200){ // request received } } } }

here how start request

// start new xmlhttp object var xmlhttp=crxh(); // add together request array aborted later if required array_xmlhttp.push(request1); // initiate callback checkresponse(xmlhttp); //send request server send(xmlhttp);

when abort:

// problem callback function not read (undefined) new property added aborted object. array_xmlhttp[index_of_request].aborted = true; array_xmlhttp[index_of_request].abort();

thank help!

codifying our long give-and-take answer...

per various articles one i've found on topic (it's not unusual issue in ie), ie not access standard properties on xmlhttp object after phone call .abort(), still trigger onreadystatechange events causes seek access standard properties, causing error.

the work-around set own property on xmlhttp object when phone call .abort() , in readystatechange handler, first check own .aborted property , if it's set, know phone call has been aborted , don't check other properties can cause problem.

so, if xmlhttp object called x, you'd this:

x.readystatechange = function() { if (!x.aborted) { if(xmlhttp.readystate==4){ if(xmlhttp.status==200){ // request received } } } }

and, when want abort:

x.aborted = true; x.abort();

javascript ajax internet-explorer internet-explorer-9

ios - Since we have [NSData dataWithContentsOfURL:], why do we use [NSURLConnection sendSynchronousRequest:returningResponse:error:]? -



ios - Since we have [NSData dataWithContentsOfURL:], why do we use [NSURLConnection sendSynchronousRequest:returningResponse:error:]? -

we can fetch simple web contents codes below:

+ (nsstring *)getcontentwithurl:(nsstring *)urlstring { nsurl *url = [nsurl urlwithstring:urlstring]; nsdata *data = [nsdata datawithcontentsofurl:url]; if(!data) { homecoming @""; } else { homecoming [nsstring stringwithutf8string:[data bytes]]; } }

but told me using nsurlconnection?

both different things:

datawithcontentsofurl:

this method ideal converting data:// urls nsdata objects, , can used reading short files synchronously. if need read potentially big files, utilize inputstreamwithurl: open stream, read file piece @ time.

important: not utilize synchronous method request network-based urls. network-based urls, method can block current thread tens of seconds on slow network, resulting in poor user experience, , in ios, may cause app terminated.

sendsynchronousrequest:returningresponse:error:

a synchronous load built on top of asynchronous loading code made available class. calling thread blocked while asynchronous loading scheme performs url load on thread spawned load request. no special threading or run loop configuration necessary in calling thread in order perform synchronous load.

important: because phone call can potentially take several minutes fail (particularly when using cellular network in ios), should never phone call function main thread of gui application.

ios objective-c nsurlconnection

angularjs - angular-spinner - Fatal error: Unable to find suitable version for angular -



angularjs - angular-spinner - Fatal error: Unable to find suitable version for angular -

i want utilize angular-spinner in project (lineman + angularjs). bower.json:

{ "name": "taas", "version": "0.0.1", "dependencies": { "angular": "~1.2.14", "angular-ui-bootstrap": "~0.10.0", "jquery": "~2.1.0", "angular-bootstrap": "~0.10.0", "angular-ui-router": "~0.2.10", "restangular": "~1.3.1", "angular-resource": "~1.2.14", "bootstrap": "~3.1.1", "font-awesome": "~4.0.3", "underscore": "~1.6.0", "underscore.string": "~2.3.3", "modernizr": "~2.7.2", "ng-table": "~0.3.1", "jquery-ui": "~1.10.4", "jquery.uniform": "~2.1.2", "elasticsearch": "~2.1.3", "flot": "~0.8.2", "angular-flot": "~0.0.2", "angular-growl-v2": "~0.6.1", "angular-animate": "~1.2.16", "spin.js": "~2.0", "angular-spinner": "~0.5.0" } }

files.js:

module.exports = function (lineman) { 'use strict'; //override file patterns here homecoming { js: { vendor: [ 'vendor/bower/jquery/dist/jquery.js', 'vendor/bower/jquery-ui/ui/jquery-ui.js', 'vendor/bower/modernizr/modernizr.js', 'vendor/bower/angular/angular.js', 'vendor/bower/angular-bootstrap/ui-bootstrap-tpls.js', 'vendor/bower/angular-resource/angular-resource.js', 'vendor/bower/angular-route/angular-route.js', 'vendor/bower/restangular/dist/restangular.js', 'vendor/bower/angular-ui-router/release/angular-ui-router.js', 'vendor/bower/underscore/underscore.js', 'vendor/bower/underscore.string/lib/underscore.string.js', 'vendor/bower/ng-table/ng-table.src.js', 'vendor/js/responsive-tables.js', 'vendor/bower/jquery.uniform/jquery.uniform.js', 'vendor/bower/flot/jquery.flot.js', 'vendor/bower/flot/jquery.flot.categories.js', 'vendor/js/jquery.flot.axislabels.js', 'vendor/bower/angular-flot/angular-flot.js', 'vendor/bower/elasticsearch/elasticsearch.angular.js', 'vendor/bower/angular-growl-v2/build/angular-growl.js', 'vendor/bower/angular-animate/angular-animate.js', 'vendor/bower/spin.js/spin.js', 'vendor/bower/angular-spinner/angular-spinner.js' ], app: [ 'app/js/app.js', 'app/js/**/*.js' ] }, webfonts: { root: 'fonts' }, css: { vendor: [ 'vendor/bower/bootstrap/dist/css/bootstrap.css.map', 'vendor/bower/bootstrap/dist/css/bootstrap.css', 'vendor/bower/bootstrap/dist/css/bootstrap-theme.css.map', 'vendor/bower/bootstrap/dist/css/bootstrap-theme.css', 'vendor/bower/font-awesome/css/font-awesome.css', 'vendor/bower/ng-table/ng-table.css', 'vendor/bower/angular-growl-v2/build/angular-growl.css', 'vendor/css/**/*.css', 'app/css/**/*.css' ] } }; };

and then

$ lineman build running "clean:dist" (clean) task running "clean:bower" (clean) task running "common" task running "bower:install" (bower) task fatal error: unable find suitable version angular

when remove "angular-spinner": "~0.5.0" line bower.json, build successful , spin.js catalog nowadays in project. what? doing wrong?

angularjs spin.js linemanjs

gtk - How can I reduce the number of arguments I have to pass around in Haskell? -



gtk - How can I reduce the number of arguments I have to pass around in Haskell? -

i'm getting speed in haskell, trying gui toolgit usable, etc. followed basic tutorial on using glade create simple gui app , i'm trying modularize it. in particular, wanted leverage functions instead of doing in main. first thing did create separate functions accessing buttons , associating code executed when buttons clicked. works fine if @ code below, have carry entire glade xml "variable" around me. realize don't global in haskell seems me there has improve mechanism rather carrying every single variable around in functions. in oo world, xml stuff instance variable in class implicitly available everywhere. what's "right" way in haskell world?

module main (main) import graphics.ui.gtk import graphics.ui.gtk.glade getbutton :: gladexml -> string -> io button getbutton gladexml buttonname = xmlgetwidget gladexml casttobutton buttonname onbuttonclick :: gladexml -> string -> [io a] -> io () onbuttonclick gladexml buttonname codesequence = abutton <- getbutton gladexml buttonname _ <- onclicked abutton $ -- run sequence of operations when user clicks sequence_ codesequence homecoming () loadgladefile :: filepath -> io (maybe gladexml) loadgladefile filename = g <- xmlnew filename homecoming g main :: io () main = _ <- initgui -- setup -- load glade xml file xml <- loadgladefile "tutorial.glade" -- create main window (everything within created too) window <- xmlgetwidget xml casttowindow "window1" -- define when quit _ <- ondestroy window mainquit -- show wondow widgetshowall window -- associate onclick event button onbuttonclick xml "button1" [putstrln "hello, world"] -- off go maingui

this suggestion augustss' comment. thoroughly untested, started:

import control.applicative import control.monad import control.monad.trans import control.monad.trans.reader import graphics.ui.gtk import graphics.ui.gtk.glade getbutton :: string -> readert gladexml io button getbutton buttonname = gladexml <- inquire homecoming . lift $ xmlgetwidget gladexml casttobutton buttonname

to run readert gladexml io action:

-- well, should utilize `runreadert` directly, @ to the lowest degree -- type signature here instructive. rungladexmlreader :: readert gladexml io -> gladexml -> io rungladexmlreader = runreadert

try reading docs on control.monad.trans.reader, , monad transformer tutorials.

let me seek again. i'm doing combining 2 ideas can tackle separately, set together:

the reader monad monad transformers

you might start reading these seek understand reader monad:

inside world (ode functor , monad); focus on section reader ("the world of future values") reader monad purpose help reader monad

basically, reader monad constructs values depend on missing, implicit "environment" value. within reader monad there action called ask :: reader r r result environment value.

so thought everywhere have gladexml -> something, can rewrite function monadic action of type reader gladexml something. example, simplification of illustration above (no monad transformer):

getbutton :: string -> reader gladexml (io button) getbutton buttonname = -- variable gladexml gets value of "implicit" gladexml value gladexml <- inquire -- utilize value argument xmlgetwidget function. homecoming $ xmlgetwidget gladexml casttobutton buttonname

the way utilize reader runreader :: reader r -> r -> a function. schematically:

{- note: none of guaranteed compile... -} illustration :: io button illustration = _ <- initgui -- setup xml <- loadgladefile "tutorial.glade" runreader (getbutton "button1") xml

however, since you're using both reader , io in here, want create combined monad has "powers" of both. that's monad transformers add together picture. readert gladexml io a is, conceptually, io action has access "implicit" gladexml value:

getbutton :: string -> readert gladexml io button getbutton buttonname = gladexml <- inquire -- there 1 catch: utilize io action, have prefix -- `lift` function... button <- lift $ xmlgetwidget gladexml casttobutton buttonname homecoming button -- i've refactored *not* take list of actions. onbuttonclick :: string -> readert gladexml io -> readert gladexml io () onbuttonclick gladexml buttonname action = abutton <- getbutton buttonname xml <- inquire _ <- lift $ onclicked abutton (runreadert action xml) homecoming () -- piece of code illustrates payoff of refactoring. -- note how there no variable beingness passed around xml. -- because i'm making "big" readert action out of little ones, , -- implicitly same `gladexml` value threaded through them. makebutton1 :: readert gladexml io button makebutton1 = button1 <- getbutton "button1" onbuttonclick "button1" $ lift $ putstrln "hello, world" homecoming button1 -- `main` action fetches `gladexml` value , hands off -- actual main logic, `readert` expects `gladexml` main :: io () main = xml <- ... runreadert actualmain xml actualmain :: readert gladexml io () actualmain = ...

haskell gtk glade

ios - nib but didn't get a UITableView using PFQueryTableViewController -



ios - nib but didn't get a UITableView using PFQueryTableViewController -

i trying add together search feature app screen needs have navigation bar in add-on search bar on uitableview. getting next error when perform segue (click button) , view loads

terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: '-[uitableviewcontroller loadview] loaded "2gx-ec-tth-view-hbf-bd-79u" nib didn't uitableview.'

here looks on storyboard.

i believe problem scene managed class called "alldataviewcontroller" , manages uiview , subclass of uitableview pfquerytableviewcontroller

//alldatatableviewcontroller.h @interface alldatatableviewcontroller : pfquerytableviewcontroller <uisearchdisplaydelegate, uisearchbardelegate, uitableviewdelegate>

so not sure doing wrong here. allow me know if have suggestions or if need add together more information.

because view controller subclasses uitableviewcontroller (well, indirectly via pfquerytableviewcontroller), expects view property refer instance of uitableview. if @ object hierarchy in storyboard scene think find root of scene not uitableview, uiview.

how did add together navigation bar? right method select "embed in..." editor menu in image builder.

ios iphone objective-c xcode

sql - Return set of records with unknown table_name -



sql - Return set of records with unknown table_name -

i want homecoming row table function (i don't know name of table, it's random)

create function foo( text ) returns setof record $$ declare table_name alias $1; begin select * table_name ; end $$ language plpgsql;

and want this:

select col1,col2 foo('bar');

any ideas?

sql demands know homecoming type @ phone call time. , functions require define homecoming type well. after not trivial.

if don't know homecoming type @ call time, out of luck. cannot solve problem single function call.

if know type @ phone call time, there alternative polymorphic types , dynamic sql execute:

create or replace function f_data_of_table(_tbl_type anyelement) returns setof anyelement $func$ begin homecoming query execute 'select * ' || pg_typeof(_tbl_type); end $func$ language plpgsql;

call:

select * f_data_of_table(null::my_table_name);

details in related answer: refactor pl/pgsql function homecoming output of various select queries

be wary of sql injection: table name postgresql function parameter

only makes sense if more select * tbl, or you'd utilize sql command.

aside: not utilize alias attach names parameter values. that's outdated , discouraged. utilize named parameters instead.

sql postgresql plpgsql

socketexception - Error adding modes in Processing -



socketexception - Error adding modes in Processing -

i downloaded processing 2.2.1 , when tried add together programming mode through menu on right side, got java.net.socketexception: network unreachable though can connect internet, , error message @ bottom of "add modes" popup said could not find listof available contributions instead of list of modes. know modes can manually downloaded , unzipped have yet find .zip file python mode. possible prepare error can download modes through gui box , if so, how?

i had downloaded linux machine runs ubuntu , worked fine there trying migrate windows 32 bit re-downloaded today windows , got error.

processing socketexception

java - run time error (ArrayOutOfBoundException) -



java - run time error (ArrayOutOfBoundException) -

getting run time error arrayoutofboundexception

class command { public static void main(string[] args) { int a,b,c,sum; = integer.parseint(args[0]); b = integer.parseint(args[1]); c = integer.parseint(args[2]); sum = a+b+c; system.out.println("command line sum "+sum); } }

// error in code ?

an arrayindexoutofboundsexception occurs when seek reference index not exist in array. here, you're implicitly assuming give programme 3 arguments (or more). if it's run no arguments, args[0] generate exception. if it's run 1 argument, you'll exception on args[1] , if it's run 2 arguments, args[2] cause said exception.

java

android - Save Images to external public storage using Universal Image Downloader? -



android - Save Images to external public storage using Universal Image Downloader? -

i'm attempting save images external sd card using universal image loader. next extremely outdated code fragment author, nostra, here:

download image stream android universal image loader

i'm interested in recreating successfully, when tried, got

this error:

06-21 07:56:22.586 17647-17647/as;dlkfa e/libegl﹕ phone call opengl es api no current context (logged 1 time per thread) 06-21 07:56:27.562 17647-17647/;alsdjf e/viewrootimpl﹕ senduseractionevent() mview == null 06-21 07:56:30.965 17647-17647/;aldjf; e/viewrootimpl﹕ senduseractionevent() mview == null 06-21 07:56:32.737 17647-17647/a;sdjfl e/androidruntime﹕ fatal exception: main java.lang.nullpointerexception @ com.nostra13.universalimageloader.utils.ioutils.copystream(ioutils.java:73) @ com.nostra13.universalimageloader.utils.ioutils.copystream(ioutils.java:50) @ ;a;ldsfkj.mediadisplayactivity.savetogallery(mediadisplayactivity.java:344) @ as;dlkfj.mediadisplayactivity.onmenuitemclick(mediadisplayactivity.java:298) @ android.widget.popupmenu.onmenuitemselected(popupmenu.java:142) @ com.android.internal.view.menu.menubuilder.dispatchmenuitemselected(menubuilder.java:735) @ com.android.internal.view.menu.menuitemimpl.invoke(menuitemimpl.java:152) @ com.android.internal.view.menu.menubuilder.performitemaction(menubuilder.java:874) @ com.android.internal.view.menu.menupopuphelper.onitemclick(menupopuphelper.java:175) @ android.widget.adapterview.performitemclick(adapterview.java:301) @ android.widget.abslistview.performitemclick(abslistview.java:1507) @ android.widget.abslistview$performclick.run(abslistview.java:3336) @ android.os.handler.handlecallback(handler.java:730) @ android.os.handler.dispatchmessage(handler.java:92) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:5455) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:525) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1187) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1003) @ dalvik.system.nativestart.main(native method)

i've changed original code this. beingness called on menu item click:

private void savetogallery() { string imageurl = imageurls.get(pager.getcurrentitem()); file path = environment.getexternalstoragepublicdirectory( environment.directory_pictures); file fileforimage = new file(path, imageurl); inputstream sourcestream = null; file cachedimage = imageloader.getinstance().getdiskcache().get(imageurl); if (cachedimage.exists()) { // if image cached uil seek { sourcestream = new fileinputstream(cachedimage); } grab (filenotfoundexception e) { e.printstacktrace(); } } else { // otherwise - download image imagedownloader downloader = new baseimagedownloader(this); seek { sourcestream = downloader.getstream(imageurl, null); } grab (ioexception e) { e.printstacktrace(); } } // todo : utilize try-finally close streams outputstream targetstream = null; seek { targetstream = new fileoutputstream(fileforimage); } grab (filenotfoundexception e) { e.printstacktrace(); } seek { ioutils.copystream(sourcestream, targetstream, null); } grab (ioexception e) { e.printstacktrace(); } seek { targetstream.close(); } grab (ioexception e) { e.printstacktrace(); } seek { sourcestream.close(); } grab (ioexception e) { e.printstacktrace(); } }

line 344 is:

ioutils.copystream(sourcestream, targetstream, null);

read comments fix. basically, using bad characters https**:**

also, here's new code, works, still won't create album app pretty desirable if want users navigate through own albums. i'll maintain begging help coding gods in comments. also, doesn't handle when saving same image yet.

//todo upon uninstall ensure files still there //todo create sure janky stuff don't crash if save same stuff twice private boolean savetogallery() { string imageurl = imageurls.get(pager.getcurrentitem()); int = imageurl.length()-1; while(imageurl.charat(i) != '/') { i--; } string newimageurl = imageurl.substring(i+1); file path = environment.getexternalstoragepublicdirectory(environment.directory_pictures); file fileforimage = new file(path, newimageurl); // if (!fileforimage.mkdirs()) { // log.e("shit", "directory not created"); // } boolean saved = false; inputstream sourcestream = null; file cachedimage = imageloader.getinstance().getdiskcache().get(imageurl); seek { if (cachedimage != null && cachedimage.exists()) { // if image cached uil sourcestream = new fileinputstream(cachedimage); } else { // otherwise - download image imagedownloader downloader = new baseimagedownloader(this); sourcestream = downloader.getstream(imageurl, null); } } grab (ioexception e) { l.e(e); } if (sourcestream != null) { seek { system.out.println(fileforimage.getabsolutepath()); outputstream targetstream = new fileoutputstream(fileforimage); ioutils.copystream(sourcestream, targetstream, null); targetstream.close(); sourcestream.close(); saved = true; } grab (ioexception e) { l.e(e); } } //updates gallery, dunno how though lol, yay sendbroadcast(new intent(intent.action_media_mounted, uri.parse("file://" + environment.getexternalstoragedirectory()))); homecoming saved; }

alright everyone, had move mkdirs() phone call before appending of url file. i'm tired right figure out ordering of things, certainly due that. here's new code. save image album in app if using universal image loader , part of url file name, otherwise, no soup you:

//todo upon uninstall ensure files still there //todo create sure janky stuff don't crash if save same stuff twice private boolean savetogallery() { string imageurl = imageurls.get(pager.getcurrentitem()); int = imageurl.length()-1; while(imageurl.charat(i) != '/') { i--; } string newimageurl = imageurl.substring(i+1); file path = environment.getexternalstoragepublicdirectory(environment.directory_pictures + "/your app name here"); if (!path.mkdirs()) { log.e("shit", "directory not created"); } file fileforimage = new file(path, newimageurl); boolean saved = false; inputstream sourcestream = null; file cachedimage = imageloader.getinstance().getdiskcache().get(imageurl); seek { if (cachedimage != null && cachedimage.exists()) { // if image cached uil sourcestream = new fileinputstream(cachedimage); } else { // otherwise - download image imagedownloader downloader = new baseimagedownloader(this); sourcestream = downloader.getstream(imageurl, null); } } grab (ioexception e) { l.e(e); } if (sourcestream != null) { seek { system.out.println(fileforimage.getabsolutepath()); outputstream targetstream = new fileoutputstream(fileforimage); ioutils.copystream(sourcestream, targetstream, null); targetstream.close(); sourcestream.close(); saved = true; } grab (ioexception e) { l.e(e); } } //updates gallery, dunno how though lol, yay sendbroadcast(new intent(intent.action_media_mounted, uri.parse("file://" + environment.getexternalstoragedirectory()))); homecoming saved; }

user#### pleasure help you. if op's talkative , informing!

android exception-handling try-catch universal-image-loader fileoutputstream

android - Custom adapter for list not working -



android - Custom adapter for list not working -

i have listview supposed lists style has been defined in custom adapter. but, when open listactivity, blank activity.

adapter code:

public class alarmlistcustomadapter extends arrayadapter<string> { private final context context; private final string[] values; typeface light; public alarmlistcustomadapter(context context, string[] values, string font) { super(context, r.layout.alarmlist_layout); this.context = context; this.values = values; lite = typeface.createfromasset(context.getassets(), font); } @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.alarmlist_layout, parent, false); textview tv1 = (textview) rowview.findviewbyid(r.id.alarm_time); textview tv2 = (textview) rowview.findviewbyid(r.id.alarm_label); tv2.settext(values[position]); homecoming rowview; } }

listactivity code-

public class alarmlist extends listactivity { public void oncreate(bundle icicle) { super.oncreate(icicle); requestwindowfeature(window.feature_no_title); getwindow().addflags(windowmanager.layoutparams.flag_fullscreen); string[] values = new string[] { "android", "iphone", "windowsmobile", "blackberry", "webos", "ubuntu", "windows7", "max os x", "linux", "os/2" }; // utilize custom layout alarmlistcustomadapter adapter = new alarmlistcustomadapter(this, values, "fonts/lato-light.ttf"); setlistadapter(adapter); } @override protected void onlistitemclick(listview l, view v, int position, long id) { string item = (string) getlistadapter().getitem(position); toast.maketext(this, item + " selected", toast.length_long).show(); } }

i'm not getting warnings or error in logcat. can going wrong?

i'm trying larn custom adapter implementation through here.

change this

super(context, r.layout.alarmlist_layout);

to

super(context, r.layout.alarmlist_layout,values);

since have r.layout.alarmlist_layout there no need inflate layout 1 time again in getview. read blackbelt's comment below.

android android-listview android-adapter

sql server - How to return a table variable from a function (UDF)? -



sql server - How to return a table variable from a function (UDF)? -

i'm using sql server 2012 , have been trying lots of different approaches homecoming table variable within function, cannot work. i've tried moving variable declaration different places, etc. here guts of sql. if please wrap guts in udf function compiles , returns @financials table variable appreciate it. sql works great, no problems. when seek wrap in udf throws errors when seek create it. hardcoded stuff create easier test , visualize.

declare @financials table ( [a bunch of variable declarations in here] ); insert @financials [big old select query here - works fine, , populates @financials] select * @financials f1 f1.transactiondate = ( select max(transactiondate) @financials salesdocumentitemid = f1.salesdocumentitemid )

i need udf homecoming @financials now.

if impossible, please consider real problem, shown in select * @financials above, in want match latest transactiondate, joined salesdocumentitemid. if find efficient way this, wouldn't need insert @financials @ all. guess problem query populates @financials complex, lots of joins, , don't want duplicate of 1 time again in subselect. i'm guessing there's awesome , easier way that. love ideas.

you don't utilize declare when returning table variable. define result table in returns clause.

create function getfinancials () returns @financials table ( [a bunch of variable declarations in here] ) begin insert @financials [big old select query here - works fine, , populates @financials] homecoming end update

how returning final result in stored procedure?

create procedure uspgetfinanicals declare @financial table ( [table definition here] ) insert @financial select dbo.getfinancials() select * @financials f1 f1.transactiondate = ( select max(transactiondate) @financials salesdocumentitemid = f1.salesdocumentitemid ) update

try this. create table variable within udf store results of first select, insert result of final query homecoming value.

create function getfinancials () returns @financials table ( [a bunch of variable declarations in here] ) begin declare @table table([a bunch of variable declarations in here]) insert @table [big old select query here - works fine, , populates @financials] insert @financials select * @table f1 f1.transactiondate = ( select max(transactiondate) @table salesdocumentitemid = f1.salesdocumentitemid ) homecoming end

sql-server tsql sql-server-2012

hp uft - QTP/UFT : To perform an action on object which is retrived from Object Repository file (.tsr) -



hp uft - QTP/UFT : To perform an action on object which is retrived from Object Repository file (.tsr) -

my objective object object repository file (.tsr) , perform action on object click, set... in below code "webbutton" object captured. when perform "click" action on object (brobj). getting error message in uft " test run cannot go on due unrecoverable error line(20):brobj.click "

dim repositoryfrom, brobj dim objectrepositorypath, str, pgstr, btnstr objectrepositorypath="c:\repository2.tsr" set repositoryfrom = createobject("mercury.objectrepositoryutil") repositoryfrom.load objectrepositorypath str = "browser("+""""+"title"+""""+")" pgstr = "page("+""""+"title"+""""+")" btnstr = "webbutton("+""""+"login"+""""+")" 'msgbox str set brobj = repositoryfrom.getobject(str+"."+pgstr+"."+btnstr) brobj.click 'getting error line

so there way in uft perform action on object retrived

from object repository file (.tsr)

the com objects access library not same objects uft run-time engine uses during playback. if want load object repository file @ run-time, can utilize repositoriescollection utility object add together file available object repositories. 1 time loaded, can access test objects other test object in uft.

dim objectrepositorypath, brobj objectrepositorypath = "c:\repository2.tsr" repositoriescollection.add objectrepositorypath set brobj = browser("title").page("title").webbutton("login") brobj.click

qtp hp-uft

javascript - famo.us trigger event at key point of animation -



javascript - famo.us trigger event at key point of animation -

i'm trying trigger event half-way through progress (not time) of transition. sounds simple, since transition can have curve it's quite tricky. in particular case it's not going paused or consideration out of way.

(simplified) trigger animation on modifier this:

function scalemodifierto(statemodifier, scale, animationduration) { statemodifier.settransform( transform.scale(scale, scale, scale), { duration: animationduration, curve: this.options.curve } ); }

when interpolated state of transitionable hits 0.5 (half-way through) want trigger function.

i haven't dug deep behind in source of famo.us yet, maybe need like

subclass , add together possibility hear when state passes through point? reverse curve defined , utilize settimeout (or seek find proximity using few iterations of chosen curve algorithm (ew))

is possible easily? route should go down?

i can think of couple of ways accomplish such, , both lend utilize of modifier on statemodifier. if new, , haven't had chance explore differences, modifier consumes state transformfrom method takes function returns transform. can utilize our own transitionable supply state on lifetime of our modifier.

to accomplish wish, used modifier basic transformfrom alter x position of surface based on value of transitionable. can monitor transitionable determine when closest, or in case greater or equal half of final value. prerender function called , checked on every tick of engine, , unbinded when nail target.

here example..

var engine = require('famous/core/engine'); var surface = require('famous/core/surface'); var modifier = require('famous/core/modifier'); var transform = require('famous/core/transform'); var transitionable = require('famous/transitions/transitionable'); var snaptransition = require('famous/transitions/snaptransition'); transitionable.registermethod('snap',snaptransition); var snap = { method:'snap', period:1000, damping:0.6}; var context = engine.createcontext(); var surface = new surface({ size:[200,200], properties:{ backgroundcolor:'green' } }); surface.trans = new transitionable(0); surface.mod = new modifier(); surface.mod.transformfrom(function(){ homecoming transform.translate(surface.trans.get(),0,0); }); context.add(surface.mod).add(surface); function triggertransform(newvalue, transition) { var prerender = function(){ var pos = surface.trans.get(); if (pos >= (newvalue / 2.0)) { // something.. emit event etc.. console.log("hello @ position: "+pos); engine.removelistener('prerender',prerender); } } engine.on('prerender',prerender); surface.trans.halt(); surface.trans.set(newvalue,transition); } surface.on('click',function(){ triggertransform(400, snap); });

the downside of illustration fact querying transitionable twice. alternative add together transitionable check right in transformfrom method. bit strange, modifying our transformfrom method until nail our target value, revert original transformfrom method.. triggertransform defined follows..

hope helps!

function triggertransform(newvalue, transition) { surface.mod.transformfrom(function(){ pos = surface.trans.get() if (pos >= newvalue/2.0) { // console.log("hello position: " + pos) surface.mod.transformfrom(function(){ homecoming transform.translate(surface.trans.get(),0,0); }); } homecoming transform.translate(pos,0,0) }) surface.trans.set(newvalue,transition); }

javascript animation transform famo.us

node.js - Posting object array to sails causes 'TypeError: Cannot convert object to primitive value' -



node.js - Posting object array to sails causes 'TypeError: Cannot convert object to primitive value' -

in html page sending post sails server cannot info in controller req.param() function not homecoming meaningful answer.

here web page code

$.post("http://myserver.local/calendar/batch", {"batch":[ { "start_date" : "2014-06-27t09:00:00z", "title" : "abc", "attendees" : [ "fred bloggs", "jimmy jones", "the queen" ], "event_id" : "123", "location" : "horsham, united kingdom", "end_date" : "2014-06-27t10:30:00z" }, { "start_date" : "2014-06-27t09:00:00z", "title" : "another", "attendees" : [ "fred bloggs", "jimmy jones", "the queen" ], "event_id" : "def", "location" : "horsham, united kingdom", "end_date" : "2014-06-27t10:30:00z" } ]}, function (data) { console.log("success"); } ).fail(function(res){ console.log("error: " + res.getresponseheader("error")); });

here controller

module.exports = { batch: function (req, res, next){ console.log("batch called"); console.log("req.body" + req.body); console.log("req.param()" + req.param()); res.send("ok"); }, _config: {} };

i have tried using req.body not seem contain content. in output

batch called req.body=[object object] typeerror: cannot convert object primitive value @ array.tostring (native)

module.exports = { batch: function (req, res, next){ console.log("batch called"); console.log(req.body); console.log(req.param("batch")); res.send("ok"); }, _config: {} };

if utilize console.log("foo" + object) nodejs seek convert obeject string. console.log(object)

node.js express sails.js

regex - Finding words with doubled letters in HTML text with a regexp -



regex - Finding words with doubled letters in HTML text with a regexp -

how write regular look finds words doubled letters in document?

by doubled letters mean: "s in progress", "d , s in address", "o in tool" , on. want match these words within <body> part of html document ?

below bit of code shows trying do:

while (<>){ if (/<body(.*)>/ .. /<\/body>/){ foreach ($_){ print $_ =~ /\b\w{0,10}(\w)\1\w{0,10}\b/; } } }

this not obvious task, first off because parsing html regex hazardous. disclaimers doing so, here's regex job:

(?s)(?:<body>|\g)(?:.(?!</body>))*?\k\b\w*(\w)\1\w*\b

see the demo.

in perl:

@result = $subject =~ m%(?s)(?:<body>|\g)(?:.(?!</body>))*?\k\b\w*(\w)\1\w*\b%g; (?s) allows dot match newlines (?:<body>|\g) matches <body> or ending position of previous match (?:.(?!</body>))*? lazily matches chars not followed closing </body> tag \k tells engine drop had been matched far returned match \b\w*(\w)\1\w*\b matches word (without \b boundaries) made of optional chars \w* 1 captured char (\w) followed referenced grouping 1 captured \1 , more optional chars \w*

if want allow letters (no digits , underscores), replace \w [a-z] , replace (?s) (?is) create case-insensitive.

regex perl tags

ruby on rails 4 - MiniMagick carrierwave-mongoid can not resize photo upload to S3 -



ruby on rails 4 - MiniMagick carrierwave-mongoid can not resize photo upload to S3 -

i can upload image s3 when seek resize before uploading not work. check around , around not find explanation.

it rails4 using mongoid. seems process :resize_to_fit => [300, -1] creating problem when remove it find, don't want user upload big photo.

class imageuploader < carrierwave::uploader::base include carrierwave::minimagick storage :fog def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end process :resize_to_fit => [300, -1] def extension_white_list %w(jpg jpeg gif png) end end

in gemfile

gem 'carrierwave' gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' gem 'fog' gem 'mini_magick'

in controller: (it go else , flash error message)

def update if @startup.update(startup_params) redirect_to startup_path(@startup) else flash.now[:error] = "the profile not saved, please seek again." render :edit end end

thank you

ruby-on-rails-4 amazon-s3 mongoid carrierwave minimagick

image processing - canvas (about) 5px line -- add bevel effect to make it 3D -- any ideas? (Sample of desired final effect included) -



image processing - canvas (about) 5px line -- add bevel effect to make it 3D -- any ideas? (Sample of desired final effect included) -

i want draw (for instance) line on html5 canvas. want add together image bevel effect line. looks 3d, piece of string sitting on canvas. has seen image processing effect can along line?

i think way kind of drawing draw step step curve, , apply @ each step texture perpendicular local tangent.

but seem want feature : able 'twist' texture depending on part of curve. here there mant options parameterize can't guess how you'll store/interpolate twist of texture. below had texture 'turn' t, parameter of bezier curve.

http://jsfiddle.net/gamealchemist/ypkv9/

example : image showing texture applied curve, , below same curve same texture turns along curve.

// ---------------------------------------------- // draw bezier curve filled // txcv used perpendicular texture // signature : drawtexturedbezier ( txcv, a, b, c, d, twisted ) // a,b,c,d command points, twisted means // have twist curve. // width of bezier == txcv.width/2 // when draw resolution tx.height (lower = nicer+slower, 3 seems fine ) // ---------------------------------------------- function drawtexturedbezier() { // build onnly 1 time local vars var pt = { x: 0, y: 0 }; var tg = { x: 0, y: 0 }; var lastpt = { x: 0, y: 0 }; drawtexturedbezier = function (txcv, a, b, c, d, twisted) { var lineheight = txcv.height; var t = 0; var incr = 1 / 1000; var pointcount = 0; pt.x = a.x; pt.y = a.y; var thiscoordsfort = coordsfort.bind(null, a, b, c, d); var thistgtfort = tangentfort.bind(null, a, b, c, d); // scan bezier curve increment of lineheight distance // on curve. { // update lastly point lastpt.x = pt.x; lastpt.y = pt.y; // seek next point far plenty previous point // compute 1 point ahead // using average estimate t of '1 point ahead' thiscoordsfort(t + incr, pt); var dx = pt.x - lastpt.x; dx *= dx; var dy = pt.y - lastpt.y; dy *= dy; // compute distance previous point var dist = math.sqrt(dx + dy); // compute required t increment // considering curve locally linear // 0.92 compensates error. var tincrement = 0.92 * incr * (lineheight / dist); t += tincrement; // compute point thiscoordsfort(t, pt); pointcount++; // update regular increment local 1 incr = 0.2 * incr + 0.8 * tincrement; // compute tangent current point thistgtfort(t, tg); // draw perpendicular texture drawtexturedline(txcv, pt, tg, t, twisted); } while (t < 1); }; homecoming drawtexturedbezier.apply(this, arguments); }

with

// draws rect centered on pt, curve having tg local tangent // having size of : txcv.width/2 x txcv.height // using txcv horizontal pattern pattern. function drawtexturedline(txcv, pt, tg, t, twisted) { var linewidth = txcv.width / 2; var lineheight = txcv.height; context.save(); context.beginpath(); context.linewidth = 2; context.translate(pt.x, pt.y); context.rotate(math.pi + math.atan2(-tg.x, tg.y)); var twistfactor = 0; if (twisted) { twistfactor = (2 * t + animating * date.now() / 2000) % 1; } context.drawimage(txcv, twistfactor * linewidth, 0, linewidth, lineheight, -0.5 * linewidth, -0.5 * lineheight, linewidth, lineheight); context.restore(); }

image-processing canvas bevelled

java - why synchronized method in the sub thread hold the lock of main thread -



java - why synchronized method in the sub thread hold the lock of main thread -

i have synchronized method. start thread long time operation, sub-thread have synchronized method, synchronized method in sub thread hold lock of synchronized method cause anr in appliction.

my code is:

import java.util.date; public class threadtest { static mqttthread mthread; public static void main(string[] args) { (int = 0; < 100; i++) { system.out.println("the " + + " - restart time = " + new date()); restart(i); } } private static synchronized void restart(int i) { system.out.println("the " + + " - restart excute " + new date()); if (null != mthread) { if (!mthread.isalive()) { seek { system.out .println("action:restartconnectthread in mthread.runflag)"); mthread = new mqttthread(); mthread.setname("mqttthread"); mthread.start(); // mqttexecutor.execute(mthread); } grab (exception e) { system.out.println("!mthread.runflag"); } } else { system.out.println("action:restartconnectthread - connecting"); } } else { seek { system.out .println("action:restartconnectthread in null thread"); mthread = new mqttthread(); mthread.setname("mqttthread"); mthread.start(); } grab (exception e) { system.out.println("null mthread"); } } } private static class mqttthread extends thread { public void run() { connecttoserver(); system.out.println("connected"); } } public static synchronized void connecttoserver() { seek { system.out.println("thread.sleep " + new date()); thread.sleep(20000); } grab (interruptedexception e) { e.printstacktrace(); } } }

it standard behavior of synchronized methods.

look @ http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html

it not possible 2 invocations of synchronized methods on same object interleave. when 1 thread executing synchronized method object, other threads invoke synchronized methods same object block (suspend execution) until first thread done object.

so code

public synchronized void method() { }

is equivalent

public void method() { synchronized (this) { } }

for purposes should utilize different lock-objects connecttoserver , restart methods

upd. sorry, missed, methods static. in case specification 8.4.3.6

a synchronized method acquires monitor before executes. class (static) method, monitor associated class object method's class used.

so can not run 2 synchronized methods of class simultaneously, if static

java android multithreading

debian - How can I see which version of map data I have in OpenStreetMap? -



debian - How can I see which version of map data I have in OpenStreetMap? -

i have built osm tile server on debian. know how see map version? in fact, verify if map info updated. thanks!

if running openstreetmap-tiles-update-expire, check /var/log/tile/run.log: should contain results of each update. file /var/lib/mod_tile/.osmosis/state.txt should contain timestamp of lastly update.

the osm2pgsql database not contain timestamps, cannot check whether have latest data. can map aerial imagery (please not add together bogus objects!), wait couple minutes , check changes drawn on tiles. check tile update time, add together /status url: e.g. http://localhost/tiles/0/0/0.png/status. forcefulness tile update, utilize /dirty instead, , wait.

debian openstreetmap osmosis

android - Relative layout inside drawer layout: relative layout params cannot be cast into drawer layout params -



android - Relative layout inside drawer layout: relative layout params cannot be cast into drawer layout params -

i trying utilize relative layout within drawer can include list view , grid view. receiving next error while running:

logcat error :

java.lang.classcastexception: android.widget.relativelayout$layoutparams cannot cast android.support.v4.widget.drawerlayout$layoutparams

xml:

<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- framelayout display fragments --> <framelayout android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- listview display slider menu --> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="240dp" android:layout_height="fill_parent" android:layout_gravity="start" android:id="@+id/drawer_relative_layout" > <listview android:id="@+id/left_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:divider="@color/list_divider" android:dividerheight="1dp" android:layout_gravity="start" android:choicemode="singlechoice" android:listselector="@drawable/list_selector" android:background="@color/list_background" /> <gridview android:id="@+id/images_drawer" android:layout_width="240dp" android:layout_height="fill_parent" android:layout_below="@id/left_drawer" android:layout_gravity="left" android:choicemode="singlechoice" android:background="@color/list_background" android:layout_margin="5dp" android:columnwidth="100dp" android:drawselectorontop="true" android:numcolumns="2" android:stretchmode="columnwidth" android:horizontalspacing="5dp" android:verticalspacing="5dp" /> </relativelayout> </android.support.v4.widget.drawerlayout>

please check java code. create sure you're using right layout parameters. might referring layouts other drawer layout.

might happen here:

drawerlayout drawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout);

or here:

drawerlayout.closedrawer(drawerlayout);

android android-layout layout android-relativelayout

openerp - Action only visible in form view, need it in tree view too -



openerp - Action only visible in form view, need it in tree view too -

i have custom module trying port openerp 6.1 openerp 7.

in module have defined several new actions point wizards in product.product model. in openerp 6.1 these action links appear in sidebar in product tree view, allowing me utilize selection of products, , in form view, using shown product.

however, in openerp 7 action links appear under "more" button in form view, not in tree view. since need able utilize actions on multiple products @ once, problem.

here action definition:

<act_window id="action_my_id" name="my name" res_model="my_model.function" src_model="product.product" view_mode="form" target="new" view_type="form" />

how create , other actions show under "more" button in tree view form view?

i found reply here on odoo forum:

in order act_window action visible in tree view, need add together next attribute it:

key2="client_action_multi"

so action definition looks this:

<act_window id="action_my_id" name="my name" res_model="my_model.function" src_model="product.product" key2="client_action_multi" view_mode="form" target="new" view_type="form" />

action openerp wizard openerp-7

Signing jars with multiple certificates for java webstart -



Signing jars with multiple certificates for java webstart -

i trying sign application multiple certificates, allow different clients (that trust 1 of them) execute them java webstart.

the signing seems work fine, see multiple .dsa/.rsa , *.sf files in meta-inf of jars. seems javaws recognizes 1 of them , refuses start if doesn't trust certificate.

does java webstart handle multiple signatures or not? doing wrong here?

it's not specified, suspect web start client looking match first certificate finds.

i found this related bug report unfortunately marked wontfix. workaround have 2 separate deployments 2 separate signatures. or work clients find out why trust 1 of certificates not other ...

java java-web-start certificate

c++ - How to parse a function in a cpp file to access the loops -



c++ - How to parse a function in a cpp file to access the loops -

i working on c++ project has gcc defined compiler in makefile. cannot utilize different compiler. need parse through .cc files override particular method called behavior(), inherited parent class. method not have arguments , has void homecoming type. need find out presence of loops (for, while , do-while) within behavior() method , analyze them in various ways finding number of times executed etc. example, allow sample.h , sample.cc header , source files respectively.

sample.h class sample_class: public base of operations { ....; ....; void behavior(); //inherited base of operations }; sample.cc void sample_class::behavior() { ....; ....; int n=10; int count=0; int c=2; for(int x=0;x<n;x++) { count=count+n; //loop1 } while(int z<5) { c=c*5; //loop2 } }

what want access contents of , while , able write like:

exec_time(behavior)=n*exec_time(loop1)+5*exec_time(loop2)

could please guide me how can while using gcc compiler? give thanks much help.

"finding number of times executed" - (and this) requirement requires runtime counting... either modify relevant functions count how they're called , save phone call stack each time, analysis on output, or seek using profiling tool captures same kind of info - perhaps gprof, or quantify or valgrind.

c++ parsing gcc

How to checkout a git revision without changing working copy -



How to checkout a git revision without changing working copy -

recently i've been using git scheme applies patches commits (phabricator & arcanist, don't think thats of import question).

i end in situation have patch applied in form of commit, edit commit. of course of study can create edits , git commit --amend, i'd able git diff, utilize meld . , other tools assume edits made on-top of lastly commit.

currently following.

git diff head~1 > temp.diff git reset --hard head~1 git apply temp.diff rm temp.diff

edit patch...

git commit -a

however seems bit clumsy, there way set git repository sha1, maintain current working re-create intact?

you should able simplify reset using:

git reset @~

that reset head previous commit, , reset index, not working tree. used default reset mode (like git reset --mixed)

a git diff should show lastly patch was. git status should show lastly modified files, ready modified/added beck index , committed again.

git

java - How to make cursor appear in JTextField by default? -



java - How to make cursor appear in JTextField by default? -

i want create cursor appear in jtextfield "box" default. currently, have place cursor in box before appear. here code.

class xyz extends jframe implements actionlistener { jtextfield box = new jtextfield(); jbutton 1 time again = new jbutton("restart"); jbutton ext = new jbutton("exit"); xyz() { box.addactionlistener(this); again.addactionlistener(this); ext.addactionlistener(this); box.setpreferredsize(new dimension(20,20)); box.sethorizontalalignment(jtextfield.center) jpanel s3 = new jpanel(new borderlayout()); //this holds 3 panels below jpanel restart = new jpanel(new borderlayout()); //this holds button jpanel leave = new jpanel(new borderlayout()); //also holds button //the next holds jlabel , textfield jpanel middle = new jpanel(new flowlayout(flowlayout.center,20,0)); jlabel j2 = new jlabel("enter guess!"); middle.add(j2); middle.add(box); restart.add(again,borderlayout.south); leave.add(ext,borderlayout.south); //adding 3 panels s3 s3.add(middle,borderlayout.center); s3.add(restart,borderlayout.west); s3.add(leave,borderlayout.east); } }

you can request textfield focused calling requestfocusinwindow. invoke 1 time frame containing textfield visible:

box.requestfocusinwindow();

java swing cursor focus jtextfield

webrtc - webrtc2sip + sipml5 + asterisk no audio issue -



webrtc - webrtc2sip + sipml5 + asterisk no audio issue -

i having problem in having sipml5 phone call other sipml5 via webrtc2sip , asterisk.

i have installed configured asterisk(version 11.10.0) + webrtc2sip(latest) + sipml5(chrome version 30.0.1599.66) phone call 1 box other on websocket.

i can create sip phone call through , reply other side seems there no audio/voice packets gets exchanged evident rtp , sip debug log , tcpdump.

asterisk , users on separate servers , found sip phone call it's sound packet not appear.

i've created 2 users(1060 , 1061) , when create phone call these asterisk response.

rtp set debug on rtp debugging enabled *cli> == spawn extension (default, 1060, 1) exited non-zero on 'sip/1061-00000000' == using sip rtp cos mark 5 -- executing [1060@default:1] dial("sip/1061-00000002", "sip/1060") in new stack == using sip rtp cos mark 5 -- called sip/1060 -- sip/1060-00000003 ringing -- sip/1060-00000003 answered sip/1061-00000002

asterisk settings are..

sip.conf

[general] port=5060 bindaddr=0.0.0.0 context=default transport=ws,wss,udp srvlookup=yes

users.conf

[1060] type=peer username=1060 host=dynamic secret=1234 context=default disallow=all allow=ulaw transport=udp,ws,wss encryption=yes avpf=yes icesupport=yes nat=yes,force_rport [1061] type=peer username=1061 host=dynamic secret=1234 context=default encryption=yes avpf=yes icesupport=yes nat=yes disallow=all allow=ulaw transport=udp,ws,wss

extensions.conf

[general] static=yes writeprotect=no [default] exten=>1060,1,dial(sip/1060) exten=>1061,1,dial(sip/1061)

rtp.conf

[general] icesupport=yes stunaddr=stun.l.google.com:19302 strictrtp=no rtcpinterval=6000 rtpchecksums=no

i can hear dialling sound on 1 end , ringing on other end phone call connected, can't hear anything.

could kindly help please.. very desperate.. in advance!

remove avpf option, not needed when using webrtc2sip. if still no voice - check sipml5 log (firefox or chrome debug console ) while sip registration , while call.

asterisk webrtc

windows installer - Detecting MajorUpgrade in Wix 3.8 -



windows installer - Detecting MajorUpgrade in Wix 3.8 -

i installing new versions of software major upgrades, installations little , of time, files alter anyway.

i skip 1 dialog in installer, if upgrade compared fresh installation done, far have failed figure out conditional (like "installed , patch") in next illustration use.

<publish dialog="verifyreadydlg" control="back" event="newdialog" value="welcomedlg" order="2">installed , patch</publish>

you need show major upgrade element or upgrade elements in wix details, way observe you're doing upgrade utilize upgrade property name. name previousversionsinstalled, if used majorupgrade elements sets property called wix_upgrade_detected.

http://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html

that means status in dialog be:

not wix_upgrade_detected

if want suppress dialog. don't want patch because not doing @ related patches.

wix windows-installer wix3 major-upgrade

ubuntu - Unable to access web2py server running in EC2 instance -



ubuntu - Unable to access web2py server running in EC2 instance -

i set web2py server on amazon ec2 instance (ubuntu), can't reach though on personal machine. can reach apache it. here steps took:

this 1 step deployment web2py website

wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh chmod +x setup-web2py-ubuntu.sh sudo ./setup-web2py-ubuntu.sh

edited ec2 inbound traffic rules take traffic on port 8000 , 80

then run sudo python web2py.py , add together password when prompted , prints out it's running.

i take public dns server aws management console , append port(8000) domain name.

i checked i'm listening on appropriate ports.

i tried start web2py.py with

sudo python web2py.py --ip 0.0.0.0 -p 8000

in order listening on available ips on port 8000. tells me check 127.0.0.1:8000. wonder if it's still not picking requests public ip ec2 gives you.

it's simple missed, thanks!

to troubleshoot this, install lynx text-based browser on ec2 machine, while ssh'ed machine seek lynx http://127.0.0.1:8000. give thought whether problem in network / security configuration or web2py server configuration.

ubuntu amazon-web-services amazon-ec2 web2py

c# - I want to get name of focused textbox controls that I created at run-time in WP 8.1 -



c# - I want to get name of focused textbox controls that I created at run-time in WP 8.1 -

i adding got focus event mytextboxes when create them

`textbox xi = new textbox(); xi.name = "x" + i.tostring(); xi.width = 10; xi.height = 10; xi.gotfocus += xi_gotfocus;`

but can't focused control's name

void xi_gotfocus(object sender, routedeventargs e) { throw new notimplementedexception(); }

is there way name of these controls ? give thanks you

you can utilize below mentioned code

void xi_gotfocus(object sender, routedeventargs e) { textbox t = sender textbox; string name = t.name; }

c# wpf focus windows-phone-8.1

c# - In Entity Framework where should you check if the user has permission to Get or Set the data in DbSet/DbContext? -



c# - In Entity Framework where should you check if the user has permission to Get or Set the data in DbSet/DbContext? -

i have model in mvc looks

public class pdffile { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int id { get; set; } public string info { get; set; } //this bytearray of pdf file public int datacount { get; set; } public datetime created { get; set; } public datetime lockedon { get; set; } public string createdby { get; set; } public string securityinfo { get; set; } // xml check security level public string usergroup { get; set; } }

and in dbcontext have

public dbset<pdffile> pdfset { get; set; }

and in identity model have variable usergroup

public string usergroup { get; set; }

now in controller everytime have check if user has permission access pdf file have do

[authorize] [nousergroupnoaccess] // custom filter ensure user has usergroup & not null or empty public actionresult sendsingleitem(int? id) { var model = db.pdfset.find(id); if (model != null && model.usergroup == user.usergroup) { homecoming view(model); } homecoming null; }

now imagine scenario everytime have access model either edit details, delete etc have check

if (model.usergroup == user.usergroup) // plus have check xml in secureinfo individual each user when editing or deleting

for lists have do

var dblist = db.pdfset.tolist(); dblist = dblist.where(u => u.usergroup == user.usergroup).tolist();

this makes controller code ugly , hard debug on error there way can these checks in dbcontext straight when editing, creating, deleting, accessing record?

i not sure if right method security check users.

i agree makes code ugly , hard maintain it's not thought coupling info access cross cutting concerns. consider using role. create role , determine role has access part of application assign user role. create role , name pdfaccess , utilize authorize attribute role:

[authorize("pdfaccess")] [nousergroupnoaccess] public actionresult sendsingleitem(int? id)

c# asp.net-mvc entity-framework

python - Getting UnicodeDecodeError when using virtualenvwrapper -



python - Getting UnicodeDecodeError when using virtualenvwrapper -

im trying create virtual environment mkvirtualenv command , getting error:

unicodedecodeerror: 'ascii' codec can't decode byte 0xc2 in position 15: ordinal not in range(128)

thanks

python ascii virtualenvwrapper

.net - IIS Express on Windows 8: error with user NT AUTHORITY\SYSTEM -



.net - IIS Express on Windows 8: error with user NT AUTHORITY\SYSTEM -

i have windows service (.net) runs batch file start iis express. windows service runs scheme user.

batch file

cd "c:\program files (x86)\iis express" iisexpress /config:"c:\...\iis express config\x64_applicationhost.config"

with os <= win7: good. iis express works perfectly.

now same windows service + iis express must run on win 8.1 , win 2012 server. windows service fine, can run batch file , iis express starts. when browse .net web application error:

the current identity (nt authority\system) not have write access 'c:\windows\microsoft.net\framework\v4.0.30319\temporary asp.net files'

the window service runs batch file follows:

dim processinfo processstartinfo processinfo = new processstartinfo("c:\...\iisexpressstart.bat") processinfo.createnowindow = false process.start(processinfo)

my question is: how can run iis express network service batch file? depends on how start iis express or on iis express configuration? idea?

it seems iis express inherits service's user. changing service's user not option.

the problem caused missing aspnet_regiis:

c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regiis -ga "nt authority\system"

.net windows batch-file windows-services iis-express

javascript - node.js express 4.4 upload file to generated folder -



javascript - node.js express 4.4 upload file to generated folder -

what best way upload file in node.js using express 4.4.1 dynamically generated folder?

something like: /uploads/john/image.png, uploads/mike/2.png

use formidable upload files on website.

npm install formidable@latest

javascript node.js express upload

math - How can I detect if two polygons have the same shape? -



math - How can I detect if two polygons have the same shape? -

i check if 2 polygons (number of vectors unclear) have same shape. without rotations easy, how do rotated polygons? need know rotation angle, too.

boolean polygonshavesameshape(pvector[] polygon1, pvector[] polygon2){ … } float getrotationangle(pvector[] polygon1, pvector[] polygon2){ … }

with little number of vertices might worth checking distances between each vertex , others.

in square illustration dist(p1,p2), dist(p1,p3), dist(p1,p4), dist(p2,p3), dist(p2,p4) , dist(p3,p4). these values exist each polygon. there point has same distance set p1, , p2, , on.

once have vertex in 1 polygon distances connected same in sec polygon can utilize 1 of lines determine angle of rotation.

hope made sense.

math rotation geometry processing polygon

php - why an element is posted eventhough its unchecked? -



php - why an element is posted eventhough its unchecked? -

i using yii, want to submit form action. in action checkbox posted eventhough didn't checked it, , value of 1 always, here code:

<?php echo chtml::beginform(yii::app()->createurl('jobs/index2'), 'post'); ?> <div class="row"> <div class="col-sm-4 col-lg-3 blog-sidebar" > <div class="sidebar-module"> <h4 style="color:#d11f45">refine search</h4> <h4>division</h4> <div id="division"> <?php $i = 0; foreach ($model2 $m2){ if($m2['category']==('division')){ echo '<div class="checkbox"><label>'. chtml::checkbox("c".$i, false).$m2->tag .'</label></div>'; $i++; } } ?> </div> <hr> <h4>location</h4> <div id="location"> <?php foreach ($model2 $m2){ if($m2['category']=='location'){ echo '<div class="checkbox"><label>'. chtml::checkbox("c".$i, false, array('value'=>'hhhhhhhhhhh', 'uncheckvalue'=>'n')).$m2->tag .'</label></div>'; $i++;} } ?> </div> <hr> <?php echo chtml::ajaxsubmitbutton( 'search', array('jobs/index2'), array( 'update'=>'#jobslist', ) ); ?> </div> </div><!-- /.blog-sidebar --> <?php echo chtml::endform(); ?> <div class="col-sm-8 col-lg-9 blog-main" id="jobslist"> <?php echo $this->renderpartial('_index', array('model'=>$model)); ?> </div> </div> </div> </div> <script src="<?php echo yii::app()->request->baseurl; ?>/js/j.js"></script>

browser source:

<div class="span-19"> <div id="content"> <div class="row" style="border-top:thin #333 solid"> <img src="/patra/images/job-banner.jpg" width="100%"> </div> <form action="/patra/index.php/jobs/index2" method="post"> <div class="row"> <div class="col-sm-4 col-lg-3 blog-sidebar"> <div class="sidebar-module"> <h4 style="color:#d11f45">refine search</h4> <h4>division</h4> <div id="division"> <div class="checkbox"><label><input type="hidden" value="n" name="accouting"><input value="hhhhhhhhhhh" type="checkbox" name="accouting" id="accouting">accouting</label></div><div class="checkbox"><label><input type="hidden" value="n" name="finance"><input value="hhhhhhhhhhh" type="checkbox" name="finance" id="finance">finance</label></div><div class="checkbox"><label><input type="hidden" value="n" name="insurance"><input value="hhhhhhhhhhh" type="checkbox" name="insurance" id="insurance">insurance</label></div><div class="checkbox"><label><input type="hidden" value="n" name="hr training"><input value="hhhhhhhhhhh" type="checkbox" name="hr training" id="hr_training">hr training</label></div><div class="checkbox"><label><input type="hidden" value="n" name="information technology"><input value="hhhhhhhhhhh" type="checkbox" name="information technology" id="information_technology">information technology</label></div> </div> <hr> <h4>location</h4> <div id="location"> <div class="checkbox"><label><input type="hidden" value="n" name="lebanon"><input value="hhhhhhhhhhh" type="checkbox" name="lebanon" id="lebanon">lebanon</label></div><div class="checkbox"><label><input type="hidden" value="n" name="uae"><input value="hhhhhhhhhhh" type="checkbox" name="uae" id="uae">uae</label></div><div class="checkbox"><label><input type="hidden" value="n" name="saudi arabia"><input value="hhhhhhhhhhh" type="checkbox" name="saudi arabia" id="saudi_arabia">saudi arabia</label></div><div class="checkbox"><label><input type="hidden" value="n" name="united kingdom"><input value="hhhhhhhhhhh" type="checkbox" name="united kingdom" id="united_kingdom">united kingdom</label></div><div class="checkbox"><label><input type="hidden" value="n" name="united states"><input value="hhhhhhhhhhh" type="checkbox" name="united states" id="united_states">united states</label></div><div class="checkbox"><label><input type="hidden" value="n" name="eygpt"><input value="hhhhhhhhhhh" type="checkbox" name="eygpt" id="eygpt">eygpt</label></div><div class="checkbox"><label><input type="hidden" value="n" name="mohammad"><input value="hhhhhhhhhhh" type="checkbox" name="mohammad" id="mohammad">mohammad</label></div><div class="checkbox"><label><input type="hidden" value="n" name="hiiiiiiii"><input value="hhhhhhhhhhh" type="checkbox" name="hiiiiiiii" id="hiiiiiiii">hiiiiiiii</label></div><div class="checkbox"><label><input type="hidden" value="n" name="bvbvbvbvbv"><input value="hhhhhhhhhhh" type="checkbox" name="bvbvbvbvbv" id="bvbvbvbvbv">bvbvbvbvbv</label></div><div class="checkbox"><label><input type="hidden" value="n" name="tststststststs"><input value="hhhhhhhhhhh" type="checkbox" name="tststststststs" id="tststststststs">tststststststs</label></div> </div> <hr> <h4>status</h4> <div class="checkbox"><label><input type="hidden" value="n" name="permanent"><input value="hhhhhhhhhhh" type="checkbox" name="permanent" id="permanent"> permanent</label></div> <div class="checkbox"><label><input type="hidden" value="n" name="temporary"><input value="hhhhhhhhhhh" type="checkbox" name="temporary" id="temporary"> temporary</label></div> <hr> <h4>hours</h4> <div class="checkbox"><label><input type="hidden" value="n" name="fulltime"><input value="hhhhhhhhhhh" type="checkbox" name="fulltime" id="fulltime"> full-time</label></div> <div class="checkbox"><label><input type="hidden" value="n" name="parttime"><input value="hhhhhhhhhhh" type="checkbox" name="parttime" id="parttime"> part-time</label></div> <div class="checkbox"><label><input type="hidden" value="n" name="flexible"><input value="hhhhhhhhhhh" type="checkbox" name="flexible" id="flexible"> flexible</label></div> <hr> <h4>salary</h4> <div id="salary"> <select class="form-control" name="s" id="s"> <option value="">select salary</option> <option value="1000$">1000$</option> <option value="2000$">2000$</option> <option value="3000$">3000$</option> <option value="4000$">4000$</option> <option value="5000$">5000$</option> <option value="6000$">6000$</option> <option value="7000$">7000$</option> <option value="8000$">8000$</option> <option value="9000$">9000$</option> </select> </div> <input type="submit" name="yt0" value="search" id="yt0"> </div> </div><!-- /.blog-sidebar -->

why checkboxes posted action? , why thier values 1?

your code contains hidden elements, it's not clear why think need them:

<input type="hidden" value="n" name="hr training"> <input value="hhhhhhhhhhh" type="checkbox" name="hr training" id="hr_training">

each of hidden elements uses exact same name checkbox element.

the post array uses name attributes if 2 different elements share same name, post array not going create much sense. in other words, when see "hr training" in post array, how know if that's hidden element or checkbox?

each input should have unique name. "grouping" of radio/checkboxes exception , that's because grouping considered single info point.

example:

status: permanent or temporary? (note utilize of radio buttons because selection cannot both.)

<input type="radio" name="status" value="permanent" />: permanent <input type="radio" name="status" value="temporary" />: temporary

will give next results:

if "permanent" checked, info contain status=permanent if "temporary" checked, info contain status=temporary if neither checked, info not contain status @ all

meanwhile, demo browser source code shows problem describe not occuring. none of unchecked checkboxes part of serialized array.

http://jsfiddle.net/mhpvm/1/

php ajax post checkbox yii

rpmbuild - spec file requires rpm-build... change requires dependent on os-release? -



rpmbuild - spec file requires rpm-build... change requires dependent on os-release? -

i'm building spec file requires /usr/bin/rpmbuild installed. under opensuse13.1 simple: add together line in spec file:

requires: rpm-build

and works nicely on opensuse13.1

yet when seek build , install bundle on opensuse12.1; not work, since binary /usr/bin/rpmbuild provided there bundle rpm , not bundle rpm-build.

how work around problem? didn't find virtual bundle both provide. note bundle rpm exists on opensuse13.1 , rpm-build depends on it.

you can use:

requires: /usr/bin/rpmbuild

rpmbuild build-dependencies

Facebook FQL friendslist_member is empty using Graph API v2.0 -



Facebook FQL friendslist_member is empty using Graph API v2.0 -

i'm using graph api explorer of permissions of personal fb account. when execute fql request:

select flid friendlist owner = me()

i list of flids. if execute:

select uid friendlist_member flid in (select flid friendlist owner = me())

i empty result, why?

if you're using graph api v2.0 or later, expected - names/ids of user's friendlists retrievable (for example, utilize in privacy selector) list of friends within lists not retrievable

this mentioned in documentation here: https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids

facebook-graph-api facebook-fql facebook-graph-api-v2.0

facebook - Stop receiving real time updates without an access_token -



facebook - Stop receiving real time updates without an access_token -

i'm trying stop receiving real time updates 1 specific page facebook application, have no user access token user or page.

in scenario, there anyway stop receiving real time updates page without having contact page owner , inquire them remove application tab page.

i have tried issuing delete request /<page_id>/tabs/app_<app_id> route off-course isn't working because need access_token this. tried using application token instead ( thought might have worked, unfortunately didn't. )

imho , according docs, need app access token stop realtime updates:

https://developers.facebook.com/docs/graph-api/reference/v2.0/app/subscriptions/#deleteperms

delete /{app-id}/subscriptions

with

object=page

as body.

facebook facebook-graph-api

bash - sed vs array vs variable -



bash - sed vs array vs variable -

have bash script contains 2 arrays:

names=( [0]=port_shutdown [1]=port_http [2]=port_https [3]=keystore_file [4]=key_alias [5]=keystore_pass [6]=truststore_file [7]=truststore_pass ) value=( [0]="$port_shutdown" [1]="$port_http" [2]="$port_https" [3]="$keystore_file" [4]="$key_alias" [5]="$keystore_pass" [6]="$truststore_file" [7]="$truststore_pass" )

and variables:

port_shutdown="8008" port_http="8046" port_https="8446" keystore_file="tomcat.jks" key_alias="tomcat" keystore_pass="password" truststore_file="trustcacerts.jks" truststore_pass="password"

run in loop:

while [ "$i" -lt "11" ]; name="${names[${i}]}" value="${value[${i}]}" echo -e "changing name - "$name" value "$value";\n" sed 's|'"${name}"'|'"${value}"'|g' "server.xml.default" > "server.xml" (( i++ )) done

but doesn't alter names... although - see values in variables:

$ ./config.sh changing name - port_shutdown value "8008"; changing name - port_http value 8046; changing name - port_https value 8446; changing name - keystore_file value tomcat.jks; changing name - key_alias value tomcat; changing name - keystore_pass value password; changing name - truststore_file value trustcacerts.jks; changing name - truststore_pass value password;

if set illustration name="port_shutdown" , value="8008" - works good...

what i'm doing wrong here?

try maybe

sed "s|${name}|${value}|g" "server.xml.default" > "server.xml"

but missign delimiter (ex: port_http alter port_https if array name in order)

bash loops sed

Python : Loop structure occurs error like "list indices must be integers, not tuple" -



Python : Loop structure occurs error like "list indices must be integers, not tuple" -

uil=[[1], [2], [3, 3, 1], [2, 3], [1], [2]] in uil: j in uil[i]: print(uil[i][j])

it reports error that: "list indices must integers, not tuple".

however, not work if add together int() uil[i]. btw, hope code simplified 1 line , more efficient process 1 1000000 tuples.

how can revise it?

i not in index, the nested list itself. loop straight on it. same j:

for in uil: j in i: print(j)

the python for statement for each construct.

if want process each nested value in sequence, no reference grouping lists, utilize itertools.chain.from_iterable() 'flatten' list:

from itertools import chain j in chain.from_iterable(uil): print(j)

python indices

sql - PostgreSQL conforms to Codds rules? -



sql - PostgreSQL conforms to Codds rules? -

does have references read regarding whether postgresql conforms 12 of codd's rules?

if not, there veteran postgresql users have sentiment on topic?

thank you.

my reply based on other answers via google.

in 1986 created first ansi standard of sql language. lastly ansi standard ansi sql:2003. it's requirements nevertheless implemented in few rdbmss. far widespread rdbmss respect ansi sql:1999, respectively older ansi sql:1992. postgresql supports ansi sql:1999 , partly ansi:2003.

if strictly speaking codd's rules:

codd's 12 rules aren't relational model. in fact, expanded these 12 40 rules in 1.990 book _the_relational_model_for_database_management.

but furthermore, if care read christopher j date's 1.999 _an_introduction_to_database_systems_ see relational model comprises basic elements , principles.

the basic element domain, or info type. postgresql not enforces domains because accepts null, definition not part of domain. triplet domain, name , value called attribute breaks down, , tuple -- because represents proposition, , proposition missing info proposition, not 1 declared in relation's header --, , relation breaks down.

furthermore, relation set, not bag. handbag accepts duplicates, not relation. because postgresql not enforce necessity of declaring candidate key each , every table, tables not relations, quite perchance , commonly bags of not tuples shown above, rows.

also, first principle info principle, database must represented data. object ids violate this, serious consequences info independence, way necessary relational model sine qua non, namely separation between user, logical , physical schemas. not supported postgresql.

sql database postgresql rules

mysql - Perform multiple SQL queries with PHP -



mysql - Perform multiple SQL queries with PHP -

i have web form should store info 2 different tables in database. in includes, have php file performs necessary queries. web form should store 2 pieces of information: xp value beingness submitted form users table, , article id completed_quests table. individually, queries work should. however, if seek perform both queries together, first query performed , sec 1 ignored. how create both queries run 1 time user hits submit button?

(edit) have updated code. clarify, there other code in php file defines variables used in these queries. these 2 queries trying run , needed know how run both queries seemed ignoring sec 1 (the update). working, running issue of insert query creating duplicate entries.

(edit) have updated code again. used on duplicate key update avoid duplicate entries in table. made sure user id primary key in table , functioning perfectly.

mysql_select_db("questroot_joomla", $con); mysql_query("insert arp2i_completed_quests (user_id, content_id) values ($userid, $currentarticle) on duplicate key update content_id=$currentarticle"); mysql_query( "update arp2i_users" . " set userxp= $userxp" . " id = $userid"); mysql_close($con);

$sql = "insert `arp2i_completed_quests` (`user_id`, `content_id`) values ('$_post[current_user]', '$_post[current_article]')"; /* it's not in $sql ->> */ "update `arp2i_users` set `userxp`= '$_post[xpvalue]' `id` = '$_post[current_user]'";

try this:

$sql = "insert `arp2i_completed_quests` (`user_id`, `content_id`) values ('$_post[current_user]', '$_post[current_article]'); update `arp2i_users` set `userxp`= '$_post[xpvalue]' `id` = '$_post[current_user]'";

php mysql sql sql-server joomla

angularjs - different nvD3 approaches -



angularjs - different nvD3 approaches -

as relatively new nvd3, confused different nvd3 code notations coming across, can 1 help me understand better.

the nvd3 code samples follows:

aprroach#1: html : <div id="chart"> <svg></svg> </div> script : nv.addgraph(function() { var chart = nv.models.linechart() .useinteractiveguideline(true) ; chart.xaxis .axislabel('time (ms)') .tickformat(d3.format(',r')) ; chart.yaxis .axislabel('voltage (v)') .tickformat(d3.format('.02f')) ; var data=sinandcos(); d3.select('#chart svg') .datum(sinandcos()) .transition().duration(500) .call(chart) .selectall('.nv-y text') .attr('x',-15) ; homecoming chart; }); approach #2 : html : <body ng-controller="mainctrl"> <nvd3 options="options" data="data"></nvd3> </body> script : var app = angular.module('myapp', ['nvd3']); app.controller('mainctrl', function($scope, $compile) { $scope.options = { chart: { type: 'linechart', height: 450, margin : { "top": 20, "right": 20, "bottom": 40, "left": 55 }, x: function(d){ homecoming d[0]; }, y: function(d){ homecoming d[1]; }, usevoronoi: false, clipedge: true, transitionduration: 2000, useinteractiveguideline: true, xaxis: { tickformat: function(d) { homecoming d3.time.format('%x')(new date(d)) }, showmaxmin: false }, yaxis: { tickformat: function(d){ homecoming d3.format('.02f')(d); } } } }; $scope.data = [....] });

in approach #1, don't see angular js controllers concept , in approach #2, don't see chart drawing calls below draw chart d3.select('#chart svg') .datum(sinandcos()) .transition().duration(500) .call(chart) .selectall('.nv-y text') .attr('x',-15)

in approach#2, if want add together 4 charts in single page, below, how can it? can 1 point reference code this?

chart1# chart2# chart3# chart4#

i believe confusing nvd3 library (#1) library such angular-nvd3 built on top of nvd3 library (#2).

to add together 4 charts page, create 4 containers in arrangement want , repeat nv.addgraph each of them add together graphs.

the approach #1 like:

html : <div id="chart1"> <svg></svg> </div> <div id="chart2"> <svg></svg> </div> <div id="chart3"> <svg></svg> </div> <div id="chart4"> <svg></svg> </div> script : nv.addgraph(function() { ... d3.select('#chart1 svg') ... } nv.addgraph(function() { ... d3.select('#chart2 svg') ... } nv.addgraph(function() { ... d3.select('#chart3 svg') ... } nv.addgraph(function() { ... d3.select('#chart4 svg') ... }

angularjs d3.js nvd3.js

Return Key method in UIInputViewController in iOS8? -



Return Key method in UIInputViewController in iOS8? -

i developing custom keyboard keyboard extension in ios8.

i can dismiss keyboard next method.

[self dismisskeyboard];

however above method dismiss keyboard. want homecoming method can go or search can utilize both dismiss , go event ios built in keyboard.

how can it?

you can utilize [self.textdocumentproxy inserttext:@"\n"];

ios8 uiinputviewcontroller

osx - Launch at startup and Mac App Store -



osx - Launch at startup and Mac App Store -

i've read lots of articles creating helper tools lsuielement , have them added loginitems using smloginitemsetenabled.

what want know is, allowed add together main app loginitems instead of creating helper? (and main app run lsuielement shows in status bar.)

since features in helper , main app launcher, due sandbox can't validate receipt within helper, can't prevent people start helper directly.

and if it's allowed (i have seem such app not sure how did it, such "flamingo"), how add together loginitems without have should downwards when toggle settings? smloginitemsetenabled terminate app when pass false.

thanks.

osx cocoa app-store sandbox appstore-approval

asp.net - WebApi cannot get PUT to work -



asp.net - WebApi cannot get PUT to work -

im testing webapi web service on local machine. cant set work. have next response service:

http/1.1 405 method not allowed cache-control: no-cache pragma: no-cache allow: get,post content-type: application/json; charset=utf-8 expires: -1 server: microsoft-iis/8.0 x-aspnet-version: 4.0.30319 x-sourcefiles: =?utf-8?b?qzpcvxnlcnncshzhcnjlz2fhcmrcrg9jdw1lbnrzxeryb3bib3hcr3jlzw5xzwjcs3vuzgvyxe1hzhmgtw9nzw5zamo4alxetezcrexgu2vydmljzvxeteztzxj2awnlxgfwavxhy3rpb25wbgfuywn0aw9u?= x-powered-by: asp.net access-control-allow-origin: * access-control-allow-methods: get,put,post,delete,options access-control-allow-headers: content-type date: tue, 24 jun 2014 06:55:02 gmt content-length: 72 {"message":"the requested resource not back upwards http method 'put'."}

i have added cors nuget bundle , has next setup:

public static class webapiconfig { public static void register(httpconfiguration config) { // web api configuration , service //enable cross origin requests (cors) var cors = new enablecorsattribute("*", "*", "*"); config.enablecors(cors); // web api routes config.maphttpattributeroutes(); config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}/{secondid}", defaults: new { id = routeparameter.optional, secondid=routeparameter.optional } ); //configures homecoming json if request accepts text/html config.formatters.jsonformatter.supportedmediatypes.add(new mediatypeheadervalue("text/html")); } }

my web.config looks (its bits , pieces found around so):

<system.webserver> <validation validateintegratedmodeconfiguration="false" /> <handlers> <remove name="extensionlessurlhandler-isapi-4.0_32bit" /> <remove name="extensionlessurlhandler-isapi-4.0_64bit" /> <remove name="extensionlessurlhandler-integrated-4.0" /> <add name="extensionlessurlhandler-isapi-4.0_32bit" path="*." verb="get,head,post,debug,put,delete,patch,options" modules="isapimodule" scriptprocessor="%windir%\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll" precondition="classicmode,runtimeversionv4.0,bitness32" responsebufferlimit="0" /> <add name="extensionlessurlhandler-isapi-4.0_64bit" path="*." verb="get,head,post,debug,put,delete,patch,options" modules="isapimodule" scriptprocessor="%windir%\microsoft.net\framework64\v4.0.30319\aspnet_isapi.dll" precondition="classicmode,runtimeversionv4.0,bitness64" responsebufferlimit="0" /> <add name="apiuris-isapi-integrated-4.0" path="/security/*" verb="get,post, put, delete" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0"/> <add name="settingshandler" path="/api/settings/*" verb="*" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0"/> <add name="sendhandler" path="/send/*" verb="get" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0"/> <remove name="extensionlessurlhandler-integrated-4.0"/> <remove name="optionsverbhandler"/> <remove name="traceverbhandler"/> <add name="extensionlessurlhandler-integrated-4.0" path="*." verb="*." type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0"/> </handlers> <httpprotocol> <customheaders> <add name="access-control-allow-origin" value="*" /> <add name="access-control-allow-methods" value="get,put,post,delete,options" /> <add name="access-control-allow-headers" value="content-type" /> </customheaders> </httpprotocol> <modules runallmanagedmodulesforallrequests="false"> <remove name="webdavmodule" /> </modules> </system.webserver>

it seems not allow me send put, , post. cant figure out how enable set command.

asp.net asp.net-web-api