Posts

Showing posts from May, 2011

scala - Actor not catching exception in Test even if thrown -

my actor looks object logprocessoractor { def props(f: () => unit): props = props(new logprocessoractor(f)) } class logprocessoractor(f: () => unit) extends actor actorlogging { def receive = loggingreceive { case startlogreaderdisruptor => f() sender ! startedlogreaderdisruptor } } and test looks must "fail method throws exception" in { val f: () => unit = () => 2/0 val logprocessorref = testactorref[logprocessoractor](logprocessoractor.props(f), name = "logprocessorsad") intercept[arithmeticexception] { logprocessorref ! startlogreaderdisruptor } } i see in logs exception thrown [debug] [06/02/2015 19:25:44.598] [scalatest-run] [eventstream(akka://logprocessoractorsystem)] logger log1-slf4jlogger started [debug] [06/02/2015 19:25:44.599] [scalatest-run] [eventstream(akka://logprocessoractorsystem)] default loggers started 02 jun 2015 19:25:44,601 [debug] [logprocessoractorsystem-akka.acto...

linux - qemu running powerpc u-boot failed -

i'm trying emulate freescale powerpc qemu,but faced problem. when try run ppc u-boot,it fails infomation below: $ qemu-system-ppc -m ppce500 -nographic -kernel u-boot qemu: fatal: trying execute code outside ram or rom @ 0xeff40000 nip eff40000 lr 00000000 ctr 00000000 xer 00000000 msr 00000000 hid0 00000000 hf 00000000 idx 1 tb 00000000 05858550 decr 00000000 gpr00 0000000000000000 0000000000fffff8 0000000000000000 00000000f1800000 gpr04 0000000000000000 0000000000000000 0000000045504150 0000000000000000 gpr08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 gpr12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 gpr16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 gpr20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 gpr24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 gpr28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 cr 00000000 [ - - - - - -...

What is a root in garbage collection in C# -

this question has answer here: what roots? 5 answers i trying understand garbage collection internals , trying comprehend root refers to? start find roots from? current thread execution or picks objects heap , recursively looks @ references? the roots things global , local variables directly accessible code. the gc finds pointers among point gc heap, , follows them (recursively) find other memory that's still accessible.

c++ - Passing a vector<class> myvector to an constructor and accessing it -

sorry if question similar posted already, don't know how word question properly. how can access "william" , "shakespeare" cout << passed author object shakespeare, passed vector of authors passed book object play? class author{} //has private variables first_name , last_name , getter //functions in public. class book{ private: vector<author> author_mem; public: book(const vector<author>& author_fn):author_mem(author_fn){} vector<author> get_author_list() const {return author_mem;} } int main(){ const author shakespeare("william","shakespeare"); const vector<author> authors = {shakespeare}; const book play(authors); //initiial idea have //cout << play.get_author_list.at(0) } i don't know how named accessors author class, let's it's getfirstname , getlastname . that should work: cout << play.get_author_list().at(0...

python - Approach where features are combination of text(labels) and numerical -

i'm trying figure out approach data set includes text, more labels , numeric data. example, in data set, have city, state, lat/lon , want classify. supervised, have labels (y) data. so in case, text not bag of words on or that. label, more 0, 1, ... however, don't ~think~ want give algorithm idea these real values. have tried couple of different algos including svm.svc , linearsvc, , decisiontree. svm, converted city , state numeric values using couple of different methods including labelencoder. doesn't seem right intuitively , not satisfied score. any thoughts or input appreciated. it looks looking onehotencoder . explanation take @ encoding categorical features section of docs. idea make column each city 0/1 values if sample belongs current city. might interested in dictvectorizer .

sql - Reporting using TSQL -

i required print 2 reports in following format: header 1 header 2 datetime sn employee/manager salary bonus john/susan 60000 5000 b jenny/gary 70000 10000 total 2 130000 15000 total bonus : 15000 total records : 2 header 1 header 2 datetime sn employee/manager salary bonus successful john/susan 60000 5000 subtotal: 1 struggling b john/susan 70000 10000 subtotal: 1 total 2 130000 15000 i have required information present in single table. before coding, wanted ask tsql experts out there if possible in tsql? if not, i'll use procedural programming language accomplish this. edit1: don't need display @ front end. have dump .txt file. schema example ...

c++ - Simple power program -

i asking today power program. so, figure out ho , want ask, how add, numbers before lines(like 1 is; 2 is; , etc.). program #include<iostream> using namespace std; int exponentiation(int base, int exponent); int main(void) { for(int = 0; <= 10; ++i) cout << exponentiation(i, i) << '\n'; } int exponentiation(int base, int exponent){ int result = 1; (int = 0; < exponent; ++i) result = result * base; return result; } output goes line line .... ....... .............. and want make looks this: 1 .... 2 ....... 3 .............. i trying make cout loop , add in code above, doesn't work: #include<iostream> using namespace std; int exponentiation(int base, int exponent); int main(void) { for(int c = 1; c < 10; c++) { ...

c++11 - C++: Creating a local copy of an Object -

i'm objective-c developer that's struggling c++ code. below code have in c++: ulconnection *conn; ...... //code builds connection conn->getlasterror()->getstring(value, 255); i need create local copy (not reference) of getlasterror() . how local reference , check null? here failed attempt: ulerror error = *conn->getlasterror(); if (&error != null){} as per understanding function conn->getlasterror() returns pointer of ulerror , need check return pointer null or not. this work you. const ulerror *error = conn->getlasterror(); if (error){} since c++11 can follows instead comparing null if( error != nullptr)

html tags not working inside response tags AJAX PHP -

i have working code, using ajax, when user types input box, output 'hello' on screen without having press enter. however, there problem. let me show part of working code first: <?php include('head.php'); echo "<response>"; echo "hello"; echo "</response>"; ?> ^---the above code works, , outputs 'hello' on screen whenever user types in input box. code input box, , else on separate files, , not shown unless requested. problem cannot use html tags inside response tags: <?php include('head.php'); echo "<response>"; echo "<i>"."hello"."</i>"; echo "</response>"; ?> ^---the above code output word 'undefined', instead of word 'hello' in italics. don't know why it's doing that, if know why, , how fix this, or if there workaround problem, please let me know. thank you. edit: requested show ...

sorting a list of integers in ascending order - C -

this program take input numbers user , sorts them in ascending order. when user hits 'enter' without entering integer, program stops taking numbers , sorts loop. my program doesnt stop taking numbers, stuck in infinite loop of taking numbers. why that? #include <stdio.h> #include "genlib.h" sortintegerarray() { int i, k, n, array[200]; (i = 0; < 200; ++i) { (k = i+1; k < 200; ++k) { if (array[i] > array[k]) { n = array[k]; array[i] = array[k]; array[k] = n; } } } } main() { int i, k, n, array[200], number; = 0; n = 0; printf("enter numbers\n"); number = getinteger(); (i = 0; < 200; ++i) { if (number == "") { break; } scanf("%d", &array[i]); } printf("the input array is: %d", ...

browser - How to enable copy paste in google chrome if it is been disabled by website? -

did lot of research work don't know how this. me guys. how add on? https://chrome.google.com/webstore/detail/allow-copy/abidndjnodakeaicodfpgcnlkpppapah?hl=en-us that or looking @ source of page (depending on method block with) or inspecting elements. it's on computer, need disable scripts make them more manageable.

c# - Putting Contracts for Constructor Arguments -

assume have interface follows contract class [contractclassfor(typeof(custom))] public abstract class customcontract : custom { public string getperson(int i) { contract.requires(i > 0); contract.ensures(!string.isnullorempty(contract.result<string>())); return default(string); } public string name { get; set; } } [contractclass(typeof(customcontract))] public interface custom { string getperson(int i); string name { get; set; } } implementation like public class customprocessor: custom { public customprocessor(isomeinterface obj, string logname) { if(null == obj) throw new argumentnullexception(...); ... } public getperson(int i) { ... } } does make sense replace throw new argumentnullexception in constructor contract.requires(obj != null). contracts supposed defined interface , since c...

c - expected identifier before token ( -

i keep getting error error: expected identifier before ‘(’ token if((familia->(hijos+i)->edad)>18) ^ i can't solve it, problem in familia-> don't know how fix it. these structs using, think should enough understand :( typedef struct hijo{ int va_a_la_escuela; int edad; int estavacunado; } hijo; typedef struct gasto{ int vestimenta; int vivienda; int comida; } gasto; typedef struct familia{ int numero_de_hijos; hijo* hijos; gasto* gastos; int recibebono; int revisada; } familia; int verificarvacuna(familia* familia){ int i; (i = 0; < familia->numero_de_hijos; i++) { if(familia->(hijos+i)->estavacunado==0)//line of error return 0; } return 1; } //verificacion de edad de hijos de la familia int verificaredad(familia* familia){ int i; (i = 0; < familia->numero_de_hijos; i++) { if(familia->(h...

javascript - (Why) does having a directive that "calls itself" in a finite ng-repeat lead to a stack overflow from infinite recursion? -

edit: see this plunker simplified version of problem (an sscce ). the following code seems cause infinite recursion problem: statement.directive.html <textarea></textarea><br /> <button ng-click='statement.newstatement()'>new statement</button> <button ng-click='statement.newsubstatement()'>new substatement</button> <hr /> <statement ng-repeat='statement in statement.curr.sections' curr='statement' parent='statement.curr'> </statement> i don't know why though. statement.curr.sections 0 (when tested it). wouldn't directive not "instantiated/implemented"? <p ng-repeat='statement.curr.sections'>x</p> doesn't cause problems. wrapping in ng-if doesn't fix problem. <div ng-if='statement.curr.sections > 0'> <statement ng-repeat='statement in statement.curr.sections' curr='sta...

swift - instancetype parameters type in closure/callback for subclasses -

say have asynchronous task grab array of instances so: class func fetchlistofinstances(callback: ([mysuperclass])->()) { // long task asynchronously , call callback } and used so: mysubclass.fetchlistofinstances() { mylist in // mylist inferred [mysuperclass] whatever in mylist { let typeireallywant = whatever as! mysubclass // stuff here each instance of typeireallywant } } swift seems pretty clever types i'll surprised if if there's not way this, couldn't find google search: class func fetchlistofinstances(callback: ([self])->()) { // long task asynchronously , call callback } ... mysubclass.fetchlistofinstances() { mylist in // mylist inferred [mysubclass] whatever in mylist { // stuff here each instance of whatever } } it may not possible, thought worth ask. according 'self' available in protocol or result of class method , use self generic type seems you're after not...

javascript - Adaptive Randomization Algorithm -

gist: i'm looking randomization algorithm can each subject, @ previous measurements, determine if subject fall high or low end, ensure approximately half of each of these groups assigned experimental condition. details: i'm building research application has 2 independent variables. 1 experimental manipulation can assign. we'll call these x (experimental) , c (control). other personal characteristic 2 categorical types, measured through scale. we'll call these p1 (type 1) , p2 (type 2). so it's 2x2 have 4 conditions (p1x, p1c, p2x, p2c). i'm recruiting 120 subjects ideally i'd have distribution of 30 subjects in each condition. i have 3 problems. 1) based on literature i'm expecting natural 50/50 split between p1 , p2 characteristics in sample. however, can't sure population isn't i'd consider general population split estimate derived from. 2) simple randomization of x or c manipulation won't guarantee equal distribution....

.htaccess - Conversion from htaccess to rewrite issue -

i have moved site apache nginx , have got issue nginx. htaccess rewriteengine on rewritecond %{request_uri} !\.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ rewriterule ^(.+)/(.+[^/])/(.*[^/])/?$ index.php?p=$1&subp=$2&subsubp=$3 [qsa,l] rewritecond %{request_uri} !\.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ rewriterule ^(.+)/(.+[^/])/?$ index.php?p=$1&subp=$2 [qsa,l] rewritecond %{request_uri} !\.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ rewriterule ^(.*[^/])/?$ index.php?p=$1 [qsa,l] options -indexes and using converter nginx: location ~ \.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ { } location ~ \.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ { } location ~ \.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ { } autoindex off; location / { rewrite ^/(.+)/(.+[^/])/(.*[^/])/?$ /index.php?p=$1&subp=$2&subsubp=$3 break; rewrite ^/(.+)/(.+[^/])/?$ /index.php?p=$1&subp=$2 break; rewrite ^/(.*[^/]...

Unit testing WebApi 2 ApiController with ExecuteAsync overriden -

i have apicontroller executeasync method overriden (i using ravendb , here create session): public override async task<httpresponsemessage> executeasync( httpcontrollercontext controllercontext, cancellationtoken cancellationtoken) { using (session = store.openasyncsession()) { var result = await base.executeasync(controllercontext, cancellationtoken); await session.savechangesasync(); return result; } } i want write automated tests using xunit or microsoft test framework , @ moment i'm stuck calling controllers action via executeasync. should construct controllercontext in particular way have done or missing something? simply creating controller object , calling actions throws nullreferenceexception session object, not created executeasync has not been called.

assembly - intel to ATT assembley conversion for reading data segment of BIOS -

what equivalent att code following intel code: bios segment byte @ 40h org 13h memory dw ? bios ends that's not question of at&t syntax such. it's question of assembler , linker use. also, suppose still need load segment register hand. simplest case rid of whole thing, , instead along these lines: mov $0x40, %ax mov %ax, %es mov %es:0x13, %ax depending on requirements , available tools, can of course produce fancier code, don't see point.

python - File not found error while Installing Numpy on Windows 7 -

i have started programming in python learn , explore data analysis. accomplish tried downloading numpy , pandas cmd prompt, have python 2.7 installed.but each time gives me file not found error numpy , panda. it seems don't have points post image. that's sad please let me know if need info update: python 32-bit , checked running platform query. i using easy_install.exe install numpy , panda don't versions i go directory scripts there in cmd prompt , type "easy_insatll.exe numpy" am doing wrong ? can use anaconda install these packages after have python installed? please let me know if need info.

sql - Combine customer primary keys -

i have 4 systems gathered in 1 dwh , has come joining different customer primary keys. 1 actual customer may present in 4 systems or 1 of them. see preferable solution doing business logic lookup? links week regular joins work small part of customers. there ssis work flow can use or how approach this? i work large health insurance company , had similar project. had several source systems came different business units contained member information. have large member population , members may in multiple systems. data in systems so in terms of quality: each system may or may not have valid ssns, medicare ids, current and/or spelled address information, valid birth dates, etc. our goal create unique identifier pair source system pks uniquely identify member across many systems. the result more of process single piece of code or ssis task. our process keeps track of every member ever comes through our system, snapshot of primary fields identify them (name, address, ssn, me...

c# - Combobox value (binded with an enum) in an instance -

good day lads! i've got question. i think i'll saving loads of text if see form, here go! form: private void form1_load(object sender, eventargs e) { /* held h1 = new held("tank", lanes.top); held h2 = new held("adc", lanes.bot); held h3 = new held("support", lanes.bot); listbox1.items.add(h1); listbox1.items.add(h2); listbox1.items.add(h3); */ //data koppelen cbrol.datasource = enum.getvalues(typeof(lanes)); } private void btnaanmaken_click(object sender, eventargs e) { int getal; if (checkemptyfields()) { messagebox.show("vul alle velden in!"); } else { if (checkmovementspeedisint(out getal)) { string naamhero = tbnaamhero.text; lanes lane = ??? int mspeedhero = getal; held nieuwheld = new held(naamhero, lane, getal); } } } private bool checkmovementspeedisint(out int getal) ...

c++ - Qml property of custom type -

i have class defined follows: class set : public qobject { q_object … }; it's qmregistertype'd , usable within qml. i'd have in class property of custom type setrange, defined follows: class setrange : public qobject { public: setrange ( qobject *parent = 0 ) : qobject::qobject(parent) { } q_property(int lowerbound member lower_bound write setlowerbound notify lowerboundchanged) q_property(int length member length write setlength notify lengthchanged) int lower_bound, length; void setlowerbound ( int lower_bound ) { if ( lower_bound != this->lower_bound ) emit lowerboundchanged(this->lower_bound = lower_bound); } void setlength ( int length ) { if ( length != this->length ) emit lengthchanged(this->length = length); } signals: void lowerboundchanged ( int lower_bound ); void lengthchanged ( int length ); }; q_declare_metatype(setrange) and property within set: q...

google chrome extension - Background youtube player -

i trying make chrome extension such play songs youtube. have done have small problem. when click extension icon, popup appears can search song , play it, when popup disappears, music stops playing. can make music play in background? here function finds song, , inserts iframe tag popup.html page function showresponse(response) { var responsestring = response; document.getelementbyid('response').innerhtml = responsestring.items[0].id.videoid; var videoid = responsestring.items[0].id.videoid; var iframe = '<iframe width="300" height="300" src="https://www.youtube.com/embed/' + videoid + '"></iframe>'; document.getelementbyid('player').innerhtml = iframe; } when popup closes, page contains , unloaded . so iframe destroyed. , no, can't keep popup open. an extension has 1 persistent page - background page . can try adding iframe there - sound should continue play. however, p...

actionscript 3 - AS3 "navigateToURL" freezes after 4 "gotoAndStop()" functions -

i developing small .swf embedded in sharepoint page, work except navigatetourl script. .swf have buttons navigate between frames , 1 navigatetourl button per frame. every frame have info page navigate , guessing people read every page before making decision, , here problem begins. let me show script: trainingsub.addeventlistener(mouseevent.click, irtrainingsub1); function irtrainingsub1(event:mouseevent):void { gotoandstop(2); } templatessub.addeventlistener(mouseevent.click, irtemplatessub1); function irtemplatessub1(event:mouseevent):void { gotoandstop(3); } servicessub.addeventlistener(mouseevent.click, irservicessub1); function irservicessub1(event:mouseevent):void { gotoandstop(4); } communitysub.addeventlistener(mouseevent.click, ircommunitysub1); function ircommunitysub1(event:mouseevent):void { gotoandstop(5); } visitbtn.addeventlistener(mouseevent.click, abrirweb1); function abrirweb1(event:mouseevent):void { navigatetourl(new urlrequest(...

android - parent.getContext within RecyclerView.Adapter's onCreateViewHolder method -

i have custom fragment attached mainactivity. layout file of fragment contains recyclerview widget. fragment_main.xml: <?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.recyclerview android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical"/> </framelayout> within recyclerview.adapter oncreateviewholder method looks this: @override public myadapter.myholder oncreateviewholder(viewgroup parent, int viewtype) { view view = layoutinflater.from(parent.getcontext()).inflate(r.layout .list_item, parent, false); return new myholder(view); } my question viewgroup pa...

c++ - SharedMemory container problems -

i've created following code testing shared memory allocators , containers.. the allocator (basic allocator keeps pointer memory block + size: template<typename t> struct sharedmemoryallocator { typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef t* pointer; typedef const t* const_pointer; typedef t& reference; typedef const t& const_reference; typedef t value_type; void* memory; std::size_t size; sharedmemoryallocator(void* memory, std::size_t size) noexcept : memory(memory), size(size) {}; sharedmemoryallocator(const sharedmemoryallocator& other) noexcept : memory(other.memory), size(other.size) {}; template<typename u> sharedmemoryallocator(const sharedmemoryallocator<u>& other) noexcept : memory(other.memory), size(other.size) {}; template<typename u> sharedmemoryallocator& operator = (const sharedmemoryallocator<u>& other) { r...

parallel processing - Error while building NAS benchmarks -

i trying build nas benchmarks using intel mpi , below makefile using. #--------------------------------------------------------------------------- # # site- and/or platform-specific definitions. # #--------------------------------------------------------------------------- #--------------------------------------------------------------------------- # items in file need changed each platform. #--------------------------------------------------------------------------- #--------------------------------------------------------------------------- # parallel fortran: # # cg, ep, ft, mg, lu, sp , bt, in fortran, following must # defined: # # mpif77 - fortran compiler # fflags - fortran compilation arguments # fmpi_inc - -i arguments required compiling mpi/fortran # flink - fortran linker # flinkflags - fortran linker arguments # fmpi_lib - -l , -l arguments required linking mpi/fortran # # compilations done $(mpif77) $(fmpi_inc) $(fflags) or # ...

UI-GRID Single Input Filtering -

whats best way handle grid filtering 1 input. there simpler way dealing way: http://ui-grid.info/docs/#/tutorial/321_singlefilter i want filter every keystroke, not click button. thanks if looking @ filtering on multiple columns, thats best way. make filter on every key stroke, can add "ng-change" text input , call filter function in example. <input ng-model='filtervalue' ng-change='filter()'/> if have large dataset , filter on every key stroke, there performance lag unless handle inside filter function.

xml - Greater than(>) and less than(<) operator not working in XSLT -

below xsl trying check condition if size of file greater preset value , try stop processing, looks condition not getting executed. not sure if not formatted right way. can in , see if there issue? value of both variable incomingfilesize , setfilesize of type 'number' <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:dp="http://www.datapower.com/extensions" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dpconfig="http://www.datapower.com/param/config" extension-element-prefixes="dp" exclude-result-prefixes="dp dpconfig inc"> <xsl:template match="/"> <xsl:variable name="file_cd" select="document('local:///fileintake/resources/fileserviceconfigdata.xml')"/> <xsl:variable name="incomingfilesize" select="number...

objective c - how to put characters combination as constant command into iOS framework -

i new ios programming. developing sdk framework right now. have command 3 characters: 'esc' 'e' '1', wanna combine 3 characters generate nsstring , put nsstring framework. therefore others can directly use constant in framework. any 1 knows how this? because in constant.h file, cannot use run-time functions such stringwithformat. i think using \u combine 3 characters. doing way: nsstring *message2 = @"\\u001b\\u002d\\u0031"; failed. considered long string: \\u001b\\u002d\\u0031 rather esc+e+1 thanks lot. \u universal characters restricted iso 10646 exclude characters. of particular interest esc. can encode in octal: nsstring *message2 = @"\033e1"; note typically not put these in header file. typically implement this way: mymessages.h // declare here extern nsstring * const mymessage2; mymessages.m // define here nsstring * const mymessage2 = @"..."; as possible, avoid generic files constant.h . plac...

java - Why can an instance of a class access private fields of another instance of its own type? -

an instance of class, in java, can access private fields of different instance of own type, such in following listing: public class foo { private int secret; public void bar(final foo foo) { foo.secret = 100; } } what argument such semantics (when designing language)? well, first have ask "why have private fields @ all?" private fields encapsulation: user of a class shouldn't have know internals of class' implementation. in fact, shouldn't know, because if relied on specifics, implementer forced support them or break backwards compatibility. in other words, protects both user , designer of class: the user protected implementation changes breaking code the designer protected having keep implementation details features unchanged forever but class doesn't need protected itself; doesn't need worry case 1 bit of code changes, bit (that uses first bit) can't change. backwards compatibility not concern, because class devel...

python - Testing Flask web app with unittest POST Error 500 -

this test.py file: import unittest, views, json class flasktestcase(unittest.testcase): def setup(self): self.app = views.app.test_client() def test_index(self): rv = self.app.get('/') assert 'hamptons bank' in rv.data def test_credit(self): response = self.app.post('/credit', data=json.dumps({ 'amount': '20', 'account': '1' }), content_type='application/json') print response.data assert 'deposit of 20 account 1' in response.data if __name__ == '__main__': unittest.main() the test_index method works fine, self.app.post keeps returning (in print response.data): <!doctype html public "-//w3c//dtd html 3.2 final//en"> <title>500 internal server error</title> <h1>internal server error</h1> <p>the server encountered internal error , unable complete request. either server overloaded or there...

Compatibility Level of SQL Server Backups -

i'm running mssql 2014. i'm working on database compatibility level of 2008. backed working copy , sent off 1 of .net subs work on application extension. claims bak file has compatibility level of 2014. i'm skeptical. if he's right, there way can configure backup retain compatibility level of database , not adopt compatibility level of server? these 2 different things. backup file can restored on same sql server version , (usually) 2 following versions. can't use backup file @ older instances. database compatibility level limits functionalities can use within database data types, build in functions etc.

r - Cannot specify probability function for extraTrees model in caret package -

everyone, recently, have been using extratrees model in caret package. however, noticed probability function extratrees model set null using following scripts: extratrees_para <- getmodelinfo('extratrees', regex = f)[[1]] extratrees_para$prob i noticed in original package of extratress, can used generate probability prediction classification problems. i'd specify prob function extratrees_para. extratrees_para$prob <- function(modelfit, newdata, submodels = null){ as.data.frame(predict(modelfit, newdata, probability = true)) } extratrees_para$type <- 'classification' then construct train function build model extratreesgrid <- expand.grid(.mtry=1:2, .numrandomcuts=1) modelfit_extratrees <- train(outcome~., data=training_scaled_sel, method = extratrees_para, metric = "roc", trcontrol = traincontrol(method = 'repeatedcv', ...

atlassian sourcetree - GIT picking up whitespace changes it shouldn't -

after running our build process, files showing in sourcetree whitespace-only changes. leaving aside discussions whether auto-generated files should included in source control, problem this: files show in uncommitted window. if attempt commit them, error below. ideally i'd have sourcetree smart enough not display these files modified in first place. there way accomplish this? git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -f c:----\fc1hkokv.mod -- ----.js on branch feature/14006-clinical-notes changes not staged commit: (use "git add ..." update committed) (use "git checkout -- ..." discard changes in working directory) modified: xxxx.js no changes added commit (use "git add" and/or "git commit -a") warning: lf replaced crlf in xxx.js. file have original line endings in working directory.

c# - How to let the user create many dice? -

so right now, code can let 2 dice ten times, if wanted user enter number of dice, how do that? static void main(string[] args) { random numgen = new random(); int dice1 = 0; int dice2 = 1; (int roll = 0; roll <=10; roll++) { dice1 = numgen.next(1,7); dice2 = numgen.next(1,7); console.writeline(dice1 + "\t" + dice2); } console.readline(); } since doesn't seem need save of dice rolls, rather output them screen omit dice ints. public void rolldice(int numberofdice) { random numgen = new random(); (int roll = 0; roll <= 10; roll++) { (int = 0; < numberofdice; i++) { console.writeline(numgen.next(1, 7) + "\t" + numgen.next(1, 7)); } } console.readline(); }

c# - text file stream reader in windows xp reads only limited number of lines -

i have visual basic (even c# nice) app reads text file containing 16000 lines web converts them string array. works on windows 7 , later , lines read. on windows xp, in odd way 5694 lines of file read , line after neglected private sub buildwordlist() try dim reader streamreader = new streamreader(client.openread("www.example.com/myfile.txt")) dim line string = "" dim mycounter integer = 0 using myreader new microsoft.visualbasic. fileio.textfieldparser(reader) myreader.textfieldtype = fileio.fieldtype.delimited myreader.setdelimiters("|") dim currentrow string() while not myreader.endofdata mycounter = mycounter + 1 currentrow = myreader.readfields() integer = 1 100 if currentrow(0).tostring() = i.tostring() maglist(i).add(currentrow(1).tostri...

ios - Can I access healthkit data from iWatch extension? -

i making iwatch app need show data healthkit. possible access healthkit apis iwatch extension? no. it's mentioned in healthkit framework reference : "you cannot access healthkit extensions (like today view) or watchkit app." what can call openparentapplication:reply: talk iphone app , retrieve data. search around method name , you'll find examples on how call , data watch it. update: others have mentioned below, has changed watchos 2. documentation has not been updated yet, check out wwdc 2015 videos healthkit , watch snippets of code can use xcode 7 beta.

asp.net mvc - jQuery DataTable refreshing data - MVC View building table first, then trying to display data retrieved via ajax -

Image
i'm working on mvc5 , load datatable iterating through model data, manually building table elements on document ready initialize table .datatable(). part works fine. now, allow user change data want display (via dropdown selection, change event fires , calls ajax controller method, returns json objects), new initialization of datatable doesn't seem want cooperate. nothing visible @ point. here's table within view: <table class="table table-bordered" id="accountrequeststatus" name="accountrequeststatus"> <thead> <tr> <th>col1</th> <th>col2</th> <th>col3</th> <th>col4</th> <th>col5</th> <th></th> </tr> ...

C - initializer element is not constant -

here's snippet of code in c: const char *d = "dictionary.dict"; struct dictionary *dict = dictionary_load_lang(d); // compile error here the type of dictionary_load_lang() struct dictionary *dictionary_load_lang(const char *lang) . when trying compile compiler says "initializer element not constant" , can't see why. what's going on? dictionary_load_lang() function, hence non-constant. can't use non-constants static storage variables (read: global and/or static ): as per c99 standard: section 6.7.8: all expressions in initializer object has static storage duration shall constant expressions or string literals. however, can such initialization if within function , non-static variable.

c# - Razor DDL to Model -

i trying head around drop down lists mvc, appears failing me. i've been tinkering code shown below can't right. what trying achieve simple - hard coding drop down options in controller, have them appear in razor rendered html , when option selected, selected value bound string property in model. with code below can't access li within view. i've seen other guides haven't been able make work, binding model best option me, given i'm trying achieve, or viewbag etc better? could show me i'm going wrong please? model public class viewmodel { public string myoption { get; set; } } view @model viewmodel @html.dropdownlistfor(m => m.myoption, li, "--select--") controller public actionresult index() { list<selectlistitem> li = new list<selectlistitem>(); li.add(new selectlistitem { text = "option one", value = "option1" }); li.add(new selectlistitem { ...

python - wordpresslib attaching images to posts -

looking @ example provided wordpresslib , straight forward on how upload images media library. however, attachment of images looks never finished. has attached images? #!/usr/bin/env python """ small example script publish post jpeg image """ # import library import wordpresslib print 'example of posting.' print url = raw_input('wordpress url (xmlrpc.php added):') user = raw_input('username:') password = raw_input('password:') # prepare client object wp = wordpresslib.wordpressclient(url+"xmlrpc.php", user, password) # select blog id wp.selectblog(0) # upload image post # imagesrc = wp.newmediaobject('python.jpg') # fixme if imagesrc: # create post object post = wordpresslib.wordpresspost() post.title = 'test post' post.description = ''' python best programming language in earth ! no image broken fixme <img src="" /> ''' #post.categories =...

javascript - How I can use mouse events with Jquery -

i'm tryng configure list of users in chat adding function slide http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_slide_down similar facebook, when mouse on focus, chat container hidden i'm using jquery-1.8.1.min.js in proyect , have principal container id , can configure events $("maincontainer").someevent(function () { code... } i can use click, haven't mouse event when put cursor inside example. i need .mousedown(), .mouseleave(), .mousemove(), hover(), etc. need use library js? i wish this, think green box container list of users in chat <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("div").mouseenter(function(){ $("div").animate({ width: '+=100px' }); }); $("div").mouseout(function(){ ...

selenium - Testing multiple browsers with different options using WebDriver, Nunit and C#? -

i trying run test on multiple browsers using webdriver, nunit , c#. it's working, getting annoying security warning in chrome. in effort fix it, need re-create driver using ".addarguments("--test-type"); ". want if iterations browser = chrome. here code. works, launches un-needed browser window first. have idea's around this? namespace seleniumtests { [testfixture(typeof(firefoxdriver))] [testfixture(typeof(internetexplorerdriver))] [testfixture(typeof(chromedriver))] public class testwithmultiplebrowsers<twebdriver> twebdriver : iwebdriver, new() { private iwebdriver driver; [setup] public void createdriver() { this.driver = new twebdriver(); //creates window needs closed , re-constructed if(driver chromedriver) { driver.quit(); //this kills un-needed driver ...

json - How to extract keys from multiple, nested arrays using jq -

setup i'm trying figure out how jq filters work , having trouble figuring out nested arrays. using data below cannot make flat 5 key output. can 1 key , 4 nulls or 4 keys , 1 null, not 5 keys. 1 key, 4 nulls: .reservations[] | {ownerid, instanceid, imageid, privateipaddress, platform} returns: { "ownerid": "000000000000", "instanceid": null, "imageid": null, "privateipaddress": null, "platform": null } 4 keys, 1 null: .reservations[].instances[] | {ownerid, instanceid, imageid, privateipaddress, platform} { "ownerid": null, "instanceid": "i-v33333333", "imageid": "ami-44444444", "privateipaddress": "10.0.0.0", "platform": "windows" } for various reasons cannot use "--query" option in aws cli return format i'm looking for: aws ec2 describe-instances --region us-east-1 --profile temp -...