Id int64 34.6M 60.5M | Title stringlengths 15 150 | Body stringlengths 33 36.7k | Tags stringlengths 3 112 | CreationDate stringdate 2016-01-01 00:21:59 2020-02-29 17:55:56 | Y stringclasses 3 values |
|---|---|---|---|---|---|
35,169,650 | Differentiate between error and standard terminal log with ffmpeg - nodejs | <p>I'm using <code>ffmpeg</code> in node js. Both the standard terminal output and the error seems to be sent to stdout, so I don't know how to differentiate between error and success... Here's my code:</p>
<pre><code>var convertToMp3 = function(filePath) {
var ffmpeg = child_process.spawn('ffmpeg',['-i', filePath, '-y', 'output.mp3']);
var err = '';
ffmpeg.stderr
.on('data', function(c) { err += c; })
.on('end', function() { console.log('stderr:', err); });
var d = '';
ffmpeg.stdout
.on('data', function(c){d +=c;})
.on('end', function(){ console.log('stdout', d); });
}
</code></pre>
<p>wether the conversion succeeds or fails, stdout is empty and stderr contains what I'd get if I'd run the corresponding command in the terminal</p>
| <node.js><ffmpeg><stdout><stderr> | 2016-02-03 06:05:58 | HQ |
35,169,724 | VM in virtualbox is already locked for a session (or being unlocked) | <p>My VM in virtualbox can not start due to this error, I don't want to destroy it and reinstall it again, anyway to recover it ?</p>
<p>There was an error while executing <code>VBoxManage</code>, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.</p>
<pre><code>Command: ["modifyvm", "319fcce3-e8ff-4b6f-a641-3aee1df6543f", "--natpf1", "delete", "ssh"]
Stderr: VBoxManage: error: The machine 'centos64_c6402_1454036461345_59755' is already locked for a session (or being unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp
</code></pre>
| <virtualbox> | 2016-02-03 06:11:02 | HQ |
35,169,911 | Build: Cannot use JSX unless the '--jsx' flag is provided | <p>I am using VS 2013 and tsx files with react. I can build my project manually just fine. (Right click and build solution)</p>
<p>But when I try to publish on Azure, VS tries to build again but at that time I am getting all bunch of errors stated as:</p>
<pre><code>Error 2 Build: Cannot use JSX unless the '--jsx' flag is provided.
</code></pre>
<p>and points to my tsx files.</p>
<p>Seems like Azure Publish using different kind of build steps than VS 2013 does.</p>
<p>How can I fix this issue?</p>
<p><a href="https://i.stack.imgur.com/0yeMs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0yeMs.png" alt="Azure publish error"></a></p>
<p><a href="https://i.stack.imgur.com/HCeVJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HCeVJ.png" alt="VS 2013 errors"></a></p>
| <azure><visual-studio-2013><typescript><tsx> | 2016-02-03 06:23:49 | HQ |
35,170,397 | Webpack external not cacheable | <p>I'm using webpack to bundle node.js web server based on Express.js framework.</p>
<p>Webpack build works fine, but at the end it gives me two red messages:</p>
<p>[1] external "express" 42 bytes {0} [not cacheable]</p>
<p>[2] external "path" 42 bytes {0} [not cacheable]</p>
<p>What does that mean and should I fix it? If yes then how to fix it?</p>
<p>My webpack config is here:</p>
<pre><code>var server = {
devtool: 'source-map',
entry: './src/server.ts',
target: 'node',
// Config for our build files
output: {
path: root('dist/server'),
filename: '[name].bundle.js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js'
},
externals: nodeModules,
module: {
preLoaders: [
// { test: /\.ts$/, loader: 'tslint-loader', exclude: [ root('node_modules') ] },
// TODO(gdi2290): `exclude: [ root('node_modules/rxjs') ]` fixed with rxjs 5 beta.2 release
{ test: /\.js$/, loader: "source-map-loader", exclude: [ root('node_modules/rxjs') ] }
],
loaders: [
// Support for .ts files.
{ test: /\.ts$/, loader: 'ts-loader', exclude: [ /\.(spec|e2e|async)\.ts$/ ] }
]
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(true),
// replace
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(metadata.ENV),
'NODE_ENV': JSON.stringify(metadata.ENV)
}
})
],
};
</code></pre>
<p>My server.ts module:</p>
<pre><code>console.log('Starting web server...');
import * as path from 'path';
import * as express from 'express';
let app = express();
let root = path.join(path.resolve(__dirname, '..'));
var port = process.env.PORT || 8080; // set our port
var router = express.Router();
router.get('/', function(req, res) {
res.json({ message: 'hooray! welcome to our api!' });
});
app.use('/api', router);
app.listen(port);
console.log('Server started on port ' + port);
</code></pre>
| <node.js><webpack> | 2016-02-03 06:55:04 | HQ |
35,170,581 | How to Access styles from React? | <p>I am trying to access the width and height styles of a div in React but I have been running into one problem. This is what I got so far: </p>
<pre><code>componentDidMount() {
console.log(this.refs.container.style);
}
render() {
return (
<div ref={"container"} className={"container"}></div> //set reff
);
}
</code></pre>
<p>This works but the output that I get is a CSSStyleDeclaration object and in the all property I can all the CSS selectors for that object but they none of them are set. They are all set to an empty string. </p>
<p>This is the output of the CSSStyleDecleration is: <a href="http://pastebin.com/wXRPxz5p" rel="noreferrer">http://pastebin.com/wXRPxz5p</a></p>
<p>Any help on getting to see the actual styles (event inherrited ones) would be greatly appreciated!</p>
<p>Thanks!</p>
| <javascript><css><reactjs><attributes> | 2016-02-03 07:07:32 | HQ |
35,170,620 | Format java.sql.Timestamp into a String | <p>Is it possible to convert/format <code>java.sql.Timestmap</code> into a String that has the following format:</p>
<blockquote>
<p>yyyyMMdd</p>
</blockquote>
<p>I know that doing it with a <code>String</code> is fairly simple e.g:</p>
<pre><code>String dateString = "2016-02-03 00:00:00.0";
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(dateString);
String formattedDate = new SimpleDateFormat("yyyyMMdd").format(date);
</code></pre>
<p>But, I have to work with the <code>Timestamp</code> object.</p>
| <java> | 2016-02-03 07:09:23 | HQ |
35,170,911 | mix deps.get failed (seems missing ssl?) | <p>I'm sorry but I'm new to Elixir. while building phoenix application, <code>mix deps.get</code> failed with an error.</p>
<pre><code>% mix deps.get
Could not find Hex, which is needed to build dependency :phoenix
Shall I install Hex? [Yn] y
** (MatchError) no match of right hand side value: {:error, {:ssl, {'no such file or directory', 'ssl.app'}}}
(mix) lib/mix/utils.ex:409: Mix.Utils.read_httpc/1
(mix) lib/mix/utils.ex:354: Mix.Utils.read_path/2
(mix) lib/mix/local.ex:107: Mix.Local.read_path!/2
(mix) lib/mix/local.ex:86: Mix.Local.find_matching_versions_from_signed_csv!/2
(mix) lib/mix/tasks/local.hex.ex:23: Mix.Tasks.Local.Hex.run/1
(mix) lib/mix/dep/loader.ex:140: Mix.Dep.Loader.with_scm_and_app/4
(mix) lib/mix/dep/loader.ex:98: Mix.Dep.Loader.to_dep/3
(elixir) lib/enum.ex:1043: anonymous fn/3 in Enum.map/2
%
</code></pre>
<p>erlang and elixir has been installed via <a href="https://github.com/yrashk/kerl" rel="noreferrer">kerl</a> and <a href="https://github.com/HashNuke/asdf" rel="noreferrer">asdf</a>.
and my installation log is here <a href="http://otiai10.hatenablog.com/entry/2016/02/03/154953" rel="noreferrer">http://otiai10.hatenablog.com/entry/2016/02/03/154953</a></p>
<p>envirionment</p>
<ul>
<li>MacOS: 10.11.2</li>
<li>Erlang: 18.0</li>
<li>Elixir: 1.1.1</li>
</ul>
<p>What is happening and what should I do?</p>
| <erlang><elixir><phoenix-framework><mix> | 2016-02-03 07:27:27 | HQ |
35,171,760 | In R is it better to use integer64, numeric, or character for large integer id numbers? | <p>I am working with a dataset that has several columns that represent integer ID numbers (e.g. transactionId and accountId). These ID numbers are are often 12 digits long, which makes them too large to store as a 32 bit integer.</p>
<p>What's the best approach in a situation like this?</p>
<ol>
<li>Read the ID in as a character string. </li>
<li>Read the ID as a integer64 using the bit64 package. </li>
<li>Read the ID as a numeric (i.e. double). </li>
</ol>
<p>I have been warned about the dangers of testing equality with doubles, but I'm not sure if that will be a problem in the context of using them as IDs, where I might merge and filter based on them, but never do arithmetic on the ID numbers.</p>
<p>Character strings seems intuitively like it should be slower to test for equality and do merges, but maybe in practice it doesn't make much of a difference.</p>
| <r> | 2016-02-03 08:17:39 | HQ |
35,172,207 | ReportLab: working with Chinese/Unicode characters | <p>TL;DR:
<b>Is there some way of telling ReportLab to use a specific font, and fallback to another if glyphs for some characters are missing?</b> Alternatively, <b>Do you know of a condensed TrueType font which contains the glyphs for all European languages, Hebrew, Russian, Chinese, Japanese and Arabic?</b></p>
<p>I've been creating reports with ReportLab, and have encountered problems with rendering strings containing Chinese characters. The font I've been using is DejaVu Sans Condensed, which does not contain the glyphs for Chinese (however, it does contain Cyrillic, Hebrew, Arabic and all sorts of Umlauts for European language support - which makes it pretty versatile, and I need them all from time to time)</p>
<p>Chinese, however, is not supported with the font, and I've not been able to find a TrueType font which supports ALL languages, and meets our graphic design requirements. As a temporary workaround, I made it so that reports for Chinese customers use an entirely different font, containing only English and Chinese glyphs, hoping that characters in other languages won't be present in the strings. However this is, for obvious reasons, clunky and breaks the graphic design, since it's not DejaVu Sans, around which the whole look&feel has been designed.</p>
<p><b>So the question is</b>, how would you deal with the need to support multiple languages in one document, and maintain usage of a specified font for each language. This is made more complicated due to the fact that sometimes strings contain a mix of languages, so determining which ONE font should be used for each string is not an option.</p>
<p>Is there some way of telling ReportLab to use a specific font, and fallback to another if glyphs for some characters are missing? I found vague hints in the docs that it should be possible, although I might understand it incorrectly.</p>
<p>Alternatively, Do you know of a condensed TrueType font which contains the glyphs for all European languages, Hebrew, Russian, Chinese, Japanese and Arabic?</p>
<p>Thanks.</p>
| <python><unicode><fonts><reportlab><chinese-locale> | 2016-02-03 08:45:54 | HQ |
35,172,319 | Spring mvc3 + hibernate + java + web services | <p>I want to create a web application which should communicate with other web-apps and access their db and pull and insert in my project db and push the data too. Somebody suggested me you can achieve that using web services.But i have no knowledge on that. </p>
<p>I am creating web application using spring mvc3 + Maven + hibernate + java and database is MySQL in STS IDE. </p>
<p>Am very new to web services. Can you please suggest me how to create web service from scratch with any good step by step format and how to get web services in IDE, how to create Web service in my project and how to link my web app with other web apps to communicate with the db?</p>
<p>A million tons of thanks in advance. :)</p>
| <java><web-services><rest><spring-mvc><soap> | 2016-02-03 08:51:30 | LQ_CLOSE |
35,172,506 | Using AWS Certificate Manager (ACM Certificate) with Elastic Beanstalk | <p>When you have a certificate for your domain issued through AWS Certificate Manager, how do you apply that certificate to an Elastic Beanstalk application.</p>
<p>Yes, the Elastic Beanstalk application is load balanced and does have an ELB associated with it.</p>
<p>I know I can apply it directly to the ELB my self. But I want to apply it through Elastic Beanstalk so the env configuration is saved onto the Cloud Formation template.</p>
| <amazon-web-services><ssl-certificate><amazon-elastic-beanstalk><aws-certificate-manager> | 2016-02-03 09:01:44 | HQ |
35,173,207 | how to print this type of array? | Array
(
[0] => Array
(
[0] => 1
)
[1] => Array
(
[0] => 2
)
[2] => Array
(
[0] => 3
)
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
[10] =>
[11] =>
[12] =>
[13] =>
[14] =>
)
How to print above array using foreach?I tried by using foreach like this:
$i = 0;
foreach($array as $arr)
{
echo $arr[$i];
$i++;
}
But the result is empty.Please help me to solve this. | <php><arrays><multidimensional-array> | 2016-02-03 09:35:02 | LQ_EDIT |
35,173,295 | is it possible to populate a hash using a for loop? | I want a hash that holds keys which are ints from 1 to 18.
Essentially, at the start I want the hash to look like this:
myHash = Hash.new
myHash[1] = "free"
myHash[2] = "free"
...
myHash[18] = "free"
But I want to know if there's a nicer way to do this, such as using a for loop?
something like:
myHash = Hash.new
for i in 1..18
hash[i] = "free"
will this work or will it just create 18 keys called "i"? Sorry if this is obvious but I am a real beginner and haven't found any answer elsewhere
| <ruby><hash> | 2016-02-03 09:38:54 | LQ_EDIT |
35,173,417 | Interactive Jupyter/IPython notebooks in slideshow mode? | <p>Is it possible to run Jupyter Notebooks in an interactive slideshow mode? That is, Python kernel would be running in the background and I can modify and execute cells.</p>
<p>The following command generates HTML slideshow and I can't modify nor execute the cells:</p>
<pre><code>jupyter nbconvert mynotebook.ipynb --to slides --post serve
</code></pre>
| <ipython-notebook><jupyter-notebook> | 2016-02-03 09:44:42 | HQ |
35,173,549 | How to compress video for upload server? | <p>I'm trying to upload video file to server. But size is too large so how i can compress video before upload to server.
Thank you for your help.</p>
| <android><video><compression> | 2016-02-03 09:50:08 | LQ_CLOSE |
35,175,651 | create 9 patch images for background images | <p>I have worked out to create 9 patch images for background images.i have struggled to create the nine patch images in making the lines at top and left portion of images.can any one guide on this?</p>
<p>see this link</p>
<p><a href="https://www.google.co.in/search?q=background+images&biw=1366&bih=641&noj=1&tbm=isch&imgil=N8KsG6ve1vbn8M%253A%253B7yPe8a2Anf4ArM%253Bhttp%25253A%25252F%25252Fwww.planwallpaper.com%25252Fbackground-images&source=iu&pf=m&fir=N8KsG6ve1vbn8M%253A%252C7yPe8a2Anf4ArM%252C_&usg=__xv3d9hZA9_uE8q0ivwIJW43bZJQ%3D&ved=0ahUKEwjJpOWLvdvKAhXPC44KHXdvBT8QyjcILw&ei=tOKxVsn6CM-XuAT33pX4Aw#imgrc=N8KsG6ve1vbn8M%3A&usg=__xv3d9hZA9_uE8q0ivwIJW43bZJQ%3D" rel="nofollow">https://www.google.co.in/search?q=background+images&biw=1366&bih=641&noj=1&tbm=isch&imgil=N8KsG6ve1vbn8M%253A%253B7yPe8a2Anf4ArM%253Bhttp%25253A%25252F%25252Fwww.planwallpaper.com%25252Fbackground-images&source=iu&pf=m&fir=N8KsG6ve1vbn8M%253A%252C7yPe8a2Anf4ArM%252C_&usg=__xv3d9hZA9_uE8q0ivwIJW43bZJQ%3D&ved=0ahUKEwjJpOWLvdvKAhXPC44KHXdvBT8QyjcILw&ei=tOKxVsn6CM-XuAT33pX4Aw#imgrc=N8KsG6ve1vbn8M%3A&usg=__xv3d9hZA9_uE8q0ivwIJW43bZJQ%3D</a></p>
<p>i would like to convert this type of image into 9 patch images..how to make stretchable lines on left and top of the image </p>
| <android> | 2016-02-03 11:21:05 | LQ_CLOSE |
35,175,814 | Windows 10 - Username with whitespace and PATH | <p>Upon installing Windows 10 I created my admin user as <code>Miha Šušteršič</code>. Now when I install programs that need to modify the environment variable PATH, most of them don't get added. For instance this happens with MongoDB and Git, but npm got added normally.</p>
<p>I think this is an issue with the whitespace in the path to the variables. I tried renaming my username to <code>M.Sustersic</code>, but the system folder Users\Miha Šušteršič\ did not get updated.</p>
<p>Is there a way for me to change this folder name automatically (so the rest of the app dependencies on \Users\Miha Šušteršič\AppData don't get bugged) or do I need to reinstall windows?</p>
<p>Is there something else I am missing here? I tried adding the dependencies on my own, but nothing worked so far.</p>
<p>Thanks for the help</p>
| <path><windows-10> | 2016-02-03 11:29:34 | HQ |
35,176,091 | How should a GRPC Service be hosted? | <p>I have created a GRPC Server in C# using the example given at <a href="http://www.grpc.io/docs/tutorials/basic/csharp.html" rel="noreferrer">Link</a>. Now I want to figure out as how should I be hosting this server so that I achieve following:</p>
<ul>
<li>Should I make this Server a Console application or a a Windows Service. If I make it a windows Service then updating the service will be cumbersome (which is a big negative) and if I make it a console app then updating will simply need shutting down exe. But that comes with the price of closing the same by mistake. Is there any other better way?</li>
<li>With IIS this issue won't b there as I can simply remove the site from LB and stop the website to perform the update but since GRPC won't be a part of IIS, I am not sure what's the way to get this working.</li>
</ul>
<p>Any references for the better architecture are welcomed.</p>
| <c#><grpc> | 2016-02-03 11:41:25 | HQ |
35,176,092 | Cannot import an andriod code sample in Andriod Studio | I am trying to import an Andriod Code Sample using the Andrio Studio.
But i get this error. Please suggest the cause or whats missing.
[enter image description here][1]
Thanks,
Asha
[1]: http://i.stack.imgur.com/BsJ3v.jpg | <android><android-studio><android-studio-import> | 2016-02-03 11:41:26 | LQ_EDIT |
35,176,270 | Python 2.7 : LookupError: unknown encoding: cp65001 | <p>I have installed python 2(64 bit), on windows 8.1 (64 bit) and wanted to know pip version and for that I fired <code>pip --version</code> but it is giving error.</p>
<pre><code> C:\Users\ADMIN>pip --version
Traceback (most recent call last):
File "c:\dev\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\dev\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\dev\Python27\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\dev\python27\lib\site-packages\pip\__init__.py", line 15, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "c:\dev\python27\lib\site-packages\pip\vcs\mercurial.py", line 10, in <module>
from pip.download import path_to_url
File "c:\dev\python27\lib\site-packages\pip\download.py", line 35, in <module>
from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner
File "c:\dev\python27\lib\site-packages\pip\utils\ui.py", line 51, in <module>
_BaseBar = _select_progress_class(IncrementalBar, Bar)
File "c:\dev\python27\lib\site-packages\pip\utils\ui.py", line 44, in _select_progress_class
six.text_type().join(characters).encode(encoding)
LookupError: unknown encoding: cp65001
</code></pre>
<p>Note : The same command works fine for python 3. I have uninstalled both and installed again but still no success.</p>
| <python><python-2.7><encoding><pip> | 2016-02-03 11:50:40 | HQ |
35,176,425 | Horizontall Scrolling Card View - Nadroid | I am trying to find a way to do the below design in android. But i am not able to find a solution to it. Can anyone give me a solution to it.
[![enter image description here][1]][1]
[1]: http://i.stack.imgur.com/AdL9q.jpg
| <android><android-layout><android-studio><android-viewpager><android-cardview> | 2016-02-03 11:57:48 | LQ_EDIT |
35,176,825 | Supporting Multiple Screens single layout | <p>I'm developing an app in android and I have to support all different screen sizes and density. Without created different folder for layout : layout-small layout-large and layout.</p>
| <android> | 2016-02-03 12:15:49 | LQ_CLOSE |
35,177,150 | what is the reason for "java.lang.NoClassDefFoundError: com.estimote.sdk.BeaconManager" ?Please help me to rseolve | java.lang.NoClassDefFoundError: com.estimote.sdk.BeaconManager
at com.campus.ReadingBeaconService.onStart(ReadingBeaconService.java:50)
at android.app.Service.onStartCommand(Service.java:450)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2702)
at android.app.ActivityThread.access$2100(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method) | <java><android> | 2016-02-03 12:29:35 | LQ_EDIT |
35,177,518 | Dynamic Programming - Minimum number of coins in C | <p>I have looked through various questions on the site and I haven't managed to find anything which implements this by the following reasoning (so I hope this isn't a duplicate).</p>
<p>The problem I'm trying to solve via a C program is the following:</p>
<blockquote>
<p>As the programmer of a vending machine controller your are required to compute the minimum number of coins that make up the required change to give back to customers. An efficient solution to this problem takes a dynamic programming approach, starting off computing the number of coins required for a 1 cent change, then for 2 cents, then for 3 cents, until reaching the required change and each time making use of the prior computed number of coins. Write a program containing the function <code>ComputeChange()</code>, that takes a list of valid coins and the required change. This program should repeatedly ask for the required change from the console and call <code>ComputeChange()</code> accordingly. It should also make use of “caching”, where any previously computed intermediate values are retained for subsequent look-up.</p>
</blockquote>
<p>After looking around online to find how others have solved it, I found the following example applied with pennies, nickels and dimes:</p>
<p><a href="https://i.stack.imgur.com/dYlPp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dYlPp.png" alt="enter image description here"></a></p>
<p>Which I tried to base my code upon. But first of all, my code isn't halting, and secondly, I'm not sure if I'm incorporating the <em>caching</em> element mentioned in the rubric above. (I'm not really sure how I need to go about that part). </p>
<p>Can anyone help find the flaws in my code?</p>
<pre class="lang-c prettyprint-override"><code>#include <stdio.h>
#include <limits.h>
int computeChange(int[],int,int);
int min(int[],int);
int main(){
int cur[]={1,2,5,10,20,50,100,200};
int n = sizeof(cur)/sizeof(int);
int v;
printf("Enter a value in euro cents: ");
scanf("%d", &v);
printf("The minimum number of euro coins required is %d", computeChange(cur, v, n));
return 0;
}
int computeChange(int cur[], int v, int n){
if(v < 0)
return -1;
else if(v == 0)
return 0;
else{
int possible_mins[n], i;
for(i = 0; i < n; i++){
possible_mins[i]=computeChange(cur, v-cur[i], n);
}
return 1+min(possible_mins, n);
};
}
int min(int a[], int n){
int min = INT_MAX, i;
for(i = 0; i < n; i++){
if((i>=0) && (a[i]< min))
min = a[i];
}
return min;
}
</code></pre>
<p>Any assistance will be greatly appreciated.</p>
| <c><dynamic-programming> | 2016-02-03 12:47:23 | HQ |
35,177,726 | How to change First letter of each word to Uppercase in Textview xml | <p>i need to change the <strong>text="font roboto regular"</strong> to <strong>Font Roboto Regular</strong> in xml itself, how to do? </p>
<pre><code><TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="18sp"
android:textColor="@android:color/black"
android:fontFamily="roboto-regular"
android:text="font roboto regular"
android:inputType="textCapWords"
android:capitalize="words"/>
</code></pre>
| <android><xml><android-layout> | 2016-02-03 12:56:30 | HQ |
35,177,797 | What exactly is Fragmented mp4(fMP4)? How is it different from normal mp4? | <p>Media Source Extension (<strong>MSE</strong>) needs fragmented mp4 for playback in the browser.</p>
| <media><mp4><media-source> | 2016-02-03 12:59:34 | HQ |
35,177,970 | Find time duration between tow times with am pm selecton | I have three dropdown lists for selecting start time and another three for selecting end time .I want asp.net program which will give duration between two time and after i entered start time then end time should be greater than start time .first dropdown list contain 1 to 12 hours ans second contains 0 to 59 minutes and third one is for selecting am/pm.[here is image of that][1]
[1]: http://i.stack.imgur.com/E8niL.jpg
Give me codebehind for this page.. | <c#><asp.net><time><difference> | 2016-02-03 13:07:50 | LQ_EDIT |
35,178,135 | Where is the insecure content "was loaded over HTTPS, but requested an insecure prefetch resource" | <p>This URL: <a href="https://steakovercooked.com/wedding/schedule-wedding-ceremony/" rel="noreferrer">https://steakovercooked.com/wedding/schedule-wedding-ceremony/</a></p>
<p>I can't find the insecure content and the Chrome keeps complaining,</p>
<p>any ideas?</p>
<p><a href="https://i.stack.imgur.com/pWn4m.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pWn4m.png" alt="enter image description here"></a></p>
| <https> | 2016-02-03 13:16:17 | HQ |
35,178,808 | How do I use transaction with oracle SQL? | <p>I am trying to use transaction blocks on a SQL-Console with an Oracle DB. I'm used to use transaxction blocks in PostgreSQL like</p>
<pre><code>BEGIN;
<simple sql statement>
END;
</code></pre>
<p>but in oracle it seems that this is not possible. I'm always getting "ORA-00900" errors and I don't know how to fix that. If I just use SQL-Statements like</p>
<pre><code><simple sql statement>
COMMIT;
</code></pre>
<p>it works. But isn't there some tag to define the start of a transaction? I tried </p>
<pre><code>START TRANSACTION;
<simple sql statement>
COMMIT;
</code></pre>
<p>But it still throws an ORA-00900. My operating system is windows, I am using IntelliJ IDEA and a Oracle 11g DB.</p>
| <sql><oracle><transactions> | 2016-02-03 13:45:51 | HQ |
35,178,903 | Overwrite a File in Node.js | <p>Im trying to write into a text file in node.js.
Im doing this the following way:</p>
<pre><code>fs.writeFile("persistence\\announce.txt", string, function (err) {
if (err) {
return console.log("Error writing file: " + err);
}
});
</code></pre>
<p>whereas string is a variable. </p>
<p>This function will begin it`s writing always at the beginning of a file, so it will overwrite previous content. </p>
<p>I have a problem in the following case:</p>
<p>old content:</p>
<pre><code>Hello Stackoverflow
</code></pre>
<p>new write:</p>
<pre><code>Hi Stackoverflow
</code></pre>
<p>Now the following content will be in the file:</p>
<pre><code>Hi stackoverflowlow
</code></pre>
<p>The new write was shorter then the previous content, so part of the old content is still persistent.</p>
<p><strong>My question:</strong></p>
<p>What do I need to do, so that the old content of a file will be completely removed before the new write is made?</p>
| <javascript><node.js> | 2016-02-03 13:50:23 | HQ |
35,178,987 | Which tab is "Google Chrome Helper" running on? | <p>In MacOS in the Activity Monitor Google Chrome extensions show as "Google Chrome Helper". These often take up much of the CPU time. Is it possible to determine which tab a given Google Chrome Helper process is running on?</p>
<p>Other people have suggested setting the plug-ins run mode to "Click to play". It seems that this doesn't cover all instances of the helper, since I already have it set to click to play. As you can see from the image below, there are MANY instances of this helper running. Anyway this doesn't get to the heart of the question- which tab is the process running on. </p>
<p><a href="https://i.stack.imgur.com/rOs9z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rOs9z.png" alt="enter image description here"></a></p>
| <macos><google-chrome><google-chrome-extension><activity-monitor> | 2016-02-03 13:53:43 | HQ |
35,179,318 | .net 5 Web API controller action arguments are always null | I did see a few threads here addressing similar issue but unfortunately nothing could solve my problem (so far).
**CONTROLLER METHOD**
Following is my controller method:
<!-- begin snippet: js hide: false -->
<!-- language: lang-html -->
namespace apiservice.Controllers{
[Route("api/[controller]")]
public class BookStoreController : Controller{
private BookContext _ctx;
public BookStoreController(BookContext context)
{
_ctx = context;
}
[EnableCors("AllowAll")]
[RouteAttribute("SearchBooks")]
[HttpGet("searchbooks/{key}")]
public async Task<object> SearchBooks(string key){
using(var cmd = _ctx.Database.GetDbConnection().CreateCommand()){
cmd.CommandText = "SearchBooks";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Key", SqlDbType.NVarChar) {Value = key});
if(cmd.Connection.State == ConnectionState.Closed)
cmd.Connection.Open();
var retObj = new List<dynamic>();
using (var dataReader = await cmd.ExecuteReaderAsync()){
while(await dataReader.ReadAsync()){
//Namespace for ExpandoObject: System.dynamic
var dataRow = new ExpandoObject() as IDictionary<string, object>;
for (var iFiled = 0; iFiled < dataReader.FieldCount; iFiled++)
dataRow.Add(dataReader.GetName(iFiled), dataReader[iFiled]);
retObj.Add((ExpandoObject)dataRow);
}
}
if(!retObj.Any())
return JsonConvert.SerializeObject("No matching record found");
else
return JsonConvert.SerializeObject(retObj);
}
}
}
}
<!-- end snippet -->
When I check the console for output it says
`fail: Microsoft.AspNet.Server.Kestrel[13]
An unhandled exception was thrown by the application. System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'SearchBooks' expects parameter '@Key', which was not supplied.`
I have created another website locally, specially to test the CORS issue (which works fine). I am calling the above method via `AJAX` in the following way:
<!-- begin snippet: js hide: false -->
<!-- language: lang-html -->
<script type='text/javascript'>
$.ajax({
type: "POST",
url: "http://localhost:5000/api/bookstore/SearchBooks",
data: { 'key': 'van' },
dataType: 'json',
contentType:"application/json",
success: function (res) {
$("#response").html(res);
},
error: function (err) {
}
});
</script>
<!-- end snippet -->
Problem is the value of argument `key` in controller method `SearchBooks` is always `null`!
But if I create a `model` (below)
**MODEL**
<!-- begin snippet: js hide: false -->
<!-- language: lang-html -->
public class SearchViewModel{
public string SearchKey {get; set;}
}
<!-- end snippet -->
and then if I modify my `AJAX` to pass value to this `model` like following, everything works just fine!
<!-- begin snippet: js hide: false -->
<!-- language: lang-html -->
<script type='text/javascript'>
var searchModel={
key: 'van'
}
$.ajax({
type: "POST",
data: JSON.stringify(searhModel),
url: "http://localhost:5000/api/bookstore/searchbooks",
contentType:"application/json",
success: function (res) {
$("#response").html(res);
},
error: function (err) {
}
});
</script>
<!-- end snippet -->
Please help! | <javascript><c#><ajax><asp.net-core><asp.net-web-api2> | 2016-02-03 14:08:49 | LQ_EDIT |
35,179,397 | Laravel environment variables leaking between applications when they call each other through GuzzleHttp | <p>I have two Laravel 5.2 applications (lets call them A and B) on my local machine, both configured on two different virtualhosts on my local Apache 2.4 development server.</p>
<p>Both applications sometimes are calling each other through GuzzleHttp. </p>
<p>At one point I wanted to use encryption and I started getting "mac is invalid" exceptions from Laravel's Encrypter.</p>
<p>While investigating the issue, I found that when app A calls app B, app B suddenly gets encryption key (app.key) from app A! This causes encryption to break because the values on app B where encrypted using app's B encryption key.</p>
<p>While debugging, I found the Dotenv library has some logic to keep existing variables if they are set. I found that both $_ENV and $_SERVER do not have leaked variables, but <code>getenv()</code> has them!</p>
<p>I'm a bit confused because PHP <code>putenv</code> says:</p>
<blockquote>
<p>The environment variable will only exist for the duration of the current request.</p>
</blockquote>
<p>It seems, if during current request I launch another request through GuzzleHttp, the variables set by Dotenv in A using <code>putenv()</code> suddenly become available in app B which is being requested by GuzzleHttp!</p>
<p>I understand that this will not be an issue on production servers where config cache will be used instead of Dotenv and most probably both apps will run on different Apache servers, but this behavior is breaking my development process.</p>
<p><strong>How do I configure Laravel or GuzzleHttp or Apache or PHP to prevent this <code>putenv()</code> leakage from app A into app B?</strong></p>
| <php><apache><laravel><guzzle> | 2016-02-03 14:12:34 | HQ |
35,179,410 | How to wait until Kubernetes assigned an external IP to a LoadBalancer service? | <p>Creating a <a href="http://kubernetes.io/v1.1/docs/user-guide/services.html#type-loadbalancer" rel="noreferrer">Kubernetes LoadBalancer</a> returns immediatly (ex: <code>kubectl create -f ...</code> or <code>kubectl expose svc NAME --name=load-balancer --port=80 --type=LoadBalancer</code>).</p>
<p>I know a manual way to wait in shell:</p>
<pre><code>external_ip=""
while [ -z $external_ip ]; do
sleep 10
external_ip=$(kubectl get svc load-balancer --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}")
done
</code></pre>
<p>This is however not ideal:</p>
<ul>
<li>Requires at least 5 lines Bash script.</li>
<li>Infinite wait even in case of error (else requires a timeout which increases a lot line count).</li>
<li>Probably not efficient; could use <code>--wait</code> or <code>--wait-once</code> but using those the command never returns.</li>
</ul>
<p>Is there a better way to wait until a service <em>external IP</em> (aka <em>LoadBalancer Ingress IP</em>) is set or failed to set?</p>
| <bash><kubernetes> | 2016-02-03 14:13:13 | HQ |
35,179,461 | Adding x86 and x64 libraries to NuGet package | <p>I have made a library which depends on CEFsharp which requires to build the library for specific platforms. So no AnyCPU support.</p>
<p>Now I want to pack this into a NuGet. As far as I understand you have to put these files into the build folder and have a <code>.targets</code> file which picks the correct dll to reference. So I ended up with a NuGet package looking like this:</p>
<pre><code>lib
monodroid
MyLib.dll
xamarin.ios10
MyLib.dll
net45
MyLib.dll (x86)
build
net45
x86
MyLib.dll (x86)
x64
MyLib.dll (x64)
MyLib.targets
</code></pre>
<p>I put the following inside of the <code>.targets</code> file:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="PlatformCheck" BeforeTargets="InjectReference"
Condition="(('$(Platform)' != 'x86') AND ('$(Platform)' != 'x64'))">
<Error Text="$(MSBuildThisFileName) does not work correctly on '$(Platform)' platform. You need to specify platform (x86 or x64)." />
</Target>
<Target Name="InjectReference" BeforeTargets="ResolveAssemblyReferences">
<ItemGroup Condition="'$(Platform)' == 'x86' or '$(Platform)' == 'x64'">
<Reference Include="MyLib">
<HintPath>$(MSBuildThisFileDirectory)$(Platform)\MyLib.dll</HintPath>
</Reference>
</ItemGroup>
</Target>
</Project>
</code></pre>
<p>So far so good. Now to the problem. When adding this NuGet to a new WPF project, I see the reference to the library appearing in the <code>.csproj</code> file like:</p>
<pre><code><Reference Include="MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d64412599724c860, processorArchitecture=x86">
<HintPath>..\packages\MyLib.0.0.1\lib\net45\MyLib.dll</HintPath>
<Private>True</Private>
</Reference>
</code></pre>
<p>Although I don't see anything mentioned about the <code>.targets</code> file. Is this still the way to do it with NuGet 3? Did I do something wrong? Currently this fails at runtime when running x64 because of the reference to the x86 lib.</p>
| <nuget><msbuild-target> | 2016-02-03 14:15:21 | HQ |
35,179,781 | Why has the 'to lowercase' shortcut been removed from VS2015? | <p>In previous versions of Visual Studio, you could make all selected text lowercase with CTRL+U, and all uppercase using CTRL+SHIFT+U.</p>
<p>The uppercase shortcut remains in the 2015 version of VS, the lowercase shortcut, however, has been removed.</p>
<p>Does anybody have any info regarding this?</p>
<p>I thought it may have been because it conflicted with a shortcut for newly introduced functionality which had to take priority, but the only CTRL+U shortcut relies on a previous combination of keys too.</p>
| <ide><visual-studio-2015><keyboard-shortcuts> | 2016-02-03 14:29:59 | HQ |
35,180,971 | how can I do to know how many times the recipient open the email or the number of click? | <p>I'm working on an application in Java EE, one of the features of this application is to send emails using javamail.
I must make reporting on items , how can I do to know how many times the recipient open the email or the number of click?</p>
<p>Thank you in advance for your suggestions</p>
| <java><jakarta-ee><javamail> | 2016-02-03 15:23:23 | LQ_CLOSE |
35,181,112 | Javascipt: How can I change the class of a div by clicking another div? | I want to make a div appear when clicking on another div. I was thinking of doing this by using JavaScript to change the class of a div when another div is clicked on.
This is the HTML of the div I want to appear:
<div id ="menutext1" class - "hidden"> </div>
This is the HTML of the control div (the one to click on to make the above div appear):
<div id ="menu1"> </div>
This is the CSS:
.hidden { display: none; }
.unhidden { display: block; }
I've looked everywhere and nothing seems to work for me!
I don't have much experience with JavaScript or JQuery but can understand it.
Thanks in advance :)) | <javascript><jquery><html><css> | 2016-02-03 15:29:37 | LQ_EDIT |
35,181,260 | ExtensionlessUrlHandler and "Recursion too deep; the stack overflowed" | <p>I'm trying to get a fellow developer's app working on my machine. Solution is built in VS 2015 using Web API and I'm running it using 64-bit IIS Express. Every request is returning 500.0 errors. Request tracing log says this about it:</p>
<pre><code>1517. -MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName ManagedPipelineHandler
Notification EXECUTE_REQUEST_HANDLER
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode Recursion too deep; the stack overflowed. (0x800703e9)
ConfigExceptionInfo
</code></pre>
<p>The relevant config section looks like this:</p>
<pre><code><system.webServer>
<handlers>
<remove name="OPTIONS" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</code></pre>
<p>Other possibly relevant facts:</p>
<ul>
<li>The machine hasn't been used for web hosting before, but I've been doing a lot of VS2013 development and only installed 2015 last week to run this project.</li>
<li>The project does contain some C# 6.0 features, namely the new string interpolation goodies.</li>
</ul>
<p>How would I even begin to debug this? I'm getting zero relevant hits on Google.</p>
| <asp.net-web-api><url-routing><stack-overflow><iis-express> | 2016-02-03 15:36:19 | HQ |
35,181,340 | Rails: Can't verify CSRF token authenticity when making a POST request | <p>I want to make <code>POST request</code> to my local dev, like this:</p>
<pre><code> HTTParty.post('http://localhost:3000/fetch_heroku',
:body => {:type => 'product'},)
</code></pre>
<p>However, from the server console it reports </p>
<pre><code>Started POST "/fetch_heroku" for 127.0.0.1 at 2016-02-03 23:33:39 +0800
ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by AdminController#fetch_heroku as */*
Parameters: {"type"=>"product"}
Can't verify CSRF token authenticity
Completed 422 Unprocessable Entity in 1ms
</code></pre>
<p>Here is my controller and routes setup, it's quite simple. </p>
<pre><code> def fetch_heroku
if params[:type] == 'product'
flash[:alert] = 'Fetch Product From Heroku'
Heroku.get_product
end
end
post 'fetch_heroku' => 'admin#fetch_heroku'
</code></pre>
<p>I'm not sure what I need to do? To turn off the CSRF would certainly work, but I think it should be my mistake when creating such an API.</p>
<p>Is there any other setup I need to do?</p>
| <ruby-on-rails> | 2016-02-03 15:40:17 | HQ |
35,181,679 | What is an Activity in Android? | <p>I'm a beginner to Android Development, Can anyone please explain what is exactly an 'Activity' means in Android ? Is that similar to a 'Page' of an Android Application ?</p>
| <android><android-layout><android-activity><android-studio><mobile> | 2016-02-03 15:55:51 | LQ_CLOSE |
35,181,785 | Android sometimes force kills application | <p>I start activity A, then start activity B.<br>
I press home button, then waiting long time.<br>
When I resume application, it force stopped. </p>
<pre><code>02-03 18:42:54.413 828-844/system_process I/ActivityManager: Force stopping ru.tabor.search appid=10089 user=0: from pid 20405
02-03 18:42:54.414 828-844/system_process I/ActivityManager: Killing 30212:ru.tabor.search/u0a89 (adj 7): stop ru.tabor.search
02-03 18:42:54.445 828-5948/system_process I/WindowState: WIN DEATH: Window{18b92c9b u0 ru.tabor.search/ru.tabor.search.modules.authorization.AuthorizationActivity}
02-03 18:42:54.447 828-845/system_process I/WindowState: WIN DEATH: Window{1cd0cfe4 u0 ru.tabor.search/ru.tabor.search.modules.registration.RegistrationActivity}
02-03 18:42:54.519 828-844/system_process I/ActivityManager: Force finishing activity 3 ActivityRecord{25a8977f u0 ru.tabor.search/.modules.authorization.AuthorizationActivity t2593}
02-03 18:42:54.520 828-844/system_process I/ActivityManager: Force finishing activity 3 ActivityRecord{d516838 u0 ru.tabor.search/.modules.registration.RegistrationActivity t2593}
02-03 18:42:54.523 828-20666/system_process W/ActivityManager: Spurious death for ProcessRecord{21ff313b 0:ru.tabor.search/u0a89}, curProc for 30212: null
02-03 18:42:59.890 828-1247/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=ru.tabor.search/.modules.authorization.AuthorizationActivity} from uid 10089 on display 0
02-03 18:42:59.903 828-1247/system_process V/WindowManager: addAppToken: AppWindowToken{1c4987a0 token=Token{279a08a3 ActivityRecord{9f5afd2 u0 ru.tabor.search/.modules.authorization.AuthorizationActivity t2593}}} to stack=1 task=2593 at 0
02-03 18:42:59.919 828-891/system_process V/WindowManager: Adding window Window{1735e91b u0 Starting ru.tabor.search} at 4 of 8 (after Window{2ab6bf53 u0 com.cleanmaster.mguard/com.keniu.security.main.MainActivity})
02-03 18:43:19.288 828-1673/system_process I/ActivityManager: Start proc 21366:ru.tabor.search/u0a89 for activity ru.tabor.search/.modules.authorization.AuthorizationActivity
</code></pre>
<p>How to fix it?</p>
| <android> | 2016-02-03 16:00:18 | HQ |
35,181,989 | How to remove the hash from the url in react-router | <p>I'm using react-router for my routing and I use the hashHistory option so that I could refresh the page from the browser or specify a url of one of my existing routes and land on the right page.
It works fine but I see the hash in the url like this:
<a href="http://localhost/#/login?_k=ya6z6i">http://localhost/#/login?_k=ya6z6i</a></p>
<p>This is my routing configuration:</p>
<pre><code>ReactDOM.render((
<Router history={hashHistory}>
<Route path='/' component={MasterPage}>
<IndexRoute component={LoginPage} />
<Route path='/search' component={SearchPage} />
<Route path='/login' component={LoginPage} />
<Route path='/payment' component={PaymentPage} />
</Route>
</Router>),
document.getElementById('app-container'));
</code></pre>
| <reactjs><react-router> | 2016-02-03 16:09:09 | HQ |
35,182,013 | How can I check if vector elements are in order? | I need to check if in my vector the elements are in order
for(i=1; i<=K; i++)
if(v[i]=v[i+1]-1)
If the statement would be true I want to return the biggest integer.
> ex. 4 5 6 7
7 | <c++><vector> | 2016-02-03 16:10:23 | LQ_EDIT |
35,183,147 | what algorithm does STL size() use to find the size of string or vector in c++ | what algorithm does STL size() use to find the size of string or vector in c++?
I know that working of strlen() is dependent on finding the NUL character in the c char array but I want to know how does size() function work to find the size of string which is not null terminated as we know.
Does stl containers use some sort of pointers to mark the ending of container?
And does that help in finding the size or something else? | <c++><string><stl> | 2016-02-03 16:58:27 | LQ_EDIT |
35,183,787 | In python, is math.acos() faster than numpy.arccos() for scalars? | <p>I'm doing some scientific computing in Python with a lot of geometric calculations, and I ran across a significant difference between using <code>numpy</code> versus the standard <code>math</code> library.</p>
<pre><code>>>> x = timeit.Timer('v = np.arccos(a)', 'import numpy as np; a = 0.6')
>>> x.timeit(100000)
0.15387153439223766
>>> y = timeit.Timer('v = math.acos(a)', 'import math; a = 0.6')
>>> y.timeit(100000)
0.012333301827311516
</code></pre>
<p>That's more than a 10x speedup! I'm using numpy for almost all standard math functions, and I just assumed it was optimized and at least as fast as <code>math</code>. For long enough vectors, numpy.arccos() will eventually win vs. looping with math.acos(), but since I only use the scalar case, is there any downside to using math.acos(), math.asin(), math.atan() across the board, instead of the numpy versions?</p>
| <python><math><numpy> | 2016-02-03 17:31:00 | HQ |
35,184,003 | Moment js convert milliseconds into date and time | <p>I have current time in milliseconds as - 1454521239279</p>
<p>How do I convert it to 03 FEB 2016 and time as 11:10 PM ?</p>
| <javascript><momentjs> | 2016-02-03 17:42:20 | HQ |
35,184,240 | webpack ERROR in CommonsChunkPlugin: While running in normal mode it's not allowed to use a non-entry chunk | <p>So When I try to split my application into 1 application.js file and 1 libraries.js file, everything works fine. When I try to split it up into 1 application.js file and 2 libraries.js files, I get this error when building:</p>
<p><code>ERROR in CommonsChunkPlugin: While running in normal mode it's not allowed to use a non-entry chunk (libraries-react)</code></p>
<p>Anyone know what might be causing this error?</p>
<p>My configuration for webpack is</p>
<pre><code>var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var extractSass = new ExtractTextPlugin('main.css');
module.exports = {
module: {
loaders: [{
test: /\.jsx$/,
loader: 'babel',
exclude: ['./node_modules'],
query: {
presets: ['react', 'es2015']
}
}, {
test: /\.scss$/,
loader: extractSass.extract(['css', 'sass'])
}, {
test: /\.html$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\/misc\/.*\.js$/,
loader: 'file?name=/misc/[name].[ext]'
}, {
test: /\.(png|jpg|jpeg|)$/,
loader: 'file?name=/images/[name].[ext]'
}]
},
plugins: [
extractSass,
new webpack.optimize.CommonsChunkPlugin('libraries-core', 'libraries-core.js'),
new webpack.optimize.CommonsChunkPlugin('libraries-react', 'libraries-react.js')
],
entry: {
//3rd party libraries
'libraries-core': [
'lodash',
'superagent',
'bluebird',
'eventemitter3',
'object-assign',
'schema-inspector',
'jsuri',
'store-cacheable',
'immutable'
],
'libraries-react': [
'react',
'react-dom',
'react-router',
'nucleus-react'
],
//application code
application: './web/app/application.jsx',
//mocks
'mocked-api': './web/app/mock/api.js',
'mocked-local-storage': './web/app/mock/local-storage.js'
},
output: {
path: './web/build',
publicPath: '/build',
filename: '[name].js'
}
}
</code></pre>
| <javascript><webpack> | 2016-02-03 17:55:47 | HQ |
35,184,454 | MYSQL HELP PLEASE CANNOT INPUT ENTRY BECAUSE OF FOREIGN KEY? | Hello i need help please, i keep getting this error when trying to add an entry to one of my tables.
Trying to add this code: `INSERT INTO ROUTE VALUES ('7418','66','200','313');`
into this table
CREATE TABLE ROUTE (
ROUTE_ID INT NOT NULL PRIMARY KEY,
ROUTE_NAME VARCHAR(45) NOT NULL,
DELIVERY_VEHICLE_VEH_ID INT NOT NULL,
DELIVERY_DRIVER_DR_ID INT NOT NULL,
CONSTRAINT FK_ROUTE_DELIVERY FOREIGN KEY (DELIVERY_VEHICLE_VEH_ID) REFERENCES DELIVERY (VEHICLE_VEH_ID),
FOREIGN KEY (DELIVERY_DRIVER_DR_ID) REFERENCES DELIVERY (DRIVER_DR_ID));
Other related tables
CREATE TABLE DELIVERY (
VEHICLE_VEH_ID INT NOT NULL,
DRIVER_DR_ID INT NOT NULL,
DEL_DATE DATETIME NOT NULL,
DEL_TIME DATETIME NOT NULL,
PRIMARY KEY (VEHICLE_VEH_ID , DRIVER_DR_ID),
INDEX (DRIVER_DR_ID),
INDEX (VEHICLE_VEH_ID),
CONSTRAINT FK_VEHICLE_HAS_DRIVER_VEHICLE FOREIGN KEY (VEHICLE_VEH_ID) REFERENCES VEHICLE (VEH_ID),
CONSTRAINT FK_VEHICLE_HAS_DRIVER_DRIVER FOREIGN KEY (DRIVER_DR_ID) REFERENCES DRIVER (DR_ID));
CREATE TABLE DRIVER (
DR_ID INT NOT NULL PRIMARY KEY,
DR_TITLE VARCHAR(15) NOT NULL,
DR_FNAME VARCHAR(45) NOT NULL,
DR_LNAME VARCHAR(45) NOT NULL,
DR_DOB DATETIME NOT NULL,
DR_LICENCENO VARCHAR(45) NOT NULL,
DR_PHONE VARCHAR(15) NOT NULL,
DR_EMAIL VARCHAR(45) NOT NULL); | <mysql> | 2016-02-03 18:07:15 | LQ_EDIT |
35,185,010 | How to send the data from controller to service in angularjs | <p>I want to send the data from controller to service in angularjs. In controller I am calling service. This service is used to call some back-end api. I want to send some data from controller to service, which will be use to call back-end api. </p>
| <javascript><angularjs> | 2016-02-03 18:36:47 | LQ_CLOSE |
35,185,324 | How to make backgroundimage move in Swift iOS | <p>For one of the viewcontrollers in my app, I would like a moving background image. How would I go about making this?</p>
| <ios><swift><viewcontroller> | 2016-02-03 18:54:27 | LQ_CLOSE |
35,185,470 | sql is the column value is null get column from another table | I have two tables.
If percentage in table A is null then I want to look for it in table B
SELECT t.id,
CASE
WHEN t.percentage IS NULL
THEN (SELECT percentage FROM test2 AS s WHERE s.id=t.id )
ELSE t.percentage
END AS percentage
FROM [project_percentage] t
| <sql><sql-server> | 2016-02-03 19:02:05 | LQ_EDIT |
35,185,974 | Font-Awesome icon with an onclick event set | <p>I am trying to use the following font-awesome icon</p>
<pre><code><i class="fa fa-minus-circle"></i>
</code></pre>
<p>as a delete icon next to items in a list on my page like this:</p>
<pre><code>Item 1 delete-icon
Item 2 delete-icon
</code></pre>
<p>On click of one of these icons I need to run a JavaScript function...</p>
<p>What html element should I be wrapping the icon with? I noticed that when I use an anchor tag it turns blue and when I use a button it ends up being wrapped in a button. Are there any other options?</p>
<p>Essentially I want to do this</p>
<pre><code><a onclick="Remove()"><i class="fa fa-minus-circle"></i></a>
</code></pre>
<p>or this</p>
<pre><code><button onclick="Remove()"><i class="fa fa-minus-circle"></i></button>
</code></pre>
<p>But have only the icon appear as is with no modifications. No blue color, and not wrapped inside a button.</p>
| <javascript><jquery><html><css><font-awesome> | 2016-02-03 19:29:42 | HQ |
35,186,149 | CREATE PROCEDURE for INSERTING THE RECORDS, IF EXCEPTION, PROCEDURE NEEDS START FROM EXCEPTION LINE | I need to write the procedure for inserting the records in to multiple tables, for example I am HAVING here 3 table,
CREATE TABLE SOURCE
(
SORT_CODE NUMBER,
FLAG CHAR(1)
);
INSERT INTO SOURCE VALUES(605096,5);
INSERT INTO SOURCE VALUES(605097,5);
INSERT INTO SOURCE VALUES(605098,5);
INSERT INTO SOURCE VALUES(605099,5);
INSERT INTO SOURCE VALUES(605100,5);
INSERT INTO SOURCE VALUES(605101,6);
INSERT INTO SOURCE VALUES(605102,6);
INSERT INTO SOURCE VALUES(605103,6);
INSERT INTO SOURCE VALUES(605104,6);
INSERT INTO SOURCE VALUES(605105,6);
SQL> SELECT * FROM SOURCE;
SORT_CODE F
---------- -
605096 5
605097 5
605098 5
605099 5
605100 5
605101 6
605102 6
605103 6
605104 6
605105 6
10 rows selected.
CREATE TABLE TARGET
(
SORT_CODE NUMBER,
TARGET_SORT_CODE NUMBER
);
Table created.
--INSERT 5 VALUES
INSERT INTO TARGET VALUES(605101,189873);
INSERT INTO TARGET VALUES(605102,189874);
INSERT INTO TARGET VALUES(605103,189875);
INSERT INTO TARGET VALUES(605104,189876);
INSERT INTO TARGET VALUES(605105,'');
SELECT * FROM TARGET;
SORT_CODE TARGET_SORT_CODE
---------- ----------------
605101 189873
605102 189874
605103 189875
605104 189876
605105
CREATE TABLE NEWID
(
SORT_CODE NUMBER,
ID_SCODE NUMBER
);
Table created.
--INSERT 2 VALUES
INSERT INTO TARGET VALUES(605103,189875);
INSERT INTO TARGET VALUES(605104,189876);
SELECT * FROM NEWID;
SORT_CODE ID_SCODE
---------- ----------------
605103 189875
605104 189876
--Creating intermediate tables with existing table's structure.
CREATE TABLE SOURCE_TEMP AS (SELECT * FROM SOURCE WHERE 1=2);
CREATE TABLE TARGET_TEMP AS (SELECT * FROM TARGET WHERE 1=2);
CREATE TABLE NEWID_TEMP AS (SELECT * FROM NEWID WHERE 1=2);
--MY Procedure for inserting the records
CREATE OR REPLACE PROCEDURE insert_sql
is
BEGIN
DELETE FROM SOURCE_TEMP;
INSERT INTO SOURCE_TEMP SELECT * FROM SOURCE; --insert query 1
DELETE FROM TARGET_TEMP;
INSERT INTO TARGET_TEMP SELECT * FROM TARGET; --insert query 2
--due to some network issue or table error this procedure GOT EXEPCTION here and above insert query 2(TARGET_TEMP) and below --insert query 3(NEWID_TEMP) is not inserted the values or not executed procedure is came out from this line.
DELETE FROM NEWID_TEMP;
INSERT INTO NEWID_TEMP SELECT * FROM NEWID; --insert query 3
EXCEPTION
WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE('ERROR');
END;
Point 1: The above procedure is executed only one insert query 1 SOURCE_TEMP is got the values.
Point 1: TARGET_TEMP and NEWID_TEMP is not inserted the values or not execute.
MyQues: can I able to re-execute this procedure with starting point of '--insert query 2' line?
becoz I am inserting the 100 tables records in new tables, if 50 tables are inserted the values during this time if i am getting any error in the proc execution, remaining 50 tables needs to insert the values, for I dont wish to delete the previous 50 tables inserted the values it will be the time consuming activity. any save point or boolean concepts is there for this type of issue in ORACLE (which is available in java and unix) if yes how to use this function?
Thanks
Sanjay | <sql><oracle><plsql><procedure> | 2016-02-03 19:39:15 | LQ_EDIT |
35,186,382 | How to run Python scirpt making a file | #!/usr/bin/env python3
# Script to convert HTML files provided by The Online Plain Text English
# Dictionary (http://www.mso.anu.edu.au/~ralph/OPTED/) into SQLite database
import sys
import sqlite3
from argparse import ArgumentParser, FileType
from bs4 import BeautifulSoup
def parse_args():
parser = ArgumentParser("Create database from HTML dictionary pages")
parser.add_argument("files", metavar="file", nargs="+", type=FileType("rb"))
parser.add_argument("--out", "-o", required=True)
return parser.parse_args()
def create_tables(conn):
conn.execute("DROP TABLE IF EXISTS words")
conn.execute("CREATE TABLE words (id integer primary key, word text, description text)")
conn.commit()
def words(handle):
doc = BeautifulSoup(handle)
for p in doc.find_all("p"):
if len(p.contents) == 4:
word = p.contents[0].string.lower()
definition = p.contents[3].lstrip(") ").replace("\n", " ")
yield word, definition
def insert_words(conn, iter):
conn.executemany("INSERT INTO words VALUES (NULL, ?, ?)", iter)
def main():
args = parse_args()
db = sqlite3.connect(args.out)
create_tables(db)
for handle in args.files:
print("Processing \"{}\"".format(handle.name), file=sys.stderr)
insert_words(db, words(handle))
db.commit()
db.close()
if __name__ == "__main__":
main()
i tried python my_script.py
but it shows this:
usage: Create database from HTML dictionary pages [-h] --out OUT
file [file ...]
Create database from HTML dictionary pages: error: the following arguments are r
equired: file, --out/-o
i dont use python. i just want to run this script and sorry for bad presentation of code I am new at this. | <python><database><sqlite><command-line> | 2016-02-03 19:51:55 | LQ_EDIT |
35,186,902 | Testing progress bar on Android with Espresso | <p>The workflow should be the following:</p>
<ol>
<li>Activity starts</li>
<li>Progress bar is visible</li>
<li>Network request fires (idling resource is already registered so espresso knows how to wait for it).</li>
<li>Progress bar is hidden</li>
<li>Text from network is shown.</li>
</ol>
<p>Up to this point, I have written assertions for steps <strong>1, 3, 5</strong> and it works perfectly:</p>
<pre><code>onView(withText("foo 1"))
.check(matches(isDisplayed()));
</code></pre>
<p>Problem is, I have no idea how to let espresso know to verify the visibility of progress bar <strong>before</strong> the request is made and <strong>after</strong> the request is made.</p>
<p>Consider the <code>onCreate()</code> method is the following:</p>
<pre><code>super.onCreate(...);
setContentView(...);
showProgressBar(true);
apiClient.getStuff(new Callback() {
public void onSuccess() {
showProgressBar(false);
}
});
</code></pre>
<p>I have tried the following but it doesn't work:</p>
<pre><code>// Activity is launched at this point.
activityRule.launchActivity(new Intent());
// Up to this point, the request has been fired and response was
// returned, so the progress bar is now GONE.
onView(withId(R.id.progress_bar))
.check(matches(isDisplayed()));
onView(withId(R.id.progress_bar))
.check(matches(not(isDisplayed())));
</code></pre>
<p>The reason this is happening is because, since the client is registered as an idling resource, espresso will wait until it is <strong>idle</strong> again before running the first <code>onView(...progressbar...)...</code> so I need a way to let espresso know to run that <em>BEFORE</em> going to idle.</p>
<p><strong>EDIT:</strong> this doesn't work either:</p>
<pre><code>idlingResource.registerIdleTransitionCallback(new IdlingResource.ResourceCallback() {
@Override
public void onTransitionToIdle() {
onView(withId(R.id.progress_bar))
.check(matches(isDisplayed()));
}
});
</code></pre>
| <android><android-espresso> | 2016-02-03 20:20:22 | HQ |
35,187,114 | I'm trying to sum up the top 80% by value of sales $ and give a count on how many customers make up that 80% | I'm trying to build a sales query for a rolling 12 months. I know my sales by customer, and my total sales. I'm trying to sum up the top 80% of sales $ and give a count on how many customers make up that 80%. Any ideas? I have a result set that looks like the below. Thanks in advance!
Customer Sales TotalSales PercentOfSales
8585 19788.81 769658.68 0.03
8429 19598.26 769658.68 0.03
2837 19431.29 769658.68 0.03
6071 19398.11 769658.68 0.03
5027 19223.13 769658.68 0.02
6677 19204.90 769658.68 0.02 | <sql><sql-server-2008> | 2016-02-03 20:31:42 | LQ_EDIT |
35,187,475 | Autofac and Automapper new API - ConfigurationStore is gone | <p>I've been using Automapper and Autofac in a .Net app for some time. I configured them this way:</p>
<pre><code>builder.RegisterAssemblyTypes(typeof (OneOfMyMappingProfiles).Assembly)
.Where(t => t.IsSubclassOf(typeof (Profile)))
.As<Profile>();
builder.Register(ctx => new ConfigurationStore(new TypeMapFactory(), MapperRegistry.Mappers))
.AsImplementedInterfaces()
.SingleInstance()
.OnActivating(x =>
{
foreach (var profile in x.Context.Resolve<IEnumerable<Profile>>())
{
x.Instance.AddProfile(profile);
}
});
builder.RegisterType<MappingEngine>()
.As<IMappingEngine>().SingleInstance();
</code></pre>
<p>With the latest build of Automapper (4.2) the API has changed and I am having trouble translating to the new API. ConfigurationStore no longer seems to exist. According to the docs, the way to register with an IOC is now like this:</p>
<pre><code> var profiles =
from t in typeof (AutoMapperRegistry).Assembly.GetTypes()
where typeof (Profile).IsAssignableFrom(t)
select (Profile)Activator.CreateInstance(t);
var config = new MapperConfiguration(cfg =>
{
foreach (var profile in profiles)
{
cfg.AddProfile(profile);
}
});
For<MapperConfiguration>().Use(config);
For<IMapper>().Use(ctx => ctx.GetInstance<MapperConfiguration>().CreateMapper(ctx.GetInstance));
</code></pre>
<p>BUT that is using StructureMap. The first half of this is no problem, but I am not sure how to translate the "For<>.Use()" portion. How do I do that in Autofac?</p>
| <.net><automapper><autofac> | 2016-02-03 20:53:25 | HQ |
35,187,720 | C# dictionary keeps changing the values into the last added value. | <p>When I try to add a new name and number from textboxes into a dictionary, and then try to add the content of the dictionary to a listBox all the previous entries are the same. Like if I add "Bob Johnson 42", "Jim Smith 33", "Peter White 21". When I put it in the ListBox it will apear as:
Peter White 21
Peter White 21
Peter White 21 </p>
<p>What am I doing wrong?
Here is the code. </p>
<pre><code>private void button1_Click(object sender, EventArgs e)
{
String name = this.textBox1.Text;
int testNumber = int.Parse(textBox2.Text);
submittedTests.Add(this.textBox1.Text, testNumber);
foreach (var x in submittedTests)
{
listBox1.Items.Add(name + " " + testNumber);
}
}
</code></pre>
| <c#><dictionary><visual-studio-2015> | 2016-02-03 21:07:46 | LQ_CLOSE |
35,188,658 | In 2016, what is the correct way to create a commercial MS Office Add In? | <p>I've been writing VB6 code for Outlook and Excel for at least 10 years, but it's generally written in the VB Editor and saved as the default project or a worksheet module, therefore not very portable.</p>
<p>I'm at the stage now where I want to switch to .net and write proper add-ins, that I can distribute and potentially sell (so would need to be protected and installable).</p>
<p>However, there seems to be a lot of conflicting advice out there about how to do this, and what software to use.</p>
<p>I'd really like to know the definitive way to do this in 2016;</p>
<ul>
<li>What software to use (I presume, either the paid or free version of VS)</li>
<li>What language to use (I assume a flavour of .net)</li>
<li>What I need to do to be able to distribute or sell the addin (do they still need to be signed?)</li>
<li>any advice on definitive resources to make the switch from hacker-style projects to stand alone projects</li>
</ul>
<p>Apologies if this sounds vague, or isn't the correct format for SO; I'm a web developer, mainly open source technologies, so the MS stack (Office aside) has always been a different world for me.</p>
<p>Thanks,
Dave</p>
| <.net><excel><office-addins> | 2016-02-03 22:04:04 | LQ_CLOSE |
35,188,763 | result from Ajax Call | <p>I have an ajax call and I want to use result of this ajax on another page.</p>
<p>//This is main.js file</p>
<pre><code>function myFun(){
var my_user = "Stas";
var itemsUrl = "myxmlwithusers";
var user_found = false;
$.ajax({
url: itemsUrl,
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
cache: false,
async: false,
dataType: "text",
success: function(data){
var jsonObject = JSON.parse(data);
results = jsonObject.d.results;
$(results).each(function(){
if($(this)[0].user == my_user){
user_found = true;
}
});
},
error:function () {
console.log("Error");
}
}
);
}
</code></pre>
<p>// This is execute.js file</p>
<pre><code>myFun();
if (user_found == true){cool}
</code></pre>
<p>I need true or false for // user_found. Let say I will put in the file execute.js my function myFun() and in main.js my user is fetch with "$(this)[0].user" and I need to receive "true" in execute.js</p>
<p>Thanks!</p>
| <javascript><jquery><ajax> | 2016-02-03 22:11:21 | LQ_CLOSE |
35,188,883 | Amazon Redshift Grants - New table can't be accessed even though user has grants to all tables in schema | <p>I have a bit of a funny situation in Amazon Redshift where I have a user X who has grant select on all tables in schema public, but once a new table is created, this grant doesn't seem to apply to the new table. Is this normal behaviour? If yes, how does one deal with it such that the schema level grants are maintained. Thank you.</p>
| <amazon-redshift><database-permissions> | 2016-02-03 22:20:17 | HQ |
35,189,251 | Docker mount S3 container | <p>What is your best practise for mounting an S3 container inside of a docker host? Is there a way to do this transparently? Or do I rather need to mount volume to the host drive using the VOLUME directive, and then backup files to S3 with CRON manually?</p>
| <amazon-web-services><amazon-s3><docker><backup> | 2016-02-03 22:45:39 | HQ |
35,189,390 | tag anchor don't works at locahost | I'm using the Ratchet framework to compose a web page, but any achor tags doest Works, even though I using the true rule, for example:
<a class="control-item" href="contact.php">click me</a>
don't Works. I really don't understand, but Works with pure HTML code, and other frameworks. | <html> | 2016-02-03 22:57:40 | LQ_EDIT |
35,189,663 | S3 Invalid Resource in bucket policy | <p>I'm trying to make my entire S3 bucket public, but when I try to add the policy:</p>
<pre><code>{
"Id": "Policy1454540872039",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1454540868094",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::sneakysnap/*",
"Principal": {
"AWS": [
"985506495298"
]
}
}
]
}
</code></pre>
<p>It tells me that my "Resource is invalid", but that is definitely the right <code>arn</code> and that is definitely the right bucket name. Anyone know what's going on?</p>
| <amazon-s3> | 2016-02-03 23:19:35 | HQ |
35,190,392 | How to stop people from viewing my HTML and CSS | <p>I want to send a link to a client with some work I am doing for them but they are rather informed about IT and that would lead me to think that they know how to copy and paste some HTML and CSS. How would I go about stopping them from seeing the HTML, CSS and JS of the page I want to send them?</p>
| <javascript><html><css><private> | 2016-02-04 00:27:16 | LQ_CLOSE |
35,190,434 | Cordova installation error: path issue (?) - error code ENOENT | <p>After installing Xcode & NodeJS I am now trying to install Cordova but I am getting the following error regarding a missing file (wrong path?).</p>
<pre><code>Luciens-MacBook-Pro:~ lucientavano$ npm cache clean
Luciens-MacBook-Pro:~ lucientavano$ sudo npm install -g cordova
Password:
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/local/lib
└── (empty)
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! node v4.2.6
npm ERR! npm v3.6.0
npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-ef9cc920
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/lucientavano/npm-debug.log
npm ERR! code 1
Luciens-MacBook-Pro:~ lucientavano$ tail -10 /Users/lucientavano/npm-debug.log
21365 error npm v3.6.0
21366 error path /usr/local/lib/node_modules/.staging/abbrev-ef9cc920
21367 error code ENOENT
21368 error errno -2
21369 error syscall rename
21370 error enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
21371 error enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
21371 error enoent This is most likely not a problem with npm itself
21371 error enoent and is related to npm not being able to find a file.
21372 verbose exit [ -2, true ]
</code></pre>
<p>Have you run into a similar issue? Thank you in advance for any suggestion you may have.</p>
| <node.js><macos><cordova><npm><ionic-framework> | 2016-02-04 00:32:25 | HQ |
35,191,336 | How to map a dictionary in reactJS? | <p>I am getting a dictionary from an online api in the form of {{key: object}, {key: object},... For like 1000 Objects}. I would like to use reactJS to do something like </p>
<pre><code>this.props.dict.map(function(object, key)){
//Do stuff
}
</code></pre>
<p>This map works with arrays but it obviously doesn't work with dictionaries. How can I achieve something similar?</p>
| <javascript><reactjs> | 2016-02-04 02:19:43 | HQ |
35,191,369 | How and where to add code to make a website responsive fit to all screen? | <h2>I have a quite dynamic file and trying to make this <a href="http://bunnymugsy.xyz" rel="nofollow">web</a> responsive, fit to all screen... can anybody help?</h2>
<p>I tried with skeleton css and also tried with different coding, but all failed. Since I started with Stacey Template in early time, it's quite tricky for me to handle it with basic knowledge of HTML&CSS.</p>
<p>Many thanks!</p>
| <html><css><responsive-design><portfolio> | 2016-02-04 02:23:06 | LQ_CLOSE |
35,192,053 | Macro Programming in Word | In Word, what is the macro vba code necessary for me to find a phrase, goto the beginning of the line the phrase is in, insert a page break, then leave myself in a position to execute the macro again. | <vba><ms-word> | 2016-02-04 03:38:07 | LQ_EDIT |
35,192,092 | Can anyone speed up this code | This code 8 cells from a data entry form and copies those cells to the next empty row on another worksheet that is used as a database. It works perfectly except that it takes 15 seconds to run. I know that I can speed up the code if it didn't copy to another sheet. It that scenario it think that I timed it at <7 seconds.
Is there a way to significantly speed up this code without merging the two sheets which, at this point is a logistical nightmare?
sub UpdateLogWorksheet1()
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim historyWks As Worksheet
Dim inputWks As Worksheet
Dim nextRow As Long
Dim oCol As Long
Dim myRng As Range
Dim myCopy As String
Dim myclear As String
Dim myCell As Range
ActiveSheet.Unprotect "sallygary"
myCopy = "e4,g26,g16,g12,g18,g20,g22,g24"
Set inputWks = Worksheets("Dept 1 Input")
Set historyWks = Worksheets("1_Data")
With historyWks
nextRow = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).Row
End With
With inputWks
Set myRng = .Range(myCopy)
End With
With historyWks
With .Cells(nextRow, "A")
.Value = Now()
.NumberFormat = "mm/dd/yyyy"
End With
.Cells(nextRow, "B").Value = Application.UserName
oCol = 3
For Each myCell In myRng.Cells
historyWks.Cells(nextRow, oCol).Value = myCell.Value
oCol = oCol + 1
Next myCell
End With
With inputWks
On Error Resume Next
End With
On Error GoTo 0
ActiveSheet.Protect "sallygary"
Range("g12").Select
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub | <excel><vba> | 2016-02-04 03:41:59 | LQ_EDIT |
35,192,264 | Reversing a Sentence without reversing Characters in JavaScript and Java | how do i reverse a sentence like "Hello World" to "World Hello" Not dlroW oleo
Been search for an example on this forum the whole day | <javascript><reverse> | 2016-02-04 04:02:07 | LQ_EDIT |
35,192,736 | Usage of increment operators | <pre><code>#include <stdio.h>
#include <string.h>
int main()
{
int i=3,y;
y=++i*++i*++i;
printf("%d",y);
}
</code></pre>
<p>The i value is initially getting incremented to 4.Then it is incremented to 5. therefore it is incremented to 6. accordingly result should come 216. but 150 is coming as a result.</p>
| <c> | 2016-02-04 04:49:41 | LQ_CLOSE |
35,193,335 | How to reconnect to RabbitMQ? | <p>My python script constantly has to send messages to RabbitMQ once it receives one from another data source. The frequency in which the python script sends them can vary, say, 1 minute - 30 minutes.</p>
<p>Here's how I establish a connection to RabbitMQ:</p>
<pre><code> rabt_conn = pika.BlockingConnection(pika.ConnectionParameters("some_host"))
channel = rbt_conn.channel()
</code></pre>
<p>I just got an exception </p>
<pre><code>pika.exceptions.ConnectionClosed
</code></pre>
<p>How can I reconnect to it? What's the best way? Is there any "strategy"? Is there an ability to send pings to keep a connection alive or set timeout?</p>
<p>Any pointers will be appreciated.</p>
| <python><rabbitmq><pika> | 2016-02-04 05:42:07 | HQ |
35,194,285 | Unable to instantiate activity ComponentInfo{com.example.rajafarid.valentines/com.example.rajafarid.valentines.MainActivity2} | i am going to create a valentines app as i am a beginner so i have a first activity(MainActivity) that have a button which activate second Activity(MainActivity 2) the problem is that it says instantiate problem
it says in manifest file
com.example.rajafarid.valentines.MainActivity 2' has no default constructor.
Validates resource references inside Android XML files.
here is the menifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rajafarid.valentines">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity2">
<intent-filter>
<action android:name="com.example.rajafarid.valentines.MainActivity2" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".DetailActivity">
<intent-filter>
<action android:name="com.example.rajafarid.valentines.DetailActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
package com.example.rajafarid.valentines;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.media.Image;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MainActivity2 extends ArrayAdapter<ImageITem> {
private Context context;
private int layoutResourceId;
private ArrayList<ImageITem> data = new ArrayList<ImageITem>();
public MainActivity2(Context context, int layoutResourceId, ArrayList<ImageITem> data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.context = context;
this.data = data;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
ViewHolder holder;
if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
row = inflater.inflate(layoutResourceId, parent, false);
holder = new ViewHolder();
holder.imageTitle = (TextView) row.findViewById(R.id.text);
holder.image = (ImageView) row.findViewById(R.id.image);
row.setTag(holder);
} else {
holder = (ViewHolder) row.getTag();
}
ImageITem item = data.get(position);
holder.imageTitle.setText(item.getTitle());
holder.image.setImageBitmap(item.getImage());
return row;
}
static class ViewHolder {
TextView imageTitle;
ImageView image;
}
}
LogCat View
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.rajafarid.valentines/com.example.rajafarid.valentines.MainActivity2}: java.lang.InstantiationException: class com.example.rajafarid.valentines.MainActivity2 has no zero argument constructor
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2515)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.InstantiationException: class com.example.rajafarid.valentines.MainActivity2 has no zero argument constructor
at java.lang.Class.newInstance(Class.java:1641)
at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2505)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.NoSuchMethodException: <init> []
at java.lang.Class.getConstructor(Class.java:531)
at java.lang.Class.getDeclaredConstructor(Class.java:510)
at java.lang.Class.newInstance(Class.java:1639)
at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2505)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
| <java><android><xml> | 2016-02-04 06:47:15 | LQ_EDIT |
35,195,221 | List process for current user | <p>As an administrator I can get a users processes by running this</p>
<p><code>Get-Process -IncludeUserName | Where UserName -match test</code></p>
<p>But as a non-administrator I can't use <code>-IncludeUserName</code> becuase "The 'IncludeUserName' parameter requires elevated user rights".</p>
<p>So if I'm logged on as the user test, how do I list only his processes and not everything that's running?</p>
| <powershell> | 2016-02-04 07:43:14 | HQ |
35,195,543 | How to display a progress bar while loading single bundled javascript file by webpack? | <p>The question is concerning webpack. After packing almost everything into a single bundle.js which is loaded in index.html, the bundle.js file is about 2M and requires several seconds to load. </p>
<p>I'd like to display a progress bar indicating loading progress while hiding all the content. Only enable user interaction and show the content after loading is done, exactly the one that Gmail is using. </p>
<p>Is it possible to use webpack to do that? How? </p>
<p>Thanks!</p>
| <javascript><webpack> | 2016-02-04 08:02:42 | HQ |
35,195,718 | I am automating angular js application, i am unable to click button using ng-click ,can u please share java script code??? for ng click | Here is the HTML code :
<a ng-click="openProjectModal($event)">Create Project</a>
I tried below code:
.//a[ng-click='openProjectModal($event)']
Using xpath it is working but i don't want to use xpath.
| <angularjs><xpath> | 2016-02-04 08:13:04 | LQ_EDIT |
35,196,040 | How to identify button without X path in selenium | Code is below
<button type="submit" class="login-button">Login</button>
In selenium i tried this code
driver.findElement(By.classname("Login")).click();
please help me in this code without x path | <selenium><selenium-webdriver> | 2016-02-04 08:32:20 | LQ_EDIT |
35,196,335 | How to find every version of android support libraries source code | <p>I meets some problems so I want to find the source code of the Android support libraries . For example , I want to read the ActionBarActivity.java source code in version 19.0.1 and 20.0.0 in support.appcompat-v7 , and find out the difference between the two versions.</p>
<p>I found the <a href="https://github.com/android/platform_frameworks_base" rel="noreferrer">https://github.com/android/platform_frameworks_base</a> , but the release have named as android-x.x.x_rxx but not like 19.0.1 .</p>
| <android><android-support-library> | 2016-02-04 08:48:44 | HQ |
35,196,625 | Including HTML inside Jekyll tag | <p>Instead of writing out <code>{% include link_to.html i=5 text="hello world" %}</code> all the time, I've written a custom tag that allows me to do <code>{% link_to 5 hello world %}</code>. It finds the page with data <code>i</code> equal to 5 and creates a link to it.</p>
<p>But it feels clunky to generate HTML strings from inside the tag code, and it is awkward to write complicated code logic inside the HTML include code. So is there a way to have the tag definition do the heavy lifting of finding the relevant page to link to, and have it pass on what it found to <code>link_to.html</code> to render? Sort of like the controller passing information on to the view in Rails.</p>
| <html><jekyll><liquid> | 2016-02-04 09:02:36 | HQ |
35,196,704 | after changing the date format it is not getting reflected in the table | [enter image description here][1]
[1]: http://i.stack.imgur.com/uItaU.png
why can i see the change in the table???
| <sql><oracle><sqlplus><date-formatting> | 2016-02-04 09:06:11 | LQ_EDIT |
35,197,052 | How to I comment a line in /etc/sudoers file using Chef Recipe? | I want to comment **"Defaults requiretty"** line present in ***/etc/sudoers*** file using Chef. If it is already commented, the ruby code should skip commenting it. I'm using CentOS 6.7 operating system. | <ruby><chef-infra><chef-recipe> | 2016-02-04 09:22:57 | LQ_EDIT |
35,197,362 | Unable to open cqlsh Apache cassandra - ImportError: No module named cqlshlib | <p>I am new to cassandra ! Have downloaded the apacahe cassandra 2.1.2 package and initialy was able to connect to cqlsh but then after installing CCM i am unable to connect , will get the following error</p>
<pre><code>Traceback (most recent call last):
File "bin/cqlsh", line 124, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron,sslhandling, copy
ImportError: No module named cqlshlib
</code></pre>
<p>Thanks in advance !</p>
| <cassandra> | 2016-02-04 09:37:59 | HQ |
35,197,836 | npm with node-sass and autoprefixer | <p>I use node-sass to compile all my Sass files to a master.css.
This works well but now I want to add prefixes. I would like to use only the npm, no Gulp or Grunt.</p>
<p>Here my package.json file:</p>
<pre><code>{
"name": "xxxxxx.com",
"version": "1.0.0",
"description": "",
"watches": {
"sass": "src/scss/**"
},
"scripts": {
"sass": "node-sass src/scss/master.scss -o dist/css/ --style compressed",
"prefix": "postcss --use autoprefixer dist/css/master.css -d dist/css/master.css",
"dev": "rerun-script"
},
"author": "Jan",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^6.3.1",
"browserify": "^13.0.0",
"clean-css": "^3.4.9",
"node-sass": "^3.4.2",
"postcss-cli": "^2.5.0",
"rerun-script": "^0.6.0",
"uglifyjs": "^2.4.10"
}
}
</code></pre>
<p>I do not get it to run. I use autoprefixer and postcss-cli. The modules have been installed locally in the project directory. I think my "script" part is false.
How would that look right?</p>
| <node.js><compilation><npm><autoprefixer><node-sass> | 2016-02-04 09:59:55 | HQ |
35,198,082 | How can I extract date from since time component | <p>I have to extract date in the format MM-dd-yyyy in java from the since time value. Since time is the time at which the doucment is created. For example, if since time is <strong>1452413972759</strong>, date would be "<strong>Sun, 10 Jan 2016 08:19:32 GMT</strong>" (Calculated from <a href="http://www.epochconverter.com/" rel="nofollow">http://www.epochconverter.com/</a>) . From this, I could get date in desired format but I am unable to code for the first step i.e., converting since time to date. Can someone help me?</p>
<p>I tried </p>
<pre><code>DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
java.util.Date date = df.parse("1452320105343");
String DATE_FORMAT = "MM/dd/yyyy";
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
System.out.println("Today is " + sdf.format(date));
</code></pre>
<p>But it gives parse exception.</p>
| <java><date><simpledateformat> | 2016-02-04 10:09:14 | LQ_CLOSE |
35,198,264 | React-Native Offline Bundle - Images not showing | <p>I have a React-Native app I'm trying to deploy in Release mode to my phone. I can bundle the app to the phone. Database, Video and audio assets are all in there but no images are showing in the UI. </p>
<p>I have done the following to 'bundle' my app:</p>
<ol>
<li>in the project folder in Terminal run <code>react-native bundle --platfrom ios --dev false --entry-file index.ios.js --bundle-output main.jsbundle</code></li>
<li>Drag the reference to the <code>main.jsbundle</code> file into XCode under <code>myapp</code> folder</li>
<li>In XCode, open <code>AppDelegate.m</code> and uncomment <code>jsCodeLocation = [[NSBundle mainBundle]…</code></li>
<li>Open <code>Product > Scheme > Edit Scheme</code> then change <code>Build Configuration</code> to <code>Release</code></li>
<li>Select <code>myapp</code> under the project navigator and then:
under <code>TARGETS: myappTests</code> > <code>Build Phases</code> > <code>Link Binary With Libraries</code>
press <code>+</code>
select <code>Workspace</code> > <code>libReact.a</code> and <code>Add</code></li>
</ol>
<p>When I try and compile in XCode with the <code>../node_modules/react-native/packager/react-native-xcode.sh</code> setting in <code>myapp > targets > myapp > Bundle React Native code and images</code> it fails with <code>error code 1</code>. </p>
<p>I've seen LOADS of posts on this and I've tried:</p>
<ul>
<li>to check <code>Run script only when installing</code>- the app then installs but with no images</li>
<li>adding <code>source ~/.bash_profile</code> to react-native-xcode.sh - the app build fails</li>
</ul>
<p>Any help would be greatly appreciated! </p>
| <ios><xcode><react-native> | 2016-02-04 10:18:18 | HQ |
35,198,305 | Android Change Button text randomly | <p>How to change button text every 5 secs ? i,e First the text will be "hello" and after 5 secs it should be "Hi" and then "hello" and then "hi" and so on until I click that button.</p>
| <android><button> | 2016-02-04 10:19:38 | LQ_CLOSE |
35,198,925 | Toggle class on and off in jquery with button | <p>I'm new to javascript but I'm having a hard time toggle this class on and off.</p>
<p><a href="https://jsfiddle.net/spadez/o2s0hmtv/2/" rel="nofollow">https://jsfiddle.net/spadez/o2s0hmtv/2/</a></p>
<pre><code>$( "#togglebtn" ).click(function() {
$(.mynav).toggleClass( "modal" );
});
</code></pre>
<p>Based on tutorials this should work, but the button doesn't seem to do anything. Can anyone show me where I went wrong please?</p>
| <javascript><jquery> | 2016-02-04 10:45:07 | LQ_CLOSE |
35,199,808 | Clojure: Unable to find static field | <p>Given the following piece of code:</p>
<pre><code>(map Integer/parseInt ["1" "2" "3" "4"])
</code></pre>
<p>Why do I get the following exception unless I wrap <code>Integer/parseInt</code> in an anonymous function and call it manually (<code>#(Integer/parseInt %)</code>)?</p>
<pre><code>clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to find static field: parseInt in class java.lang.Integer
</code></pre>
| <clojure> | 2016-02-04 11:29:10 | HQ |
35,201,358 | How to include untyped node modules with Typescript 1.8? | <blockquote>
<p>Typescript 1.8 now supports untyped JS files. To enable this feature,
just add the compiler flag --allowJs or add "allowJs": true to
compilerOptions in tsconfig.json</p>
</blockquote>
<p>via <a href="https://blogs.msdn.microsoft.com/typescript/2016/01/28/announcing-typescript-1-8-beta/">https://blogs.msdn.microsoft.com/typescript/2016/01/28/announcing-typescript-1-8-beta/</a></p>
<p>I'm trying to import <a href="https://github.com/zilverline/react-tap-event-plugin">react-tap-event-plugin</a> which does not have a typings file.</p>
<pre><code>import * as injectTapEventPlugin from 'injectTapEventPlugin';
</code></pre>
<p>says module not found. So i tried:</p>
<pre><code>import * as injectTapEventPlugin from '../node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js';
</code></pre>
<p>This says Module resolves to a non-module entity and cannot be imported using this construct. And then I tried:</p>
<pre><code>import injectTapEventPlugin = require('../node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js');
</code></pre>
<p>It's crashing with <code>ERROR in ./scripts/index.tsx
Module build failed: TypeError: Cannot read property 'kind' of undefined</code> at <code>node_modules/typescript/lib/typescript.js:39567</code></p>
<p>My tsconfig:</p>
<pre><code>{
"compilerOptions": {
"target": "ES5",
"removeComments": true,
"jsx": "react",
"module": "commonjs",
"sourceMap": true,
"allowJs": true
},
"exclude": [
"node_modules"
]
}
</code></pre>
<p>I'm using webpack with ts-loader:</p>
<pre><code> {
test: /\.tsx?$/,
exclude: ['node_modules', 'tests'],
loader: 'ts-loader'
}
</code></pre>
| <javascript><typescript><ecmascript-6><node-modules><ts-loader> | 2016-02-04 12:43:41 | HQ |
35,201,431 | Contains dont Work as I expected | I'm wondering why I cannot compare this objects
public class myCustomClass
{
public string Value { get; set; }
public List<string> Keys { get; set; }
}
And i receve an List<myCustomClass>
I created an comparer and lookslike
var comparer = new MyQueryStringInfo {
Value = "somethingToCompare"
};
Ande When I do `attrOptions.Contains(comparer)` is false.
My question is can i only compare if my value exist inside my List, without compare my Keys? | <c#> | 2016-02-04 12:47:20 | LQ_EDIT |
35,201,595 | Instance of variable | <p>I have a c code</p>
<pre><code>int foo( int *p, int n){
int a[81];
int i,v;
for( i = 0; i < n ; i++){
a[i]=p[i]
if( n == 1 ) return a[0];
v=foo ( a, n-1);
if( v > a[n-1] )
return v;
else
return a[n-1];
}
int main ( void ){
int b[81], i;
for( i = 0; i < 81; i++){
b[i]=rand();
foo(b,81);
return 0;
}
</code></pre>
<p>And i need to find out how many instances of variable a will exist( max number) my answer was 81 , but it was wrong and i cant find out what number it should be. How could i determine it?</p>
| <c> | 2016-02-04 12:55:49 | LQ_CLOSE |
35,202,655 | Write java to execute curl command line | <p>I want to write java code to implement this curl command:</p>
<pre><code> curl --form "file=@7_018011.gif" --form "apikey=helloworld" --form
"language=por" https://api.ocr.space/Parse/Image >> m.txt
</code></pre>
<p>where <b>@7_018011.gif</b> is the name of the image i want user to input to send the request to a RESTFUL service. Where can i start ?</p>
| <java><curl> | 2016-02-04 13:44:02 | LQ_CLOSE |
35,202,815 | How to get image from the page and store in variable via jquery? |
img src="~/Images/Barcodes/MGRNNo.jpg" id="barCodeImage" width="150px" height="60"
I want to store the above image in varibale via jquery
like
var barcodeimage=$('#barCodeImage').image();
and
I want to print it
like
applet.append64(barcodeimage);
applet.print();
is it possible ?
| <javascript><jquery> | 2016-02-04 13:51:00 | LQ_EDIT |
35,202,993 | How can I connect my autoscaling group to my ecs cluster? | <p>In all tutorials for ECS you need to create a cluster and after that an autoscaling group, that will spawn instances. Somehow in all these tutorials the instances magically show up in the cluster, but noone gives a hint what's connecting the autoscaling group and the cluster.</p>
<p>my autoscaling group spawns instances as expected, but they just dont show up on my ecs cluster, who holds my docker definitions.</p>
<p>Where is the connection I'm missing?</p>
| <amazon-ec2><docker><amazon-ecs> | 2016-02-04 13:58:55 | HQ |
35,203,438 | create table sql in access | this is my query in sql it seems to say i have a syntax error im used to coding in sql server not access fo i expected this outcome if anyone could help me correct my code id really apprisiate it
create table M (
NMR_METER_PT_REF Varchar (50) ,
NMR_ST_METER_READ_DATE Datetime,
NMR_END_METER_READ_DATE datetime,
NMR_ST_METER_READING Int,
NMR_END_METER_READING int,
RCH_RECONCILIATION_QTY int,
METERS_THROUGH_ZEROS_COUNT int);
INSERT M (
SELECT
NMR_METER_PT_REF
, NMR_ST_METER_READ_DATE
, NMR_END_METER_READ_DATE
, NMR_ST_METER_READING
, NMR_END_METER_READING
, RCH_RECONCILIATION_QTY
, METERS_THROUGH_ZEROS_COUNT
FROM G
WHERE (((NMR.ST.METER_READING) <= NMR.ST.METER_READING)))
drop table M
select * from M
; | <sql><ms-access> | 2016-02-04 14:19:31 | LQ_EDIT |
35,203,647 | Updating Visual Studio 2015 extensions end up disabled | <p>I have a machine with seems to repeat the following pattern with VS2015 (including all patches).</p>
<ol>
<li>Install an extension and it's fine, works perfectly.</li>
<li>The developer of the extension releases a new update.</li>
<li>Update extension, which means VS2015 needs to be restarted.</li>
<li>Restart VS2015, look in the extensions and notice that the (updated) extension is now disabled.</li>
</ol>
<p>I've tried clearing the MEF cache, but that doesn't seem to help. The only way I've found to resolve this is to </p>
<ol>
<li>Delete the extension</li>
<li>Restart VS2015</li>
<li>Notice the extension is still there as disabled</li>
<li>Delete it again</li>
<li>Restart VS2015 (it's now removed)</li>
<li>Install the extension from fresh from the Extension manager.</li>
</ol>
<p>I have another machine which doesn't experience this, and also the activity.xml file doesn't get updated unless there is a loading issue (where you get the error pop-up).</p>
<p>The first time I noticed this was when I installed Mads Kristensen's Web extensions pack (which included all of his components) and caused all the pre-installed components to be disabled, so I uninstalled that and deleted all the components that were bundled under that, as it looked like it didn't detect the component were already there and created a duplicate behind the scenes, but now it seems this is happening for all 3rd party components.</p>
<p>Has anyone got any ideas what I can try to resolve this and possibly what could be causing this?</p>
<p>I'm hoping there is a file somewhere in the VS folder that is logging the issue.</p>
| <visual-studio-2015> | 2016-02-04 14:29:01 | HQ |
35,203,909 | Can I stop the transition to the next state in an onExit? | <p>I have two states, A and B. </p>
<ul>
<li>When I exit state A by clicking on a close button I do a transition to screen A using $state.go to state B (screen B) </li>
<li>When I exit state A by clicking on the back browser button on screen A I do a transition to state B (screen B) as the browser URL changes</li>
</ul>
<p>In the onExit of screen A I do a check and if this fails an Error Dialog opens, clicking Close on the error dialog returns a failed promise to the onExit</p>
<p>However the onExit still goes ahead and I go to screen B</p>
<p>Is it possible to stop the transition from State A (Screen A) to State B (Screen B) if something fails in the onExit?</p>
| <angularjs><angular-ui-router> | 2016-02-04 14:39:05 | HQ |
35,204,586 | Excel Cell Range Name Clears After Saving File | I have a problem regarding excel cell range. So I have an excel file containing cell ranges but when I save it and reopened the same file some cell ranges were missing. I have tried "save as" but still same results. I have also searched but still no luck. Hope someone helps me. Thank you in advanced. I'm losing time figuring it out. Any help would be really appreciated! | <excel><vba><range> | 2016-02-04 15:09:03 | LQ_EDIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.