Posts

Showing posts from March, 2011

java - Want to use properties file for storing and for reading hashmap -

i have codes , corresponding states it. i want read properties file data. not reading if populate data file. hence have supply externally using file writer. if populate data , read give error as: file not found exception i want data when letter in key asked. when write m, want data key starting m. eg m - mh:maharashtra,mn-manipur,ml=meghalaya,... my code far: public class codeproperties { public static void main(string[] args) { createcodeprop(); map<string, string> props = loadcode(); printconsole(props); } // write new properties file in java private static void createcode() { properties p = new properties(); p.setproperty("mh", "maharashtra"); p.setproperty("sk", "sikkim"); p.setproperty("mp", "madhya pradesh"); p.setproperty("mn", "manipur "); p.setproperty("ml", "meghalaya"

javascript - Can’t seem to grab ID and pass it to inner function -

i’m trying id of element on click, , pass animate function inner function. i can id can’t seem pass inner function. $("a").on("click",function() { var id = '#' + $(this).attr('id').substring(2); $('html, body').animate({ // console.log(id); not visible ?! scrolltop: $(id).offset().top }, 2000); });

c# - Pass variable from event handler to another method -

i working on .net application gets message serial port (arduino) received event handler. unable pass message stored event handler method. event handler receives data looking this: private static void messagereceivedhandler(object sender, serialdatareceivedeventargs e) { serialport serialport = (serialport)sender; string received_data = serialport.readexisting(); // pass received_data method } i want received_data variable passed method named getmessage() . method execute operations using received data returned. getmessage() called class, these operations can not implemented in event handler. edit : sorry, missed important point here. want received_data available in getmessage without getting parameter. because class needs access getmessage without (out output_data) parameter. public bool getmessage(out output_data) { bool success = true; // part not understand how implement string input_data = received_data; try{ // operations input_da

Angular 4 dynamic routerlink server/localhost not responding. Works when routerlink is static -

i attempting create dynamic navigation menu based on navigation menu service , navigation menu component. first prototyped navigation menu make sure worked when component html hardcoded. code looks this: <nav> <md-list> <md-list-item routerlinkactive="link-active"> <a [routerlink]="['/users']"> <md-icon>people</md-icon><span *ngif="navigationmenuservice.getstatus() == navigationmenuservice.navigationmenustatuses.iconsandlabels">users</span> </a> </md-list-item> <md-list-item routerlinkactive="link-active"> <a [routerlink]="['/patients']"> <md-icon>hotel</md-icon><span *ngif="navigationmenuservice.getstatus() == navigationmenuservice.navigationmenustatuses.iconsandlabels">patients</span> </a> </md-list-item> <md-list-i

xamarin.forms - Slow startup of xamarin app -

we developing cross platform app on pcl, time being using android devices testing. our concern taking 6 8 seconds (depending on device test it) start app, slow. after placing few breakpoints saw timing consumed pretty evenly. did notice particular parts took longer: 1s before reaching oncreate() on mainactivity (there's splash screen before has 1 image , background color) 1s on base.oncreate(bundle); 1s on global::xamarin.forms.forms.init(this, bundle); 1.5s on page mainpage = new logscreen(); (creating main page set main navigation page). this common problem while using xamarin.forms there many threads related specially one: https://forums.xamarin.com/discussion/93178/lets-talk-performance/p6 the news xamarin team working on it. here tips can improve it: https://blog.xamarin.com/5-ways-boost-xamarin-forms-app-startup-time/

vba - Why won't this loop to add CustomDocumentProperties work? -

i'm trying add few custom document properties folder of word documents. i know loop works fine, because used same loop different code modify , update pre-existing custom document properties. the code add custom document properties works, tested running in it's own macro single document, worked fine. since loop works , code within loop works, can't figure out what's wrong it. here's code: sub add_custom_docproperties() dim file dim path string dim filepath variant filepath = inputbox("please enter filepath files want update.", "input filepath", "copy filepath here...") select case strptr(response) case 0 endednotification = msgbox("the macro has been ended.", , "notification") exit sub case else end select path = filepath & "\" file = dir(path & "*.*") 'application.screenupdating = false while file <> "" documents.open filename:=path & file

ios - Unable to install IBMMobileFirstPlatformFoundation 7.1 using cocoapods -

we trying configure our native ios app mfp 7.1 using cocoapods. however, when define ibmmobilefirstplatformfoundation in our podfile , try pod install , getting below error: [!] error installing ibmmobilefirstplatformfoundation [!] /usr/bin/git clone https://hub.jazz.net/git/imflocalsdk/imf-client-sdks /var/folders/94/h6b7y6wx5k1dc_4q2xj5_8hw0000gn/t/d20170911-59452-jm2y5r --template= --single-branch --depth 1 --branch ibmmobilefirstplatformfoundation_7.1.11 cloning '/var/folders/94/h6b7y6wx5k1dc_4q2xj5_8hw0000gn/t/d20170911-59452-jm2y5r'... fatal: remote branch ibmmobilefirstplatformfoundation_7.1.11 not found in upstream origin we have followed below doc couldn't work. adding ibm mobilefirst platform foundation ios sdk new application cocoapods podfile: # platform :ios, '10.0' target 'test' use_frameworks! pod 'alamofire', '4.5.0' pod 'alamofireobjectmapper', '4.1.0' pod 'datepickercell', &#

Regex, lookBehind or lookAhead? -

my 2 regular expressions: ( |\t)+(?!"n)[\:a-za-z0-9,\"\[\]\}\{]+ ( |\t)+(?!"name": ".+)[\:a-za-z0-9,\"\[\]\}\{]+ both keep (yes, first one): "name": see http://regexr.com/3gnmu i'm trying hours keep (select other lines): "name": "animated", "name": "controlled", or @ least "animated" "controlled" where "name" present, using lookahead , lookbehind (notepad++, not javascript) in: "end": { "line": 3, "column": 17 } }, "range": [ 71, 79 ], "name": "animated", "typeannotation": null, "optional": false }, "name": "controlled", "typeannotation": null, "optional": false }

javascript - Creating HTML structure and using functions in append -

is there way use function in jquery .append somehow? need this: $("<tbody>").append(function(){ (i = 0; < test1.length; i++){ test1[i] } }) why okay in case $("<tr>").append( $("<th>").append("#"), $("<th>").append(theaders[1]), $("<th>").append("tuesday"), $("<th>").append("wednesday"), $("<th>").append("thurdsday"), $("<th>").append("friday"), $("<th>").append("saturday") ) but receive elements without "< th>" in next option: $("<tr>").append( $.each(theaders, function(i, d){ $("<th>").append($('<th></th>').text(d)); }) ) where var theaders = ["#", "monday", "tuesday", "wednesday", "thurdsday

react native - How disable iOS autobackup app data? -

i have application in react-native , when remove , reinstall application data restored. have resolution on android using android:allowbackup="false" in androidmanifest.xml, same problem happens in ios. have similar solution ios?

Tensorflow Text Classification Get Labels -

i'm trying run tensorflow example text classification found here . question how can input given text , label output using tf.estimator.estimator predict method?

php - What causes "unexpectedly closed the connection ERR_INCOMPLETE_CHUNKED_ENCODING" in chrome -

accessing test.php in local server environment, , chrome not load page. <?php virtual('./database_functions.php'); echo "<!doctype html>"; echo "<body>"; echo "<p>hello world"</p>; echo "</body>"; echo "</html>"; ?> running script command line php get: php fatal error: call undefined function virtual() in /var/www/test.php on line 2 this illustrates new question. google searching reveals include/require/require_once recommended, however, i'd understand why virtual being problematic. it's not getting right answer understanding why virtual() being problematic. edit: blame dreamweaver. explained @aynber

xml - Android scroll content above -

when typing in richeditor scroll content held in scrollview (the effect richeditor have, if within scrollview). unfortunately cannot add richeditor within scrollview seems mess entire scroll, forcing user manually scroll down page when text added richeditor. <scrollview android:id="@+id/scroll" android:layout_width="match_parent" android:layout_height="wrap_content" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" > <edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/titlefield" /> </linearlayout> </scrollview> <linearlayout android:layout_width="match_parent" android:layout_height=&qu

How to check if a string contains the characters from another string in Java? -

this question has answer here: accept 2 strings , display common chars in them [closed] 3 answers i using java 8. suppose have 2 strings a=helloworld , b=howareyou respectively. want find out matching characters of string b string along position in b. in example matching characters h , e , o , w , r , r 5th character in string b. don't want find if substring or not. want check if characters of 1 string present in string or not. there way that? below java code. public class charcheck { public static void main(string[] args) { string = "helloworld"; string b = "howareyou"; char st = containsany(a, b); system.out.println(st+", "); } private static char containsany(string str1, string str2) { if (str1 == null || str1.length() == 0 || str2 == null || str2.length() == 0) { if (str1 == null || str1.lengt

serial port - How can I receive data from an HM10 on another Arduino? -

link set of arduino's beginner in things arduino. tried set ble hm10 connection between 2 arduinos. connected ble modules ftdi cable , set them master , slave. connect instantly when power them up. set baud rate 9600 (default) , tried send "sensor value" slave master board servo should moved. i wrote code down , tested in many ways. hm10 rx/tx pins in arduino pin 0/1 , 7/8... nothing works me. wrote statement if data of slave reaches master serial terminal outputs nothing instead of "a". i used arduino uno slave code: #include <softwareserial.h> softwareserial myserial(7, 8); // rx, tx // connect hm10 arduino uno // txd pin 7 // rxd pin 8 int reading = a0; // fsr attached a0 int fsrreading; int val; void setup() { serial.begin(9600); myserial.begin(9600); //bluetooth serial begin } void loop() { int reading = analogread(a0); //read fsr value serial.print("analog reading = "); seria

javascript - What is the sort criteria for 'argument field' in dxChart? -

Image
i working in chart syde-by-syde bar, when finished saw order of 'argument field' wrong, sending in right order, chart shown disordered. i haven't been found nothing in documentation how sort field. grateful if knows trick fix it. here chart , datasource: var datasource = [ { state: "01-aug-2017", juan_sebastián: 7,maría_alejandra: 3,josé_tomás: 8,}, { state: "02-aug-2017",juan_sebastián: 1,maría_alejandra: 2, }, { state: "03-aug-2017",maría_alejandra: 3,juan_sebastián: 2,josé_tomás: 4,}, { state: "04-aug-2017",josé_tomás: 2,juan_sebastián: 4,}, { state: "08-aug-2017",josé_tomás: 1, }, { state: "09-aug-2017",maría_alejandra: 1,josé_tomás: 2,}, {

python - What to use for 'Default callback URL' when applying for Tumblr API? -

i want write simple python script download images tumblr page, teach myself various skills. have put 'default callback url' when registering api (seen here: https://www.tumblr.com/oauth/register ) what , should put? , how can find should put? thanks, complete noob out of depth.

python - Numpy replace for loop by using a matrix to perform indexing -

when dealing 3-dimensional matrix "m" of dimensions (a, b, c), 1 can index m using 2 vectors x elements in [0, a) , y elements in [0, b) of same dimension d. more specifically, understand when writing m[x,y,:] we taking, each "i" in d, m[x[i], y[i], :], thus producing dxc matrix in end. now suppose x numpy array of dim u, same concept before time y matrix uxl, each row correspond boolean numpy array (a mask) and @ following code for u in u: my_matrix[y[u], x[u], :] += 1 # y[u] mask selects specific elements of first dimension i write same code without loop. this np.add.at(my_matrix, (y, x), 1) # use numpy.ufunc.at since same elements occur multiple times in x or y. which unfortunately returns following error indexerror: boolean index did not match indexed array along dimension 0; dimension l corresponding boolean dimension 1 this issue can found when performing assignment for u in u: a_matrix[u, y[u], :] = my_matrix[y

yii2 advanced app - change blameable behaviour / value -

i created blameable values im model following options: blameable behaviors created by:angelegt_von updated by:aktualisiert_von value:\yii::$app->user->id this works fine now, need value \yii::$app->person->id. instead of automatically fill specified attributes current user id,it should filled person id person class(model) in application,created gii. however,following code throw out error:getting unknown property: yii\web\application::person public function behaviors() { return [ 'timestamp' => [ 'class' => timestampbehavior::classname(), 'createdatattribute' => 'angelegt_am', 'updatedatattribute' => 'aktualisiert_am', 'value' => new \yii\db\expression('now()'), ], 'blameable' => [ 'class' => blameablebehavior::classname(),

java - Opencart Skip 2 step checkout -

i need upgrade code work opencart 2.2 code remove step 2 of checkout opencart 2.1.0.1 http://www.lhcode.com.br/?ddownload=531 this ocmod 2.1.0.1

scala - Alphabetical range not displaying in IntelliJ IDEA console as expected -

i'm following tutorial on range here . sample code is val alphabetrangefromatoz = 'a' 'z' println(s"range of alphabets z = $alphabetrangefromatoz") the expected output according tutorial is: range of alphabets z = numericrange(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) what in intellij idea console output is: range of alphabets z = numericrange z is expected behavior idea? can configure idea in manner display output in way tutorial shows range? this due using newer scala version tutorial author. behavior changed in scala 2.12. output in tutorial how used work , output seeing new behavior. if want string showing of included elements can use th mkstring method on range val range = 'a' 'z' println(range.mkstring(", ")) prints a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z

ActionController::UnknownFormat error (missing template) in Users::OmniauthCallbacksController#facebook when using Devise gem in a rails application? -

i'm attempting finish facebook omniauth integration , ran error below. i'm not sure what's causing happen. occures second time try log in using facebook auth. first time (on user create) works perfectly. if log out , hten log in throws error. here's error actioncontroller::unknownformat in users::omniauthcallbackscontroller#facebook users::omniauthcallbackscontroller#facebook missing template request format , variant. request.formats: ["text/html"] request.variant: [] note! xhr/ajax or api requests, action respond 204 no content: empty white screen. since you're loading in web browser, assume expected render template, not nothing, we're showing error extra-clear. if expect 204 no content, carry on. that's you'll xhr or api request. give shot. user.rb class user < applicationrecord # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatabl

Jira-Python How to sync up two issues from two different Jira Databases -

i trying sync 2 different jira issues. let's john updated issue x in jira database a. want issue y in jira database b sync john updated, , vice-versa. is there way can use jira-python it? i found webhooks, want see if can done in python first.

Meteor - Updating user profile inside callback -

i'm trying update user profile inside callback, keep gettings same error. tried multiple approaches.. great. thanks! exception in callback of async function: error: invalid modifier. modifier must object. let user = meteor.users.findone({"profile.wallets.address": d.address}); let wallets = user.profile.wallets; wallets[0].amount = d.amount; meteor.users.update(user._id, {$set: {'profile.wallets': wallets}}); have tried doing this: let profile = user.profile profile.wallets = wallets meteor.users.update(user._id, {$set: {profile: profile}}) because maybe modifier can't dotted path

centos - sudo ruby picks system ruby but not rvm installed ruby. it doesnt work even after adding user in exempt_group option in sudoers file -

after going through articles understand sudo's environment , commands can use influenced /etc/sudoers file. this sudoers manual - https://www.sudo.ws/man/1.8.13/sudoers.man.html - specifies users in group specified exempt_group option not affected secure_path alters sudo's path this how defaults set in /etc/sudoers file defaults always_set_home defaults env_reset defaults env_keep = "colors display hostname histsize kdedir ls_colors" defaults env_keep += "mail ps1 ps2 qtdir username lang lc_address lc_ctype" defaults env_keep += "lc_collate lc_identification lc_measurement lc_messages" defaults env_keep += "lc_monetary lc_name lc_numeric lc_paper lc_telephone" defaults env_keep += "lc_time lc_all language linguas _xkb_charset xauthority" # # adding home env_keep may enable user run unrestricted # commands via sudo. # # defaults env_keep += "home" defaults secure_path = /sbi

html - inline div is not in center of another div/section on server but on localhost its fine -

Image
here website , part im having issues https://kas-test.000webhostapp.com/volonteri.html top part used inline tag works not in center bottom part, on kontakt.html.. off course while when run same code on localhost looks fine.. here picture of localhost: its in center.. why? i recommend start using grid system ( bootstrap has one ). blockquote isn't way make "left border", can accomplish using border-left: 5px solid black but if want "hotfix" code, can update doing: .inline { display: inline-block; width: calc(50% - 30px); // new max-width: 500px; // new margin: 15px; float: left; } blockquote { text-align: justify; border-left: 5px solid black; border-radius: 3px; padding-left: 20px; // new } cheers,

python - pip is not recognized what trying to install pyinstaller -

whenever try install pyinstaller not able , error "'pip' not recognized internal or external command, operable program or batch file." me affects me when try install directories. try use full syntax command, typing: python -m pip install pyinstaller

function - Accessing variable outside of scope (javascript) -

i trying access variable outside of scope of function. trying access price outside of function. have wait until request finishes, or not have access price? var httprequest = new xmlhttprequest(); httprequest.open('get', "https://api.iextrading.com/1.0/stock/aapl/quote", true); httprequest.send(); httprequest.addeventlistener("readystatechange", processrequest, false); function processrequest(e) { if (httprequest.readystate == 4 && httprequest.status == 200) { response = json.parse(httprequest.responsetext); console.log(response.latestprice); var lastprice = response.latestprice; document.getelementbyid("stockprice").innerhtml = lastprice; price = lastprice; } } document.write("outside: " + price); you don't have access price variable outside of function

.net core - What is the relationship between OpenId Connect and IdentityServer and Identity? -

i confused aspnetcore identity,openid connect , identityserver4. relationship between them,and suitable occasion each of them? openid connect specification (an authentication protocol). identityserver4 implementation of openid connect provider (server-side) asp.net core identity user-management library (over database). can used asp.net core application create users, verify password etc. openid connect providers using identityserver4 asp.net core applications, can use asp.net core identity authenticate users on login page.

"No executable found matching command" .net core console application -

after publishing .net core 2.0 console application... dotnet publish src\myapp.console --output c:\publish\console --configuration release i try executing in in published folder dotnet myapp.console but error no executable found matching command "dotnet-myapp.console" the trick include full file name .dll ie: dotnet myapp.console.dll

python - day number of a quarter for a given date in pandas -

i have create data frame of date follows: import pandas pd timespan = 366 df = pd.dataframe({'date':pd.date_range(pd.datetime.today(), periods=timespan).tolist()}) i'm struggling identify day number in quarter. example date expected_value 2017-01-01 1 # because it first day in q1 2017-01-02 2 # because second day in q1 2017-02-01 32 # because 32th day in q1 2017-04-01 1 # because first day in q2 may have suggestions? thank in advance. one of way creating new df based on dates , quarter cumcount map values real df i.e timespan = 5000 ndf = pd.dataframe({'date':pd.date_range('2015-01-01', periods=timespan).tolist()}) ndf['q'] = ndf['date'].dt.to_period('q') ndf['new'] = ndf.groupby('q').cumcount()+1 maps = dict(zip(ndf['date'].dt.date, ndf['new'].values.tolist())) map values df['expected'] = df.da

search - Endeca - Dimension product.category does not exist -

in endeca dgraph (mdex), following error logged repeatedly. affects cache components of atg. dgraph {dgraph} dimension product.category not exist the cachemap of dimensionvaluecachetools component not getting populated category dimension emptycachemap. refreshcache not providing expected results. seeing following error, logged dimensionvaluecacherefreshhandler **** error tue sep 12 12:37:38 -04:00 2017 1505234258871 /atg/endeca/assembler/assemblertools no dimension name matches product.category found. please provide valuable thoughts.

javascript - detect when an html element exits the screen -

Image
i have marquee. (tag < marquee >). when first element (the span class "span1") stops being seen on screen, notify me. http://jsfiddle.net/5o4ez17s/ <div id='container_marquee'> <marquee id='mymarquee' behavior="scroll" onmouseover="this.stop();" onmouseout="this.start();"> <span class='span1'>first marquee text</span> <span class='span2'>second marquee text</span> <span class='span3'>third marquee text</span> <span class='span4'>fourth marquee text</span> <span class='span5'>fifth marquee text</span> </marquee> </div> for example.. : alert("the first span not visible on screen"); i not want have set interval or something, maybe there more efficient way it. perhaps associate listening ev

run individual test intelliJ 2016 premium with python plugin -

Image
i know can right click on test , run individual test pycharm -> https://www.jetbrains.com/help/pycharm/running-tests.html i unable how figure out intellij 2016 python plugin? the main point set python sdk. seems specified not sure else wrong. advice update latest version of intellij idea , python plugin , see if helps. check project structure -> project sdk has correct path python.

Amazon S3 only returning Vary headers -

Image
i'm trying setup cors s3 bucket. below configuration - <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>*</allowedorigin> <allowedmethod>get</allowedmethod> <allowedmethod>head</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>*</allowedheader> </corsrule> </corsconfiguration> when make request postman (including origin header), below response. response not have access-control-allow-origin header vary header. http/1.1 200 ok date: tue, 12 sep 2017 04:24:54 gmt vary: origin, access-control-request-headers, access-control-request-method last-modified: tue, 12 sep 2017 04:09:59 gmt etag: "3a0b53f2dee09a17e509c5ba4fb0552" accept-ranges: bytes content-type: text/css content-length: 3805 server: amazons3 how access-control-allow-

execute a method only if the time is elapsed without using timer in java -

i want execute method in class every day once . if in day executed return or else execute method. i want know happens if exit code running in background? assuming you know how schedule task run daily trick becomes knowing if task has run in day without being prompted schedule. for desired behavior need save time-stamp (either variable in java environment or file on disk) of recent run, checking before updating , executing function. some psuedocode: static bool timemanager(){ currenttime = getcurrenttime() timestamp = gettimestamp() if(currenttime - timestamp > 1day-afewminutes){ updatetimestamp(currenttime) return true }else{ return false } } void jobwrapper(){ if timemanager(){ dothejob() }else{ log("skipping job @ "+currenttime+" because job ran "+lasttime) } } edit: rollback pointed out race condition put time manager in static method. realized rounding second might

php - Combine 2 arrays into 2d array without losing data -

i have 2 arrays , want combine third array 1 array key , value. tried use array_combine(), function eliminate repeated keys, want result array 2d array. sample array below: $keys = {0,1,2,0,1,2,0,1,2}; $values = {a,b,c,d,e,f,g,h,i}; $result = array( [0]=>array(0=>a,1=>b,2=>c), [1]=>array(0=>d,1=>e,2=>f), [2]=>array(0=>g,1=>h,2=>i) ); //what using right is: $result = array_combine($keys,$values); but returns array(0=>g,2=>h,3=>i). advice appreciated! you can below:- <?php $keys = array(0,1,2,0,1,2,0,1,2); $values = array('a','b','c','d','e','f','g','h','i'); $values = array_chunk($values,count(array_unique($keys))); foreach($values &$value){ $value = array_combine(array_unique($keys),$value); } print_r($values); https://eval.in/859753

c# - What will be the effective way for Database Synchronization? -

i need sync databases (multiple local dbs , 1 server db) related inventory management system. i've searched lot , found microsoft sync framework. gave shot it's not helping syncing multiple local dbs 1 server db. working fine i've 1 local db , 1 server db. my main problem that, when sync databases stock management must synced whole system's operations depends on it. is there better way syncing except using microsoft sync framework?

cakephp - Error: userHelper could not be found in cakephp3.5.1 -

how fix issue error: userhelper not found. this search.ctp inside element called in default.ctp <?php echo $this->form->create(null, ['url' => ['controller' => 'users', 'action' => 'search']], array('type' => 'get')); ?> <?php echo $this->form->input('username'); ?> <?php echo $this->form->button('search', ['type' => 'submit']); ?> below search controller public function search() { $value = $this->request->getdata('username'); $results = $this->users->find('all', ['fields'=>[ 'users.username', 'users.email', 'users.id', 'users.age', 'users.address', 'users.gender' ], 'order' => 'users.id asc', 'conditions' => array(' username like

java - How to pack several text files into arj archive and unpack it -

1) want pack several text files arj archive. 2) want unpack arj archive, consist of several text files. server-linux. web server- tomcat. client-side uses windows os. use jsp technology. can not use arj archivers, arj32 directly on client-side. thought assemble jar (library) file open source ( http://arj.sourceforge.net ) , import in jsp. little bit difficult me , not written in java lang.

c++ - I am getting different output while solving this program manually -

as assignment, have speculate output of program: #include <iostream> #include <ctype.h> #include <string.h> void change (char* state, int &s) { int b = s; (int x = 0; s>=0; x++, s--) if ((x+s)%2) *(state+x) = toupper(*(state+b-x)); } int main ( ) { char s[] = "punjab"; int b = strlen(s) - 1; change (s, b); std::cout<<s<<"#"<<b; } according book, when compiled , executed, program should output: bajjab#-1 the problem guess, executing code in mind, be bajnup#-1 instead. i making mistake somewhere, where? while running code on paper, it's idea keep track of values variables take. this int b = strlen(s) - 1; gives 5. inside change() now, b holds value of s , 5. now focus here: for (int x = 0; s>=0; x++, s--) if ((x+s)%2) *(state+x) = toupper(*(state+b-x)); x == 0, s == 5 , sum not even, %2 not result in 0, resulting in body of if statem

android - How to open PDF or TXT file in default app on Xamarin Forms -

i going open document using default app in xamarin forms. tried approach doesn't work me , not sure reason. device.openuri(new uri(file_path)); please give me great solution if knows how handle it. thanks. you can use dependencyservice implement each platform. firstly, create interface pcl example like: public interface ifileviewer { void showpdftxtfromlocal(string filename); } then android platform, create class implement interface: [assembly: xamarin.forms.dependency(typeof(fileviewer))] namespace namespace.droid { public class fileviewer : ifileviewer { public void showpdftxtfromlocal(string filename) { string dirpath = xamarin.forms.forms.context.getexternalfilesdir(android.os.environment.directorydocuments).path; var file = new java.io.file(dirpath, system.io.path.combine(dirpath, filename)); if (file.exists()) { xamarin.forms.device.begininvokeonmainthread(()

Can't find the script templates on Apps Script welcome screen -

thanks help. i'm starting way in apps script. watching of google's video tutorials , in tutorials there script templates in welcome screen gmail, calendar etc, can't see them on apps script. it lot started. thanks in advance all. as @parag jadhav stated, templates can accessed apps script editor welcome screen (which shown when editor first opened or clicking "help > welcome screen" menu item. selecting template welcome screen create new project pre-populated code need started. you may follow through guide . google apps script allows developers extend , manipulate google docs, sheets , forms. starting apps script, can useful have template work -- framework developers can learn , modify suit needs. to continue learning how extend google docs, sheets , forms apps script, take @ following resources: overview of apps script guide add-ons

javascript - It takes 2 seconds for my clock to appear on the html page -

i set 2 files js create clock timing event , html file show clock.. when run html file, takes 2 seconds clock appear. how make run faster?? my code found below... html file window.onload = startcurrenttime; function startcurrenttime() { var today = new date(); var h = today.gethours(); var min = today.getminutes(); var s = today.getseconds(); var y = today.getfullyear(); var mon = today.getmonth() + 1; var d = today.getdate(); min = checktime(min); s = checktime(s); mon = checktime(mon); d = checktime(d); // document.getelementbyid('todaylocaltime').innerhtml = "&nbsp;local current date:"+ d + "/" + mon + "/" +y + "&nbsp;local current time:" + h + ":" + min + ":" + s + " sgt "; document.getelementbyid('todaylocaltime').innerhtml = "<font size=3>current time " + h + ":" + min + ":" + s + "</font>

How can I convert .txt file into a list python? -

within .txt file: [['courtney fan', 'https://www.aaa.com', 'he guy'], ['courtney fan', 'https://www.bbb.com', 'dave butner', 'https://www.ccc.com', 'austin']] i tried method, doesn't split properly: with open("/users/jj/desktop/courtney_fan.txt","r") f: sd = f.read().split() how can write nested list in python? if data valid python literal (list, dict etc..) can use literal_eval function pythons built-in ast package. better solution using eval evaluate valid data structure, , not allow arbitrary code execution. there 0 cases using plain eval idea. from ast import literal_eval open("/users/jj/desktop/courtney_fan.txt","r") f: my_list = literal_eval(f.read())

batch file - regsvr32 /s works on windows 7? -

after searching while software show me blocking/uses shared folder found dr hoiby's "wholockme" ( http://www.dr-hoiby.com/wholockme/ ) looks of , seams program made xp. im trying instal on windows 7 , 10 , displays the file "file location" doesn't exist. usage: "wholockme [-m] [-f] filename" -m : display dialog box @ mouse position -f : dont test if instance exists. -i not runing program computer shared folder -i have runned compatibility mod xp , administrator rights -i have added program context menu my gues " regsvr32 /s wholockme.dll " (install.bat) doesnt work intended. ive added " @echo off " , " pause " no succes. https://stackoverflow.com/a/5726778/8214005 found regsvr32 /s added on xp , vista, gues bat file failed install dll succes. program waste of time right now? there free software can show user works in shared directory(the shared files on server request not host , programs lockhu

How to create Cron Job Hourly in Travis -

i need create build job in travis triggers 1hourly or 2hourly . have seen option in travis daily,weekly , monthly. please give me advice in same. i'm not sure travis is, can use @hourly instead of @daily etc in /etc/crontab , or put script in /etc/cron.hourly instead of /etc/cron.daily . locations may different depending on linux distro, how works in ubuntu.

php - Problems with open card Pay Pal standard plugin -

i'm having problem opencart shop version 2.x paypal standard plugin. 2017-09-08 13:31:18 - pp_standard :: ipn request: cmd=_notify-validate&mc_gross=7.13&invoice=2872+-+oleg+lopeta&protection_eligibility=eligible&item_number1=&item_number2=&payer_id=mh5hlr9x2gmxc&payment_date=03%3a30%3a19+sep+08%2c+2017+pdt&payment_status=completed&charset=windows-1252&first_name=oleg&mc_fee=0.59&notify_version=3.8&custom=2872&payer_status=verified&business=ebay%40rrr.lt&num_cart_items=2&verify_sign=abzlmqfngcw1kgs7w9u77rx7troaa8ihh-c5l6t2vsitswmlni0mbcay&payer_email=oleg.lopeta%40gmail.com&txn_id=7el168808h347641d&payment_type=instant&last_name=lopeta&item_name1=&receiver_email=ebay%40rrr.lt&item_name2=siuntimas%2c+pakavimas%2c+nuolaidos+ir+mokes%1aiai&payment_fee=&quantity1=1&quantity2=1&receiver_id=mnvalkuc7tzec&txn_type=cart&mc_gross_1=2.48&mc_currency=eur&m

angular - Test in Karma/Jasmine getModifierState -

how test method (angular): public detectcapslock(event: keyboardevent): void { let capson: boolean = event.getmodifierstate && event.getmodifierstate("capslock"); if (capson) { this.capson = "caps lock on"; } else { this.capson = ""; } }

by combining base url getting text out of image in python using scrapy? -

i tried code : src1 = "https://hms.harvard.edu/"<br/> src = response.css('div.person-line > div > img::attr("src")').extract_first()<br/> src = sites/default/files/hms-faculty-emails/bx0uvxkp.jpg <br/> import urlparse <br/> urlparse.urljoin(src1, src)<br/> https://hms.harvard.edu/sites/default/files/hms-faculty-emails/bx0uvxkp.jpg<br/> src2 = urlparse.urljoin(src1,src)<br/> email = pytesseract.image_to_string(image.open(src2))<br/> i'm getting error ioerror errno 22 invalid mode ('rb') or filename how email text out of text image..can 1 please? you should use io.bufferio buffer, because call function image_to_string http path. need write code this: def get_text(src): response = urlopen(src) buffer = io.bytesio(response.read()) return pytesseract.image_to_string(image.open(buffer))

jsf - What is the use of <alloy> tags of Liferay faces in liferay 6.2? -

what use of <alloy> tags of liferay faces? used fetch liferay web content? how use <alloy: commandbutton> tag , redirect button other wanted page? the <alloy> tags provided liferay faces alloy jsf component tags manifest html markup , javascript liferay's alloyui framework. can use <alloy:commandbutton> redirect 1 jsf view (within same portlet, on same portal page) adding "?faces-redirect=true" end of value of action attribute, or end of <to-view-id> value in faces-config.xml <navigation-rule> . can specify <redirect /> in <navigation-rule> . fetching web content can done via <portal:runtime> component liferay faces portal. see multiple instances use-case in showcase details.

angular - ng build --aot with out prod mode is not compiling in AOT -

can use aot mode dev or qa mode passing --aot flags in ng build command "ng build --env=dev --aot". have tried not compiling 'aot'? 1 suggest solution? yes, can adding flag ng build --aot=true the default value --aot false. (in non prod environments) you can see more detail build options here https://github.com/angular/angular-cli/blob/master/docs/documentation/build.md

php - Sublime Text 3 xdebug Scotch Box (Vagrant) Windows 10 not working -

i'm trying debug october cms application sublime text 3 , scotch box vagrant. my vagrant box ( https://box.scotch.io/ ) installed php 7, (the php -i config part xdebug listed below). sublime text 3 xdebug client running under windows 10. on windows port 9001 enabled/open in windows 10 firewall. here config files can think of check. the php -i command shows xdebug running on vagrant box: php -i | grep xdebug /etc/php/7.0/cli/conf.d/20-xdebug.ini, xdebug xdebug support => enabled ide key => sublime.xdebug xdebug.auto_trace => off => off xdebug.cli_color => 0 => 0 xdebug.collect_assignments => off => off xdebug.collect_includes => on => on xdebug.collect_params => 0 => 0 xdebug.collect_return => off => off xdebug.collect_vars => off => off xdebug.coverage_enable => on => on xdebug.default_enable => on => on xdebug.dump.cookie => no value => no value xdebug.dump.env => no value => no value xdebug.du

ini - Delphi XE6: How to load resource into TMemIniFile? -

i've been running delphi xe6 , trying put read-only ini files exe file. that have solved. loading files working fine tmemo. i have defined following function loading pure txt ini file resource tmemo: procedure loadtxtfromresource(const resourcename: string; outmemo: tmemo); var resourcestream: tresourcestream; begin resourcestream := tresourcestream.create(hinstance, resourcename, rt_rcdata); try outmemo.lines.loadfromstream(resourcestream); resourcestream.free; end; end; it working flawlessly. now, need, re-write procedure load aforementioned text file tmeminifile. i've been trying various things, can't seem able that. hints? you need load resource stream string list, , transfer tmeminifile . procedure loadinifromresource(const resourcename: string; inifile: tmeminifile); var resourcestream: tresourcestream; text: tstringlist; begin resourcestream := tresourcestream.create(hinstance, resourcename, rt_rcdata); try

powershell - Exception in "ValidateCredentials" "The server cannot handle directory requests." -

i use windows powershell query , validate user's windows credentials during installation process. worked until yesterday. department in company has changed configuration of domain controller , following exception. exception calling "validatecredentials" "2" argument(s): "the server cannot handle directory requests." @ line:32 char:5 + if ($pc.validatecredentials($username, $credential.getnetworkcredenti ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [], methodinvocationexception + fullyqualifiederrorid : directoryoperationexception from research found out has missing ssl connection. have add contextoptions.securesocketlayer somewhere in code. the question is: right place put parameter? cannot find examples powershell. here's script used check credentials: $credential = $host.ui.promptforcredential("need credentials.", "for using windows in

c# - Saving a Dictionary(Of String, Int16()) into a PostgreSQL cell -

i have dictionary(of string, int16()). dictionary represents analog values measurement. want store dictionary 1 cell of postgresql database. using npgsql. i searching long time, have no idea how that. my thought serialize dictionary , save array, not sure if correct way. is there out there, can me in matter? thanks answers have @ create type create type stringintpairtype (k string,v int); update: here full example of how accomplish pg sql define element type of dictionary create type stringintpairtype (k text,v int); create sample table. note collection column marked '[]' @ end create table collectionstables ( id serial unique, collection stringintpairtype[], description text, ts timestamp not null default now() ) inserts single record 2 dictionary elements insert collectionstables(collection,description) values ( array [ ('test1',1)::stringintpairtype, ('test2',2)::stringintpairtype ],