Posts

Showing posts from January, 2012

c# - tweetinvi, I can't retrieve messages -

i want monitor retrieve messages bot can respond them. i can send pm using tweetinvi reason, can't retrieve of messages in account. getlastmessage returns null. i have tried following: in test, have timer runs every 1s , pols messages. private static void ontwittertimedevent(object source, system.timers.elapsedeventargs e) { try { ienumerable<imessage> msg = controller.getlatestmessagesreceived(); ; // message.getlatestmessagesreceived(100); if (msg != null) { console.writeline(msg.elementat(0).senderscreenname + msg.elementat(0).text); if ((msg.elementat(0).senderid == ####myid#####) & (msg.elementat(0).text == "?")) { message.publishmessage(tweet, ####myid#####); console.foregroundcolor = consolecolor.darkgreen; console.writeline(msg.elementat(0).senderscreenname + msg.elementat(0).text); console.resetcolor();

Slider revolution and fancybox-3 -

hi try implement fancybox 3 in carousel plugin slider revolution. next code work fancybox 2 fancybox 3 arrows not work. want o know if have solution. link: https://www.themepunch.com/faq/using-fancybox-with-slider-revolution/ code work in fancybox2 not show arrows in fancybox3 /* change revapi1 whatever api name being used slider */ var api = revapi1; /* no need edit below unless want change default fancybox settings */ api.on('revolution.slide.onloaded', function() { jquery(this).find('.fancybox').each(function() { var $this = jquery(this); if(!$this.is('a')) $this = $this.removeclass('fancybox').find('a'); $this.addclass('fancybox').attr('rel', 'gallery').fancybox({ /* begin fancybox options */ width: 'auto', height: 'auto', autosize: true, aspectratio: true, fittoview: true, autocenter: true, scrollin

Yii2 yii console commands not work -

Image
i try run command, 1 answer command how run commands? i did not find solution, reinstallation yii2 helped me.

c++ - Is it possible to reserve memory in icu::UnicodeString? -

i wondering if possible reserve memory in icu::unicodestring (icu 59.1) similar how done in std::string through std::string::reserve method? have looked through documentation provided icu::unicodestring , have not seen method allow me that. have missed one, or not possible? thanks!

formatting output data neatly C++ -

Image
this question has answer here: format output in table, c++ 4 answers when print results of program screen, data on place want align results best possible. using setw(10) in order it's not working can me? thanks this output looks like: this print function: void print(const call_record *call_db, int & count) { cout << fixed << showpoint << setprecision(2); for(int i= 0; <= count; i++) { cout << call_db[i].firstname <<" " << call_db[i].lastname <<" " << call_db[i].cell_number <<setw(15) << call_db[i].relays <<setw(10) << call_db[i].call_length; cout <<setw(10) << call_db[i].net_cost <<setw(10) << call_db[i].call_rate << setw(10) << call_db[i].call_tax <<setw(10) << call_db[i].total

c++ - Bizzare identical incorrect results across different MWR2MM algorithms for RSA montgomery multiplication -

Image
background i'm trying implement rsa 2048 in hardware (xilinx zynq fpga) using variety of different montgomery methods. implementing algorithm using xilinx hls (essentially c++ code synthesized hardware). note: sake of post, treat standard c++ implementation, except can have variables act bit-vectors 4096 bits wide, , access individual bits using foo[bit] or foo.range(7,0) syntax. haven't yet parallelized it, should behave standard c++ code. please don't afraid , stop reading because said word fpga , hls. treat 1 c++ code. i've been able working prototype uses standard square-and-multiply modular exponentiation, , standard radix-2 mm algorithm modular multiplication, takes space on fpga , need use less resource-heavy algorithms. to save space, i'm trying implement tenka-koc scalable multiple word radix 2 montgomery multiplication (mwr2mm) proposed here . i've been struggling month no avail. there interesting problem resulting out of struggles canno

Batch learning general algorithm -

i have been reading reinforcement learning: introduction sutton , barto (2012) , have come across batch learning method. unfortunately, method not described in book , scientific articles regarding batch learning yet advanced me. could please elaborate on method , provide exemplary pseudo-algorithm reinforcement learning method?

compare - AssertJ comparing double values -

i compare double values assertj. dont catch why test failing. @test public void testinteresttoquote() { double result = basiccalculator.accumulationfactorbyyearsandinterest(years, interest) assertions.assertthat(result).iscloseto(expected, assertions.offset(0.1d)) } exception is: java.lang.assertionerror: expecting: <7.256571590148141e-5> close to: <7.25> less <0.1> difference <7.249927434284099>. (a difference of <0.1> being considered valid) why assertion fail? it late yesterday, 7.256571590148141e-5 not thought, 7.25.., because e-5 moves point 5 left, 0.0000725...

logic - Update database best approach -

i have database contain scrapped content (a huge amount of data) . database updated daily . i'm wonder best approach update db . 1) data db backend , compare new scrapped articles list , if it's new article , add list , , after completing comparaison phase , add new articles db . 2) each article in scrapped list , search in db , if doesn't exist add db. thank

Rails select, group, having, count -

i want count of how many appointments under 1 hr, 1 2 hrs , on 2 hours. appointment .select("id, extract(minute (check_out_at - check_in_at)) minutes") .group("id, minutes") .having("count('minutes') < 60") .count the count method return following exception: activerecord::statementinvalid: pg::syntaxerror: error: syntax error @ or near "as" line 1: ...extract(minute (check_out_at - check_in_at)) minutes... assuming id primary key, neither need group by nor having . can count of appointments under 1 hour: appointment.where("(extract(epoch (check_out_at - check_in_at))) < 3600").count to count of appointments grouped hour, can this: appointment.group("floor(extract(epoch (check_out_at - check_in_at))/3600)").count the output like: {0.0=>1, 2.0=>31, 3.0=>11} meaning 1 appointment between 0-1 hour, 31 between 2-3 hours , on.

In Spring Boot what tells the app to use a database? -

this question has answer here: where default datasource url h2 come on spring boot? 1 answer i've small spring boot project maven pulls spring-boot-starter-data-jpa spring-boot-starter-data-rest h2 and others. don't have datasource references, have jparepository , userdetailsservice. how, then, spring libraries deciding use hibernate (shows logged in console) and, guess, h2? i looked @ stackoverflow conversation own console log has no "h2" or "database" log statements. you should add "schema.sql" src/main/resource. must match entity classes. spring boot take care of rest. better write application.properties spring.jpa.hibernate.ddl.auto=create-drop you can work mysql instead of h2. delete h2 dependency, add mysql connector dependency , add these application.properties spring.datasource.url=jdbc:mysql:

AB Testing Analysis in R. prop.test() OR t.test() -

ab testing scenario: testing new design of registration page entry button on web - user clicking on button taken new page in user can supply email , create registered account. the sample chosen randomly - 50% see test button, 50% see control. data collected @ user-level. columns: account_id, group ( values test or control), visit_flag (values 1 if visited, 0 if didn't) should using prop.test check if ctr (click-through-rate) significant or should using t.test?

r - Apply which.min to data.table under a condition -

i have data.table , need know index of row containing minimal value under given condition. simple example: dt <- data.table(i=11:13, val=21:23) # val # 1: 11 21 # 2: 12 22 # 3: 13 23 now, suppose i'd know in row val minimal under condition i>=12 , 2 in case. what didn't work: dt[i>=12, which.min(val)] # [1] 1 returns 1 , because within dt[i>=12] first row. also dt[i>=12, .i[which.min(val)]] # [1] 1 returned 1 , because .i supposed used grouping. what did work: to apply .i correctly, added grouping column: dt[i>=12, g:=true] dt[i>=12, .i[which.min(val)], by=g][, v1] # [1] 2 note, g na i<12 , which.min excludes group result. but , requires computational power add column , perform grouping. productive data.table has several millions of rows , have find minimum often, i'd avoid computations. do have idea, how efficiently solve this? you can use fact which.min ignore na values "mask"

performance - Running two instances of Android emulator, second instance is slow -

when run 2 separate android virtual devices using 2 instances of android emulator, second device launched extremely slow , laggy (the first device fine). slowness continues after kill first device. i noticed second device eats huge amount of host cpu (around 230%) whereas first device uses around 30%. my host runs mac os x 10.11.6 , has quad-core i7 processor. what cause issue? open avd's settings , hit show advanced settings . under emulated performance can choose use gpu render faster. can adjust ram virtual devices under memory , storage in same menu. hope works.

PHP/Mysql Database populated dropdown list spitting out index number instead of string value -

i can't figure out why drop down list, populated mysql, giving me number instead of string value. below code drop down list, displays item names. problem when pull selected item later number instead of string item name user selected. <select name="product1" class="form-control" id="sel1"> <?php require('./phpconnect.php'); $dropdown = array(); $downquery = "select * masterdesc"; $response = @mysqli_query($dbc, $downquery); if($response){ while(($row = @mysqli_fetch_array($response,mysql_assoc))){ $dropdown[] = $row['description']; } } foreach($dropdown $key => $value){ echo '<option value=' . $key . '>' . $value . '</option>'; } echo "</select>"; mysqli_close($dbc); ?> here code later used pull selected item. $product1 = $_post['product1']; any thoughts?

git - VSTS - continuous deployment to two separate Azure web apps from one repository -

Image
so i'm using visual studio, git, , visual studio team services. i've got "test" site running azure web app , continuous deployment set up. push local pc vsts, updates test app. far good. main question: can set continuous deployment second web app, "real" or "live" site on different domain, linking same vsts repository? possible link 2 azure web apps 1 vsts repository? the workflow i'm thinking of using disable continuous deployment live app, push change, update test app, make sure it's working, , re-enable continuous deployment live app , push trivial change, update both, or pull in latest repository live app if it's possible that. strategy? i've never deployed before , welcome , advice. yes, better way using 2 branches of repository. create new branch in repository (e.g. test, there test , master branches now) configure continuous deployment each app service use corresponding branch of repository if using az

CSS transitions not effecting HTML generated by Javascript -

i have css transform rotates objects on hover. .rotate { transition: 0.2s; } .rotate:hover { transform: rotate(20deg); } this works fine when applied hard coded html element. however page contains script generates more html , inserts div (div.innerhtml = newhtml). the css transitions not work on elements generated script. why case , how can corrected? edit: here simplified example shows code, i'm unable example work @ all, hard coded rotate , generated html don't rotate , have no idea why. <!doctype html> <head> <style> .rotate { transition: 0.2s; } .rotate:hover { transform: rotate(20deg); } </style> </head> <body> <a class="rotate" href="#">a test text</a> <div id="plot"></div> <script> function makehtml() {

Performance Reduction While Using SQLite3 Interface In Python -

i learning sqlite3 , using through python interface. my sqlite3 script includes several view creation , select * viewx limit n; statement @ end. when run in sqlite3 on shell, instantaneous (the version of sqlite3 3.7.7.1) on other hand, when run in python using executescript, takes more time (the version of sqlite3 in python 3.8.8.1) i curious why happening. the output of explain query plan is: in shell: 0|0|1|scan table table1 t1 (~1000000 rows) 0|1|2|search table table2 t2 using integer primary key (rowid=?) (~1 rows) 0|2|0|search table table3 t3 using index index_3 (x_id=?) (~10 rows) in python: (0, 0, 1, 'scan table table1 t1') (0, 1, 2, 'search table table2 t2 using integer primary key (rowid=?)') (0, 2, 0, 'search table table3 t3 using index index_3 (x_id=?)')

php - Wordpress ACF Add_Row to Nested Repeater -

i'm trying add new row acf repeater nested inside repeater. 2nd-level repeater contains 2 sub-fields i'm adding array pass add_row() . row not added when run this. think may using add_row incorrectly, not sure i'm going wrong. appreciate help! $mydata = array( 'field_59796b22b2fa0' => 'com', 'field_59796b3bb2fa1' => 1 ); if( have_rows('field_596c523609342', $id) ) { while( have_rows('field_596c523609342', $id) ) { the_row(); if( have_rows('2field_59796b08b2f9f', $id) ) { while( have_rows('2field_59796b08b2f9f', $id) ) { the_row(); add_row('field_59796b08b2f9f', $mydata, $id); } } } }

Request to API Flask-Restful with JWT header and JSON data -

i'm trying following python: this work: curl -i -h "content-type: application/json" -h "accept: application/json" -x -d "{\"dato\":\"1\"}" http://localhost:5000/api/v1/recurso -h " authorization: jwt ...p_gws2xoay" my resource: class recursoprivado(resource): @jwt_required() def get(self): json_data = request.get_json(force=true) #data = json.loads(json_data) return json_data api.add_resource(recursoprivado, '/recurso') i tried this, return response [401] url = 'http://localhost:5000/api/v1/recurso' data={"dato":"1"} token="...p_gws2xoay" response=requests.get(url, data=data, headers={'authorization':'jwt '+token}) any ideas? response = requests.get(url, data=data, headers={'authorization': 'jwt '+token}) should this: response = requests.get(url, json=data, headers={'authorization': 'jw

python - How to use idxmin() to return USABLE index for pandas Series object -

i trying return index of minimum value of series (which comes column of dask dataframe), , use index access corresponding value in different column of same dataframe. (i.e. value @ same index.) doing intermediate math in process. i using following code: start_time = dataframe['time'].sub(c1).pow(2).idxmin() end_time = dataframe['time'].sub(c2).pow(2).idxmin() #now pull out data different column in dataframe using start_time , end_time data = dataframe['current'].loc[start_time:end_time] however consistently getting following error: pandas.core.indexing.indexingerror: many indexers i have no clue means, 1 other thing noticed have no grasp on type of value idxmin() returning. mysterious object me. when try print out value of start_time or end_time is: start_time: dd.scalar<series-..., dtype=int32> end_time: dd.scalar<series-..., dtype=int32> i cannot find specific information on these objects (although i've deter

recursion - C Converting 4 digit numbers to binary -

i want print binary equivalent of numbers file in 20 bit field spaces after every 4 bits when number exceeds 1024 (i've tested this), no longer outputs in binary in base don't know (i.e. 1234 = 0000 0014 1006 5408) here code #include <stdio.h> long converttobinary(long); int main() { char binnum[20]; //binary number char array int i; long b, decnum; //b output binary number, decnum each input number file file *fileptr; fileptr = fopen("numbers.txt", "r"); while (!feof(fileptr)) { fscanf(fileptr, "%li", &decnum); if (decnum < 0 || decnum > 65535) { printf("error, %5li out of range.\n", decnum); continue; } b = converttobinary(decnum); //function call binary conversion = 18; while (i >= 0) { if (i == 4 || == 9 || == 14) { binnum[i] = ' ';

spring - Java Stream with ::new to Kotlin -

i'm trying convert following spring security code java kotlin. java: collection<? extends grantedauthority> authorities = arrays.stream(claims.get(authorities_key).tostring().split(",")) .map(simplegrantedauthority::new) .collect(collectors.tolist()); kotlin: val authorities = arrays.stream(claims[authorities_key].tostring().split(",".toregex()).droplastwhile { it.isempty() }.totypedarray()) .map(simplegrantedauthority()) .collect(collectors.tolist<simplegrantedauthority>()) i type mismatch error ( required: function<in string!, out (???..???)>! ) on .map(simplegrantedauthority()) . how convert above java code kotlin ::new keyword correctly? using arrays.stream doesn't make code super readable: val authorities = arrays.stream(claims.get(authorities_key).tostring().split(",").totypedarray()) .map(::simplegrantedauthority).collect(collectors.tolist<

python - Count unique elements from all the rows of a column -

i have data frame df column called "groups". looks below - groups [u'cn=myusers,ou=groups,dc=sample,dc=com',u'cn=sample-users,ou=groups,dc=sample,dc=com'] [u'cn=myusers,ou=groups,dc=sample,dc=com',u'cn=sample-users,ou=groups,dc=sample,dc=com',u'cn=moreusers,ou=groups,dc=sample,dc=com'] first row contains 2 groups , 2nd row contains 3 groups. want make count of each unique group in whole column. resulting data frame should - group count u'cn=myusers,ou=groups,dc=sample,dc=com' 2 u'cn=sample-users,ou=groups,dc=sample,dc=com' 2 u'cn=moreusers,ou=groups,dc=sample,dc=com' 1 how able achieve task. trying- res=df.groups.apply(pd.series).stack().value_counts() but doesn't give me expected result. doesn't break counts of individual groups. this should work: from itertools import chain pd.dataframe(map(lambda x: (x, 1), chain.from_iterab

html - No horizontal scrollbar in flex layout when scroll amount is less than vertical scrollbar -

i'm attempting place scrollable area inside of flex layout, when need both horizontal , vertical scrollbars on nested box, vertical scrollbar isn't being taken account when determining need horizontal scrollbar (and vice-versa). see example: https://jsfiddle.net/mjkwbud4/ the setup the .fixed div given: a fixed width of 200px overflow: auto inner block content 200px wide, height greater outer container. expected outcome: a vertical scrollbar appear, since content's height larger fit a horizontal scrollbar appear, since vertical scrollbar takes space, meaning inner content wouldn't fit either. actual outcome: a vertical scrollbar appears, , takes horizontal space a horizontal scrollbar not appear, despite there not being enough. using mousewheel shows can indeed scroll side-to-side, though overflow: auto considers there no need scrolling. changing overflow: auto overflow: scroll shows both scrollbars being active. $0.scrollwidth > $0.c

css - How to find an event listener in Chrome Dev Tools? -

i know hovering on element causes element new class added it. how check , eventlistener on chrome? event listeners tab in chrome list listeners on document instead of specific element. to view event listeners single element have selected, make sure uncheck 'ancestors' box in event listeners tab. if checked, see event listeners ancestors of element - may seeing now. hovering doesn't add class element, triggers hover state element can targeted css pseudo-class selector. not event listener there event listeners can added detect mouse pointer on element (see end of answer). here example of targeting hover state of paragraph tag :hover pseudo-class selector: p:hover { background: blue; color: white; } <p>hover me</p> <p>or hover me</p> in chrome devtools, can force hover state on element view hover state behavior. click :hov button @ top right of styles pane, , check :hover box. if there pseudo-cla

dplyr - How to convert week and year columns to a date column with lubridate in R -

i have been following along hadley wickham's r data science book. has lot of advice on using lubridate, lot of functions assume have year, month, , day. how convert date format when have year , week using lubridate? data.frame( year = c(2015, 2015, 2016, 2016, 2016, 2016, 2016), week = c(1, 20, 35, 49, 8, 4, 53) ) #year week #2015 1 #2015 20 #2016 35 #2016 49 #2016 8 #2016 4 #2016 53 you can weeks() function in lubridate, if want. have first set baseline date object. did here using str_c stringr. library(dplyr) library(stringr) my_dates <- tribble( ~year, ~week, 2015, 1, 2015, 20, 2016, 35, 2016, 49, 2016, 8, 2016, 4, 2016, 53 ) my_dates %>% mutate(beginning = ymd(str_c(year, "-01-01")), final_date = beginning + weeks(week)) #> # tibble: 7 x 4 #> year week beginning final_date #> <dbl> <dbl> <d

object - C++ when is the right time to use a no default constructor vs. getters and setters vs just invoking the variables in the class directly -

ie. when have class say class color() { private: std:: string _colors public: color(); color(std::string colors); std::string setcolors(std::string colors); std::string colors; ~color(); } and wanted call in class main assign variable colors. #include "color.h" using namespace std; int main() { color c; c.colors = "blue"; //is correct color("blue"); //is correct c.setcolors("blue");//or correct. return 0; } when correct time use either? the answer is: depends. on you, preferences, coding guidelines of team, how oo code is, syntactic sugar language offers, etc. becomes question of usable/readable code. my (arguably general) advice is: whenever writing simple code , class resembles data more objects, totally ok give public access members (you might want use structs in c++ though instead of class, make decision more obvious). not easier write in first place, easier use read endless get-set

javascript - How to display the contents of mongo db in front end? -

i working on meanstack , new it. requirement want contents of mongo db displayed on web page. believe done using angular js. have created module named 'display' along angular modules of mean stack server, client , test folders inside it. in config folder of client, there 2 files, users.client.menus.js , users.client.routes.js the following users.client.menus.js, (function () { 'use strict'; angular .module('display') .run(menuconfig); menuconfig.$inject = ['menuservice']; function menuconfig(menuservice) { menuservice.addmenuitem('topbar',{ title: 'display table', state: 'display', type:'label', roles: ['*'] }); } }()); users.client.routes.js (function () { 'use strict'; angular .module('display.routes') .config(routeconfig); routeconfig.$inject = ['$stateprovider']; function routeconfig($stateprovider) {

swift - iOS CosmicMind/Material TextField Mask -

i add pattern uitextfield. example, when user starts type, automatically format content inside the uitextfield following mask: '###.###.###-##' // brazilian document format '+99 (99) 99999-9999' // brazilian phone number format. how can material uitextfield ? i have tried find in official repository's documents unable to.

vhdl - How to send a floating point number to FPGA from HPS? -

i using altera de0 nano soc fpga. want know how send floating point number fpga hps. let float ex_hps = 6000.9282; sent via avalon memory mapping interface. if avalon_write_data address has 32 bits data length (which can set qsys), in fpga side number stored in 32-bit std_logic_vector right? does std_logic_vector contains float number fixed point type ( 13 downto -14 ) original value? or how put number fixed point number ex_fpga(13 downto -14) in fpga side in vhdl? this have looked yourself. you need map float integer in c first, using knowledge system. #include <math.h> unsigned int preparefortransmission(float inputvalue) { if (inputvalue < 0) return 0; /* underflow error: clip */ if (inputvalue >= powf(2.0f, 14)) return (unsigned int)pow(2.0, 28) - 1; /* overflow error: clip */ return (unsigned int)(inputvalue * pow(2.0, 14) + 0.5); /* +0.5 round */ } then in vhdl can port unsigned std_logic_vector(27 downto 0) ufixed(13 downto -

jmh - How to benchmark methods that throw exceptions? -

how 1 supposed benchmark methods throw exceptions using jmh? i tried following under jmh 1.19: @benchmark public void throwexception() throws illegalargumentexception { throw new illegalargumentexception("hard-coded exception"); } but got error: # run progress: 0.00% complete, eta 00:02:00 # fork: 1 of 3 # warmup iteration 1: <failure> java.lang.illegalargumentexception: hard-coded exception [...] am supposed blackhole exceptions follows? @benchmark public void throwexception(blackhole bh) { try { throw new illegalargumentexception("hard-coded exception"); } catch (illegalargumentexception e) { bh.consume(e); } } or there way tell jmh accept thrown exceptions? summarizing answers i've received i've received kiril s. , oleg estekhin : jmh fail if benchmark method throws exception. correct this, benchmark method must catch exception. can consume exception using blackhole object,

python - srapy crawl mulitlayer append data in a list and yield this item -

Image
the web site structure i'm trying parse using scrapy following: i'd extracted data have format: [{ "project":{"projectname":"project1"}, "samples":["sample1's_content","sample2's_content","sample3's_content"] }, { "project":{"projectname":"project2"}, "samples":["sample1's_content","samples2's_content","sample3's_content"] }] i tried this: from item import item class spider(scrapy.scrapy): name = spider def start_request(self): url = "the main page's url" yield scrapy.request(url=url, callback=self.parseprojectlist) def parseprojectlist(self, response): url in selector(project_list) yield scrapy.request(url=url, callback=self.parseproject) def parseproject(self, response): #scrap data myitem = item()

c# - TLSharp function GetHistoryAsync returns only 100 last messages -

i have 2714 new messages in telegram chat. call gethistoryasync "limit" parameter equals 10000, function returns 100 last messages. know whether tlsharp error or telegram protocol restriction? you can't more 100 pieces of messages/views/... in 1 request, can play max_id , offset, specific 100 messages. public async task<tlabsmessages> gethistoryasync(tlabsinputpeer peer, int offset, int max_id, int limit)

OrientDB Studio - How to display Embedded Field Values? -

is there way make orientdb studio display embedded field values inside graph? for example, want show name.en values following class... @class **items** name: {"de":"deutsch","en":"english"} from graph view, select node , it'll make appear settings tab @ left of page, select field display list.

postgresql - Throttle Postgres I/O for debugging purposes -

in chromium devtools, can throttle network speed, useful debugging. is there way throttle i/o speed of postgres server running locally? there's no postgresql feature so. patch 1 in, though, adding small sleep in postgresql's buffer i/o routines. instead, simulate slow i/o @ operating system level. particularly vm. or use nbd (network block device) , rate-limiting tool trickle . or run else i/o heavy contend postgresql, , possibly ionice postgresql. see also: https://www.kernel.org/doc/documentation/cgroup-v1/blkio-controller.txt https://unix.stackexchange.com/q/48138/45708

database - error accessing oracleDB with python -

i used docker run virtual oracle db server on localmachine(host). it works when use in on shell(bash). however want make access python interface. cx_oracle(python interface oracle) installed, but not accessed on python code(jupyter notebook). code simple below import cx_oracle con = cx_oracle.connect("system/oracle@localhost:8080") error code: databaseerror traceback (most recent call last) <ipython-input-8-681e47c38e7c> in <module>() ----> 1 con = cx_oracle.connect("system/oracle@localhost:8080") databaseerror: ora-12537: i'm not sure can use cx_oracle.connect port that. can check data source name ( dsn ). first, try connecting without :8080 . if doesn't work, try below. go python interactive mode command line. python -i import cx_oracle dsn = cx_oracle.makedsn( 'localhost', '8080' ) if don't find that, check out burleson. site helpful ora issues. h

c++ - Does make_shared do a default initialization (zero-init) for each member variable -

take ordinary struct (or class) plain old data types , objects members. note there no default constructor defined. struct foo { int x; int y; double z; string str; }; now if declare instance f on stack , attempt print contents: { foo f; std::cout << f.x << " " << f.y << " " << f.z << f.str << std::endl; } the result garbage data printed x, y, , z. , string default initialized empty. as expected. if create instance of shared_ptr<foo> using make_shared , print: { shared_ptr<foo> spfoo = make_shared<foo>(); cout << spfoo->x << " " << spfoo->y << " " << spfoo->z << spfoo->str << endl; } then, x, y, , z 0 . makes appear shared_ptr performs default initialization (zero init) on each member after object instance constructed. @ least that's observe visual studio's compiler. is

c# - Can't upload file inside an asp:formview inside an asp:UpdatePanel? -

this aspx file:- <ajaxtoolkit:modalpopupextender id="modalprogress" runat="server" targetcontrolid="panelupdateprogress" backgroundcssclass="modalbackground" popupcontrolid="panelupdateprogress" /> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:formview id="formviewreg" runat="server" width="100%" allowpaging="false" onitemupdating="formviewreg_itemupdating"> <edititemtemplate> <asp:linkbutton id="lbtnupdatepersonal" runat="server" onclick="lbtnupdatepersonal_click" validationgroup="g1">update</asp:linkbutton> <asp:fileupload id="fileupload1" runat="server" /> </edititemtemplate> <itemtemplate> <asp:linkbutton id="lbtneditpersonal" runat="server" onclick="lbtneditpersonal_click">edi

issue getting data of other page in a single page application using AngularJs -

this app.js, var myapp = angular.module('myapp', ['ngroute']); myapp.config(function($routeprovider){ $routeprovider.when('/',{ templateurl: 'views/home.html', controller: 'homectrl' }).when('/detail',{ templateurl: 'views/details.html', controller: 'detailctrl' }).otherwise({ redirectto: '/home' }); }); myapp.controller('homectrl',function($scope){ $scope.message ="welcome home page" }); myapp.controller('detailctrl',function($scope){ $scope.message ="name: manish" }); this index.html page, <html > <head> <meta charset="iso-8859-1"> <title>try out</title> <script type="text/javascript" src="js/angular.js"></script> <script type="text/javascript" src="js/angular-route.js&qu

javascript - Angular 1 + webpack produces huge file -

i have been working on angular webpack seed github link after installing modules, saw app.bundle.js file becomes 15mb , , took time. i have tried changing devtool to config.devtool = 'cheap-module-source-map'; it reduces file size 200kb almost, good, application crashed angular error error: [$injector:unpr] unknown provider: t 'use strict'; // modules var path = require('path'); var webpack = require('webpack'); var autoprefixer = require('autoprefixer'); var htmlwebpackplugin = require('html-webpack-plugin'); var extracttextplugin = require('extract-text-webpack-plugin'); var copywebpackplugin = require('copy-webpack-plugin'); /** * env * npm lifecycle event identify environment */ var env = process.env.npm_lifecycle_event; var istest = env === 'test' || env === 'test-watch'; var isprod = env === 'build'; module.exports = function makewebpackconfi

wordpress - Which widget is used to display category post with their respective panels? -

Image
i new in wordpress , have 5 categories needs display on homepage each panel. every category post has own panel in 5 post shown , show view more link. here screenshot saw 1 of wordpress website. this image of recent posts category. want on website. can tell me widget or plugin used kind of structure build. for more reference can https://freshersbee.com

webdriver - Selenium-Onclick() JavaScript issue -

following source code select radio button having javascript onclick() method. <span class="adcontrols"> <input id="rdbtnpreviousdate" name="date" value="rdbtnpreviousdate" onclick="javascript:settimeout('__dopostback(\'rdbtnpreviousdate\',\'\')', 0)" type="radio"/> <label for="rdbtnpreviousdate">27-jul-2017</label> </span> i tried following none of code run successfully. 1) wbd.findelement(by.cssselector("input[id=rdbtnpreviousdate]")).click(); 2) wbd.findelement(by.cssselector("input[value=rdbtnpreviousdate]")).click(); 3) wbd.findelement(by.xpath("html/body/form/table[2]/tbody/tr[1]/td[2]/span[1]/input")).click(); 4) wbd.findelement(by.xpath("//[class='adcontrols'][@id='rdbtnpreviousdate']]")).click(); 5) wbd.findelement(by.cssselector("input[onclick=javascript:settimeout('__

Reverse a string in Python -

there no built in reverse function in python's str object. best way of implementing this? if supplying concise answer, please elaborate on it's efficiency. str converted different object, etc. how about: >>> 'hello world'[::-1] 'dlrow olleh' this extended slice syntax. works doing [begin:end:step] - leaving begin , end off , specifying step of -1, reverses string.

c# - Bind a record in Treelist -

i'm facing issue in binding single row treelist. in application have 2 forms. first form contains treelist contain list of rows. i need selected row list. using public object selectedrow { return treelist.getdatarecordbynode(treelist.focusednode) } using code selected row. in second form, i'm trying bind row. public void row(selectedrow) { treelist2.datasource=selectedrow; //i row value here. } but data not able shown in second treelist. step need bind selectedrow second treelist. the datasource should ienumerable-type. try (pseudo-code ahead): public void row(selectedrow) { list<yourtype> list = new list<yourtype>(); list.add(selectedrow); treelist2.datasource=list; }

typo3 - How to get link settings in flux link wizard -

i using flux link wizard in fluidcontent element ( https://fluidtypo3.org/viewhelpers/flux/master/wizard/linkviewhelper.html ) like this: <flux:field.input name="link" label="link"> <flux:wizard.link /> </flux:field.input> but rte settings not invoked in link wizard (default classes etc.). possible add default rte settings flux link wizard? i using typo3 8.7.4 ckeditor flux 8.2.1 fluidcontent 5.2.0 fluidpages 4.1.0 pagetsconfig not available in fluid templates, why it's not possible fetch settings.

google calendar - Push notification not respecting 404 status code -

according google calendar api push notification. "every other return status code considered message failure , google calendar api not retry particular notification." when return 404 because no longer have given resourceid in our system google still retrying same requests. any ideas?

html - Change the column order in a css grid -

i playing around css grids. when view on desktop size (min-width: 769px) have single row 3 columns - this: --------------------------------------------- | col 1 | col 2 | col 3 | | | | | --------------------------------------------- can css-grid move columns around can on mobile layout: --------------------------------------------- | col 1 | col 3 | | | | --------------------------------------------- | col 2 | --------------------------------------------- i know span cells this: .content{ grid-column: 1 / span2; } but want change order of columns. can without pre-processor? here current grid class: .my-grid { display:grid; grid-template-columns: 15% 1fr 25% ; grid-template-rows: 1fr; /* many rows need */ grid-gap: 10px; border: 2px solid #222; box-sizing: border-box; } grid l

Android: TextViews next to each other on different screen sides -

i'm struggling textviews . want them next each other in opposite screen sides. first should on left of screen , second on right. code: <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <textview android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/unit" android:textsize="22sp" android:text="unit"/> <textview android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/unitname" android:text="km"

tableau - How do I display the total percentage and count together as a stacked bar chart without formatting all data to percentage values? -

Image
i asked this question (and this question ) recently, , though both have solutions, left new dilemma because each solution works on independent level (i.e. 1 solution won't work if other solution in place). the problem this: in tableau, discovered opting display data percentage of total row value analysis > percentage of > row , resulted in count value being displayed number between 0 , 1 (i.e. percentage format, because of aforementioned percentage-only setting). is there way achieve 100.00% stacked bar shows both percentage , count, , isn't formatted display data percentage of row total? the screenshot shows happens when both solutions in place. original screenshots available within body of each of previous questions. note: feel right way go might normalise data (bringing values scale between 0 , 1), being new tableau, not sure how achieved. if correct, appreciate walkthrough. right click on second sum({number of records]) pill on label shelf,