Posts

Showing posts from September, 2015

math - "ELO Rating" and how does "TSR Rating" work? -

i don't know if belongs in math stack exchange or correct forum is, @ least used fitness model evolution of algorithms, or perhaps matchmaking algorithm specific player ranking in team based games. i'm posting here programming subset of mathematics, considering how elo in use. i member of dota 1 community transitioned "elo ranking system" , new ranking system named "tsr"; community , it's website died on year ago , can no longer find information regarding it's calculation. experience tsr system more accurate elo, shame if lost. does know how calculate tsr according "tsr ranking system"? here internet archive of site there literature on subject, cannot find exact page in question. http://web.archive.org/web/20110923152416/http://www.dotacash.com/index.php?p=news

java - Where to find notes.exe from within an RCP plug-in -

i have rcp eclipse plug-in goes ibm lotus notes . need call notes.exe binary arguments (kind of .bat file), , know how when know where notes installed. how find out ibm lotus notes installed, can know call notes.exe from? note: please don't suggest in typical install folder, i'd able regardless of whether it's typical default folder or not. thanks look in windows registry under hkey_classes_root\notes\shell\open\command see answers old stackoverflow question java code can read/write registry.

java - JOOQ forcedTypes to Boolean -

code generation worked fine. db char(1) field1,field2 mapped boolean in code base. <forcedtypes> <forcedtype> <name>boolean</name> <expressions>field1,field2 </expressions> </forcedtype> </forcedtypes> but while doing insert db, a truncation error encountered trying shrink char 'false' length 1. error the sql generated jooq insert mytable ("field1", "field2", ) values (cast(? boolean), cast(? boolean)) this trying insert false/true in db want insert 1 or 0. need help. i have derby dev functional testing , oracle other environments. use same jooq generated stubs(generated using derby db) both db's. seems working fine oracle not derby. http://blog.jooq.org/tag/boolean-data-type/ states oracle supports , derby not support conversion. need work around. using data type rewritin...

How to understand that a user gets database access in SQL Server -

i have been tasked auditing security on sql server. but, when @ login in sql server management studio, don't see checkbox beside master db login. how can determine databases login has access to? if see login match user in manner, login has access database. select sp.name 'login', dp.name 'user' sys.database_principals dp join sys.server_principals sp on dp.sid = sp.sid order sp.name, dp.name; you can in sql server 2005/2008

R studio graph not appearing in plots window -

i having trouble getting graphs appear in 'plots' window of r studio - once run script appear in separate r graphics window, separate r studio, 'plots' tab blank. is there setting or code should use change this? thank in advance,

How can do a tuple comparison in coffeescript similar to that in python? -

this function st3 = (x, y) -> console.log "#{x?}, #{y?}" if [x?, y?] [true, true] # <- line 'good' 'bad' this output true, true bad i want able tuple comparison in python. in python, if can written as if (x, y) == (true, false): return 'good' the coffescript if loop translated javascript such if ([x != null, y != null] === [true, true]) { 'good'; } that's why not evaluated true. is there alternative way express in coffeescript? if want check see if of arguments not none , this: def check_all(*args): return all(arg not none arg in args) if wanted check if they're true (like literally true) use def check_all(*args): return all(arg true arg in args) if wanted take in list (instead of variable number of parameters, remove asterisk.

Ace editor blurring the text -

Image
i'd use ace editor display program code part of tutorial, twilio does. how can tell ace highlight text , blur rest? see below. add css class applying blur filter, , add blur class lines afterrender event editor.renderer.on("afterrender", function(e, renderer) { var textlayer = renderer.$textlayer; var config = textlayer.config; var session = textlayer.session; var first = config.firstrow; var last = config.lastrow; var lineelements = textlayer.element.childnodes; var lineelementsidx = 0; var row = first; var foldline = session.getnextfoldline(row); var foldstart = foldline ? foldline.start.row : infinity; var usegroups = textlayer.$uselinegroups(); while (true) { if (row > foldstart) { row = foldline.end.row + 1; foldline = textlayer.session.getnextfoldline(row, foldline); foldstart = foldline ? foldline.start.row : infinity; ...

php - File upload form validation is not working in laravel 5.1? -

i using form validation upload file in laravel 5.1, class fileuploadrequest extends request { public function rules() { return ['file' => 'required', 'max:2048', 'mimes:pdf,png,jpeg,jpg']; } public function upload(fileuploadrequest $request) { } but not validating both size , mime.. wrong me? try modifying rules function this public function rules() { return [ 'file' => 'required|mimes:pdf,png,jpeg,jpg|size:2048', ]; }

python - pexpect did not block my script with pexpect.expect -

i making task scheduler pexpect of python. implemented simple idea: term = spawnu('tcsh') # need tcsh instead of default bash term.sendline('first_task') term.expect('my_shell_prompt') # when parent receive prompt means end of previous task. term.sendline('second_task') ...(and on) but found pexpect.expect did not block line: term.expect('my_shell_prompt') # go through line before finish of previous task. since works matching pattern set last output of previous task. suspect pexpect.expect matched my_shell_prompt before child starts job. have add delay before matching. however, happens if add delay before pexect.expect. time.sleep(2) # delay 2 second term.expect('my_shell_prompt') does know how debug this? appreciate. i think found answer myself. pexpect not distinguish echoed command , output child. difficult accomplish previous attempt. i workarounded saving check code in txt file. such file feedback chi...

javascript - How to use jQuery input mask plugin with special character regex validation? -

i want utilize inputmask plugin special character & maxlength validation text box. supports either one. there way implement this? var pattern = /^[\w\s\/\&\'\-]*$/i; $("#example1").inputmask("99-9999999"); $("#example2").inputmask(pattern);

swift - iOS - Alamofire v2 Basic Auth not working -

so i'm sending basic auth request bing image search grab image data, , working great, right until updated latest version of alamofire (1.3 -> 2.0.2), had because 1.3 wasn't close compatible xcode 7. anyway, here code: let credentials = ":\(settings.bingapikey)" let plaintext = credentials.datausingencoding(nsutf8stringencoding, allowlossyconversion: false) let base64 = plaintext!.base64encodedstringwithoptions(nsdatabase64encodingoptions(rawvalue: 0)) manager = alamofire.manager.sharedinstance manager!.session.configuration.httpadditionalheaders = [ "authorization": "basic \(base64)" ] let url = nsurl(string: settings.bingimageapi + "&query=" + keyword + "&$top=15&$skip=" + string(skip))! manager! .request(.post, url, parameters: nil, encoding: .json) .responsejson { request, response, result in ... and i'm getting error: failure: error domain=nscocoaerrordomain code=3840 "...

sql - Date continuity in a database (find missing date gaps) -

Image
i have database of users pay monthly payment. need check if there continuity in these payments. example in table below: +---------+------------+ | user_id | date | +---------+------------+ | 1 | 2015-02-01 | | 2 | 2015-02-01 | | 3 | 2015-02-01 | | 1 | 2015-03-01 | | 2 | 2015-03-01 | | 3 | 2015-03-01 | | 4 | 2015-03-01 | | 1 | 2015-04-01 | | 2 | 2015-04-01 | | 3 | 2015-04-01 | | 4 | 2015-04-01 | | 5 | 2015-04-01 | | 1 | 2015-05-01 | | 2 | 2015-05-01 | | 3 | 2015-05-01 | | 4 | 2015-05-01 | | 5 | 2015-05-01 | | 1 | 2015-06-01 | | 2 | 2015-06-01 | | 3 | 2015-06-01 | | 5 | 2015-06-01 | | 3 | 2015-07-01 | | 4 | 2015-07-01 | | 5 | 2015-07-01 | +---------+------------+ until may ok, in june user 4 didn't pay although paid in next month (july). in july users 1 , 2 didn't pay, ok, because resign service. in case need have informatio...

distributed - Can Giraph reuse the graph in memory from previous job for subsequent jobs? -

i've around million nodes & billion edges, giraph keep graph in memory such can used again subsequent jobs or loads & stores complete graph before & after every job respectively? what mean subsequent jobs?? when launch graph algorithm (shortest path example), giraph loads underlying graph in-memory , keeps until computation completed (all super-steps done). if check-pointing enabled giraph stores current state of vertices @ end of super-steps (depending on configurations) fault-tolerance purposes. after computation completed results stored in hdfs (or else hbase) , java processes terminated. there not rational reasons giraph keeps graph in-memory subsequent graph algorithms.

html - How to use picture element for sharp images on mobile -

picture element getting , spread ( http://caniuse.com/#search=picture ), , think great way avoid serving oversized/undersized pictures, specially when want display same picture on mobile , desktop @ 100% of viewport width. that can solved this: <img srcset="large.jpg 1920w, medium.jpg 720w, small.jpg 360w" src="medium.jpg"> this allows browser clever , decide picture load, find problem approach: many mobile devices have pixel density of 2 or more! therefore when displaying 360w need medium image if want image sharp. done this: <picture> <source srcset="http://goo.gl/lsuu9t" media="(min-width: 720px)"> <source srcset="http://goo.gl/lsuu9t" media="(min-width: 360px , min-resolution: 2dppx)"> <img src="http://goo.gl/lsuu9t"> </picture> the problem here, in opinion, can grow as screen resolution grows , lose bene...

regex - Python regular expression using the OR operator -

i trying parse large sample of text files regular expressions (re). trying extract these files part of text contains 'vu' , ends newline '\n' . patterns differ 1 file another, tried combinations of re in files using or operator. however, did not find way automate code re.findall() function looks combination of re. here example of how tried tackle issue, apparently still can not evaluate both regular expressions , or operator in re.findall() : import re def series2string(myserie) : myserie2 = ' or '.join(serie serie in myserie) return myserie2 def expression(pattern, mystring) : x = re.findall(pattern, mystring) if len(x)>0: return 1 else: return 0 #text example text = "\n\n (troisième chambre)\n - vu la requête, enregistrée le 28 février 1997 sous le n° 97nc00465, présentée pour m. z... farinez, demeurant ... à dommartin-aux-bois (vosges), par me y..., avocat ;\n" #expressions out pattern1 ...

resolution - Image size of MRI T2-weighted scans -

i have mri t2-weighted scans of human brain. however, size of them 128x128 pixels each of 1.71875/1.71875 mm size. use these scans find perfusion parameters: cbv, cbf , mtt. however, people confused me saying quality of images not enough analysis - though images gathered medical institution. i heard rumors since paramagnetic tracer used during scans quality sufficient, because need capture flow of tracer. if increase resolution, time between scans increase , won't capture flow of tracer correctly. are there specialists in area explain situation of images quality? reasonably enough or should better?

java - breadth first search error -

Image
public int bfs(int maxdepth){ //maxdepth = 3 works.. maxdepth = 4 gives me error int src = 0; int dest = 2; int nodes = arr[src].length - 1; boolean[] visited = new boolean[nodes + 1]; int i; int countdepth = 0; int countpaths = 0; int element; queue.add(src); while(!queue.isempty() || countdepth != maxdepth) { element = queue.remove(); = element; while(i <= nodes) { if(arr[element][i] > 0 && visited[i] == false) { queue.add(i); visited[i] = true; if(arr[i][element] > 0) //if has 2 directions visited[i] = false; if(element == dest || == dest) countpaths++; } i++; } countdepth++; } return cou...

c++ - Is it possible to extend the scope of a variable beyond the if statement without using pointers? -

i've got simple trace class logs entering , exiting method: #include <iostream> class trace { public: trace() {std::cout << "enter" << std::endl;} ~trace() { std::cout << "exit" << std::endl; } }; void foo() { trace trace; std::cout << "foo..." << std::endl; } int main() { foo(); return 0; } output: enter foo... exit now want able enable/disable tracing. i'll this: #include <iostream> class trace { public: trace() {std::cout << "enter" << std::endl;} ~trace() { std::cout << "exit" << std::endl; } static bool enabled; }; bool trace::enabled = false; void foo() { if(trace::enabled) trace trace; std::cout << "foo..." << std::endl; } int main() { trace::enabled = true; foo(); return 0; } the ...

Unicode list to integer ; R -

one of variables in data frame unicode (all cases numbers). head(total$page) [u'0'] [u'0'] [u'6'] [u'1'] [u'2'] how convert integers, that: head(total$page) 0, 0, 6, 1, 2 thanks. edit. dput: dput(head(total$page)) structure(c(1l, 1l, 36l, 2l, 13l, 4l), .label = c("[u'0']", "[u'1']", "[u'10']", "[u'11']", "[u'12']", "[u'13']", "[u'14']", "[u'15']", "[u'16']", "[u'17']", "[u'18']", "[u'19']", "[u'2']", "[u'20']", "[u'21']", "[u'22']", "[u'23']", "[u'24']", "[u'25']", "[u'26']", "[u'27']", "[u'28']", "[u'29']", "[u...

logstash - Present average processing time in Kibana -

i have application logs logstash in below format. { "timestamp": "2015-09-09t10:54:57.4562725+00:00", "message": "started processing", "messageid": "b80fb2aa-4b7b-4f49-9e60-865c6afa688e", "clientname": "testclient" } { "timestamp": "2015-09-09t10:55:57.4562725+00:00", "message": "done processing", "messageid": "b80fb2aa-4b7b-4f49-9e60-865c6afa688e", "clientname": "testclient" } { "timestamp": "2015-09-09t10:55:57.4562727+00:00", "message": "time elapsed: 561 ms", "messageid": "b80fb2aa-4b7b-4f49-9e60-865c6afa688e", "clientname": "testclient" } what trying achieve average processing time (all logging done same messageid part of 1 processing cycle). the last log in every transaction has processing time ( shown above: "message...

postgresql - Change integer to bigint key in a table without long exclusive lock -

is possible inherit table column of type int table same column of type bigint in postgresql 9.1? changing column type bigint if first table not option. i have table several tens of millions entries has id of int. right id approaching 2^32, , thinking if it's reasonable thing create facade table bigint id , let original 1 inherit facade. make sense? no, not possible change type of column of parent table when inherit table. the column type must match, since when query parent table (without only in from clause) postgresql implicitly scans child tables , appends results. can't if types differ, same way can't union tables of different types. update based on comments : use view , do instead trigger i suggest using view that's union of 2 tables, old table's contents upcast bigint . define instead of trigger redirects insert s new table. if update s , delete s should define check constraint on each table restricts range of ids non-overlap...

Parallel Period filter (MDX) -

i want add working days inside parallelperiod function below, there way filter or except (like working days, count until yesterday)?. code below info gets measure x previous year ytd sum( ytd( parallelperiod( [Χρονική Περίοδος].[year quarter month].[year name], 1, [Χρονική Περίοδος].[year quarter month].[year name].&[calendar 2015]) ), [measures].[x] )

Prevent multiple active batch spark streaming -

i running spark job stream context running each 60seconds. problem processing time of 1 batch long (due calculation , saving rdd , parquet cloud storage), 1 batch couldn't able finish within 1 minute timeframe. ends next batch keep going in , become active (status = processing). after while, have 10 active batch in processing while first 1 has been finished yet. result, slowed down , no batch able finish. there anyway strictly limit number of active batch 1 @ time. thanks.

php - Zend2 : how default skeleton 'Application module' is rendered, when i trigger Album module? -

iam starting zend2. went through zend doc , useful in setting project/ understand flow. setup first module album (mentioned in tutor) , working fine. what wanted understand is, trigger album module using link http://localhost/album , browser output in such way album module output embedded default module 'application'. when trigger localhost url http://localhost/album , expect output of album module written in viewscripts , it's output basic html output table. please let me know how application module gets executed when trigger album module? aware configure userdefined modules in zf\config\application.config.php file know myquery here basic thing didnt understand. appreciated. when zf2 application booted modules in application.config.php loaded. misconception think if use route module other modules ignored. explained here , this flow chart can helpful understand zf2 processes.

php - Laravel 5.1 GuzzleHttp Client error: 404 when using mailgun -

i'm using mailgun service when sending mail laravel. however, i've set today , it's stopped working. have entered correct info in .env , config/services.php , config/mail.php . i'm still getting below error: clientexception in middleware.php line 69: client error: 404 it looks domain not getting passed through somehow, though in config/services.php file have: 'mailgun' => [ 'domain' => env('mydomain.com'), 'secret' => env('<my-mailgun-key>'), ], i have hidden above credentials safety, in real application proper values. please help. i hade same problem , solved removing env() call. thats because env return value of env variable in first argument (not value of argument) , otherwise return second argument. so: 'mailgun' => [ 'domain' => 'mydomain.com', 'secret' => '<my-mailgun-key>', ], try that.

activiti - How to modify variables in an atomic way using REST API -

consider process instance variable has value. update value, instance increment one, using rest api of activiti / camunda. how this? the problem rest api has services setting variable values , them. incorporating such api lead race condition. also consider example regarding integers while variable complex json object or array! this answer camunda 7.3.0: there no out-of-the-box solution. can following: extend rest api custom resource implements endpoint variable modification. since camunda rest api uses jax-rs, possible add camunda rest resources custom jax-rs application. see [1] details. in custom resource endpoint, implement read-modify-write cycle in 1 transaction using custom command: protected void readmodifywritevariable(commandexecutor commandexecutor, final string processinstanceid, final string variablename, final int valuetoadd) { try { commandexecutor.execute(new command<void>() { public void execute(commandcontext commandcont...

can i integrate a Python module into my own python code? -

i in process of writing quiz using simple python part of project- create executable file runs quiz when opened (so user doesn't have manually run code , potentially see answers of questions). as part of quiz, use webbrowser module send user wikipedia page if first answer submitted incorrect can research correct one. there way integrate module code, doesn't need imported (and therefore if used on computer, user doesn't have download module in order take quiz). seems beginner python . let me tell basic , first of whatever .py file create module in , lets have created file name example.py , can call module in file using: import example note: .py not required once imported correctly,you can call methods written in like: example.func() now, if have multiple modules, can keep inside folder(lets package ) ,so have: package- a.py b.py c.py __init__.py then have have file named init .py in same folder containing : import import ...

How to change header text from another page in c# asp.net -

i developing "label configuration" in whole web application in asp.net. requirement change header text on grid view. have created labelconfig.aspx page , need changes header text in page on same application. how can change header text in grid view page?

How do I calculate the invoice total after calling xrm.ConvertSalesOrderToInvoice() in the MS Dynamics CRM 2015 SDK? -

i'm using crm 2015 portal sdk (microsoft.crmsdk.extensions 7.1.0 nuget), , trying create invoice based on existing sales order. can create invoice, total 0 until views invoice using dynamics crm ui - , can't find way force recalculation via sdk. the sdk documentation (such is!) whopping great chm file included in sdk download, generated xmldoc comments - little in way of descriptions or examples. there's content @ https://msdn.microsoft.com/en-us/library/gg309408.aspx , includes couple of walkthroughs doesn't go detail. here's code i'm running - inside action method in asp.net mvc 5 project: public actionresult createinvoice(guid id) { var xrm = new spotlightxrmservicecontext("connectionstrings.crm2015.spotlight"); var order = xrm.salesorderset.firstordefault(o => o.id == id); var columns = new columnset(true); var invoiceentity = xrm.convertsalesordertoinvoice(order.id, columns); return(view(invoiceentity)); } after running c...

regex - Find files accessible outside of my organization -

in drive.files.list can, using 'q' parameter, files user can read/write or own. able use regular expression in query value. example set q "not '.+@my-org.com' in writers" . such query supported? have way (except invoking drive.permissions.list each , every file in drive) information from? thanks, uri seems account level drive api part of report api - activities list. api (and admin console - audit - drive) section supported in unlimited license. still haven't found proper api drive state (list files metadata in account, permissions etc.) seems state can inferred analyzing relevant activity events assuming activity not being evicted after predefined period of time. conclusion, @ moment, there no "root" directory @ account level. "root" respect logged in user. more happy proved wrong. uri

c# - Web Crawling Content Tag Issue -

i writing web crawler goes particular website, read data , take response. i've been successful in bringing response pages stuck 1 page says this content cannot displayed in frame. the error comes in visual studio frame. link works fine in browsers. i've done research , found page i've crawled doesn't have " content="allow" " tag in html. since can not change html... there way can on pass problem???

jquery - textarea maxlength dropdown menu -

i have dropdown menu 3 values , depending on value select in menu want textarea maxlength change. possible or can work? i have looked @ jquery val() , change() not got work. /best regards you can use like <input id="myinput" type="text" maxlength="2"> <select> <option onclick='changemaxlength(2)'>2</option> <option onclick='changemaxlength(5)'>5</option> <option onclick='changemaxlength(10)'>10</option> </select> and jquery function changemaxlength(length) { jquery("#myinput").attr('maxlength', length); }

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

what undefined reference/unresolved external symbol errors? common causes , how fix/prevent them? feel free edit/add own. compiling c++ program takes place in several steps, specified 2.2 (credits keith thompson reference) : the precedence among syntax rules of translation specified following phases [see footnote] . physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed. [snip] each source character set member in character literal or string literal, e...

r - using foreach and %dopar% to output the desired results -

so in simplistic world, lets take data: set.seed(123) require(doparallel) cl<-makecluster(2) registerdoparallel(cl) m <- 10 result = foreach(i=1:m,.combine=cbind) %dopar% { rows <- (1:10) <- rnorm(10, 5, 1) <- round(a, 0) b <- rnorm(10, 6, 1) b <- round(b, 0) df <- data.frame(rows,a,b) output_1 <- length(df$a[df$a == df$b]) # save number of accounts == b output_2 <- length(df$a[df$a != df$b]) # save number of accounts , b not equal result <- rbind(output_1,output_2) } using can check our output result[1,] result[2,] but want include rows (a string of row identities, not count) correspond a!=b in output of result the problem not single value , varies per alteration. how can 1 achieve this? update if add output_3 <- setdiff(df$rows, df$rows[df$a == df$b]) and adjust result <- rbind(output_1,output_2, output_3) we run more simulations required here apparently desire: set.seed(123) ...

Magento configswatches Call to a member function toOptionArray() on a non-object -

i using magento 1.9.1.0 when in admin goto admin >catalog > configurable swatches i below error fatal error: call member function tooptionarray() on non-object in d:\wamp\www\mournewcs3\app\code\core\mage\adminhtml\block\system\config\form.php on line 463 my magento version updated 1.9 1.9.1.0 i not figure out how fix , based on online research when comment below text file "app/code/core/mage/configurableswatches/etc/system.xml" it works fine commented text : <swatch_attributes translate="label"> <label>product attributes show swatches in product detail</label> <frontend_type>multiselect</frontend_type> <source_model>configurableswatches/system_config_source_catalog_product_configattribute</source_model> <sort_order>20</sort_order> <show_in_default>1</show_in_defau...

exception - How to ignore an ERROR while executing a block of code in ORACLE -

i trying run block of code in oracle , exits block if throws error. how overcome it? tried adding exceptions , didn't work. below code , error. > begin in ( > select constraint_name , table_name > user_constraints > constraint_type ='c' > , status = 'enabled' ) loop dbms_utility.exec_ddl_statement('alter table "'|| i.table_name || '" > disable constraint ' || i.constraint_name); end loop; end; / and throws following error should ignored , block should continue executing. begin * error @ line 1: ora-30671: cannot modify not null constraint on identity column ora-06512: @ "sys.dbms_utility", line 574 ora-06512: @ line 9 i tried adding exceptions didn't work well. you should use, nested begin-end block here, exception handling been inside inner block. begin in ( select constraint_name , table_name user_constraints constraint_type ='c' , sta...

service - Replace metadata page to Aspx page in Servicestack? -

i want replace metadata page of servicestack custom design page. have tried customise metadata page want replace our aspx page. in aspx page want add/remove our plugins of servicestack. we using servicestack version 3.9 development. how can replace /metadata page other page? if replacement of page possible how can access metadatafeature handler? means, how can display operations in page?

javascript - Odd behavior in $scope.$watch -

i have following $scope.watch function: $scope.logchecked = []; $scope.selectall = false; $scope.$watch('selectall', function(selectall) { console.log($scope.logchecked.length, $scope.logchecked, selectall); }); the console.log() output correctly enumerates $scope.logchecked while $scope.logchecked.length shows 0 0 [pf2n1448: false, cc7a1340: false, cc7a1328: false, pf2n1424: false, if2n1328: false…] true i modifying logschecked following checkbox: <td><input type="checkbox" ng-model="logchecked[log.batchid]"/></td> what's going on here? because logchecked array nothing inside (hence length 0 ), attached properties (arrays still objects). var foo = []; foo.bar = 'baz'; document.write(foo.length); // 0 document.write(foo.bar); // "baz" the part isn't obvious log.batchid isn't numeric. logchecked[log.batchid] attaches value property of logcheck...

c# - Design View Model as internal class -

i'm working on windows runtime component project must expose few controls outside world. use design view models have like: public sealed class firstpaneldesignviewmodel { ... } it works supposed during design time class exposed outside world of project, thing not desirable. can modify this: internal class firstpaneldesignviewmodel { ... } but designer (.xaml file opened) complains cannot access class , render not occur anymore: the name "firstpaneldesignviewmodel" not exist in namespace "using:someproject.designviewmodels". is there way use design view models in windows runtime component without exposing outside? i guess use friend assemlies using system.runtime.compilerservices; using system; [assembly: internalsvisibleto("assemblyb")] // class internal default. class friendclass { public void test() { console.writeline("sample class"); } } // public class has internal method. public class c...

java - How to add text to a specific position in the word file using Apache poi? -

Image
i have presence list need change depending if student present or not. need student names , putt ' ok ' if student present , ' / ' if student absent. wonder how search text in doc file , how put text in particular position. here word file use i can read docx file, still don't know how add text table. public class wordfile { public static void main(string[] args) { try { string filepath = system.getproperty("user.home") + "\\desktop\\admin dokument\\em.docx"; fileinputstream fis = new fileinputstream(filepath); xwpfdocument xdoc = new xwpfdocument(opcpackage.open(fis)); iterator < ibodyelement > bodyelementiterator = xdoc.getbodyelementsiterator(); while (bodyelementiterator.hasnext()) { ibodyelement element = bodyelementiterator.next(); if ("table".equalsignorecase(element.getelementtype().name())) { ...

fortran - Error on line 50: attempt to give DATA in type-declaration -

i try compile fortran 77 code , have problems this. integer row(nnzmax+nszero),column(nnzmax+nszero), + ireg(nximax),florsm(nzimax)/nzimax*2/ real lambda,imodel(nximax,nzimax),dm(nmmax), + dum1(nmmax),dum2(nmmax),data(ndmax+nsconst), + anz(nnzmax+nszero),ibmodel(nximax,nzimax), + smwz(nzimax)/nzimax*-1./,spwz(nzimax)/nzimax*-1./ error on line 50: attempt give data in type-declaration error on line 52: attempt give data in type-declaration i used work code,but has been compiled intel fotran compiler. have moved other country not have ifort installed here. using fort77 now. should try compilation options or?i have used script compile app .f folder. #! /bin/csh -f set list=`ls *.f` set flag="-o" echo $list foreach file (${list}) echo $file f77 ${file} ${flag} ${file:r} mv ${file:r} ../bin/. end i have changed declarations this: integer row(nnzmax+nszero),column(nnzmax+nszero), + ireg(nximax),florsm(nzimax), + dat...

file - Reading/Writing to Disk directly using C -

this question has answer here: linux: hard disk direct access (without fs) c program 3 answers i know how read/write from/to file in c using file pointer.but want go 1 step ahead , learn how directly read/write disk partition.also difference between writing file , disk.also can manipulate content present on disk such videos,images etc. i using c language on linux 14.04 gcc compiler. tia. one of nice things unix/linux systems pretty want access file. linux has /dev filesystem has special files block , character devices. among these raw disk partitions. if run df -k , you'll see devices associated mounted filesystems. on 1 of systems, command outputs following: filesystem 1k-blocks used available use% mounted on /dev/mapper/vg0-root 1040280 427008 560844 44% / /dev/mapper/vg0-var 4161216 3275900 675604 83% /var...

performance testing - PUT in JMeter 415 Unsupported Media Type -

i'm new in performance tests, started using jmeter , creating own scripts. doing stress performance test on api, until post, get, patch working, stopped @ put method. need send file using put method, in postman working (in body using file type selected file, in header multipart/form-data). i tried put file path in "send files request", parameter name: file, mime type: form-data, content encoding: utf-8. in request doesn't give me file. put http://10.111.30.12/api/tasks/2 put data: [no cookies] request headers: connection: keep-alive x-authtoken: mjeznuzfmemxmzfeqtvbmumxqzyxmdu0mje0oeffrtjdrju0odq0qkrcnduyqkq0qtgxreu0m0y5mdqwmtk1rdjgmee2rdnertixnjfbrje3meq0qtnfqzm1otvbrjmyqui0mkjfn0mwmjyxmkfdrtbfmtqymzyynjywmkremtu0rkmxqtlbmjjdoujfqkmwrjewnddfotewnjgyrdawmtvbotleq0exq0ffqtbgqja2mevdrunfqjgzoeq1mta4odvgouyxmdhbqum0rtc5n0jdqta2rkyynjyxqurgode3num0mdlfn0renem0mtc0nzc4mzczrjndq0vdqzm3q0y2qzu4ree2odg2qzaynee1mzy0qthdn0iwmjhemjde ...

asp.net mvc - The right way to bind the model to save multiple records to a table -

Image
i have menusettings pages displays menuname database(menutable).i want save details menurole table.for think have iterate on each menuitem , store details in menurole table(is correct method?).but problem getting menulist null.so couldnot iterate on menulist .also not sure how can bind checkbox value menurole table. the view is model is public class menurolevm { public int? roleid { get; set; } public selectlist rolelist { get; set; } public menurole menurole { get; set; } public ienumerable<menu> menulist { get; set; } } public partial class menurole { public int id { get; set; } public nullable<int> menuid { get; set; } public nullable<int> roleid { get; set; } public nullable<system.datetime> transactiontime { get; set; } public bool canadd { get; set; } public bool canedit { get; set; } public bool candelete { get; set; } public bool canview { get; set; } public virtual menu menu { get; set; }...

database - Querying REDIS with HMSET -

i using redis data store , have created hmset like: hmset key:1 source 5 target 2 hmset key:2 source 3 target 1 hmset key:3 source 3 target 5 hmset key:4 source 6 target 2 hmset key:5 source 2 target 3 now, want query these keys based on provided source , target list. suppose, list of source , target [2, 3, 6] i want have query select key source in[2, 3, 6] , traget in[2, 3, 6] which give me result key:4 source 6 target 2 key:5 source 2 target 3 with dataset (only few sets), option iterate them (either in lua script or fetching app) , filtering inspecting hashes. to speed things up, maintain secondary indexes (again, effort yours). like: sadd source:3 key:2 key:3 sadd target:2 key:1 key:4 then can relatively find matching keys issuing sinterstore command sinterstore found_keys source:2 source:3 source:6 target:2 target:3 target:6 you'll have keys seek under found_keys name. although, if find this , should ask yourself: why don't give ...

ios - Parse Query Results Not Appending to New Array -

Image
i'm using swift , i'm trying append parse query's results array, however, array shows appended value when it's printed within query's loop. when try printing array outside of loop before method's return, empty array. how can array appended value show outside of loop? class task { func all() -> array<string> { var taskarray = array<string>() var query = pfquery(classname:"task") var currentuser = pfuser.currentuser() // nil let userid = currentuser?.objectid query.wherekey("userid", equalto: currentuser!) query.findobjectsinbackgroundwithblock { (objects: [anyobject]?, error: nserror?) -> void in if error == nil { // find succeeded. println("successfully retrieved \(objects!.count) tasks.") // found objects if let objects = objects as? [pfobject] { ...

ios - Warning: Attempt to present * on * which is already presenting (null) -

this first application ios. so have uiviewcontroller uitableview have integrated uisearchbar , uisearchcontroller in order filter tablecells display override func viewdidload() { menubar.delegate = self table.datasource = self table.delegate = self let nib = uinib(nibname: "itemcelltableviewcell", bundle: nil) table.registernib(nib, forcellreuseidentifier: "cell") let searchbutton = uibarbuttonitem(barbuttonsystemitem: .search, target: self, action: "search:") menubar.topitem?.leftbarbuttonitem = searchbutton self.resultsearchcontroller = ({ let controller = uisearchcontroller(searchresultscontroller: nil) controller.searchresultsupdater = self controller.dimsbackgroundduringpresentation = false return controller })() self.table.reloaddata() } i using modal segue in order open element's viewcontroller display details of element. func tableview(tableview: uitablevi...

visual studio 2015 - How can I suppress Intellisense errors for certain files? -

visual studio 2015 offers option show intellisense errors in same window displays regular build errors. because don't need build in order see if code sytatictically correct. however, window shows 1 false positive error seems related intellisense bug. there way suppress intellisense errors specific code regions or entire files? did find answer? can writing following in code on line prior error raised #pragma warning disable xxxx where xxxx error code without "cs" or can try these steps suppress specific warnings visual c# or f# in solution explorer, choose project in want suppress warnings. on menu bar, choose view, property pages. choose build page. in suppress warnings box, specify error codes of warnings want suppress, separated semicolons, , rebuild solution. taken here https://msdn.microsoft.com/en-us/library/jj715718.aspx note warnings mentioned rather errors, me listed errors if choose show suppressed errors in error list window. migh...

python - How do I make this pygame program to change from a drawing state to non drawing state when clicked and vice versa? -

Image
i want simulation of paint work such if mouse button pressed, starts drawing ( button released instantly). again, when button pressed, should stop drawing. there no error. in present case shared remains pen down (drawing) mode. have tried get_pressed function succeeded in drawing when key remains pressed. tried making equal (a,0,0) , vary a achieve goal unsuccessful. after few attempts resulted in drawing mode turning on or off instantaneously instead of on click. here's part controls action: while keepgoing: clock.tick(30) event in pygame.event.get(): if event.type == pygame.quit: keepgoing = false elif event.type == pygame.mousemotion: lineend = pygame.mouse.get_pos() if pygame.mousebuttonup: pygame.draw.line(background, drawcolor, linestart, lineend, linewidth) linestart = lineend elif event.type == pygame.keydown: mydata = (event, background, drawcolor, l...

Shibboleth Configuration with ADFS 3.0 at the IDP sever -

we (very) new shibboleth , using adfs3.0 in our idp server , shibboleth authentication. issue facing though idp authenticating request don't see user information in request headers or in server variables. the question configuration should have adjust information in request. am missing add configuration settings in shibboleth2.xml or in attrribute-map.xml in client side? for start, when configuring relying party (in case shibboleth sp) in adfs, need configure claims issued. for start, perhaps configure adfs server send userprincipalname name id claim. can use "send ldap attributes claim" template under "issuance transform rules" in adfs. check again , see if appear in server variable.

xml - Alternatives for XSLT transformations with Delphi XE8 -

i trying perform xslt transformation delphi xe8 , running problems. xsl file refers external xsl file using import statement href attribute has relative path. transform fails error "named template 'skrivutdate' not appear in stylesheet." definition 'skrivutdate' located in external xsl file. definition looks following: <xsl:template name="skrivutdate"> <xsl:param name="oppgitttid"/> <xsl:if test="string-length($oppgitttid)!=0"> <xsl:value-of select="substring($oppgitttid,9,2)"/>.<xsl:value-of select="substring($oppgitttid,6,2)"/>.<xsl:value-of select="substring($oppgitttid,3,2)"/> </xsl:if> </xsl:template> i have placed external xsl file in appropriate directory (relative original xsl file) same error (i have tried other conceivable directories external file, none have worked). however, can perform transformation using editx x...

project - 0 Width column still showing up in Copied Data -

i have custom column @ start of gantt view, column somehow got shrunk 0px. when copy data excel, data still shows up. cannot figure out how make column have width. if try add column again, when copy excel there twice. can do? go task-> view (drop down)-> reset default this should bring columns finite widt

javascript - jQuery: click to scroll to next section -

i have function set whereby when click .section-down-arrow-wrap traverse ancestors , find closest .fullscreen element, idea when click scroll .section element down next instance of .fullscreen can see if fiddle though: https://jsfiddle.net/neal_fletcher/d9zbw1k2/ isn't working expected, scroll next one, don't, scroll upwards. need method that'll find fullscreen further tree won't grandparent element of section-down-arrow-wrap . here's markup: html: <div class="section"> <div class="fullscreen"> <span> <div class="section-down-arrow-wrap scroller">click</div> </span> </div> <div class="fullscreen"> <div class="half-screen"> <div class="section-down-arrow-wrap scroller">click</div> </div> </div> <div class="fullscreen"> <span> ...