Posts

Showing posts from September, 2011

regex - Referencing named groups in look-around (Python 2.x) -

i have pattern matches multiple key/value pairs, , key/value strings can delimited characters, groups of key/value can delimited, not same character . i figured out how allow dynamic delimiters, , restrict same delimiter being used twice. eg: \w+(?p<kv_delim>[:;|])\d+(?p<g_delim>(?!(?p=kv_delim))[:;|])\w(?p=kv_delim)\d(?p=g_delim)? you can view regex101.com example here . , works great, problem comes when using either of 2 named groups in positive look-behind . lets string is foo:1;r:2 the "key/value delimiter" (named group: kv_delim ) : , "group delimiter" (named group: grp_delim ) ; what im trying dynamically match : , ; , in look-around statement, foo<kv_delim> , or bar<kv_delim> . if hard-code delimiters (in look-around), you can see works . if try reference named-group kv_delim within look-around statement, you can see throws errors . error: subpattern references not allowed within lookbehind assertion

Python Serial Writes to Arduino is different from Arduino's Serial Monitor's Serial Writes -

i have python script writes string test arduino serial port. if arduino receives test string, should reply string ok , led 13 should up.. problem: when arduino serial monitor used write test serial port, arduino replies ok expected , led #13 lights up. however when python script writes test same serial port, nothing happens. arduino not reply serial port , led #13 not light up. any ideas how python script can fixed ok response arduino , led 13 light up? arduino sketch int ledpin = 13; void setup() { serial.begin(9600); pinmode(ledpin, output); } void loop() { while(serial.available() == 0) { } if(serial.readstring() == "test\r\n") { serial.print("ok\r\n"); digitalwrite(ledpin, high); } readstring = ""; // clear recieved buffer delay(100); } python script port = 'com5' ser = serial.serial( port=port, baudrate=9600, timeout=5 ) serial.write("test\r\n") respo

c# - ASP.NET Project Clone from Git Hub has broken database, but not from ZIP file from Google Drive -

i have asp.net project working on udemy class. trying familiarize myself git hub after evening of working on project, push remote repository. when build , run application on machine @ home runs perfectly. however, when use computer @ work clone project git hub, , run it, project build, when press link leads page requires database error controller class ' the model backing 'applicationdbcontext' context has changed since database created. consider using code first migrations update database ( http://go.microsoft.com/fwlink/?linkid=238269 ). so use nuget package manager 'update-database' , receive following error. cannot find object "dbo.movies" because not exist or not have permissions. if download zip file git hub receive same errors, put project on google drive , downloaded work computer , works fine. i'm not sure problem be, why movies database not being built. perhaps did incorrectly while pushing project computer git

android - Unable to connect to Firebase Cloud Messaging -

i'm trying unable connect firebase cloud mssaging service. below error: background sync failed: service_not_available, retry in 320s and many more. here log cat: 09-12 23:56:34.682 24569-24613/aboundinfo.mzkhan.firebaseapp i/openglrenderer: initialized egl, version 1.4 09-12 23:56:34.712 24569-24613/aboundinfo.mzkhan.firebaseapp i/openglrenderer: hwui protection enabled context , &this =0xa0922088 ,&megldisplay = 1 , &meglconfig = 8 09-12 23:56:34.712 24569-24613/aboundinfo.mzkhan.firebaseapp d/openglrenderer: enabling debug mode 0 09-12 23:56:34.852 24569-24569/aboundinfo.mzkhan.firebaseapp i/timeline: timeline: activity_idle id: android.os.binderproxy@305676cc time:224172576 09-12 23:56:34.862 24569-24615/aboundinfo.mzkhan.firebaseapp d/firebaseinstanceid: background sync failed: service_not_available, retry in 10s 09-12 23:56:39.662 24776-24776/aboundinfo.mzkhan.firebaseapp:background_crash d/resourcesmanager: creating new assetmanager , set /data/app/abo

html - CSS Image swap on hover jumps with border -

a little background. have searched , searched. there plenty of answers adding border on hover none found table has 1px white border style whether hovering or not. image jumps on hover. have tried box-sizing: border-box , adding same color border hover style. site old , not original developer. built using tables instead of divs. transitioning them new site want 1 updated in mean time new images. 1 black , white , color. when mouse on black , white, want turn color one. using sprite 400px (w) 240px (h). images 120px high changing position hover effect. html <td class="bottom right left stlouis"></td> css .stlouis { width: 400px; height: 120px; background-image: url(../images/stlouis.jpg); background-position: 0 0; } .stlouis:hover { background-position: bottom; } thank help! in case anyway looking fix on this, display: block; fixed issue.

google app engine - Objectify inconsistency when getting all entities of a given kind (local Cloud Endpoints) -

Image
i experiencing inconsistencies when trying load entities of given kind, using objectify. the setup i running cloud endpoints backend locally, , using following method populate datastore: public static void dsup() { store store1 = new store("h&m", new geopt(new float(56.157702), new float(10.206938))); store store2 = new store("marc jacobs", new geopt(new float(56.158284), new float(10.208618))); store store3 = new store("weekday", new geopt(new float(56.158522), new float(10.207547))); ofy().save().entities(store1, store2, store3).now(); // synchronous save auto generate id } after setting database, datastore viewer shows 3 objects created: the problem i started noticing client app (ios) received 2 stores: i revisited getstores() method on backend, , changed loads stores 4 times, logging each try, , returning results first try. the method (after changing multiple load tries), looks this: public static lis

javascript - Get custom atrribute value with JQuery of an datalist -

im trying value of custom attribute in datalist no success, can me? the datalist <div class="form-group col-md-6"> <label for="sel_cidade">cidade</label> <input type="text" name="sel_cidade" id="sel_cidade" list="sel_municipio" class="form-control"> <datalist id="sel_municipio" name="sel_municipio"> <?php foreach ($selectmunicipioibge $r ) { echo '<option data-value="' . $r->cidadecodigo . '">' . $r->cidadenome; } ?> </datalist> <input type="hidden" name="sel_cid" id="sel_cid"> </div> the jquery $("#sel_cidade").on("change", function () { console.log($("#sel_municipio").val($("#sel_municipio").attr("data-value"))); });

sql - splitting one column into several -

first time poster here, please forgive mishaps. i have query in sql sake of simplicity returns duration, business duration , impacted service. problem lies in fact if impacted service, has more 1 value in row. example can 'crm, payrol , scheduling'. see below. duration business duration impacted service 60 40 crm 100 95 payroll 70 70 scheduling 50 45 crm,scheduling, scheduling what want individual row each of values inside one. so: duration business duration impacted service 60 40 crm 50 45 crm 100 95 payroll 50 45 payroll 70 70 scheduling 50 45 scheduling how go it? thanks! one method uses split function. google "sql server split function" o

ruby - How do I dynamically generate TwiML from my Rails app? -

i have integrated twilio through twilio-ruby rails app. basic sms , voice capabilities working expected, want extend functionality. able generate twiml in controller dynamically, save somewhere (either locally or service), , have twilio access xml. example, customer makes order through app, twiml generated , saved, , twilio makes voice call supplier new order data. keeping concurrent orders in mind, might solution this? best solution storing twiml/xml , having twilio access it? thank you. dynamically generating twiml during call seem preferred method. an example of generating twiml content dynamically docs greet caller name: https://www.twilio.com/docs/quickstart/ruby/twiml/greet-caller-by-name#twiml-quickstartrb require 'rubygems' require 'sinatra' require 'twilio-ruby' '/hello-monkey' people = { '+14158675309' => 'curious george', '+14158675310' => 'boots', '+14158675311

Heroku. Django dumpdata -

how can data on heroku , create fixture can load locally? heroku run python manage.py dumpdata --natural > data.json command, how can download file? try adding dashes indicate end of command: heroku run python manage.py dumpdata --natural -- > data.json this should redirect output local file.

Openshift python requests proxy permission denied -

Image
i'm trying use proxy python 'requests' package on openshift server. getting permission denied error. see below. is openshift blocking connection or not configuring correctly? else? openshift doesn't want let me connect proxy because code works fine locally , on heroku. code from ssl import protocol_tlsv1 import ssladapter proxies = {'https': 'http://{}:{}@96.44.147.34:6060'.format(cfg.proxy_username, cfg.proxy_password)} url1 = 'https://reservaciones.volaris.com/flight/deeplinksearch' session = requests.session() session.mount('https://', ssladapter.ssladapter(ssl_version=protocol_tlsv1)) request1 = session.get(url1, proxies=proxies) traceback requests.exceptions.proxyerror: httpsconnectionpool(host='reservaciones.volaris.com', port=443): max retries exceeded url: /flight/deeplinksearch (caused proxyerror('cannot connect proxy.', newconnectionerror('<requests.packages.urlli

javascript - Is there a difference between declare "use strict" on a global anonymous function or inside the controller? in AngularJs -

given 2 options: 1 (function(){ "use strict"; angular.module('someapp.controllers', []) .controller("ctrl1", ['$scope', function($scope) { .... }]) .controller("ctrl2", ['$scope', function($scope) { .... }]) .controller("ctrl3", ['$scope', function($scope) { .... }]); })(); 2 (function(){ angular.module('someapp.controllers', []) .controller("ctrl1", ['$scope', function($scope) { "use strict"; .... }]) .controller("ctrl2", ['$scope', function($scope) { "use strict"; .... }]) .controller("ctrl3", ['$scope', function($scope) { "use strict"; .... }]); })(); is there difference between two? 1 of recommended or considered "better practice" within angular? why? is there difference between two? well

asp.net - Textchange event firing without any change in textbox contents -

i have form record number, boxes "primary" notes , effective date. then have optional "secondary" notes , effective date box. when clicks on button edit primary or secondary notes, looks see if other notes have changed (a session variable set "true" fires "textchanged" event other textbox). if so, instead of enabling textbox matched "edit" button, flashes message saying cancel or update other textbox's changes. my problem contents of textbox being viewed "changed" when nothing changed. if load record, , run separate validation check, verifies contents of textbox match data loaded textbox. then, not changing anything, when click on "edit" button, separate validation comes no longer matching, though information in session variable , textbox both unchanged. here validation check - if not session("sn1") nothing sesslst = sesslst & "<p>sec notes match = "

javascript - Check the dropdowns and change cell colors dynamically -

i have web table displaying sql server database table using php pdo. table created , displayed on index.php file. have form in edit.php users can update table. of fields in edit.php have dropdowns. example, 1 field has dropdown options q1,q2,q3,and q4. if initial value q1 or user updates q1, want make background color of cell in table green, if q2=>yellow, q3=>red. can please me this? have index.php , edit.php shown below: index.php <?php require_once('include/database.php'); ?> <!doctype html> <html> <head> </head> <body> <tr><th>q rating</th></tr> <tr><th>action</th></tr> <?php $stmt = $conn->prepare("select * matrix order objectid asc"); $stmt ->execute(); $result = $stmt->fetchall(); foreach($result $row) { ?> <tr> <td><?=$row['q_rating'];?></td> <td><a

algorithm - How to shuffle rows with keeping two fields in original order? -

i have array of rows 4 fields: group,name,key,value i need "shuffle" array, resulting array should comply following rule: every key-value pair having same group should have same order in original array here's 1 possible algorithm, requires auxiliary array of same size original array. it's o(n), makes several passes on original array. using stable counting sort algorithm , make copy of original array sorted group. keep histogram use in step 3. use fisher-yates shuffle algorithm shuffle original array in place. make final pass on shuffled array created in step 2. each row, replace key , value entries next unused key , value entries sorted array created in step 1. the counting sort algorithm assumes group values integers in small range, ideally smaller total number of rows in original array. if not case -- either groups not integers or don't have restricted size -- original histogram counting sort can created placing group values in h

java - Compute the symmetric difference of two regions (triangle and circle) -

is there way calculate symmetric difference between 2 regions (triangle , circle) in java (android)? i have classes this public class triangle{ double[] a; double[] b; double[] c; } public class circle{ double center; double radius; } and need know symmetric difference between regions. can not find related this. this not available in standard java apis far know. need yourself. start might helpful note area of symmetric difference differences of areas of union , intersection of 2 regions. area of union sum of areas of 2 regions minus area of intersection. boils down calculating area of intersection. possible shapes of intersection of circle , triangle?

jquery - How to get src value from the class in the attr? -

.attr('href', 'http://example.com/'); i want link class a.mylink... like here: .attr('href', ''); <a href="http://example.com/" class="mylink"></a> here code .$('<iframe src="" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>').attr('src', '.link here'); first need call attr function on valid object. leave second parameter out set href attribute. calling without second parameter href attribute object. getter: var href = $('.mylink').attr('href'); this store href in variable setter: $('.mylink').attr('href','new href value'); this set html to: <a href='new href value' class='mylink'></a> in case selector invalid. try instead: $('iframe').attr('src');

How to use base class methods in a subclass of a Builtin JavaScript class in javascript -

in c# example can extend framework type , assign expression type , retain members of base type have extended methods. i'm trying inherit sentence range . note suggested duplicate doesn't apply here because range not susceptible these techniques. how can achieve in javascript? have: /* namespace */ var webpagereader = webpagereader || {}; /* classes */ webpagereader.sentence = function(range) { this.setstart(range.startcontainer, range.startoffset); // bombs here this.setend(range.endcontainer, range.endoffset); }; function test(){ webpagereader.sentence.prototype = new range(); var dom = new webpagereader.dom(); var s = new webpagereader.sentence(dom.getselectedrange()); alert(s.endoffset) ; } webpagereader.dom = function() { /* public methods */ this.getselectedrange = function() { var sel; if (window.getselection) { sel = window.getselection(); if ((sel.type == "range" || allowcaretselection) &&

ios - Does Ejabberd/XMPP have a Limit on Auto-Join MUC? -

i in process of developing application offers multiple conferences/rooms each user @ once. in other words, individual user can in many rooms @ 1 time... however, whilst works 10/11 (it varies) rooms, user attempts join more rooms, fails. originally thought result of front-end ios, having tested 10+ rooms instantbird (macos xmpp client), can confirm issue seems @ ejabberd end... thus far, have been unable extract sort of error message returned. have checked logs , seems fine (i may missing not sure for). i have couple of ideas might don't know start: does ejabberd limit number of rooms user can join @ 1 time? does ejabberd have timeout may exceeded when trying join multiple rooms (this explain why varies between 10 , 12 rooms max)? your answer here: https://docs.ejabberd.im/admin/guide/configuration/#modmuc there config property max_user_conferences and documentation tells us: this option defines maximum number of rooms given user can join.

android - getIntent().getExtra() returns null -

i have code direct users profile page bottom bar. private void startnewintent(class classname, string uid){ intent intent = new intent(act, classname); intent.putextra("uid", uid); act.startactivity(intent); act.finish(); } classname = displayprofile.class; if(firebaseauth.getinstance().getcurrentuser() != null){ string uid = firebaseauth.getinstance().getcurrentuser().getuid(); startnewintent(displayprofile.class, uid); } else { startnewintent(emailpasswordactivity.class); } in profileactivity.java protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); string uid = getintent().getstringextra("uid"); if(uid != null){ ... } } i tried bundle = getintent().getextra() same results. have seen similar questions. seem case: getintent() extras null i tried intent.setflags(intent.flag_activity_single_top | intent.flag_activity_clear_top); but getintent().getextra != nul

python - opening several txt files using while loop -

i have txt files names have following pattern: arc.1.txt, arc.2.txt,...,arc.100.txt,..., arc.500.txt,...,arc.838.txt i know can write program using for loop open files 1 one, if total numbers of files. want know possible use while loop without counting number files open them ? it possible use while loop assuming files numbered in sequential order: i = 0 while true: += 1 filename = 'arc.%d.txt' % try: open(filename, 'r') file_handle: ... except ioerror: break though becomes pretty ugly nesting. you're better off getting list of filenames using glob.glob . from glob import glob filenames = glob('arc.*.txt') filename in filenames: open(filename) file_handle: ... there race conditions associated second approach -- if file somehow gets deleted between when glob found , when time process file program have bad day.

jquery - Set background-color/image of an element with scrollHeight -

i have container div has innerdiv in turn has multiple div elements. outermost container div has larger height overflow y-axis. trying give background-color innerdiv style applies partial part of innerdiv, scrollable height not provided background-color .i tried assigning height() scrollheight of innerdiv equal of container div using jquery,but doesn't change anything. there way via css/script. css divs used : .box { align-content: flex-start; border: solid 5px gray; display: flex; flex-direction: row; flex-wrap: wrap; margin-left: 50px; max-width: 900px; height: 100%; overflow-y: scroll; } .innerbox { background-color:gray; background-size: cover; margin: 5px; flex-direction: row; display: flex; border: solid 1px gray; flex-wrap: wrap; justify-content: space-between; } here fiddle link,it appears fine there though not when saved file locally. https://jsfiddle.net/rawatdeepesh/rtcdl9u9/ i'm confused need. if want gre

scala - Prediction.io Text classification build fails -

installed pio on ubuntu. installed text classification template, imported data. upon building, sql errors (im on postgres record): pio build --verbose [sql execution] insert pio_meta_enginemanifests values( 'vcgpc4ezkjqevcymu1ydlvnyjmkbna4s', '36dc85cb0d6c0f72434a04756323b01863a36d51', 'predictionio-0.9.6', 'pio-autogen-manifest', 'file:/home/ubuntu/predictionio-0.9.6/target/scala-2.10/org.template.textclassification.textclassific... (276)', ''); (1 ms) [stack trace] ... io.prediction.data.storage.jdbc.jdbcenginemanifests$$anonfun$2.apply(jdbcenginemanifests.scala:48) io.prediction.data.storage.jdbc.jdbcenginemanifests$$anonfun$2.apply(jdbcenginemanifests.scala:40) scalikejdbc.dbconnection$$anonfun$3.apply(dbconnection.scala:297) scalikejdbc.dbconnection$class.scalikejdbc$dbconnection$$rollbackifthrowable(dbconnection.scala:274) scalikejdbc.dbconnection$class.localtx(dbco

exchangewebservices - EWS Java how to find emails older than xx days and Delete all in one shot -

i want find items in folder older xx days , delete items found in 1 shot. able find items matching criteria. here code. import org.joda.time.datetime; int purgedays = 14; try { itemview view = new itemview(integer.max_value); folder purgefolder = folder.bind(service, folderid); // need convert mon sep 12 16:31:27 cdt 2016 searchfilter searchfilter = new searchfilter.islessthanorequalto(itemschema.datetimereceived, (datetime.now().minusdays(purgedays).todate())); finditemsresults<item> emailstopurge = service.finditems(purgefolder.getid(), searchfilter, view); if (emailstopurge != null && emailstopurge.getitems() != null && emailstopurge.gettotalcount() > 0 ) { // want delete items @ once emailstopurge.deleteall(); } else { log.info("found no emails purge mailbox-"+ username); } } catch (exception e) { log.error("excepti

twitter bootstrap - Navigation sidebar with Hakyll -

i'm trying make website hakyll , bootstrap . add navigation sidebar (automatically updated @ compilation) on pages of website , i'm not sure of how it. searched tutorials or examples didn't find anything. according me, should render temporary page sidebar template , render page adding html code $partial()$ . read making snapshots . but i'm not comfortable hakyll functions , don't know how it? do know how make navigation sidebar hakyll ? do have example or tutorial me ?

SQL Server Datetime object persistent reformatting issue in Excel -

i have annoying issue working sql server datetime objects in excel 2013. problem has been stated several times here in so, , know work around reformat datetime objects in excel doing this: right click cell choose format cells choose custom in type: input field enter yyyy-mm-dd hh:mm:ss.000 this works fine loathe having every time. there permanent work around aside creating macros? need maintain granularity of datetime object cannot use smalldatetime . using microsoft sql server management studio 2008 r2 on win7 machine. thanks in advance. -stelio k. without code it's hard guess how data gets sql server excel. assume it's not through data connection, because excel wouldn't have issues displaying data dates directly. what data connections? excel doesn't support kind of formatting or useful designer matter, when working data connections only . functionality provided power query or pivottable designer. power query integrated in excel 2016 ,

sql server 2008 - How do you align merged data in SQl -

i have 3 tables want combine final table in mssql2008. problem lies in merging data in final table format. issue number of columns have in each table close 100 each need efficient code creates final table i need sql script generate final table <h1> table 2008</h1> <table border = 1> <tr> <td> id </td> <td> sample_year </td> <td> total_at_t-5 </td> <td> total_at_t-4 </td> </tr> <tr> <td> mmm </td> <td> 2008 </td> <td> 5.25 </td> <td> 65.25</td> </tr> </table> <p> </p> <h1> table 2011</h1> <table header = "2011" border = 1> <tr> <td> id </td> <td> sample_year </td> <td> total_at_t-6 </td> <td> total_at_t-5 </td> </tr> <tr> <td> mmm </td> <td> 2011 </td>

python - How to resize a Splash Screen Image using Tkinter? -

i working on game school project , part of splash screen load simulate 'loading' of game. have code , bring image, want bring defined .gif file onto screen. here code: import tkinter tk root = tk.tk() root.overrideredirect(true) width = root.winfo_screenwidth() height = root.winfo_screenheight() root.geometry('%dx%d+%d+%d' % (width*1, height*1, width*0, height*0)) image_file = "example.gif" image = tk.photoimage(file=image_file) canvas = tk.canvas(root, height=height*1, width=width*1, bg="darkgrey") canvas.create_image(width*1/2, height*1/2, image=image) canvas.pack() root.after(5000, root.destroy) root.mainloop() my issue because image larger screen not fit whole image. how can resize image using code .gif image fits on screen? p.s. please not make real drastic changes code want, value changes ok. i recommend use pil . here code: from pil import image, imagetk import tkinter tk root = tk.tk() root.overrideredirect(true) width

bundler - Middleman INIT Error -

i took on middleman-netlify website. git clone {website codebase url} bundle install bundle update middleman init (error issue) i don't know next. have tried following uninstall middleman , gems, reinstalled, , restart mac gem cleanup gem update [polytronixglass (master)]$ middleman init /users/stephanieapril/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:23:in `source': uninitialized constant gem::source (nameerror) /users/stephanieapril/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:65:in `extension_dir' /users/stephanieapril/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:46:in `gem_build_complete_path' /users/stephanieapril/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:2174:in `missing_extensions?' /users/stephanieapril/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:71:i

javascript - applying regular expression for text highlight -

i using jqxdataadapter jqxwidgets in code follows: var dataadapter = new $.jqx.dataadapter(source, { loadcomplete: function (records) { var html; var color = '#f3f315'; //get data var records = dataadapter.records; var length = records.length; console.log("checking length: "+length);// outputs 5 (var = 0; < length; i++) { console.log("checking words here: " +records[i].word_text);// displays 5 words in console log 1 } html = "<div style='margin: 10px;'><pre>" + records[1].note_content + "</pre></div>"; //records[1].note_content shows long paragraph of text words highlight // correct way apply regular expression? (var = 0; < length; i++) { html = html.replace(new regexp(records[i]

multithreading - Java Timer Program - rubix cube -

i trying make rubix cube timer friend. start timer hold down space bar, , once let go starts. having problem though, when hold down space bar timer starts @ whatever time is. want able reset 0 whenever try glitches out. tell me how fix it, or how in more efficient way? thanks! package dev.suns.rubix_timer; import java.awt.color; import java.awt.font; import java.awt.toolkit; import java.awt.event.keyadapter; import java.awt.event.keyevent; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.util.calendar; import java.util.gregoriancalendar; import java.util.timer; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.swingconstants; public class rubixtimermain extends jframe { private jpanel contentpane; private jlabel labeltimer; private timer timer; public rubixtimermain() { createwindow(); } public static void main(string[] args) { new rubixtimermain(); } private void createwindow()

c - warning: implicit declaration of function - order of includes matter? -

i have following sample code snippet of code main.c calls 3 functions, 3 headers - giving me warnings reason unknown: #include "header1.h" #include "header2.h" #include "header3.h" int main() { function1(); // header1 function2(); // header2 function3(); // header 3 } basically, after using gcc, functions 2 & 3 produce warning. however, after rearranging code this: #include "header3.h" #include "header1.h" #include "header2.h" int main() { function1(); // header1 function2(); // header2 function3(); // header 3 } it give me warning functions 1 & 2 implicit. doing wrong here? your include file 1 should this: #ifndef __rezon_functions1__ #define __rezon_functions1__ #endif the other 2 files should similar macro name changed accordingly

How to display woocommerce subtotal of items only, before shipping or tax, on order detail page -

with plugins off , checking every setting, can't subtotal items on order details page. mine shows as: line item 1 $50 line item 2 $60 priority mail $10 --------------------- discount $0 shipping $10 order total $120 refunded -$0 however need order item subtotal: line item 1 $50 line item 2 $60 order item subtotal $110 priority mail $10 --------------------- discount $0 shipping $10 order total $120 refunded -$0 to declare order value when shipping, have take order total, subtract shipping, enter value on shipping form. shouldn't there order item subtotal? i've shut off plugins , checked settings, don't have one. know?

ruby - Rails app hangs when using Wicked_pdf gem and wkhtmltopdf-binary-edge -

i'm trying print pdf of view using `'wicked_pdf' gem. first time use gem. i've read the documentation , googled around , found simular questions here on stack overflow nothing seems trick. i've validated binaries ( see edit below) working fine, problem isn´t there. i found 2 strange lines in terminal when running rails s ( see edit @ bottom) i've been searching solution 3 straight days, , can't figure out. am missing here? the server hangs output in terminal rendered pages/partials/_travel_part.html.erb (36.6ms) rendered users/show.html.erb within layouts/application (531.7ms) rendered layouts/_navbar.html.erb (2.6ms) rendered shared/_footer.html.erb (0.8ms) completed 200 ok in 1640ms (views: 1115.4ms | activerecord: 136.0ms) "***************[\"/usr/local/bin/wkhtmltopdf\", \"-q\", \"file:////var/folders/sm/zwm8cy0x73qb6q1pq22r4bjh0000gn/t/wicked_pdf20160913-35465-hkw9b8.html\", \"/var/folders/s

Google Cloud Compute VM Instance for WordPress -

sorry, not programming question. i upgraded (before trial period expiry) free google cloud trial account micro vm instance hosting wordpress. did not have problem during trial period, once have upgraded, see database error - "error establishing database connection" time trying open webpage. have keep resetting (stop & start) instance each time want connect website , view homepage. don't know what's gone wrong nothing has changed in simple skeletal website since upgrade. appreciate in giving me pointers fix problem. with limited data guess based on page google machine profiles micro instance cpu not guaranteed request timing out while waiting on cpu available make connection... theory.

css - getting rid of gap in html table -

i getting gap @ end/beginning of 2 cells in email , can't life of me figure out why. the cell-padding set 0 cell-spacing = 0 here's have: <style type="text/css"> h1,h2,h3,h4,h5,h6,h7 { font-family: gotham, "helvetica neue", helvetica, arial, sans-serif; line-height: 1;} h1 { font-size: 20px; color: #b99350; line-height: 1; font-size: 25px; padding-top: 10px; font-align: center; font-weight: normal; text-align: center; } h3{ font-family: gotham, "helvetica neue", helvetica, arial, sans-serif; line-height: 1; color: #b99350; font-size: 24px; padding-top: 15px; padding-bottom: 10px; padding-left: 15px; padding-right: 10px; font-style: normal; font-weight: normal; text-align: center; text-transform: capitalize; } h4{ font-family: gotham, "helvetica neue", helvetica, arial, sans-serif; line-height: 1; color: #b99350; font-size: 22px; padding-right: 10px; padding

mysql - Connect to database for heavy traffic website Mysqli and PHP -

while coding use default connecting config is: //connection information define('database_user', 'root'); define('database_password', '*********'); define('database_host', 'localhost'); define('database_name', 'mydatabase'); // override default php.ini settings sending mail date_default_timezone_set("america/indianapolis"); //connecting $con = mysqli_connect(database_host, database_user, database_password,database_name); if (!$con) { trigger_error('could not connect mysql: ' . mysqli_connect_error()); } but normal connection website, if have heavy traffic website facebook or other websites using mysql database side, have users, comments, changing data every second. same way or there better way avoid max_use_connections warning other website going slow in first use normal later going slow day after day till restart server. i tried other solutions using different database every