command-line-interface

Proper Measurement of Characters in Pixels

与世无争的帅哥 提交于 2019-12-04 18:11:33
I'm writing a text box from scratch in order to optimize it for syntax highlighting. However, I need to get the width of characters in pixels, exactly, not the garbage Graphics::MeasureString gives me. I've found a lot of stuff on the web, specifially this , however, none of it seems to work, or does not account for tabs. I need the fastest way to measure the exact dimensions of a character in pixels, and tab spaces. I can't seem to figure this one out... Should mention I'm using C++, CLR/CLI, and GDI+ Here is my measuring function. In another function the RectangleF it returns is drawn to the

Run cron job in CodeIgniter and Hostgator

天涯浪子 提交于 2019-12-04 17:45:51
I'm trying to run the follow cron job in codeigniter and hostgator /usr/bin/php /home/username/public_html/index.php cronjob contact martin But nothing happens, I receive the following email: <h4>A PHP Error was encountered</h4> <p>Severity: Notice</p> <p>Message: Undefined index: REMOTE_ADDR</p> <p>Filename: core/Input.php</p> <p>Line Number: 351</p> <p>Severity: Warning</p> <p>Message: Cannot modify header information - headers already sent by (output started at /home/iglesias/public_html/mysite.com/system/core/Exceptions.php:185)</p> <p>Filename: libraries/Session.php</p> <p>Line Number:

PHP cli script does not output anything

核能气质少年 提交于 2019-12-04 15:56:33
问题 So I have a php script which I execute using the following command: php -f my_script.php myArguments The script is under version control using svn. I just updated it, pasted the command to run it into a terminal, and executed it. However, there is no output. Not a failure message, not it printing anything, nothing. It looks like it never starts. Kind of like the following: me:/srv/scripts# php -f my_script.php myArguments me:/srv/scripts# Other scripts will run just fine. It is difficult for

Apache Commons CLI : Getting list of values for an option

 ̄綄美尐妖づ 提交于 2019-12-04 15:12:47
问题 For a CLI, I have a requirement to pass in an array of ints as input for a particular option. Example - The below command would take in an array of customerIds and perform some operations. myCommand -c 123 124 125 I have implemented the CLI using Apache commons CLI, and I am using getOptionValues("c") to retrieve this array. The problem is that, this is returning only the first element in the array, i.e. [123], while I am expecting it to return [123, 124, 125]. A condensed version of my code,

Adding Cordova (Phonegap) Plugins manually to existing android projects

自作多情 提交于 2019-12-04 15:00:44
I'm trying to add additional Phonegap plugins (namely, the File plugin) to an existing android application that uses Phonegap. I've tried navigating to my project directory (in my workspace) and then run the command cordova plugin add https://theurlwhichworks.org/ It says the plugin is installing, and when I go to look in my workspace on my computer, there is a folder titled plugins, and inside, a directory called org.apache.cordova.file which means that the plugin (apparently) downloaded correctly, but doesn't seem to have been added to my project. Is there any way to manually add this plugin

Accessing Sitecore API from a CLI tool

风格不统一 提交于 2019-12-04 13:32:39
问题 I would like to access the Sitecore API from within a command line tool (with a goal of exporting some information about users in the database), however I haven't been able to get a simple CLI program connected. To give a simple example using Sitecore; using Sitecore.Configuration; using Sitecore.Data; using Sitecore.Data.Items; ... static void Main(string[] args) { Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master"); Console.WriteLine(master.Items.ToString())

Unable to install plugins in cordova project

青春壹個敷衍的年華 提交于 2019-12-04 12:44:54
Am facing a big issue : Unable to install the phonegap plugins in my cordova project.Actually it was working fine still yesterday. Now whenever I try adding any cordova plugin using CLI in my cordova project. I get the following error; D:\Projects\test cordova>cordova plugin add org.apache.cordova.network-information Fetching plugin "org.apache.cordova.network-information" via plugin registry npm http GET http://registry.cordova.io/org.apache.cordova.network-information npm http 502 http://registry.cordova.io/org.apache.cordova.network-information npm ERR! registry error parsing json What is

Installing angular-cli on Windows Behind Proxy Server

余生颓废 提交于 2019-12-04 12:12:40
问题 I am currently building Angular 2 demos from behind a corporate proxy server with known issues for blocking both NPM and TypeScript 'typings' installs. While I have been able to work around these issues with proxy server settings, I'm a little unsure what to do about the latest issue. Whenever I try to install angular-cli globally: npm install -g angular-cli or even locally to a directory with an existing npm init setup (including package.json file): npm install angular-cli --save I receive

The Android Command for Ionic Framework does not work in Windows 8 CLI?

烈酒焚心 提交于 2019-12-04 11:45:39
I am on Windows 8 and following through how to install and use Cordova with Ionic Framework on Windows 8.1. I followed through the video here: http://learn.ionicframework.com/videos/windows-android/ . I am stuck at 5:58 of the video where the SDK Manager is suppose to come up when I type 'android' in the command line, but it says it's unrecognizable command. I made sure my file directories are exact. What else am I missing? How do I fix this problem? PATH C:\Users\Jaime\AppData\Roaming\npm; C:\Program Files\Java\jdk1.8.0_25\bin; C:\Development\AndroidSDK\sdk\platform-tools; C:\Development

How to Export SQL Query to TXT Using Command Line

淺唱寂寞╮ 提交于 2019-12-04 10:51:12
问题 I want to export select * from table results to a text file from the command line in linux. How should I do this? Thanks, Jean 回答1: look at link you only need to add this to the query select * from table INTO OUTFILE '/tmp/myfilename.txt' you can improve this to csv file (using it in excel latter) like : INTO OUTFILE '/tmp/myfilename.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' 来源: https://stackoverflow.com/questions/4243610/how-to-export-sql-query-to-txt-using