Posts

Showing posts from April, 2012

vector - CAPL writing to Text file -

i pretty new capl language. hence, having problems writing data .txt file. code wrote: includes { } variables { message generate_num gen; message logger logs; mstimer tim_100ms; mstimer tim_500ms; int time_over; // 500 ms flag. dword handle=0; float val=0; long index=0; int val_arr[512]; } on start { time_over=0; setwritepath("c:\\users\\türker\\desktop\\soft_pro"); handle= openfilewrite("log.txt",1); gen.num_data=1; } on envvar logger_sw { if(@this) { settimer(tim_500ms,500); settimer(tim_100ms,100); } else { canceltimer(tim_500ms); canceltimer(tim_100ms); } } on envvar save_txt { if(@save_txt==1) { int i; float val_n; for(i=0;i<elcount(val_arr);i++) { val_n=val_arr[i]; writeprofilefloat("1","1",val_n,"log.txt"); } } } on timer tim_100ms { output(gen); gen.num_data++; set...

android - Xamarin UI Tests get info about device and app version -

i have question. can in xamarin ui test information device , app? need information (ios+android): system version. device id app version there's nothing out of box gives this. instead way using backdoor. https://developer.xamarin.com/guides/testcloud/uitest/working-with/backdoors/ this method expose on app, , can call using iapp.invoke() , giving name of method. these methods can take string parameter , return string. inside backdoor method can whatever details want , return them. we use @ work device info such if phone or tablet, orientation it's running in (so can custom test steps on landscape vs portrait). it's useful trick.

javascript - Side effects when async operating on arrays -

i'm learning node.js atm, i'm asking myself: how "threadsafe" normal arrays? example: var myarr = ["alpha", "beta", "gamma", "delta"]; ee.on('event', function(itemstring) { //loop on array change length while looping through for(var i=0; i<myarr.length; i++) { // delete item out of array if(myarr[i] == itemstring) myarr.splice(i,1); } }); if multiple of events fired on ee-object, there chance, loop fail because indexes spliceed away? or said different: way ensure loop won't skip or fail because elements may deleted callback call of same event? thx :) node.js single threaded , not interrupts sync execution. still, you're modifying array while iterating length may lead skipping elements. also, event not prepared fired twice same array element.

How to data specific data from json file in angularjs -

i'm new angularjs , i'm trying retrieve json data json file. i'm unable it. this approach in controller: .controller('firstctrl', ['$scope', '$http', function ($scope, $http) { $http.get('https://feeds.citibikenyc.com/stations/stations.json'). success(function (data, status, headers, config) { $scope.data = data; alert(data); }). error(function (data, status, headers, config) { // called asynchronously if error occurs // or server returns response error status. }); }]); i want save specific values scope. how can this? in alert shows: [object object]. how can access each value inside json file? thanks. for(var item in data.stationbeanlist){ alert(item.id); } will ids of list or can push array way var ids = []; for(var item in data.stationbeanlist){ ids.push(item.id); } regards.

java - How the compiler will get to know which print method should be called by obj.print();? -

here example of interface showing multiple inheritance.and want know how can achieve multiple inheritance interface , why can't use class? interface printable // interface1 { void print(); } interface showable //interface2 { void print(); } class testtnterface1 implements printable,showable { public void print() { system.out.println("hello"); } public static void main(string args[]) { testtnterface1 obj = new testtnterface1(); obj.print(); //which print method called now? } } first question: the implementation satisfies both contracts, whether cast concrete class printable or showable , used same. notice there "impossible" situation, this: public interface printable{ string print(); } public interface showable{ void print(); } public class impl implements printable,showable{ /*impossible implement because cannot have same method signature 2 different return types*/ } the multi...

javascript - BootStrap Table With Dynamic Data using Jquery -

i using bootstrap table jquery. i tried myself still not solution. please check out this link . here need data dynamic. for example, there can situation fields can created dynamically. sometimes there can 3 columns , there can 4 columns based on json object.

javascript - How to find the selected element xpath using firebug function? -

firebug plugin or suggest me other method find selected element xpath in code linked xpath.getelementtreexpath() function. that function called when right-click element within html panel , choose copy xpath .

how can fetch data from database chunlby chunk by chunk using Python PETL or pygramETL or pandas -

is way fetch data db using chunkwise i have around 30 million data in db cause big memory usage without using tried pandas version 0.17.1 for sd in psql.read_sql(sql,myconn,chunksize=100): print sd but throwing /usr/bin/python2.7 /home/subin/pythonide/workspace/python/pygram.py traceback (most recent call last): file "/home/subin/pythonide/workspace/python/pygram.py", line 20, in <module> sd in psql.read_sql(sql,myconn,chunksize=100): file "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 1565, in _query_iterator parse_dates=parse_dates) file "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 137, in _wrap_result coerce_float=coerce_float) file "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 969, in from_records coerce_float=coerce_float) file "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 5279, in _to_arrays dtype=dtype) file "/usr/li...

signals - How does GNU Radio File Sink work? -

i want know how file sink in gnu radio works. receive signal , write file, , while it's being written signal receiving not done? i want make sure if portion of signal lost without being written file because of time taken writing. any or reading material regarding appreciated. depending sampling rate of device, writing samples file without discontinuities may impossible. instead writing disk, can write samples in ramdisk . ramdisk abstraction of file storage, using ram memory storage medium. great advantage of ramdisk fast read/write data transfers. however, file size limited somehow amount of ram memory host has. here article create ramdisk under linux. sure find guide windows too.

android - can we use google nearby api without internet or wifi routers -

i'm trying use google nearby api documents have read seems use google nearby api requires wifi router or internet connection if there have idea situation here waiting. no i did not want add here other word "no". but, did not allow me.

r - using fun.y in ggplot -

i absolute beginner. so, apologize asking basic question. trying plot minimum value in dataset. looked @ following page ( changing y scale when using fun.y ggplot ) , didn't find solution. here's first code: works well. plotsa red dot @ mean. ggplot(mpg, aes(trans, cty)) + geom_point() + stat_summary(geom = "point", fun.y = "mean", colour = "red", size = 4) this 1 doesn't work. can please me? ggplot(mpg, aes(trans, cty)) + geom_point() + stat_summary(geom = "point", fun.ymin = min, colour = "red", size = 50) i not sure what's going on. in stat_summary , plot depends on geom choose. seem want plot points, chose geom = 'point' . point has single y value, fun.y used summary. there other arguments, fun.ymin , fun.ymax . isn't super clear in documentation, needed if using geoms take additional aesthetics. example, geom = 'pointrange' plots point , vertical bar ymin , ...

button - Design of android app main page -

Image
i need know how make such frames button in android app , called.any please stuck problem button doesn't great use gridview creating design. in grid item layout, add imageview , textview , overlay. refer custom gridview imageview , textview in android detailed code.

java - How can I prevent tests from running during deploy? -

currently have surefire configured though spring boot's bom. i have tests running during deploy though there seems issue 1 of them... said same test passes fine in previous part of pipeline. don't need these tests run twice. i part of parent bom (has springs bom parent) how can configure tests not run during deploy phase? mvn deploy , running mvn test , mvn verify must continue work normal. you can achieve using commands while deploying or in pom.xml skip entire unit test, uses argument -dmaven.test.skip=true mvn install -dmaven.test.skip=true or in pom.xml <configuration> <skiptests>true</skiptests> </configuration>

Selected text and making bold apart from first word using jQuery -

i know simple still new jquery, i'm little unsure how approach. have found few solutions making first word bold not need. i want make words bold other first word; possible? i.e buy product to be buy this product i have example solution first word not sure how adjust. $('.homepage-boxes .ty-banner__image-wrapper a').find('.ty-btn_ghost').html(function(i, h){ return h.replace(/\w+\s/, function(firstword){ return '<strong>' + firstword + '</strong>'; }); }); i have adjusted classes need , find class want make text <strong> excluding first word. there few ways this. use regex / (.*)/ match first space followed every other character end of string sub match: $('.homepage-boxes .ty-banner__image-wrapper a').find('.ty-btn_ghost').html(function(i, h){ return h.replace(/ (.*)/, " <strong>$1</strong>"); }); <script src="https://ajax.googlea...

ruby on rails - undefined local variable or method `template_params' for TemplatesController:Class -

i tried create model named template , when tried open localhost:3000/templates/new , got undefined method error in templatescontroller , private method doesn't work, why? templates controller: class templatescontroller < applicationcontroller def new @template = template.new 4.times { @template.fields.build} end def edit @template = template.find(params[:id]) end def show @template = template.find(params[:id]) end def create @template = template.new(template_params) if @template.save redirect_to root_path end end def update end private def template_params params.require(:template).permit(:name, fields_attributes: [:id, :name,:template_id]) end end templates/new.html.erb: <div class="container"> <%= form_for(@template) |f| %> <%= f.label :name %> <%= f.text_field :name %> fields: <ul> <%= f.fields_for :fields |field| %> ...

get headers - PHP - `get_headers` returns "400 Bad Request" and "403 Forbidden" for valid URLs? -

Image
working solution @ bottom of description! i running php 5.4, , trying headers of list of urls. for part, working fine, there 3 urls causing issues (and more, more extensive testing). 'http://www.alealimay.com' 'http://www.thelovelist.net' 'http://www.bleedingcool.com' all 3 sites work fine in browser, , produce following header responses: (from safari) note 3 header responses code = 200 but retrieving headers via php, using get_headers ... stream_context_set_default(array('http' => array('method' => "head"))); $headers = get_headers($url, 1); stream_context_set_default(array('http' => array('method' => "get"))); ... returns following: url ...... "http://www.alealimay.com" headers | 0 ............................ "http/1.0 400 bad request" | content-length ............... "378" | x-synthetic .................. "true" ...

sql - insufficient system memory in resource pool -

i run ssis project , got error. there insufficient system memory in resource pool how check memory resource pool , know query/project spend mymmemory thanks increase server memory (sql server property >memory >maximum server memory .) kill use less process(sql). close unwanted process task manager too. good link

jquery - JavaScript trim character -

i want delete "()" each value. how that? var arr = ["(one)","(two)","(three)","(four)","(five)"]; for(var = 0; < arr.length; i++){ console.log(arr[i]); } since other answers unnecessarily complicated, here's simple one: arr = arr.map(s => s.slice(1, -1)); you can in-place if prefer; important part .slice(1, -1) , takes substring starting character @ index 1 (the second character) , ending before last character ( -1 ). string.prototype.slice documentation on mdn

Searching for a file and installing to that location with Inno Setup -

i new stackoverlow , inno setup, , guess. i trying have inno setup search file (in case wow.exe(i making interface installer)) , install folders , files directory. for example: user selects world of warcraft directory installer copies setup directories , files world of warcraft folder my problem: #define myappname "orangepaw3 ui installer" #define myappversion "1.1" #define myapppublisher "orangepaw3.net" #define myappurl "http://www.orangepaw3.net" #define vclstyle "rubygraphite.vsf" [setup] ; note: value of appid uniquely identifies application. ; not use same appid value in installers other applications. ; (to generate new guid, click tools | generate guid inside ide.) appid={{56fe86a8-b8b8-42b6-a569-0d6d261af486} appname={#myappname} appversion={#myappversion} ;appvername={#myappname} {#myappversion} apppublisher={#myapppublisher} apppublisherurl={#myappurl} appsupporturl={#myappurl} appupdatesurl={#myappurl} defau...

java - Using SharedPreferences for custom ArrayList -- Adapter or Editor error? -

i attempting save custom arraylist sharedpreferences. ideally first time app runs, there should empty sharedpreferences, if need fill 1 item, can "example." i've tried using debug break points , have isolated problem setadapter line marked below. the app crashes @ setadapter line, may due editor not being initialized? debugger tells me "editor = null" public class mainactivity extends appcompatactivity { arraylist<purchaseorders> purchaseorders = new arraylist<purchaseorders>(); purchaseorderadapter adapter; public sharedpreferences sharedpref; public sharedpreferences.editor editor; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); purchaseorders = new arraylist<purchaseorders>(); string[] items = new string[]{"1", "2", "3"}; purchaseorders.add(new p...

Using firebase tree structure to represent a "document outline" structure directly -

how good/stupid use firebase tree structure directly represent user-facing tree structure, "document outline" in "word processors"? opposed e.g. doing sql-join parent-child type of relationship , building tree via projection (which slow). i know there limit of 32 levels of nesting ( https://www.firebase.com/docs/web/guide/understanding-data.html ), should enough, cannot imagine sane user wanting many levels of nesting textual tree-outline... although maybe need divide 32 two, because of each node needing have sub nodes children , metadata, right? i know once tree node accessed via firebase api, sub-nodes need fetched, performance problem if user has lot of data, in end think not problem, since data user-entered plaintext (short). a performance problem arise if user pastes long chunks of text copied somewhere (e.g. tens of kilobytes). separate "tlob-s" via kind of "symlink" in firebase , fetch them on-demand different node, right? sam...

Python script fails using launchd and Selenium -

i'm trying run simple script using launchd in os x 10.10.5 job fails. think has permissions/privileges not set correctly? this error code throws up: traceback (most recent call last): file "/users/john/documents/autorun/opentwitter.py", line 7, in driver = webdriver.firefox() file "/library/python/2.7/site-packages/selenium-3.0.0.b2-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 64, in init self.service = service(executable_path, firefox_binary=self.options.binary_location) file "/library/python/2.7/site-packages/selenium-3.0.0.b2-py2.7.egg/selenium/webdriver/firefox/service.py", line 44, in init log_file = open(log_path, "a+") ioerror: [errno 13] permission denied: 'geckodriver.log' exception attributeerror: "'service' object has no attribute 'log_file'" in <bound method service.__del__ of <selenium.webdriver.firefox.service.service object @ 0x1...

Log4Net: Rolling File appender, custom file name -

i want logfile have following format: yyyy-mm-dd-[area]{-[optional tag]}.log so end 2016-08-23-area-performancetesting.log, area = [area] , performancetesting = [optional tag]. i having trouble adding 'area' string variable after date, optional tag variable. the resulting filename turns out this, wrong: {yyyy-mm-dd(tt)}.name.2016-08-23(pm).log <appender name="rollingfile" type="log4net.appender.rollingfileappender"> <param name="file" value="c:\logs\%date{yyyy-mm-dd(tt)}.name.log" /> <param name="appendtofile" value="true" /> <param name="rollingstyle" value="composite" /> <param name="maxsizerollbackups" value="1000" /> <param name="maximumfilesize" value="25mb" /> <param name="staticlogfilename" value="false" /> <param name=...

Python 3.5 ImportError: dynamic module does not define module export function (PyInit_cv2) -

this i'm getting when try import cv2 python3.5 idle. i'm using opencv 3.1.0 python3.5.2 ubuntu 16.04 i tried lots of installing methods no 1 solved problem, had import working on terminal stopped well. might have solution? import cv2 traceback (most recent call last): file "<pyshell#0>", line 1, in <module> import cv2 importerror: dynamic module not define module export function (pyinit_cv2) edit: followed tutorials on links: http://docs.opencv.org/3.0-last-rst/doc/tutorials/introduction/linux_install/linux_install.html http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/ for python3, need provide python init method entrance, which in cv.py guess. in case, this file did not exist. copied own google code . if cv.py not provided, you may error importerror: dynamic module not define init function (pyinit_cv2) when import cv2 in python3 (no such problem in python2).

C# editing Registry does not work -

i trying registry editing. below code mcve of problem: registrykey key; key = registry.localmachine.opensubkey("drivers", true); key = key.createsubkey("names"); key.setvalue("name", "nick", registryvaluekind.string); key.close(); that code works fine. following (changed drivers software ) not: registrykey key; key = registry.localmachine.opensubkey("software", true); key = key.createsubkey("names"); key.setvalue("name", "nick", registryvaluekind.string); key.close(); to me, difference between 2 blocks of code trivial. cause of issue, , how can around it? running code admin. my end goal modify values in "software\microsoft\windows nt\currentversion\winlogon" folder. i know possible powershell - should possible c# well. you can write 64-bit registry 32-bit process, need explicitly request 64-bi...

c# - Swashbuckle - Add Model and Example values to Swagger UI from a Model from another project -

Image
i using swagger document .net c# api , when models on project swagger crashes , doesn't load anything. when load sample webapi project visual studio uses models on same project , works: but when use models other project crashes before loading anything. i have api project , business project. models view models stored(and shared among other projects, therfore needed there) on buisiness project. is there way can indicate swagger model definitions are? i have handled similar scenario when worked on web api project hosted on iis. required enable xml documentations view models , models 2 different projects. below summary of main steps of work: enable xml documentation related projects (refer here ) for each project, build first , include xml file in project. set property of file "copy output directory" "copy newer" ensure copied bin folder of server. in swagger config, invoke includexmlcomments() include xml documentation files suggeste...

Swift cannot append to subscript? -

i can't seem use .append() on subscript. for example, here's array: var arraytest = [ "test": 8, "test2": 4, "anotherarry": [ "test4": 9 ] ] i able this: arraytest.append(["test3": 3]) but can't append array inside arraytest. i'm trying: arraytest["anotherarray"].append(["finaltest": 2]) first note: variable arraytest dictionary of type [string: nsobject] , not array. value key anotherarray dictionary. second note: setting key anotherarry , retrieving key anotherarray nil in example. i'm not sure how able call append() on arraytest since dictionary , doesn't have method. but key issue trying dictionaries , arrays value types , copied when passed around, rather referenced. when subscript arraytest anotherarray , getting copy of value, not reference value inside dictionary. if want modify directly inside array or dictionary (as opposed replaci...

c# - Azure github deploy and Automatic Package Restore -

i trying deploy project via project kudu , git hub on azure, without success. deploy log: command: "d:\home\site\deployments\tools\deploy.cmd" handling .net web application deployment. msbuild auto-detection: using msbuild version '14.0' 'd:\program files (x86)\msbuild\14.0\bin'. packages listed in packages.config installed. d:\program files (x86)\msbuild\14.0\bin\microsoft.common.currentversion.targets(1819,5): warning msb3245: not resolve reference. not locate assembly "common.logging, version=2.1.1.0, culture=neutral, publickeytoken=af08829b84f0328e, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors. [d:\home\site\repository\xpto.infrastructure.exporting\xpto.infrastructure.exporting.csproj] d:\program files (x86)\msbuild\14.0\bin\microsoft.common.currentversion.targets(1819,5): warning msb3245: not resolve reference. not locate assembly "common.logging.core, version...

Shorten hex string in node.js -

i have long hex string itdkl7s5wvhzo3hpfuwsa3lod3lsnzg8qaylvw5mprwnht0_zr7qxdkbn6bqkvdgivvkmkuhuuhmjrr1kyoapfwcmwcdy1zek5dyf3vk9lztsrdiphnqe01y3d8gvwzekt54210-mybtve0qmfknxc_-qjnmdhil-lsegqitrurrltzc1slvzrxj3inezfch96sbj_8jfqpvdobhepjrb . possible shorten , decode in node.js?

c++ - C++03 Initialization of an Array of Objects -

i'm sure dupe, can't seem find information on prior c++11. if have plain old data (pod) type: class foo { double x, y, z; }; and class such as: class bar { foo foos[13]; }; if construct bar object default initialize 13 foo member objects default initializer? i've tested visual studio 2008 , default initializing foo objects. i'd know if that's standard behavior or visual studio special sauce. it seems had created variables in zeroed range.

Failed to sync gradle project in Android Studio -

i unable sync basic samples project google play services . have tried updating minsdk , targetsdk , compilesdk versions, updated project structure , flavors project still won't sync . this error: error:could not find method compile() arguments [com.android.support:support-v4:24.2.0] on defaultexternalmoduledependency{group='com.android.support', name='appcompat-v7', version='24.2.0', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.defaultexternalmoduledependency. please install android support repository android sdk manager. <a href="openandroidsdkmanager">open android sdk manager</a> however installed latest android support repository (rev 36) assume issue else. if want try , clone project: https://github.com/playgameservices/android-basic-samples.git gradle file: apply plugin: 'com.android.application' android { compilesdkversion 24 buildtoolsversion '24....

mysql - Php login code not reading from database -

this question has answer here: when use single quotes, double quotes, , backticks in mysql 10 answers im trying make login php android app, modified php tutorial, issue used response of "success" = 0 "message"= "not fields filled", added few print_r see problem result aimatosnintendo , inputs username , password, it's not getting ifs, code: <?php // array json response $response = array(); define('db_user', ""); // db user define('db_password', ""); // db password (mention db password here) define('db_database', ""); // database name define('db_server', ""); // db server // array json response $conn = new mysqli(db_server, db_user, db_password,db_database); // check post data print_r ($_post['username']); print_r ($_post['password']); if(...

python - Why is my output throwing an unexpected result? -

i unsure why code not working. have copied verbatim instructor. import urllib def read_text(): quotes = open("c:\users\kyle\desktop\movie_quotes.txt") contents_of_file = quotes.read() print(contents_of_file) quotes.close() check_profanity(contents_of_file) def check_profanity(text_to_check): connection = urllib.urlopen("http://www.wdyl.com/profanity?q="+text_to_check) output = connection.read() print(output) connection.close() read_text() and output: <html><head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>404 not found</title> </head> <body text=#000000 bgcolor=#ffffff> <h1>error: not found</h1> <h2>the requested url <code>/profanity?q=shot</code> not found on server.</h2> <h2></h2> </body></html> why happening? thank you!! ...

javascript - Ransack submit form onchange of select box -

using ransack, have simple dropdown filtering list. working ok, need press submit button. i'd action of changing dropdown submit search_form_for <%= search_form_for @query |f| %> <%= f.select :category_eq, options_for_select(article::categories.sort.map {|k,v| [v,k]}), include_blank: true, onchange: "this.form.submit();" %> <%= f.submit %> <% end %> the onchange doesn't work onchange: "this.form.submit();" edit the onchange doesn't appear in rendered form <form class="article_search" id="article_search" action="/articles" accept-charset="utf-8" method="get"><input name="utf8" type="hidden" value="✓"> <select name="q[category_eq]" id="q_category_eq"><option value=""></option> <option value="caffe">caffe</option> <option value=...

sql server - Can I create column with header name according to values in another table? -

Image
this first question here , please excuse me, if question looks wired. totally new programming , sql though have knowledge in ms access database. i have created 2 tables orderstabel , ordereditems . want create table orderfulldetails in screenshot here: i want create orderfulldetails table follows. contains in item column in ordereditem table should create separate column in orderfulldetails table names. if column exists in orderfulldetails table equal item name in ordereditem table, qty value should entered matching column according orderno. , if there no column matching, should create new column. your million worth me. thanks firstly welcome stack overflow. in asking question expected show how have attempted solve problem yourself. not pictures, , prefer given sample data, in format makes easy copy. please note not coding service. however, because first time, kind. it goes against normal rules of relational database design build third table ho...

dns - How does my local HOSTS file resolve but IP will not -

i'm in process of launching new website. migrated code new server. admin @ new host told me have add entry hosts file , able see website. had me add: 111.222.3333.4444 example.com www.example.com these example, after doing this, worked. question is, how? if visit ip directly in browser 403 forbidden error. host have way resolve ip location on server if resolved domain name? i'm confused how works. understand changing ip address can domain name resolve ip, i'm wondering why, on hosts end, resolve way, not typing in ip directly. thanks! does host have way resolve ip location on server if resolved domain name? not exactly. browser, when sending request ip address, send 1 important piece of information called 'host header', actual host name typed in browser. you can not open website entering ip address in browser's address bar because web servers (and possibly many other network components between , web server) not host 1 web site on ip ...

r - Spatial data and memory -

i trying add geotiffs running memory issues. r using 32gb according the following r error... in writevalues(y, x, start = 1) : reached total allocation of 32710mb: see help(memory.size) i checked properties of r , 64 bit , target is... "c:\program files\r\r-3.3.0\bin\x64\rgui.exe" the version is r.version() $platform [1] "x86_64-w64-mingw32" $arch [1] "x86_64" $os [1] "mingw32" $system [1] "x86_64, mingw32" $status [1] "" $major [1] "3" $minor [1] "3.0" $year [1] "2016" $month [1] "05" $day [1] "03" $`svn rev` [1] "70573" $language [1] "r" $version.string [1] "r version 3.3.0 (2016-05-03)" $nickname [1] "supposedly educational" so looks max memory being used r. tried use bigmemory package in r. in code below tried changing matrix big.matrix failed , error occurs when trying write output file. suggestion...

javascript - Not able to print pop up dialog box -

i need print popup dialog box. have tried several times, whole window popup dialog box, need print dialog box. i did find 1 solution print dialog box, not showing values entered in text box while printing. please me code below or give references print div values values inside text box. this code have written print pop dialog. <script> function printcontent() { var documentcontainer = document.getelementbyid('scorecard'); var windowobject = window.open("", "printwindow", "width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes"); windowobject.document.writeln('<!doctype html>'); windowobject.document.writeln('<html><head><title></title>'); var str = "<style type='text/css' media='all'>"; str = str + "mystyles { text-align: center; }...

c# - How to read each character in string and replace with urdu characters -

this question has answer here: how can convert english digits arabic digits? 6 answers this different approach different question, it's not arabic it's urdu. it's not date time it's string. i want read each character in string , replace urdu characters. for example: string amount = "100"; i want read each string. if 1 should replace urdu character ١ if 0 should replace urdu character ٠ and end result of ١٠٠ how can break down, tried using this: var output = ""; foreach (char c in str) { if (c == 1) { output = "١"; } output += c; } i want concatenate characters. i suggest using dictionary<char, char> substitutions; string.concat concatenation: dictionary<char, char> urdu = new dictionary<char, char>() { {'0', '١...

python - PyCrypto RSA and Pickle -

i'm working pycrpyto's rsa class: from crypto.cipher import pkcs1_v1_5 crypto.publickey import rsa message = 'to encrypted' key = rsa.generate(2048) cipher = pkcs1_v1_5.new(key) ciphertext = cipher.encrypt(message) that code runs fine, , i'm able decrypt ciphertext. however, need able serialize these ciphers. haven't had problem pickle -ing other pycrypto ciphers, aes, when try pickle rsa cipher run following error: from crypto.cipher import pkcs1_v1_5 crypto.publickey import rsa import pickle message = 'to encrypted' key = rsa.generate(2048) cipher = pkcs1_v1_5.new(key) pickle.dump(cipher, open("cipher.temp", "wb")) cipher = pickle.load(open("cipher.temp", "rb")) ciphertext = cipher.encrypt(message) traceback (most recent call last): file "<stdin>", line 1, in <module> file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/crypto/cipher/pkc...

jenkins - how do i get latest build in jenkns with specified parameter -

i asked question how latest build in jenkns specified parameter , , solutions http://localhost:8080/job/myjenkinsjob/api/xml?tree=builds[actions[parameters[value]],number]&xpath=//build[action[parameter[value="myparametervalue"]]]/number&wrapper=list however return multiple build numbers, want latest (one build number only) <list><number>49</number><number>48</number></list> i tried several variation xpath , didnt work does xpath: select first element specific attribute @ all? so: http://localhost:8080/job/myjenkinsjob/api/xml?tree=builds[actions[parameters[value]],number]&xpath=(//build[action[parameter[value="myparametervalue"]]])[0]/number&wrapper=list or perhaps brackets need elsewhere

runnable - How to auto refresh data displayed in my Android Activity every second -

i need auto refresh data displayed in activity every second, i've used runnable, timer etc. these works after few seconds ui slow , not responsive. i've read intentservice don't think it's idea use infinite loops in intentservice . there i'm missing, please help. maybe help: private class waittimer extends timertask { @override public void run() { //every 5 seconds if(millis % 5 == 0) { //do magic here } millis+=1 } } and in oncreate() millis = 0; timer = new timer(); timer.schedule(new waittimer(), 0, 1000);

javascript - Questions about this JS script -

i found js script on internet unsure on how adjust 1 index.php file. so script has section holds default values. file .js file: (function($) { $.extend({ smoothscroll: function() { // scroll variables (tweakable) var defaultoptions = { // scrolling core framerate : 150, // [hz] animationtime : 700, // [px] stepsize : 80, // [px] // pulse (less tweakable) // ratio of "tail" "acceleration" pulsealgorithm : true, pulsescale : 8, pulsenormalize : 1, // acceleration accelerationdelta : 20, // 20 accelerationmax : 1, // 1 // keyboard settings keyboardsupport : true, // option arrowscroll : 50, // [px] // other ...