Posts

Showing posts from August, 2011

c - Is sign magnitude used to represent negative numbers? -

i understand two's complement used represent negative number there method of using sign magnitude. sign magnitude still used represent negative numbers? if not used then? , how machine interprets negative numbers using two's complement able communicate , understand machine uses sign magnitude instead? yes, sign magnitude used today, though not might expect. example, ieee floating point uses single "sign" bit denote positive or negative. (as result, ieee floating point numbers can -0.) sign magnitude not commonly used today integers, however. communication between 2 machines using different number representations presents problem if both try use native encoding format. if common format defined exchanging information, there no problem. example, machine uses two's complement can construct number using sign magnitude encoding (and vice versa). these days, different machines more communicate using ascii representation of number (eg. in json or xml), or...

r - as.character(as.Date()) returns NA in shiny datatable -

the following code works in datatable display: observe({ if (!any(input$date == "na")) { dates <- isolate(as.date(dataset$data[, input$date], format = input$dateformat)) } if (!any(input$date == "na")) { dataset$data[, input$date] <- dates } however, dataset$date (date column) saved in date format. want save in character format. here's attempt: observe({ if (!any(input$date == "na")) { dates <- isolate(as.date(dataset$data[, input$date], format = input$dateformat)) } if (!any(input$date == "na")) { dataset$data[, input$date] <- as.character(dates) } this gives me na values date column. thoughts on how fix appreciated. p.s. i'm not sure if isolate needed in case, latest attempt, i've tried different versions such basic as.character(as.date())

jinja2 - How to use Erlang configuration files with Python J2 template? -

i deploy ansible configuration files following way: - name: deploying test configuration template: src={{ item }}.j2 dest={{ basho_bench_home_dir }}/conf/{{ item }} sudo: yes with_items: - http_fix_1min.conf.template - http_max_1min.conf the files have lines these: {mode, max}. {duration, 1}. {concurrent, 32}. this breaks j2 rendering: fatal: [192.168.99.135] => {'msg': "ansibleerror: file: roles/basho_bench/templates/http_fix_1min.conf.template.j2, line number: 24, error: expected token 'end of print statement', got 'content'", 'failed': true} fatal: [192.168.99.135] => {'msg': 'one or more items failed.', 'failed': true, 'changed': false, 'results': [{'msg': "ansibleerror: file: roles/basho_bench/templates/http_fix_1min.conf.template.j2, line number: 24, error: expected token 'end of print statement', got 'content'", 'failed': t...

c++ - passing member-function as argument to function-template -

consider 3 ways implement routine in c++: through functors, member functions, , non-member functions. example, #include <iostream> #include <string> using std::cout; using std::endl; using std::string; class foo { public: void operator() (string word) // first: functor { cout << word << endl; } void m_function(string word) // second: member-function { cout << word << endl; } } functor; void function(string word) // third: non-member function { cout << word << endl; } now consider template-function call 3 functions above: template<class t> void eval(t fun) { fun("using external function"); } what proper way call foo::m_function through eval? tried: functor("normal call"); // ok: call ‘void foo::operator()(string)‘ eval(functor); // ok: instantiation of ‘void eval(t) [with t = foo]’ function("normal...

linux - Using the contents of a file as a perl argument -

i trying followng perl something.pl -t happiness=longstring where longstring long (150,000 chars). long enough following message: "oserror: [errno 7] argument list long" i figured instead there way redirect output of file. have not succeeded in doing however. what looking along lines of: perl something.pl -t happiness=<<<file.txt where file.txt contains bunch of text. have struggled in < or <<< treated literally perl script , pushing '=<< perl something.pl -t happiness file.txt your first argument happiness (assuming word, otherwise assign inside something.pl) , read file.txt separately, either 1 line @ time, or slurp whole thing (though not recommended 150k+ characters) , process normally. the idea behind redirecting of output becomes moot when have access source of script -- people redirect output things gnu tools (ie 'df -h') because can't (easily) edit tool's source code bidding.

c# - How can i bypass CORS Policy with ASP.NET and Ajax? -

i want bypass cors policy get data xml domain. try have no luck. there are: jsonp : way, don't know how use it. because xml construction difference jsonp construction. if yes, please me how use jsonp data xml domain. proxy : cause of project asp.net framework 4.0. so, create proxy page , use xml. example: http://localhost:4030/proxy.aspx?u=http://onotherdomain.com/data.xml . can't data basic protected site. it's allways return 401 unauthorized. for you, jsonp faster or proxy faster ? thanks watching ? if other domain not explicitly trust you, cannot invoke client via ajax security reasons unless use jsonp. however, can use jsonp long sticking requests , server knows how respond jsonp-formatted response. on other hand, if explicitly trust you, have few options. cors support on server long using modern browsers (ie9 still has issues this) appropriate headers. xdomain , javascript proxy shim. however, requires explicit request domain inclusi...

android crash report (cordova/crosswalk) -

hi i'm gettings crash report store. it's not devices, (rare). 1 know problem this? my app built cordova/crosswalk android app. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** build fingerprint: 'samsung/ms013gxx/ms013g:4.4.2/kot49h/g7102xwubnk1:user/release-keys' revision: '7' pid: 2574, tid: 2604, name: workerpool/2604 >>> com.myapp.id <<< signal 11 (sigsegv), code 2 (segv_accerr), fault addr 73d4b2e0 r0 7c3ee878 r1 402862e8 r2 fffff320 r3 4024a679 r4 73d8b330 r5 7c3ee878 r6 402862e8 r7 40136394 r8 00000000 r9 7baadb78 sl 00000001 fp 00000000 ip 00000000 sp 73d4b2e8 lr 405945ff pc 4024a678 cpsr 00070030 d0 0000000000000000 d1 0000000000000000 d2 0000000000000000 d3 0000000000000000 d4 4020000000000000 d5 bebbb63036c79c05 d6 0000014072bea4d0 d7 43a0000000000140 d8 000000003f800000 d9 0000000000000000 d10 0000000000000000 d11 0000000000000000 d12 0000000000000000 d13 0000000000000000 d14 0000000000000000 d15 0000000000000...

Is there any way to send arguments/values to Robot test cases from jenkins? -

i have automated test takes input user , runs test. idea on if can give argument jenkins robot testcase , run test? ex: scenario: test if lighting device works or not. steps: 1. ssh login light device, 2. run predefined set of commands, 3. verify lighting_flag set 0 or 1, 4. ssh logout device in case, need take light device username , password input user. possible jenkins (build parameters) , run robot test case? please let me know. thanks, sthuthi you can use variables. example, user keyword connecting , logging in might like: connect device [arguments] ${host} open connection ${host} login ${username} ${password} now, provided jenkins parameters username , password , can use execute shell task this: pybot --variable username:[username] --variable password:[password] <path/to/tests> this sets global variables ${username} , ${password} test execution. more info in user guide .

c# - Using dependency injection to lazy load domain model properties -

i using repository pattern have data models behind repository return domain models. using dependency injection of this. problem is, let's have domain model student studentrepository. student may have properties on use in places, not others, example, courses: public class student { public int id { get; private set; } public string name { get; private set; } public student(int id, string name, ienumberable courses = null) { id = id; name = name; _courses = courses; } private ienumerable<course> _courses; public ienumerable<course> courses() { if(_courses == null) { // need way load courserepository _courses = courserepository.getcoursesbystudentid(id); } return _courses; } } therefore, want type of lazy loading set not know how can elegantly, , difficult me understand how can load implementation of courserepository (or icourserepository using di)...

typescript - How to type JSON results -

i convert js ts: class foo{ getsection() { return dataservice.getsection('home_page').then(data => { this.section(data.results[0]); //error here }); } } the compile time error message is: property 'results' not exist on type 'void'. data json result set, , results[0] simple first record. how type resolve error? the issue dataservice.getsection('home_page') being inferred return promise<void> , therefore data of type void . fix in dataservice : getsection(secname: string): promise<any> or stronger if don't want any . (some basic docs on annotations : http://basarat.gitbooks.io/typescript/content/docs/types/type-system.html )

Polymer 1.0 default icon set in iron-icons not working using blaze (meteor) templating engine -

after upgrading polymer 1.0, default iron-icons set not working. trying use home icon default icon set. html code fragment: <link rel="import" href="/components/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="/components/iron-icons/iron-icons.html"> <link rel="import" href="/components/iron-icons/communication-icons.html"> <link rel="import" href="/components/iron-form/iron-form.html"> <link rel="import" href="/components/iron-selector/iron-selector.html"> <link rel="import" href="/components/iron-pages/iron-pages.html"> <!-- ootb paper elements --> <link rel="import" href="/components/paper-drawer-panel/paper-drawer-panel.html"> <link rel="import" href="/components/paper-header-panel/paper-header-panel.html"...

c# - Most efficient (& fastest) way to query a list -

i'm trying work out performant way query list. know there ton of examples out there , has come loads before, i'm new , i'm struggling how apply of concepts situation. private static void keepmatchesbasedonrestrictions(ref list<entity> matches, list<entity> prefilteredshifts, list<entity> locationalinformations) { if (matches.count == 0) return; matches.removeall( (match) => ( geographyhasrestriction(match, prefilteredshifts, locationalinformations) ) ); } private static bool geographyhasrestriction(entity match, list<entity> prefilteredshifts, list<entity> locationalinformations) { entityreference fw = match.getattributevalue<entityreference>("crm_fw"); entity shift = prefilteredshifts.single<entity>( => match.getattributevalue<entityreference>("crm_shift").id == a.id ...

html - Why Google Tag Manager puts both display:none AND visibility:hidden on iframe? -

if take @ <noscript> part of google tag manager embed code, you'll notice like: <noscript><iframe style="display:none;visibility:hidden" src="//www.googletagmanager.com/..." height="0" width="0"></iframe></noscript> i can understand why style="display:none" important (it hide element such takes 0 space in layout , yet still fetches content) however, why add "visibility:hidden" part? seems me adds no additional value, i'm assuming there must edge case or legacy or mobile browser doesn't behave correctly without it. anyone know this? could thing make sure screenreaders don't ever tell it. looks people have found problematic otherwise on here: http://juicystudio.com/article/screen-readers-display-none.php#comment3 i haven't tested this, can't confirm of it, layout-wise should not make differences display:none instructs remove element layout together, maki...

I need a solution to rotating a bike so that the two wheels always sit on the terrain( y points) in python and am using pygame module -

i have project making random terrain , moving bike along it. terrain generates random displacement points , makes 2d map of mountains, etc. i have array of points , want make bike image either rotate or able placed or aligned 2 wheels equal 2 y points supposed be. for example if bike @ x=10 middle of bike , wheels 2 right , left want position bike align x=8 , x=12 , corresponding y points terrain array. i've looked around hard , have found nothing work. appreciated thank much. p.s. if u need script of part of project ask im using raspberry pi off it.

sitecore - How to know if save was clicked in Content Editor or Page Editor in saveUI processor -

i have saveui processor , want run code if user clicked save button in page editor. i've tried checking context like: sitecore.context.pagemode.ispageeditor but it's false. guess processor isn't in right context. how go checking click from? "sender" indicated in args somewhere? you should able correctly detect pagemode in sitecore context via if (sitecore.context.pagemode.ispageeditorediting) there options like ispageeditor ispageeditordesigning ispageeditorclassic if have in sitecore.context.pagemode namespace see options available can detect mode need. i believe older versions of sitecore (possibly 6.5 , below) there different properties. i recommend looking @ post additional information - https://www.sitecore.net/learn/blogs/technical-blogs/martina-welander-sitecore-blog/posts/2013/07/improving-the-page-editor-experience-part-3-detecting-page-mode.aspx

c# - Use variable from the method -

how can call string[] phpcorrect out of method? if there's easy solution such of easy, share , if there method closer windows.storage.fileio.readtextasync , share it. public async void readfile() { // settings var path = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php1.txt"; var path1 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php2.txt"; var path2 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php3.txt"; var path3 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php4.txt"; var path4 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php5.txt"; var path5 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php6.txt"; var path6 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcode\php7.txt"; var path7 = @"f:\designe- video\projects\phpgonehelp\phpgonehelp\phpcod...

javascript - Mapping object properties from one array to another -

i have 2 arrays (i'll call them thing1 , thing2 ), of same length, elements in different orders. the elements can matched each other based on target , source names associated each element. example matching elements each listed below: thing1[0].target object { name: "benthopelagics, large", parent: object, imports: array[7], tl: 3.717611213, b: 0.2… } thing1[0].source object { name: "outside", parent: object, imports: array[4], tl: 5.149219037, b: 0… } thing2[216] object {source: "benthopelagics, large", target: "outside", value: 0.05800000596} i'd copy "value" field thing2 thing1, being newcomer javascript, haven't been able figure out how matching of source , target names. can give me example of syntax required? loop through thing2. each iteration of thing2 loop through thing1 , search matching object properties. ( demo ) for(var = 0, j = thing2.length; < j; i++) { for(var k = 0, l...

c++ - Cannot find Chrome_OmniboxView -

i cannot find chrome_omniboxview. think name of chrome maybe change. code following cannot work anymore. please me. hwndchromemain = findmainwebbroswer(l"chrome_widgetwin_1"); // ok // buffer ::sendmessage(hwndchromemain, wm_gettext, 255, (lparam)buffer); // ok // saved buffer // find chrome child tab hwndchromechild = ::findwindowexw(hwndchromemain, null, l"chrome_omniboxview", null); // not ok the hwndchromechild null. this no longer possible of chrome version 28, omnibox no longer has hwnd. you need change way interacting omnibox. 1 way use microsoft automation framework. source: https://code.google.com/p/chromium/issues/detail?id=246644

Python Pandas: rolling_kurt vs. scipy.stats.kurtosis -

i trying figure out why following code returns different values sample's kurtosis: import pandas import scipy e = pandas.dataframe([1, 2, 3, 4, 5, 4, 3, 2, 1]) print "pandas.rolling_kurt:\n", pandas.rolling_kurt(e, window=9) print "\nscipy.stats.kurtosis:", scipy.stats.kurtosis(e) the output getting: pandas.rolling_kurt: 0 0 nan 1 nan 2 nan 3 nan 4 nan 5 nan 6 nan 7 nan 8 -1.060058 scipy.stats.kurtosis: [-1.15653061] i have tried play pearson vs fisher setting no avail. setting bias=false seems it: in [3]: scipy.stats.kurtosis(e,bias=false) out[3]: array([-1.06005831])

caching - php reading header into array from cached curl file -

this question has answer here: what type string? a:1:{s:2:“en”;} 3 answers i using zebra_curl / curl cache webpages cache folder, , i'm wanting access looks header information holds original url , other information inside need when processing cached files. at first thought json, , when using json_decode wasn't getting back, i've done bit of searching on internet, can find lots dumping cache file nothing reading cache file. below sample, have stripped actual html webpage out purpose of post. o:8:"stdclass":4:{s:4:"info";a:27:{s:12:"original_url";s:65:"http://www.amazon.co.uk/dp/b00oytaqam/ref=sr_1_1?m=a3p5rokl5a1ole";s:3:"url";s:65:"http://www.amazon.co.uk/dp/b00oytaqam/ref=sr_1_1?m=a3p5rokl5a1ole";s:12:"content_type";s:29:"text/html; charset=iso-8859-1";s:9:"htt...

Passing JavaScript variable to PHP on dropdown change -

i trying change text in div depending on value change on dropdown box. dropdown box values populated mysql using php. loading dropdown box on page load. <script> $(document).ready(function() { $('#products').change(function(){ var idval=$('#products').val(); $.ajax ( { type: "post", url: "my.php", data: {winner_id:idval}, success: function(response) { alert("the winner passed!")}, } ); <?php require_once 'config.php'; $iid=$_get['winner_id']; $sql="select * products prod_id = ".$iid; $result = mysql_query($sql); $row = mysql_fetch_array($result); $prodcredit="credit :".$row["prod_price"]; $time="estmated time :".$row["prod_time"]; ?> $('#esdtime').text(' <?php echo $prodcredit ?> ' ); $('#credit').text('...

web scraping - Web Scraper for dynamic forms in python -

i trying fill form of website http://www.marutisuzuki.com/maruti-price.aspx . it consists of 3 drop down lists. 1 model of car, second state , third city. first 2 static , third, city generated dynamically depending upon value of state, there onclick java script event running gets values of corresponding cities in state. i familiar mechanize module in python. came across several links telling me cannot handle dynamic content in mechanize. link http://toddhayton.com/2014/12/08/form-handling-with-mechanize-and-beautifulsoup/ in section " adding item dynamically " states can use mechanize handle dynamic content did not understand line of code in it item = item(br.form.find_control(name='searchauxcountryid'),{'contents': '3', 'value': '3', 'label': 3}) what "item" in line of code corresponding city field in form. came across selenium module might me handling dynamic drop down list. not able find in documentat...

Polymer 1.0 - Binding css classes -

i'm trying include classes based on parameters of json, if have property color, $= makes trick pass class attribute (based on polymer documentation ) <div class$="{{color}}"></div> the problem when i'm trying add class along existing set of classes, instance: <div class$="avatar {{color}}"></div> in case $= doesn't trick. way accomplish or each time add class conditionally have include rest of styles through css selectors instead classes? know in example maybe color simple go in style attribute, purely example illustrate problem. please, note issue in polymer 1.0. as of polymer 1.0, string interpolation not yet supported (it mentioned in roadmap). however, can computed bindings. example <dom-module> <template> <div class$="{{classcolor(color)}}"></div> </template> </dom-module> <script> polymer({ ... classcolor: function(color) { r...

server - Heroku, schedule new Dyno sleeptime -

with announcement of new dyno pricing on heroku had questions mechanics of new free dyno. i wondering if possible schedule sleep time dyno. way make sure application down while of users sleeping. no, not possible. app automatically sleep when doesn't requests 30 minutes, , awaken if request comes in. if have exceeded daily quota, app not awaken.

java.util.scanner - String sentinel on integer input Java -

i posted question example, different problem. came problem. when choose option 3(multiply) result zero. , if choose option 4, cannot divide zero(zero sentinel). how can make sentinel string or char when use int input numbers calculated? here code. import java.util.scanner; public class switchloopnumbers { public static void main(string[] args) { scanner scan = new scanner(system.in); int numbers = 0; int result = 0; int option; boolean quit = true; string done = ""; { system.out.println("calculator menu"); system.out.println("********** ****"); system.out.println("\n1. add"); system.out.println("2. substract"); system.out.println("3. multiply"); system.out.println("4. divide"); system.out.println(); system.out.print("enter...

jquery - Typeahead and screenreaders -

i using typeahead/bloodhound generate list content of database. bloodhound suggestions read screenreader when highlighted. have added few aria roles elements in attempt content read screen reader. however, when highlighted, screenreader silent. if add focus element, blodhound modal window closes, not work. what have far: var mytypeahead = $('.supersearch').typeahead({ highlight: true, autoselect: true }, { name: 'search-content', displaykey: 'title', source: content.ttadapter(), templates:{ header: '<h3 class="typeaheadtitle">filtering content...</h3>', empty: [ '<div class="noresults">', 'no results', '</div>' ].join('\n'), suggestion: handlebars.compile('<div class="searchlistitem"><a href="{...

r - Function or other basic script that compares values on two variables in a dataframe using an id variable located in both -

let's have 2 data frames, both of contain some, not of same records. same records, id variable in both data frames matches. there particular variable in each data frame needs checked consistency across data frames, , discrepancies need printed: d1 <- ## first dataframe d2 <- ## second dataframe colnames(d1) #column headings dataframe 1 [1] "id" "variable1" "variable2" "variable3" colnames(d2) #column headings dataframe 2 identical [1] "id" "variable1" "variable2" "variable3" length(d1$id) #there 200 records in dataframe 1 [1] 200 length(d2$id) #there not same number in dataframe 2 [1] 150 ##some function takes d1$id, matches d2$id, compares values of matched, returning discrepancies i constructed elaborate loop this, feel though not right way of going it. surely there better way for-if-for-if-if statement. for (i in seq(d1$id)){ ##sets counter loop if (d1$id[i] %in% d2$id){ ## sea...

c++ - Can function calls be reordered -

i using c++98. extent can function calls reordered? not using global state, state of objects local function. my particular case is: { raiitype t; object1.functioncall(); object2.functioncall(); } where object1 , object2 declared in next scope up. constructor t permitted reordered after either function call, assuming can trivially proven (at least human) there no dependencies between construction , function calls? in particular case, raii object used time execution of function calls. so long standards-compliant program not tell difference in observable behavior , compiler (as other components in system) may freely reorder instructions , operations likes.

python - how do i increase the min and max on my number list? -

i'm creating game in python ran trouble when creating level system. ya see attack created list 1(min) 10(max) , every level gains want min , max of list increase 1 how should if possible? i'm coding in python 3.2 char ={ 'atk':[1,10], 'hp':100, 'name': 'ruby', 'age': 1, 'weapon': 'scythe', 'lvl': 1, 'xp': 0, 'nextlvl': 50, 'stats': { 'str': 1, 'dex': 1, 'vit': 1 }} while char['xp'] >= char['nextlvl']: char['lvl'] += 1 char['nextlvl'] = char['nextlvl'] * 3 char['stats']['str'] +=1 char['stats']['dex'] +=1 char['stats']['vit'] +=1 char['atk'] +=1 <-- problems right here print('level:', char['lvl'],'exp:', char['xp'],'nextlvl:', char['...

excel - Can I use a variable to name other variables? -

i'm working on code requires lots of data stored , want write new data type these placed into. private sub commandbutton1_click() dim myfile string, text string myfile = application.getopenfilename() open myfile input #1 until eof(1) line input #1, text 'check see if line contains name if instr(text, "name=") <> 0 'trim down name text = replace(text, "name=", "") text = trim(text) 'set current value of text name of new scalarin dim text scalarin end if loop end sub i don't think works more understand idea. want happen read in name file , set name of new instance of custom data type. public type scalarin unitofmeasure string value variant source string end type

python - Converting web.asynchronous code to gen.coroutine in tornado -

i want convert current tornado app using @web.asynchronous @gen.coroutine. asynchronous callback called when particular variable change happens on ioloop iteration. current example in tornado docs solves i/o problem in case variable interested in. want coroutine wake on variable change. app looks code shown below. note: can use python2. # transaction db change can happen # process class transaction: def __init__(self): self.status = 'incomplete' self.callback = none # in this, checking status of db # before responding request class mainhandler(web.requesthandler): def initialize(self, app_reference): self.app_reference = app_reference @web.asynchronous def get(self): txn = transaction() callback = functools.partial(self.do_something) txn.callback = callback self.app_reference.monitor_transaction(txn) def do_something(self): self.write("finished request") self.finish...

python - TypeError: start must be a integer -

i trying draw 5 turtles, getting typeerror on line 25. here code: import turtle wn = turtle.screen() redrose = turtle.turtle() color = input("what background color be?") fillcolor_f = input("what color of rose be?") redrose.hideturtle() redrose.speed(30) redrose.penup() redrose.left(180) redrose.forward(175) redrose.right(90) redrose.forward(30) redrose.right(90) redrose.pendown() def drawrose(red): redrose.color("pink") redrose.fillcolor(fillcolor_f) redrose.fill(true) in range(red): redrose.forward(i) redrose.right(49) in range(5): drawrose(redrose) redrose.penup() redrose.forward(350) redrose.right(144) redrose.pendown() redrose.fill(false) drawrose(50) wn.bgcolor(color) i trying draw 5 roses, produces errors. doing in interactivepython.org. you recursively calling drawrose wrong parameter. on line 23 ( for in range(red): ) expect red integer...

playframework - Error running tests in Play Framework after migrating to 2.4.x (Java) -

i migrated 2.3 2.4. application seems working, none of tests run. fail following error: [error] test models.testcountry.createtheater failed: com.google.inject.provisionexception: unable provision, see following errors: [error] [error] 1) error injecting constructor, java.lang.illegalstateexception: got deeper 5 levels while searching /home/jlei/workspace/ebor-play/target/web/classes/main/meta-inf/resources/webjars [error] @ controllers.webjarassets.<init>(webjarassets.scala:21) [error] @ controllers.webjarassets.class(webjarassets.scala:21) [error] while locating controllers.webjarassets [error] parameter 18 @ router.routes.<init>(routes.scala:96) [error] while locating router.routes [error] while locating play.api.test.fakerouterprovider [error] while locating play.api.routing.router [error] [error] 1 error, took 2.828 sec [error] @ com.google.inject.internal.injectorimpl$2.get(injectorimpl.java:1025) [error] @ com.google.inject.internal.in...

powershell - How can I create a log that is usable for output, but still allow for output and input in the console -

function logwrite { out-file -append "scan.log" } function test-isadmin { if (-not ([security.principal.windowsprincipal] [security.principal.windowsidentity]::getcurrent()).isinrole( [security.principal.windowsbuiltinrole] "administrator")) { write-warning "you not have administrator rights run script!`nplease re-run script administrator!" break } } function restart-saned { get-service -name tbs | logwrite stop-service -name tbs start-service -name tbs } above snippet of code trying use. cannot "get-service" line output log file. when not create function , instead use: get-service -name tbs | out-file -append "scan.log" logging works correctly , output. there way create function simplify logging in powershell? you need re-pipe special $input variable, function logwrite { $input | out-file -append "scan.log" }

machine learning - How do you know if a data set is right for linear regression if it has multiple features? -

Image
if has 1 feature it's easy. graph it. one of records there looks (18, 15). simple. if have multiple features adds more dimensions graph, right? how can visualize data set , determine whether or not linear regression applicable if can't graph it? by way, aware there whole cluster of algorithms choose , linear regression might not best fit particular problem. i'm asking i'm learning this perspective not what's best way this perspective. so linear regression assumes data linear in multiple dimensions. wont possible visualize high dimensional data unless use methods reduce high dimensional data. pca can bringing down 2 dimensions won't helpful. you should cross validation on model see if getting decent fit on data. if not means linear regression not data. .

javascript - Wordpress & non-wordpress: 500 Internal Server Error when use $_POST, $wp_session and custom SQL -

Image
i'm developing custom profiles users. my intention save data storage in $wp_session , custom database. from javascript, check if $idsession , , $url exists, if exist show " delete button ", else show " add button " (i've 3 action buttons - marcador - favoritos - "recomendar". latter button isn't configured yet). this javascript code : function accion(t){ $.ajax({ url : '/action.php', data: { accion:t }, type: 'post', datatype: 'json', success: function(d){ switch(d.tipo){ case 'chequear': if(d.estadofav==1){ $('#favoritos').html('<i class="fa fa-heart"></i> borrar favorito'); $('#favoritos').attr('data-accion','eliminar-favorito'); } if(d.estadomarc==1){ $('#marcador').html('<i class="fa fa-bookmark"></i> borr...