Posts

Showing posts from May, 2013

node.js - 'Restore Packages' option is missing on right click in Visual Studio 2015 -

i trying start angular 2 , visual studio 2015 (update 3) eq. tutorial: https://angular.io/docs/ts/latest/cookbook/visual-studio-2015.html need "restore packages" on right click on 'packages.json'-file, option missing in menu. any hints? if like, can restore packages using npm command. same doing restore package. hope helps. open command prompt cd folder have angular project run command : npm install

python - Selenium Error: Element is not clickable at point(X,Y), other element would receive the click -

Image
i using python , selenium. on this link click reply add comment element not clickable @ point (933.9500122070312, 16.666671752929688). other element receive click: <a href="/create_account"></a> code given here: import requests bs4 import beautifulsoup gensim.summarization import summarize from selenium import webdriver from datetime import datetime selenium.webdriver.support.ui import webdriverwait selenium.webdriver.common.keys import keys time import sleep selenium.common.exceptions import nosuchelementexception selenium.webdriver.support import expected_conditions ec selenium.webdriver.common.by import driver.get(url) sleep(4) f = driver.find_element_by_css_selector('.postfull__reply') f.location_once_scrolled_into_view f.click() update this how appears in inspector: your css correct, problem long content scrolls element below of .header why can't click element. you can location of e

qt - C++/QML: ListView is not updated on dataChanged signal from QAbstractListModel -

i trying write qml gui large dynamic c/fortran simulation. data want display stored in fortran common blocks , updated on fixed time steps. problem qml listview not refresh when datachanged signal emitted after each time step, although signal received gui (test in code below). i missing out obvious because when flick listview down , again, displayed data updated , correct (i guess because qml engine re-renders elements when "out of sight" , in again). thing not work listview gets updated every time datachanged signal received , not when re-rendered. below more detailed description of approach , relevant code parts. each simulation entity has several attributes (alive, position...), decided create listmodel containing dataobject each entity. corresponding header file (the actual simulation data declared extern structs in "interface.h", can access via pointer): "acdata.h" #include <qtcore> #include <qobject> #include <qtgui> ex

android - How to display a toast message on clicking a button in a fragment? -

first of all, forgive me if silly question because relatively new in field. basically, have activity contains fragment. fragment has 3 buttons. , when of buttons clicked, wanted display specific toast messages . used onclick() method works fine in activity. when use same in fragment, app crashes. please me in regard.name of activity "user.java" , xml file "activity_user.xml". name of fragment "user_home.java" , xml file "user_home_layout.xml". have attached 2 images, first 1 contains activity , xml file while second 1 contains fragment , sml file. 1. activity 2. fragment you need set custom onclicklistener button : yourbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { toast.maketext(getactivity(), "your toast text", toast.length_long).show(); } });

c# - SQL Query returning all table columns -

sqlcommand query = new sqlcommand(); query.connection = dbconn; try { query.commandtext = "select email,lastsync users email in ('alexander@contoso.com')"; sdr = query.executereader(); while(sdr.read()) if(!sdr.isdbnull(1)) syncedusers.add(sdr.getstring(0)); sdr.close(); } catch(exception e) { logger.log(e.message); list<string> fields = new list<string>(); if(sdr!=null) (int = 0; < sdr.fieldcount; i++) { fields.add(sdr.getname(i)); } logger.log(string.join(",",fields)); } this (not always) throws error: unable cast object of type 'system.int32' type 'system.string'. and 1 time looked, logging contained list of all fields of table, not 2 requested fields: id,email,lastsync,... although query 2 columns only. id int, email string, assume error thrown in getstring(0) . error not reliably reproducible, did not yet while vs debugging enabled. now, long reader open, fie

c# - Winforms: Smooth the rounded edges for panel -

Image
i have followed this tutorial in order create rounded panel. code in tutorial in vb able convert c# here code: public class spanel : panel { pen pen; float penwidth = 2.0f; int _edge = 20; color _bordercolor = color.white; public int edge { { return _edge; } set { _edge = value; invalidate(); } } public color bordercolor { { return _bordercolor; } set { _bordercolor = value; pen = new pen(_bordercolor, penwidth); invalidate(); } } public spanel() { pen = new pen(_bordercolor, penwidth); } protected override void onpaint(painteventargs e) { base.onpaint(e); extendeddraw(e); //drawborder(e.graphics); } private void extendeddraw(painteventargs e) { e.graphics.smoothingmode = smoothingmod

javascript - document.getElementById(fieldName).value; is not working in chrome and firefox -

following javascript in html working in ie browser. but, when execute in chrome , firefox browser not working. var lastname = getvalueoffield("txtname"); function getvalueoffield(fieldname) { return document.getelementbyid(fieldname).value; } please me. it working fine... fiddle <input type="text" id="txtname" value="testdata"> var lastname = getvalueoffield("txtname"); function getvalueoffield(fieldname) { console.log(document.getelementbyid(fieldname).value) return document.getelementbyid(fieldname).value; }

matrix - Matlab: Can't handle data -

i writing program in matlab reads in matrix coming sensor (microcontroller arduino leonardo). can choose how fast matrices being recorded (e.g. 60 frames per min 1 matrix every second). all works great, had create default file records matrices not recorded (let’s it’s fast enough record 8 matrices per sec , want 1 per sec, default file record other seven). otherwise i’d kicked out of here: %get data %data read string (csv) data = str2double(strsplit(fgetl(serialport), ',')); if and(get(hobject,'value') == 1, correctport == 1) %try right ports try %reshape data (1d -> 2d array) , display in matrix k = 1; = 1:nrow j = 1:ncol % reading in tag names tagnames{k} = ['tag_matrix_' num2str(k)]; % creating matrix data2d(row_index(i), col_index(j)) = data(k); % display in matrix set(handles.(tagnames{k}),'string',d

c# - How to get an EF query to compile the most optimised SQL? -

i'm new ef, , has been bugging me couple of days now: i have user entity. has parent workspace, has collection of users. each user has collection of children schedule, in user.schedules property. i'm navigating through objects this: var query = myuser.workspace.users.selectmany(u => u.schedules); when enumerating results of query (myuser instance of user has been loaded using .find(userid)), noticed ef makes 1 query db each user in workspace.users how come ef doesn't results in 1 single query, starting primary key of myuser, , joining on tables involved? if else directly context such this, works fine though: context.users.where(u => u.id = userid).selectmany(u => u.workspace.users.selectmany(u => u.schedules)) is there i'm doing wrong? let take first query: var query = myuser.workspace.users.selectmany(u => u.schedules); if @ type of query variable, you'll see ienumerable<schedule> , means regular linq objec

How to make a text stand by the right side of an image using html and css -

i need text stand right side of image on same level have this <a class="following-row" href="index-2.html?pid=2306"> <img alt="girls logo" src="photos/users/35257/resized/9fd79de3589edff68db18bb6141025c3.jpg"> <span class="following-row-text">girls<span class="item-details"> · 78 followers</span></span> </a> i cant have correct set of css styling give me want, please need help. thanks <div> <img style="vertical-align:middle" src="http://cdn.jssor.com/demos/img/icons/icon_chrome.png"> <span style="">girls · 78 followers</span> </div> check snippet

php - paypal express checkout set paypal fee additional -

i have integrate paypal express checkout in our website. know , information paypal documentation. need set amount parameter in request input , paypal deduct fee based on amount, want paypal add fee additional on amount. example : product amount : $100.00; paypal deduct fee 2.9% on $100.00 want add aditional 2.9% on main amount, : amount = 100.00 fee = 2.9% than total amount = $100.00 + 2.9% = $102.90 means want paypal automatically set fee on checkout page , charge user. can me. thanks in advance. if want add fee on order you'll need prior sending user paypal, or on review page after user returned paypal. most people add cart "handling fee" or whatever want call it. if want more accurate should use 2.9% + .30 formula.

java - How to stop the application from within in Openshift -

i want able stop application inside every 3 days. want schedule method automatically stop application without intervention outside (like sitting on desktop etc). so far, have these in mind: runtime.getruntime().exec("rhc stop-app --app applicationname"); //this doesn't work. have tried or system.exit(0) // told not run command on openshift server or runtime.getruntime().exit(0) //i afraid run command or runtime.getruntime().halt(0) //i afraid run command some of commands afraid use because told not run them on openshift server may stop whole vm. , stop applications hosted on vm. , me banned. banned. edit: question not how stop application generally. question regarding how stop spring mvc wep application hosted on openshift server. , no answers donot work in link. well, used runtime.getruntime().exit(0) , stopped application. didn't ban or anything. , restarted application see if there issues. no issues. command do. thanks edit

refresh - How to clear the local storage and session storage in Webview Chrome App? -

i developing chrome app using webview( https://developer.chrome.com/apps/tags/webview ). cleared cache using ( https://developer.chrome.com/apps/tags/webview#type-cleardataoptions ) webview url refreshing takes 5 10 mins.do have idea on this? i tried this: var cleardatatype = { appcache: true, cache: true, // remove entire cache. cookies: true, } webview.cleardata({ since: 0 }, cleardatatype, function() { // reload webview after clearing browsing data. });

c# - Setting X axis start to first value in first series, Chart control -

i have chart control on windows form , changed data i'm adding x axis string representing date datetime type. before changing set minimum x axis 1 one line starts @ y axis i'm using date can't same! is there simple way start line on chart control @ y axis? here doing , i'm trying: chart2.chartareas[0].axisx.minimum = 1; and adding data chart thus: seriesave.points.addxy(strdate, average); //strdate string, average double. i way: seriesave.points.addxy(dt.date, average); datetime tpdate = datetimepicker1.value; // results in cannot convert datetime double. chart2.chartareas[0].axisx.minimum = tpdate.date; all x- , y-values in chart stored doubles . when adding value as datetime gets converted double implicitly tooadate conversion function. so when need set value minimum , maximum etc need call function in code: chart2.chartareas[0].axisx.minimum = tpdate.date.tooadate(); to convert datetime use datetime.fromoadate function:

html - Maintain elements placements as screen resolution changes -

Image
this site www.foxboxretail.com . in front banner slider there problem css code. problem banner navigations placements gets change screen size gets change f.g. 1360px resolutionv (it's perfect) 1920px resolution (navigation position of slider changed.) in above image can see navigation gets upper side mess design. how maintain screen size? css .slide-part{ width:100%; max-width:1600px; margin:10px auto 0 auto; min-height:100px; max-height:400px; position:relative } .fadein { padding-top: 27%; position:relative; width:100%; max-width:1600px; margin:0 auto; min-height:60px; } .fadein img { position:absolute; left:0; top:0; bottom:0; right:0; width:100%; width: auto\9; object-fit:fill; height:400px } .banner-links { position: absolute; bottom: 0; width: 100%; background: rgba(0,0,0,0.6); } .banner-links-inner { width:auto; max-width:1000px; margi

.net - Disable compiler optimisation for a specific function or block of code (C#) -

the compiler great job of optimising release builds, can useful ensure optimisation turned off local function (but not entire project unticking project options > optimize code ). in c++ achieved using following (with #pragma commented out): #pragma optimize( "", off ) // code such function (but not whole project) #pragma optimize( "", on ) is there equivalent in c#? update several excellent answers suggest decorating method methodimploptions.nooptimization . implemented in .net 3.5, though not in compact framework (cf) version. related follow-on question whether equivalent for: * projects targeting .net 3.0 or earlier? * projects deployed device such windows ce 6.0 using .net 3.5 cf? you can decorate specific method (or property getter/setter) [methodimpl(methodimploptions.nooptimization)] , [methodimpl(methodimploptions.noinlining)] , prevent jitter optimizing , inlining method: [methodimpl(methodimploptions.nooptimization | methodim

javascript - App crashes while debugging, after installed Android 6.0.1 -

this might sound weird one. beginner coder , right making app has login/register activities. worked fine on samsung galaxy s3 (android version 4.3.), week ago installed cyanogenmod , have android version 6.0.1. here problem - if run app opens popup alert " unfortunately, myfirstapp has stopped. ", , when click ok button opens login window, should. after try enter credentials login or register shows default error message cannot connect server. tried on second phone, same model samsung galaxy s3, android 4.3 works without problem. i tried debugging app crashes immediately, console message: connected target vm, address: 'localhost:8613', transport: 'socket' disconnected target vm, address: 'localhost:8613', transport: 'socket' my appconfig: // default configuration emulator/device urls // private static string base_url = "http://10.0.2.2/myfirstapp/"; private static string base_url = "http://192.168.0.103/myfirstapp/

javascript - How do I add rotation angle to the marker using ng-app? -

i not able add angle rotation marker. want calculate angle between current latitude longitude , next latitude longitude , accordingly place car icon. tried adding rotation @ place declaring car , bike icons did not help. html file: <div class="row" ng-controller="admin"> <div class="col-xs-12 col-md-12"> <ng-map center="pune india" zoom="13"> <marker ng-repeat="v in selectedvehicles" icon="{{showicon(v)}}" position="{{markers[v.id]}}" on-click="showdetails(event, v)"> </marker> </ng-map> </div> javascript file: var app = angular.module('tripnship'); app.controller('admin', ['$scope','ngmap','vehicle', function($scope,ngmap,vehicle) { $scope.vehicles = vehicle.all(); $scope.selectedvehicles = []; var car_icon = { scaledsize: [60,

angularjs - Angular one-time bindings for object properties -

i want make performance optimization of app. , came across following issue. let me have object multiple keys (which not changeable within 1 object) , view similar this: <div ng-if="vm.model"> <span>{{ vm.model.property1 }}</span> <span>{{ vm.model.property2 }}</span> <span>{{ vm.model.property3 }}</span> </div> i have wanted use one-time bindings properties, if change vm.model inside controller object reference, expressions won't updated inside view, unless explicit change of model falsy value , trigger digest cycle somehow, force whole block removed , recompiled. is there way can avoid having these 3 redundant watchers, since these properties shouldn't watched, parent object reference should. https://docs.angularjs.org/guide/expression try this <div ng-if="vm.model"> <span>{{ ::vm.model.property1 }}</span> <span>{{ ::vm.model.property2 }}</s

Android: Custom Dialog displays on back navigation -

the application displays custom dialog using code dialog.show(getactivity().getsupportfragmentmanager(), tag); in conditional statement onstart method of fragment. but issue is, after dismissing fragment , navigate other activity , click on button displays custom dialog again conditional statement false. how suppress dialog being displayed. in onstop , onpause dismiss dialog dialog.dismiss(). make global object of dialog. reason dialog never dismissed , stays in activity when come shown.

gradle - Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/csv/CSVFormat -

i using gradle project log4j2... , getting following error while creating csvlayout: exception in thread "main" java.lang.noclassdeffounderror: org/apache/commons/csv/csvformat csvparameterlayoutexample class package log4j_tutorial; import org.apache.logging.log4j.logmanager; import org.apache.logging.log4j.logger; public class csvparameterlayoutexample { private static final logger logger = logmanager.getlogger(); public static void main(string[] args) { int val1 = 10, val2 = 11, val3 = 12; logger.trace("trace message!", val1, val2, val3); logger.debug("debug message!", val1, val2, val3); logger.info("info message!", val1, val2, val3); logger.warn("warn message!", val1, val2, val3); logger.error("error message!", val1, val2, val3); logger.fatal("fatal message!", val1, val2, val3); } } log4j2.xml <?xml version="1.0" encoding="utf-8"?> <config

php - While making a simple form, I get a "Fatal error: Uncaught Error: Call to a member function query()" -

fatal error: uncaught error: call member function query() on string in c:\xampp\htdocs\boobae\index.php:58 stack trace: #0 {main} thrown in c:\xampp\htdocs\boobae\index.php on line 58 here code: <?php include './include/header.include.php'; ?> <?php include './include/connect.include.php';?> <?php $reg = @$_post['reg']; //declaring variables prevent errors $fn = ""; $ln = ""; $un = ""; $em = ""; $em2 = ""; $pswd = ""; $pswd2 = ""; $d_birth = ""; $d = ""; $u_check = ""; $phone_number = ""; $conn=""; //registration form $fn = strip_tags(@_post['fname']); $ln = strip_tags(@_post['lname']); $un = strip_tags(@_post['uname']); $em = strip_tags(@_post['email1']); $em2 = strip_tags(@_post['email2']); $pswd = strip_tags(@_post['passwprd1']); $pswd2 = strip_tags(@_post[

android - Youtube Video 400 network Error when try to play video -

i try play video using youtube video api when put static id means declare id in file @ time code working. but when try fetch id getintent() got id video not play. i got there problem network. below code. working in condition. this video_activity.java public class video_activity extends appcompatactivity implements youtubeplayer.oninitializedlistener { textview textview1, textview2; scrollview scrollview; webview webview; videoview videoview; private mediacontroller mcontroller; private uri uriyoutube; private youtubeplayerview youtubeview; private static final int recovery_dialog_request = 1; video video; public string videourl; // google console apis developer key // replace key your's string youtube_video_code; string developer_key; //string video_ids; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_video_); developer_key = "aizasyc0rjdlc0jkyy0z66qgonknmkoayo

javascript - White page showing after splash screen before app load (cordova-Android) -

i'm developing cordova android application load website using inappbrowser , don't know why have white page after splash screen , want rid , here index.html code : <!doctype html> <html> <head> <meta name="format-detection" > <meta name="msapplication-tap-highlight" content="no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> <title>inapp browser</title> </head> <body> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/app.js"></script> </body> </html> and here config.xml

android - cannot send data to database of web server -

when directly go link of php browser, creates empty record in database. however, when send data using app, fails. java: protected string doinbackground(string... params) { string reg_url = "http://www.minigameserver.square7.ch/register.php"; string user_name = params[0]; string user_ac = params[1]; string user_pw = params[2]; try { url url = new url(reg_url); httpurlconnection httpurlconnection = (httpurlconnection) url.openconnection(); httpurlconnection.setrequestmethod("post"); httpurlconnection.setdooutput(true); outputstream os = httpurlconnection.getoutputstream(); bufferedwriter bufferedwriter = new bufferedwriter(new outputstreamwriter(os,"utf-8")); string data = urlencoder.encode("user_name","utf-8")+"="+urlencoder.encode(user_name,"utf-8")+"&"+ urlencoder.encode("user_ac","utf-8&

javascript - How to show text over the camera Cordova/Phonegap? -

i using apache cordova camera plugin. possible show text on camera? if not how done it? this can done in 2 different ways. 1. create own plugin , draw layout on camera. 2. can follow cordova custom camera plugin plugin. have edited in existing plugin can pass 1 more argument 'caption' in options show text on camera.

Does Android have a different behavior for WakeLock when the device is connected to power source? -

to give context: trying measure energy consumption of best practices in android apps. have refactored app using wakelock keep screen on , use flag flag_keep_screen_on instead. surprisingly, able have small improvement on energy consumption. i expecting cpu able go low power state, spend less energy. is there different behavior cpu power management in these conditions, or use of flag not expected have reasonable effect? i measuring device odroid-xu has connected power. android version 4.2.2 - api level 17. the reason didn't find difference wakelock prevents device going sleep when device's screen off, while when using flag_keep_screen_on display using power along app, , believe me takes reasonable amount of power. so result same, while using flag_keep_screen_on might result in bad ux.

python - Inserting elements from array to the string -

i have 2 variables: query = "string: {} number: {}" param = ['text', 1] i need merge these 2 variables , keep quote marks in case of string , numbers without quote marks. result= "string: 'text' number: 1" i tried use query.format(param), removes quote marks around 'text'. how can solve that? you can use repr on each item in param within generator expression, use format add them string. >>> query = "string: {} number: {}" >>> param = ['text', 1] >>> query.format(*(repr(i) in param)) "string: 'text' number: 1"

javascript - Display dataset values on bar ChartJs 2.1.6 -

as per chartjs version has changed,the dataset values display on bar has not working.the existing code has working v1.0.2. ref: how display data values on chart.js var ctx = document.getelementbyid("mychart2").getcontext("2d"); var mybar = new chart(ctx).bar(chartdata, { showtooltips: false, onanimationcomplete: function () { var ctx = this.chart.ctx; ctx.font = this.scale.font; ctx.fillstyle = this.scale.textcolor ctx.textalign = "center"; ctx.textbaseline = "bottom"; this.datasets.foreach(function (dataset) { dataset.bars.foreach(function (bar) { ctx.filltext(bar.value, bar.x, bar.y - 5); }); }) } }); now modification must work chartjs v2.1.6? current bar graph syntax has working v2.1.6 given below. var mybarchart = new chart(ctx, { type: 'bar', data: data

How to randomize an array of bit arrays in verilog? -

i new verilog. how can randomize following: bit [7:0] data []; *without use randomize() of systemverilog. systemverilog not change size of dynamic array unless put constraint on it. either need allocate array before calling randomize() , or use constraint randomize size. bit [7:0] data []; data = new[10]; randomize(data); or bit [7:0] data []; randomize(data) {data.size inside {[5:15]} ;}; or if not have access randomize() systemverilog, can data = new[10]; foreach(data[ii]) data[ii] = $urandom;

java - AdapterView.AdapterContextMenuInfo is null -

here problem, have architecture of class : activity fragment recyclerview (which has adapter) the adapter: has class viewholder: public static class noteviewholder extends recyclerview.viewholder implements view.oncreatecontextmenulistener{ textview notename; public noteviewholder(view itemview) { super(itemview); notename = (textview)itemview.findviewbyid(r.id.note_name); itemview.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) {/**/} }); itemview.setoncreatecontextmenulistener(this); } @override public void oncreatecontextmenu(contextmenu contextmenu, view view, contextmenu.contextmenuinfo contextmenuinfo) { contextmenu.setheadertitle("select action"); contextmenu.add(0,666,0,"delete note"); } } the fragment overrrides oncontextitemselected(menuitem item){ //info null adapterview.adaptercontextmenuinfo info = (adapterview.

ubuntu - Problems using template to create new PostgreSQL Database -

i made upgrade ubuntu 16.04 few days ago. far good. now want use existing postgres template create new database. template has schemas. in 1 installed teh postgis extension. my problem is, system ignores search_path , defeault schema setting. tried create new schema, problem still remains. best regards, in hope of ideas. michael.

virtualbox - Vagrant - Not Supported the capability 'change_host_name' -

the problem capability 'change_host_name' isn't supported guest when try execute following command line: vagrant it gives me error following: vagrant attempted execute capability 'change_host_name' on detect guest os 'linux', guest doesn't support capability. capability required configuration of vagrant. please either reconfigure vagrant avoid capability or fix issue creating capability. note os is: os x yosemite 10.10.5 guest additions version: 4.2.0 , virtualbox version: 5.0 i've tried many solutions of others face issue, couldn't fix it. this https://github.com/mitchellh/vagrant/issues/7625 . fixed in next release, until if blocking you, can patch vagrant yourself if want patch yourself method1 : search plugins/guests/ubuntu/guest.rb file in vagrant installation e.g. /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb on mac/linux default install or /opt/vagrant/embedded/gems/vag

ios - How to Syncronize async data download with the main thread in swift -

i have problem. when app start, downloads async data server in app delegate, segue home screen. in home screen, app checks async data have been downloaded in app delegate. if doesn't find data, loads offline content, because data maybe not ready yet or maybe server down , app never data. my problem comes when app download data after offline data has been loaded. home screen loaded offline data, mixed new data. in app delegate i've set download async data in core location delegate method, because data downloaded if user grants location access app: func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]){ if(hasbeenlaunched == false){ hasbeenlaunched = true dispatch_async(dispatch_get_main_queue()){ self.loadcityslugarray() } } //other code... } i set hasbeenlaunched bool true when app has entered download method, , check in home screen: override func viewdidload() { if(h

while looping in c languge iteration -

i don't know mistake, please need help. when enter wrong data in username , password , ask if yes or no try again. if type y yes can't type in username anymore. #include <stdio.h> #include <stdlib.h> #include <conio.h> int main() { printf ("\n\t\t welcome payroll account!"); printf ("\n\t\t please enter username & password proceed."); printf ("\n\t ********************************************************* \n \n \n"); char password [10], username [10], ch; char name [10] = "username"; char pass[10] = "password"; char month, ename, address; float regpay,regov,rd,rdot,meal; float sss,ph,pi,union,other,ssssal,loan,hloan,uloan,eloan,td; float te,netpay; int n,day,year,i; char input; char again = 'y'; while (again == 'y' || again =='y') { printf("username: "); gets (username); printf(&q

twitter bootstrap - Change the text in a button using javascript? -

this question has answer here: how change text of span element in javascript 8 answers i have faq list works way : there several mini cards contain question (some text) , button (let's "see answer"). when click on button, answer question appears above button. button should not "see answer" button, "close" one. need little last part. here have done : <p>question</p> <div class="collapse" id="faq"> <div class="well"> answer question </div> </div> <a class="btn" role="button" data-toggle="collapse" href="faq" aria-expanded="false" aria-controls="collapseexample">see answer</a> side question : since list , i'm going have several "see answer/close" buttons, i'm no

javascript - Finding the caret position in character in a div content editable with angular -

i m having troubles while getting cursor caret position inside of div contenteditable attribute. actually, m using following function : onblurarea (field, ev) { ev.preventdefault() const editable = ev.target.childnodes[1].childnodes[2] this.positions[field] = {start: this.getcaretcharacteroffsetwithin(editable), editable} } getcaretcharacteroffsetwithin (element) { let ie = (typeof this.doc.selection != 'undefined' && this.doc.selection.type != 'control') && true let w3 = (typeof this.win.getselection != 'undefined') && true let caretoffset = 0 if (w3) { let range = this.win.getselection().getrangeat(0) console.log(range) let precaretrange = range.clonerange() precaretrange.selectnodecontents(element) precaretrange.setend(range.endcontainer, range.endoffset) console.log(precaretrange) caretoffset = precaretrange.tostring().length console.log(caretof

php - Form Data Not posting to database -

can see wrong below code. when submit data using html form expected confirmation confirm registered. however, when check database not there! i have checked names same names of each input correct , can confirm database connected successfully, along names of database columns ect... any appreciated. <?php if (isset($_post['carrierinsert'])) { $acc = $_post['acc']; $sql = "select cariers.acc cariers cariers.acc ='$acc'"; $result = $db->query($sql); if($result->num_rows > 0) { echo "<font color='red'>carrier exits</font>"; $sql = "insert cariers ( `reg`, `acc`, `accstatus`, `carramid`, `carrfloor`, `pay`, `comms`) values ( '".$db->real_escape_string($_post['reg'])."', '".$db->real_escape_string($_post['acc'])."', '".$db->real_escape_string($_post['accstatus&