2018-10-22         Otis

gnu make: How to concat two strings

Given the line:program_OBJS := ${program_SRCS:.cpp=.o}I would like to append .o to each filename instead of replacing .cpp with .o.How do I do that? To just append something to a list of space separated items you can use:program_OBJS := $(foreach program,$(program_SRCS),$(program).o)To use the substitution method (like you show in your question):program_OBJS := $(program_SRCS:.cpp=.cpp.o)but for that the list must contain the .cpp suffices, or the substitutions will not occur. [XXX]GNU make has addsuffix function [XXX]Shorter alternative, using a pattern substitut...

 makefile                     6 answers                     76 view
 2018-10-22         Otis

Error connecting to Quickbooks Desktop POS through the web connector

I have a client that needs to connect his website to the Quickbooks Desktop POS 18.0. I Downloaded the Quickbooks webconnector, but the latest version gives an error and says I need quickbooks 2015 or later, so I downloaded the 2.1.0.30 version and was able to install it on the machine.I then used the following php application https://github.com/consolibyte/quickbooks-php. I installed it on my server, got the ssl certificate and everything needed for security. I'm only using it for tests now, but the problem is that when I generate the .qwc file and use it on the web connec...

 quickbooks                     1 answers                     47 view
 2018-10-22         Otis

How to convert string with xml tags into dictionary using split function or more generic ways in Python?

I have a string which is actually a big xml structure string.I want convert this string into dictionary so that I can quickly grab the key value pair. How can I do so and what is the way here? I am using python3.<TDS xmlns="http://uburw"> <odour> <state> <order-number>AE:9E:7A:4E:8A:15</order-number> <oper-order-age>600</oper-order-age> <oper-order-time>200</oper-order-time> <oper-order-delay>1500</oper-order-delay> <branch-root>80008e5d3c4d1572</branch...

 python                     1 answers                     8 view
 2018-10-22         Otis

Pythonic way performing split on all elements of a list

I want to end up with a list that contains the first elements of a split on all items of a list. That is. input_list = [‘A1 - Some Text’, ‘A2 - Other Text’] should result as output_list = [‘A1’, ‘A2’]. What is the most Pythonic (clever) way of doing this? Extra points for not needing multiple list variables. UPDATE:Updating with my initial attempt:input_list = [‘A1 - Some Text’, ‘A2 - Other Text’]output_list = []for element in input_list: output_list.append(element.split(' - ')[0])) If l contains your list, I think something like: [i.split('-')[0] for i in l] should p...

 python                     1 answers                     81 view
 2018-10-22         Otis

Moment isSameOrAfter not calculating correctly

Not sure if I have the correct parameters, syntax, or am just flat out not using it correctly but when using 'isSameOrAfter' while checking if a current utc date time is after a date is coming back false when it should be true.var utcDateTime = "8/28/2018 7:30:00 PM";var oneDayBefore = moment(utcDateTime, "M/D/YYYY h:mm:ss A").subtract(1, 'days');// oneDayBefore should now be 8/27/2018 7:30:00 PMif (moment().utc().isSameOrAfter(oneDayBefore, 'day')) {alert('is same or after')};I think I have found two ways to do it but please advise, I'm a little confused about the paramete...

 javascript                     2 answers                     69 view
 2018-10-22         Otis

MongoDB 2.4 not allow to create collection after fileSize~=2GB but dataSize~1MB

I am using MongoDB 2.4 32 bit on ARM processor. I am creating dynamic collections in my database. I went through the MongoDB documentation that states - Storage engine MMAP pre allocates disk space upto 2GB for file system. 32-bit MongoDB processes are limited to about 2 gb of dataHere is the output of db.stats(){ "db" : "admin", "collections" : NumberInt(40), "objects" : NumberInt(998), "avgObjSize" : 196.9498997995992, "dataSize" : NumberInt(196556), #~1MB "storageSize" : 1478905856.0, "numExtents" : NumberInt(42), "indexes" : NumberInt(50),...

 mongodb                     1 answers                     22 view
 2018-10-22         Otis

How do I change the location of ejb-jar.xml in my maven project?

When building my EJB project with maven, maven expects the ejb-jar.xml to be in META-INF/. However; I need to be able to put it in directoryA/META-INF.maven-ejb-plugin doesn't seem to provide a parameter for specifying where ejb-jar.xml is.Can you point me in the right direction? Indeed, the maven-ejb-plugin doesn't provide any parameter to change the location of the deployment descriptor which is expected to be available at META-INF/ejb-jar.xml (the location is hard coded in the EjbMojo) or the build will fail at packaging time when building EJB 2.X (which makes sense)...

 java                     4 answers                     49 view
 2018-10-22         Otis

how to use json data inside list in cassandra?

i want to upload data in form of json inside list example:create table product (product_details list<text>, location varchar, primarykey(location));Insert into product(product_details,location) values( [ {"productname": "xyz"}, {"price":"100"} ], 'bangalore' );It is showing errors First of all you have syntax error in create table query for primary key. And next problem you can try insert value ...

 cassandra                     1 answers                     48 view
 2018-10-22         Otis

SQL Syntax Formatting Tool

I find the need to send SQL statements by email often and I was wondering if anyone had a tool that would color code the Oracle Reserved Words, Keywords, and Namespaces so that when the code is copied from the tool into say Lotus notes it would appear in the email as it does in the tool. try thisInstant SQL Formatteralt text http://i38.tinypic.com/16a86kw.jpgyou must select the option Output -> SQL (HTML:font)Bye [XXX]SQLinForm - No download necessary. It uses a Java applet. Feature rich. That’s the one I like. [XXX]An alternative is to use Pastebin , encrypt it a...

 sql                     3 answers                     13 view
 2018-10-22         Otis

update and delete is not working vb.net

im having a problem in my codes there's no error showing up and when i press the button nothing happens this is the code im using first one is the update buttonPrivate Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click Try con.Open() With cmd .Connection = con .CommandText = ("Update TBL_EMPLOYEE MiddleName='" & txtMiddleName.Text & "',LastName='" & txtLastName.Text & "', Gender='" & txtGender.Text & "',Age='" & txtupAge.Text & "' ,Address='" & ...

 sql-server                     1 answers                     22 view
 2018-10-22         Otis

Apache Kafka Consumer - terminate from console

I am new to Apache Kafka and I am trying to consume messages from a topic. I ran the following from the console to see the messages:bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic test --from-beginningBut after that I could see a consumer being created called "console-consumer-4158" and I accidentally closed the console.How to terminate the running consumer? the process itself will be stopped after you terminate consumer.as you are using old consumer API, groupId (console-consumer-4158) + information about consumed offsets are stored in zookeepe...

 java                     1 answers                     5 view
 2018-10-22         Otis

Error while starting react-native application

I am not able to run react-native on port 8088. Sometimes it runs and sometimes it doesn't. Last time I restarted the laptop so it ran and now again it isn't running. Is there any permanent solution? The command should be:react-native start --port 8088You can use this command to check the options:react-native start --help [XXX]

 javascript                     1 answers                     100 view
 2018-10-22         Otis

How do I construct an ISO 8601 datetime in C++?

I'm working with the Azure REST API and they are using this to create the request body for table storage:DateTime.UtcNow.ToString("o")Which produces: 2012-03-02T04:07:34.0218628ZIt is called "round-trip" and apparently it's an ISO standard (see http://en.wikipedia.org/wiki/ISO_8601) but I have no idea how to replicate it after reading the wiki article.Does anyone know if Boost has support for this, or possibly Qt?Note: I'll get back to you after the weekend after comparing it to C#. If the time to the nearest second is precise enough, you can use strftime:#include <c...

 c++                     7 answers                     28 view
 2018-10-22         Otis

How to do incremental backup in MySQL using LSN using ansible without using percona?

I wants to backup mysql DB incrementally using ansible/shell commands. Can anyone give me the steps involve in it. I have a database and table in my MySQL. my.cnf file having the configuration for that. Every one hour I wants to do the backup and upload my DB datas to the s3 bucket. Without using LSN value we can achieve the solution.Flush binary logs [new binary log file created]By using binlog.index file, found previous binary file. Copied thatfile to where I want to upload. That is the dump file and I got datafrom that file got restore.File saved by current timestam...

 mysql                     1 answers                     15 view
 2018-10-22         Otis

Creating a session in PHP then checking for that session in JSP

I want to be able to create a session in PHP so that my JSP file can check for that session value and know that the PHP file was reached.The idea is:User goes to PHP file - session is created The PHP file now redirects to a webappThe web app notices the user isn't logged in and redirects to the JSP file for the user to log in.The JSP will check if the PHP file was accessed by checking for the created session ID. If it was reached, it will auto-login for the user. If it wasn't reached, then we let the user log in.Can this be done? If the PHP file redirects to the webapp whic...

 php                     1 answers                     79 view
 2018-10-22         Otis

how to test private function outside react component

I have a private function outside component. It sounds more convenient to do test for function alone better than test it inside MyComponent, but it's private not exported.function func(){ return something;}export default class MyComponent extends Component {render <SomeComponent someProp={func()} />}I use mocha and enzyme for test and I wonder if there is anyway to test private function rather than test it inside the component. func is defined in module scope. It's not possible to reach variables outside the scope they were defined in JavaScript.Even if func were e...

 javascript                     2 answers                     28 view

Page 1 of 144  |  Show More Pages:  Top Prev Next Last