Posts

Showing posts from April, 2014

c++ - How to use pointers with strings? -

i know question not specific let me explain code char name[5][30]; (int = 0; < 5; i++) cin >> name[i]; (int = 0; < 5; i++) cout<<name[i]; in example above created array of characters can input 5 words each 30 bit length. , works fine when try use pointer when don't know how many words input. error in line 5 saying value of type int cant asigned char , understand error how how pass problem? int n; cout << "number of names" << endl; cin >> n; int *name; name = new char[n][30]; (int = 0; < 5; i++){ cin >> *name; name++; } (int = 0; < 5; i++){ cout << *name; name++; } use char , not int . incrementing name doesn't seem idea because have returned first element before printing. used array indexing operator. i guess n input & output should done instead of fixed 5 input & output. int n; cout << "number of names" << endl; cin

android - WebView, get text from IFrame source -

i have webview in load html content. part of content iframe (name=testframe). trying get text (" currently not available ") iframe source, unfortunately below code not working me. this output of code: i/system.out: iframe text: <html><head> iframe location in html source: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> </head> <body style="background-color:#dfdfdf"> <iframe src="" name="testframe" width="800" height="500" align="left" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"> </iframe> </body> </html> content of iframe: <html xmlns="http://www.w3.org/1999/xhtml"> <head> ... </head> ... <body> <d

cocoa - NSTouchBar: How to replace "Esc" with "Done" button -

Image
how addressbook app presenting done instead of esc screenshot? the documentation states system provided button depends on context. how define context? found it. need use nspopovertouchbaritem. set not show close button, , add 1 yourself.

angularjs - Angular js using $rootScope in ng-src script on refresh fails -

i'm creating project internationalization, labels in /conf/lang/lang_{{lang}}/labels.js included in index.html. lang - rootscope variable setting in app.run(). index.html <script ng-src="{{labelurl}}"></script> app.js - run() $rootscope.$on('$locationchangestart', function (event, next, current) { if($cookiestore.get("config_details") != undefined) { $rootscope.language = $cookiestore.get("config_details").language; } else { $rootscope.language = 'english'; } $rootscope.labelurl = "conf/lang/lang_"+$rootscope.language+"/labels.js"; }) this script file loading correctly on url changing when refresh manually $rootscope value destroys , script file loading after html content loaded. me resolve this!!! yes when try reload page destroyed. @ this var myapp = angular.module('myapp', ['

sql server - Inserting multiple data tables from stored procedure into strongly typed/named dataset -

i have sql server stored procedure returns several tables. accessing these in vb via data adapter table mapping in following method: da.selectcommand = sqlcommand da.tablemappings.add("table", "settingstable") da.tablemappings.add("table1", "maindatatable") da.fill(dsresult) the issue have here around source table name. these automatically generate table, table1, table2 etc. there way can give these tables names coming out of stored procedure? depending on parameters may not return tables every time, table map "maindatatable" "table1", , "table2". are there solutions this? need keep compatibility far sql server 2008 r2 if possible. many in advance.

sql server - SSIS - Update error in For each loop -

Image
i have .txt files trying import oledb destination. want apply updates data before extracting them in .csv format. , trying achieve through ssis. i have below flow: 1>execute sql task truncate existing table 2>data flow task import flat file oledb dest 3>execute sql task update data per needs. 4>data flow task export data in csv file. concerns here is: have many such text files , want use for each loop container in package, text file has vendor wise data eg: tibco.txt, want import file location , extract destination folder same name .csv extension. have used variable stores name of file each time loop runs , have set in expressions : connection string input flat file used in step 2 above. my package runs fine until 2nd step fails update data @ step 3. error : [execute sql task] error: executing query "update tablename set vendor_inventory = r..." failed following error: "invalid column name 'hostname'.&

elixir - How to write a query for a shared/footer.html.eex? -

i have shared footer show display on pages, almost. want display information database in it. instead of querying in each action of webapplication accross controller , passing via assigns in each action in each controller, there way query once in kind of action footer? you may want consider creating controller plug allow assign footer information in number of controllers , actions. have following in controllers. plug :assign_footer when action in [:index, :show, :edit]

javascript - jquery datepicker appearing after one option is selected -

the code below works fine, have make date picker appear when select defined option select list> let's use this, example: $(function() { $('#date').datepicker({ dateformat: 'dd-mm-yy', altfield: '#thealtdate', altformat: 'dd-mm-yyyy' }); }); function showdp(cbox){ if (cbox.checked) { $('#date').css({ display: "block" }); } else { $('#date').css({ display: "none" }); } } <input type="checkbox" id="dpenable" onclick="showdp(this);"> <input id="date" type="text" style="display:none"/> <select> <option id='1'>1</option> <option id='2'>2</option> <option id='3'>3</option> </select> the date picker should appear when sele

c# - Own code noticeably slower than others -

the code wrote slower (max time exceeded) code found online, if online code looks more bloated. so trap did step code looks cleaner slowed down somehow? slow (mine): using system; public class program { public static void main() { int countmax = 0; int num = 0; (int = 2; <= 1000000; i++) { int count = 1; int temp = i; while (temp != 1) { if(temp % 2 == 0) temp /= 2; else temp = temp * 3 + 1; count++; } if(count > countmax) { countmax = count; num = i; } } console.writeline("number: " + num + " hops: " +countmax); } } fast (online): using system; public class program { public static void main() { const int number = 1000000; long sequencelength = 0; long startingnumber =

java - OpenCV SIMPLEBLOB not detecting any blobs -

i trying implement simpleblob opencv in android application. however, when try run featuredetector.detect(...) can not find blobs , not sure why. as input, have 2d array (for example) [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 116, 211, 112, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 26, 240, 255, 217, 24, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 24, 229, 255, 236, 32, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 145, 246, 189, 26, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0

maven - Local Nexus Server - Mirrors -

i still error: [error] plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or 1 of dependencies not resolved: failure find org.apache.maven.plugins:maven-resources-plugin :jar:2.6 in http://it-nexus.mydomain:8081/nexus/content/groups/public cached in local repository, resolution not reattempted until update interval of nexus has elapsed or updates forced -> [help 1] and has mirror configuration: <mirrors> <mirror> <id>nexus</id> <name>nexus public mirror</name> <url>http://it-nexus.mydomain:8081/nexus/content/groups/public</url> <mirrorof>central</mirrorof> </mirror> </mirrors> it not clear me how configure mirrors in way can upload artefacts mvn deploy . it seams me maven looks plugin- artefacts @ plain nexus- server. in opinion should cascaded in way if artefacts not available in local nexus should looked in central. how that? it's not apparent me need

administration - Elapsed Time Interpretation in Oracle AWR Report -

in awr (automated workload repository) report, see following free buffer waits : 24,000 seconds i have 4 cpu machine. does means there 24,000/4 = 6,000 seconds of "clock time" or "real time" wait ? this 24000 seconds sum of sessions wich waiting "free buffers". if have 100 sessions , 1 hour awr-report, means each session waiting 240 seconds per hour free buffers (on average).

C# Call external command and read Stdout unbuffered -

is there way call external command line program , read stdout un-buffered? have read several topics , examples propose use of process.beginoutputreadline() it's preconditions. ( msdn process.beginoutputreadline ) my problem program i'm calling (which not have source code for) not line break output during execution. resulting in have wait until execution finished , parse data @ once. any ideas? had idea append program i'm calling start /b more & my_prog.com , feeding running process newline on stdin never got working program "start: /b: system cannot find file specified." . seemed work in cmd prompt though.

trading - How to solve Fractals over N-bars period in MQL4, similar to IQOptions Fractals indicator? -

Image
i learning mql4 myself. registered iqoptions binary options trading. i planning write indicators myself trading system. fractals lot, not mql4-supported fractal logic, keen on iqoptions specific one. in mql4, find fractal use ifractal() doesn't take parameters other offset. i convinced myself finds fractal on 3 bars. doing lot of homework, have realized iqoptions indicator doing more fractal. please find attached screenshot. i wrote many programs added recent 1 below. need figure out has been there. image attached iqoption screenshot, fractals on 20 bar period. //+------------------------------------------------------------------+ //| bulls.mq4 | //| copyright 2005-2014, metaquotes software corp. | //| http://www.mql4.com | //+------------------------------------------------------------------+ #property copyright "2005-2014, metaquotes softw

CSS: Scale text field without scaling text inside -

is possible scale text input on x axis while maintaining size of font? i did this: #searchinput { text-decoration: none; display: inline-block; background-color: rgba(0, 0, 0, 0); border: none; border-bottom: 3px solid transparent; width: 10px; border-bottom-color: blue; padding-left: 10px; padding-bottom: 5px; height: 40px; font-size: 30px; color: #307fff; transition: 1s ease; transform-origin: top left; } #searchinput:hover { border-bottom: 3px solid blue; transform: scalex(25); } #searchinput:focus { border-bottom: 3px solid blue; transform: scalex(25); } <input type="text" id="searchinput" name="search"> the result cursor on middle of input , text stretched doing same animation changing width instead of scaling input works, i'm curious if can done transform. its not correct way implement material type input text. use background-position on :focus , :v

python - Calculating average grade wont succeed -

i have calculate average grade of person in python. received input file , in combination that, have calculate everyones average grade. tried lot, got average grade of first person.. can me? the input file following: tom bombadil__________6.5 5.5 4.5 dain ijzervoet________6.7 7.2 7.7 thorin eikenschild____6.8 7.8 7.3 meriadoc brandebok____1.0 5.0 7.7 sam gewissies_________2.3 4.5 6.7 the output follow: tom bombadilhas average grade of 5.5 dain ijzervoethas average grade of 5.5 thorin eikenschildhas average grade of 5.5 meriadoc brandebokhas average grade of 5.5 sam gewissieshas average grade of 5.5 i used code: def names(lines): in lines: invoer_split = i.split("_") first_name = invoer_split[0] print first_name + "has average grade of %.1f" %(average_grade(names)) def average_grade(names): in lines: grades_split = i.split("_") grades = grades_split[-1] grades_float = map(float,grades.s

html - bootstrap navbar toggle avoid second scrollbar -

Image
is there way avoid second scrollbar when bootstrap toggle? cool wood if there trick avoid :) @ best increase height or that? my bootstrap default-nav css code: @media (max-width: 1200px) { .navbar-header { float: none; } .navbar-left, .navbar-right { float: none !important; } .navbar-right { margin-right: 0; background-color: #2c3e50; } .navbar-toggle { display: block; float:right; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); background-color: #fff; text-align: left; } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-collapse.collapse { display: none !important; background-color: #fff; text-align: left; } .navbar-nav { float: none !important; background-color: #fff; text-align: left; m

Setting default browser for appium testing -

i'm trying run appium test on android device. the test starts on deep link click app, opens browser , redirects app (with deep link params) when run test in device, device asks me browser open link. problem need run tests in remote devices cloud service (like testdroid) variety of devices large , way choose browser different between devices. is there way make default browser open in tests?

Multidimensional array as a structure member memory allocation C -

i started learn c 10 days ago , decided write battleship game. have structure player has 2d integer array member. struct player{ ... int field[x][y];...}; x , y both 5 in case. when create new player in main , call print_field(int field[x][y]) method (that prints members of field ) int main(){ struct player player1; print_field(player1.field);} i random stuff like 00000 18356276361600061541186983333419528026550 00010 41963970000 04196320041956320 i tried different obvious ways of malloc , calloc like player1.field = malloc(sizeof(player1.field)); but different types of pointers, array or cast exceptions. please explain me how works. when define local (non-static) variable, or allocate memory through malloc , memory not initialized in way. content indeterminate , seemingly random (in reality whatever happens in memory @ time). using memory in way, except initialize it, leads undefined behavior . you can initialize whole structure when

java - How to make Infinispan work with camel -

import org.apache.camel.builder.routebuilder; import org.apache.camel.component.infinispan.infinispanconstants; import org.apache.camel.component.jackson.jacksondataformat; import org.apache.camel.model.dataformat.jsonlibrary; import uk.co.sammy.model.collection; public class infinispanroute extends routebuilder { private jacksondataformat json = new jacksondataformat(collection.class); @override public void configure() throws exception { from("file:src/data?noop=true&include=.*.json") .choice() .when() .jsonpath("$..custinfo[?(@.firstname == 'sammy')]").unmarshal(json) .log("got customer data ${body.custinfo.firstname}") .setheader(infinispanconstants.operation, constant(infinispanconstants.put_if_absent)) .setheader(infinispanconstants.key, simple("${body.custinfo.firstname}")) .to("infinisp

swift - How to use launch image set in UIImageView iOS? -

i have issues launch screen images, when app started. using default image set contains @1,2,3x images, figured out there launch image set. solve problem of different iphone sizes export multiple screen resolutions. after uploaded correct images launch image set, can't select them within uiimageview in launch storyboard. possible , if so, how can use in storyboards? or there way this? i cycle through x amount of images randomly display when opening application. every time open app, display image. you can't use launch images in rest of storyboards. should create normal image set use in rest of app , use constraints adjust size whatever device app runs on.

python - pandas read_csv running continuously -

ideally below lines should read 2 lines file. code working fine on system giving issue on amazon virtual machine.(process taking gbs of memory not completed running 2 lines) have python 64 bit installed on both system & pandas present. import pandas pd file1_read=pd.read_csv('d:\huge_csv\ubsrtoubsr_acctpgp_first.csv',nrows=2,sep=',|\|',engine='python')

jquery - Laravel 5 how to convert AJAX response JSON into PHP, so I can loop through it with foreach on the view? -

i'm working on ajax search function users table, , i've managed until content of response json file. can't figure out how hand it's content on $users php array, loop through it. the js: $('.searchbar').keypress(function (e) { if (e.which == 13) { $.ajax({ datatype: "json", url: '/results', data: {keyword: $('.searchbar').value()}, success: function (result) { console.log(result); }, error: function(){ console.log("no results " + data + "."); } }); } }); the route: route::get('results', 'searchescontroller@search'); the search function in searchescontroller : public function search(request $request) { $keyword = $request->get('keyword'); $users = \app\user::where("username", "like","%$keyword%&qu

android - Firebase data for all users without authorizing -

is possible create parts of data available users list of shop products without authorizing authorized users can change information products or create new ones? you can it, declare following rules @ specific location { "rules": { "products":{ ".read": "true", ".write": "auth.uid!=null" } } } only authurized users can write data.

html - Onclick add class to 2nd child div || Javascript -

i'm trying add "on" class second child, code doesn't seem work. possible? or how possible? i'm rookie , have tried multiple several forums , tutorials before asking question. html <!--parent--> <div class="element" id="elem1" onclick="addclass()"> <!--first child--> <div> </div> <!--second child--> <div> </div> </div> <!--parent--> <div class="element" id="elem2" onclick="addclass()"> <!--first child--> <div> </div> <!--second child--> <div> </div> </div> <!--parent--> <div class="element" id="elem3" onclick="addclass()"> <!--first child--> <div> </div> <!--second child--> <div> </div> </div> css element{ display:none; } on{ display:initial; } javascript

Using Python and Json and trying to replace sections -

i'm using python try , locate , change different parts of json file. i have list 2 columns , want string in first column, find in json file , replace second column in list. does have idea how this? been driving me mad. for row in new_list: if json_str == new_list[row][0]: json_str.replace(new_list[row][0], new_list[row][1]) i tried using .replace() above says list indices must integers or slices, not list. the way i've managed print off data works... but not referencing anything, if has ideas, feel free lend hand, thanks. import json # import json file , text file... # open('json file', 'r', encoding="utf8") jsondata: # data = json.load(jsondata) # jsondata.close() jsondata = {"employees":[ {"firstname":"a"}, {"firstname":"b"}, {"firstname":"c"} ]} # text_file = open('text file', 'r', encoding="utf8") #

mysql - PHP language based setting -

i creating mysql + php script user can configure lanuage based formates like dateformat: dd.mm.yyyy delimiter: , currency: € locale: de is there standard available such configurations? if mean built-in in php, yes there standard available. works locales. can use setlocale() function, set current locale, has impact on different php functions, strftime() . closer here . but warned. output not expect, because not iso compliant. there has been long discussion locales , impact on date functions, in end decided stay posix compliant, not iso compliant.

python - Matplotlib bar plot with pandas Timestamp -

i having trouble making simple example work: from numpy import datetime64 pandas import series import matplotlib.pyplot plt import datetime x = series ([datetime64("2016-01-01"),datetime64("2016-02-01")]).astype(datetime) y = series ([0.1 , 0.2]) ax = plt.subplot(111) ax.bar(x, y, width=10) ax.xaxis_date() plt.show() the error is: typeerror: float() argument must string or number, not 'timestamp' note astype(datetime) piece - tried after reading other post . without piece, same error. on other hand, example works enough plain datetime64 types - is, changing these 2 lines: x = [datetime64("2016-01-01"),datetime64("2016-02-01")] y = [0.1 , 0.2] so issue must timestamp type pandas converts datetime64 objects into. there way make work timestamp directly, , not revert datetime64 ? i'm using series / timestamp here because real objective plotting series dataframe . (note: cannot use dataframe plotting methods

javascript - Create a multi-series line flot chart getting data from database -

i trying create line flot chart multiple series getting data database. this table have: code | date/time ----------------------- | 9-10-2016 09:25 b | 10-11-2016 10:11 c | 11-10-2016 14:23 | 9-10-2016 10:10 b | 10-11-2016 11:00 so, need show in chart total number of occurrences each "code". in above table, have 2 occurrences code "a", 2 occurrences of code "b" , 1 occurrence of code "c". i don't have problems creating flot chat not able proper data variables time series in flot chart. so, how extract data form database using mysql , php ??? below code of flot chart have 1 line series , need add series available in database, 10 or 100. i have var d1 , need add d2, d3, d4..... <script type="text/javascript"> $(document).ready(function () { var d1 = [<?php print_r($js_array1); ?>]; var data = [{label: "<?php echo $error_code; ?>" , data: d1, lines: { show: true,

Eclipse Java error: This selection cannot be launched and there are no recent launches -

i have looked everywhere on internet , tried forums , nothing works. error keeps coming up. have tried running java project (not android) drop down run button doesn't work because says "none applicable". eclipse needs see main method in 1 of project's source files in order determine kind of project can offer proper run options: public static void main(string[] args) without method signature (or malformed version of method signature), run menu item not present run options.

javascript - Moving the players image with keyboard -

hey making platformer game , before, player rectangle. have changed image keys don't move it. how can make keys wasd move players image? did before, forget how did it. (function () { var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe; window.requestanimationframe = requestanimationframe; })(); var canvas = document.getelementbyid("canvas"), ctx = canvas.getcontext("2d"), width = 1000, height = 200, player = { x: width / 2, y: height - 15, width: 48, height: 64, speed: 3, velx: 0, vely: 0, jumping: false, grounded: false, count: 0, img: new image() }, keys = [], friction = 0.8, gravity = 0.3; player.img.src = "img/playersheet.png"; player.img.onload = draw; var boxes =

python - Image does not appear on Tkinter -

l have problem tkinter l add image background of frame ,however ,l tried many things nothing show up. l m @ beginning of code , l move on after l overcome problem. here code: import tkinter tkinter import * sc=tk() sc.title("matplotlib") sc.geometry("500x500") img=photoimage("mat.png") fr1=frame(sc,height=200,bd=5,bg="red",relief=sunken);fr1.pack(side=top,fill=x,expand=1) fr2=frame(sc,height=200,bd=5,relief=sunken);fr2.pack(fill=x,expand=1) fr3=frame(sc,height=200,bd=5,relief=sunken);fr3.pack(side=bottom,fill=x,expand=1) label1=label(fr2,image=img);label1.pack(fill=both) mainloop() how can l solve it? or l not want use other module if possible l m willing use tkinter structure of code the problem filename isn't being treated filename of image. first non-keyword argument used internal name of image. you must specify file keyword argument use file image: img=photoimage(file="mat.png") also, depending on

jenkins - How to tag push request in github -

after have pull request - how push specific tag? moreover - know how trigger push specific tag in jenkins? thanks# jenkins git plugin allows add post build action "git publisher". here pressing "add tags" button can set tag push (it can variable jenkins environment, $build_number). if "create tag" or "update tag" option selected, tag created or updated , pushed @ completion of build, , push fail if tag given name exists. if "create tag" option not selected, push fail if tag not exist. here detailed example .

python - Pytest setup/teardown hooks for session -

pytest has setup , teardowns hooks module, class, method . i want create custom test environment in setup (before start of test session) , cleanup after tests finished. in other words, how can use hooks setup_session , teardown_session ? these hooks work me: def pytest_sessionstart(session): # setup_stuff def pytest_sessionfinish(session, exitstatus): # teardown_stuff but next fixture session scope looks prettier: @fixture(autouse=true, scope='session') def my_fixture(): # setup_stuff yield # teardown_stuff

python - PYQT QpushButton with QcomboBox multi-slot connect -

Image
so have developed gui work, having trouble connecting qcombobox multiple different slot, depending on user input. essentially, want user able select drive qcombobox, press qpushbutton , automatically directed network drive. i have been scratching head on logic days now. know second part of code should go (maybe?): def retranslateui(self, mainwindow): self.btngo.clicked.connect(self.driverselectclicked) def driverselectclicked(self): if self.combobox1.currentindex() == 0: os.startfile('c:/') if self.combobox1.currentindex() == 1: os.startfile('z:/') you should pulling drive path information directly combobox. in addition setting text combobox entry, can set data drives = ['c:\\', 'z:\\'] drive in drives: text = '[{}] disk drive'.format(drive) self.combobox1.additem(text, drive) then later, when you're processing click, can read data field contains drive , use directly def drivers

share - multiple google +1 sharing buttons -

i have single webpage multiple items. , want able share them separately google+1 containing # automatically scroll correct one. for each of items defined schema , verified testing tool: https://search.google.com/structured-data/testing-tool this sees different items, used product schema. but when click g+1 button generates same preview each g+1 button. is possible have multiple g+1 buttons on single page different content? no. share content based on url , ignores #fragment. if want multiple share summaries have have multiple urls.

mysql - php how do you retrieve post from database? -

i know question has been asked many times, can't ever make work code, please bear me, i'm pretty new php oop pdo . my objective retrieve post title stored in database using php oop pdo the problem it returns error: undefined property: pdostatement::$fetch i looked @ php docs pdostatement i learned crud this tutorial , can't translate code, here code: crud.php <?php include 'connection.php'; class crud{ private $db; function __construct($pdo) { $this->db = $pdo; } public function create_post($post_title, $post_content) { try{ $query = "insert posts(post_title, post_content) values (:ptitle, :pbody)"; $stmt = $this->db->prepare($query); $stmt->bindparam(':ptitle', $post_title); $stmt->bindparam(':pbody', $post_content); $stmt->execute(); return $stmt; } catch

java - Getting 'E/AndroidRuntime: Error reporting crash android.os.TransactionTooLargeException' on clicking a Positive button of AlertDialog -

i'm getting error: e/androidruntime: error reporting crash android.os.transactiontoolargeexception and too: java.lang.stackoverflowerror: stack size 8mb while running below given code: mauthlistener = new firebaseauth.authstatelistener() { @override public void onauthstatechanged(@nonnull firebaseauth firebaseauth) { final firebaseuser user = firebaseauth.getcurrentuser(); if (user != null) { // user signed in if (isfacebookloggedin()) { if (dialog == null) { final alertdialog.builder builder = new alertdialog.builder(signupactivity.this); layoutinflater inflater = (layoutinflater) getbasecontext().getsystemservice(context.layout_inflater_service); view alertdialogview = inflater.inflate(r.layout.choose_unique_name_dialo

amazon web services - Ansible register rds and how to use it? -

i have rds play looks - name: create postgresql instance in rds hosts: localhost gather_facts: false tasks: - name: provision rds instances rds: command: create instance_name: ansibledataloading size: 100 instance_type: db.m3.xlarge region: us-east-1 db_engine: postgres username: app password: app db_name: db tags: environment: testing application: dataloading register: rds - name: wait rds wait_for: host={{rds.instance.endpoint}} port=5432 delay=60 timeout=320 state=started - name: add rds endpoint db group add_host: hostname={{rds.instance.endpoint}} groupname=amazon_rds when try access rds endpoint in play error. i did db_host: "{{hostvars.localhost.rds.instance.endpoint}}" the error got was, failed! => {"changed": false, "failed": true, "module_stderr": "", "module_

java - GUI calculation issue -

Image
i have been trying ever trying figure out why code jframe wont show correct calculations! when add numbers in windows calculator correct when use program different , incorrect. in program answer 520420 instead of 52420,5 in windows calculator. please tell me going wrong program , correct answer windows calculator? bellow calculate button adds numbers total price if check box selected! private void calculatorbactionperformed(java.awt.event.actionevent evt) { double price = 0; if(shoestk.isselected()) { price = price + 120; } if(cricketbatck.isselected()) { price = price + 300; } if(bikeck.isselected()) { price = price + 20000; } if(watchck.isselected()) { price = price + 500000; } if(plasticbagck.isselected()) { price = price + 0.50; } system.out.println(price); string total = double.tostring(price); totaltxt.settext(total); }

metaprogramming - Name of a Python function in a stack trace -

in both python2 , python3, in stack trace __name__ of function not used, original name (the 1 specified after def ) used instead. consider example: import traceback def a(): return b() def b(): return c() def c(): print("\n".join(line.strip() line in traceback.format_stack())) a.__name__ = 'a' b.__name__ = 'b' c.__name__ = 'c' a(); the output is: file "test.py", line 16, in <module> a(); file "test.py", line 4, in return b() file "test.py", line 7, in b return c() file "test.py", line 10, in c print("\n".join(line.strip() line in traceback.format_stack())) why so? how change name used in stack trace? __name__ attribute used then? so, every function has 3 things can considered being name of function: the original name of code block it's stored in f.__code__.co_name (where f function object). if use def orig_name create function,