qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
84,827 | There are characteristic chord progressions taught in music theory, for example, the *cadential 6-4*, which is **Ic - V - I**. Then there's **Ib - ii7b - V - I**, & so on. I want to know if these cadences have to be written as is, or they can be modified by writing one or more chords in them in an inversion?
Also, fr... | 2019/05/13 | [
"https://music.stackexchange.com/questions/84827",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/59054/"
] | Two leading music scholars of our generation, Jim Hepokoski and Warren Darcy, formulated what they call [Sonata Theory](https://en.wikipedia.org/wiki/Sonata_theory) (note the capital S and T!) to better understand the sonata process.
They list five types of sonatas. The Type 3 Sonata is the sonata that you describe, w... | The term Sonata can be used for any instrumental piece.
The *Sonata* that you're thinking of is the classical *Sonatensatz* and needs to have these 3 section to be called as such.
The classical Sonata includes apart of the Sonata-Satz form a Menuet or Scherzo and other forms like Adagio-Satz, Lied-Satz, (AB: a form ... |
84,827 | There are characteristic chord progressions taught in music theory, for example, the *cadential 6-4*, which is **Ic - V - I**. Then there's **Ib - ii7b - V - I**, & so on. I want to know if these cadences have to be written as is, or they can be modified by writing one or more chords in them in an inversion?
Also, fr... | 2019/05/13 | [
"https://music.stackexchange.com/questions/84827",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/59054/"
] | Two leading music scholars of our generation, Jim Hepokoski and Warren Darcy, formulated what they call [Sonata Theory](https://en.wikipedia.org/wiki/Sonata_theory) (note the capital S and T!) to better understand the sonata process.
They list five types of sonatas. The Type 3 Sonata is the sonata that you describe, w... | A sonata that has only the exposition and the recapitulation or only a very short development section can be called a *sonatina.*
Early sonata forms from the transition between the Baroque and Classical periods can be based on a two part form. Essentially the material of the first half will move from the tonic key to ... |
28,734,847 | I am running the Thin server for my Rails app locally. Every time I start it I receive the following message:
```
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
```
Even ... | 2015/02/26 | [
"https://Stackoverflow.com/questions/28734847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1545308/"
] | `gem update --system` to get rid of the message works for me. | I had the same problem. Looking through the output from `gem pristine --all` I saw that several gems were being skipped with a message like
```
Skipped bigdecimal-1.1.0, it is bundled with old Ruby
```
I reinstalled those gems manually to get rid of the message
```
gem uninstall bigdecimal
gem install bigdecimal
`... |
70,849,002 | Assume I have the following situation:
```
interface Base {
a: string;
}
interface Derived extends Base {
b: string;
}
const x: Derived = {
a: "a",
b: "b",
};
```
Is it possible to have the linter and/or compiler to complain about the following line:
```
const y : Base = x;
```
The purpose would be to d... | 2022/01/25 | [
"https://Stackoverflow.com/questions/70849002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665794/"
] | [This comment](https://stackoverflow.com/questions/70849002/disallow-properties-from-derived-class-on-assignment#comment125249375_70849002) is correct: TypeScript is [structurally-typed](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#structural-typing).
This means that as long as you ex... | How about this...
```
type A = {
a: string;
};
type B = {
b: string;
};
type Derived = A | B;
const x: Derived = {
a: "a",
b: "b",
};
const a: A = { a: "123" };
const b: B = { b: "234" };
const d: Derived = x;
const b1: B = x; // <---- Error
const a1: A = x; // <---- Error
```
**Surely, with int... |
14,761,777 | I'm new to node/pdf js. I just install node and run pdf.js.
Now I want know how can I open pdf files using pdf js by passing pdf file url as parameter in query string? | 2013/02/07 | [
"https://Stackoverflow.com/questions/14761777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523864/"
] | Try adding `?file=document.pdf` to the viewer url. See also <https://github.com/mozilla/pdf.js/issues/2496> | It will require some changes in the `viewer.js`:
* Move `parseQueryString: function pdfViewParseQueryString(query)` outside `var PDFView` so it's a standalone function: `function pdfViewParseQueryString(query)`
* Replace all occurences of `PDFView.parseQueryString(..)` to `pdfViewParseQueryString(..)`
* Change `var DE... |
14,761,777 | I'm new to node/pdf js. I just install node and run pdf.js.
Now I want know how can I open pdf files using pdf js by passing pdf file url as parameter in query string? | 2013/02/07 | [
"https://Stackoverflow.com/questions/14761777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523864/"
] | It will require some changes in the `viewer.js`:
* Move `parseQueryString: function pdfViewParseQueryString(query)` outside `var PDFView` so it's a standalone function: `function pdfViewParseQueryString(query)`
* Replace all occurences of `PDFView.parseQueryString(..)` to `pdfViewParseQueryString(..)`
* Change `var DE... | On a further note, it is important to know that the file=document.pdf argument must come before the hash sign:
<http://myserver.com/web/viewer.html?file=test.pdf#page=6&zoom=page-fit,0,540>
HTH |
14,761,777 | I'm new to node/pdf js. I just install node and run pdf.js.
Now I want know how can I open pdf files using pdf js by passing pdf file url as parameter in query string? | 2013/02/07 | [
"https://Stackoverflow.com/questions/14761777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523864/"
] | Try adding `?file=document.pdf` to the viewer url. See also <https://github.com/mozilla/pdf.js/issues/2496> | On a further note, it is important to know that the file=document.pdf argument must come before the hash sign:
<http://myserver.com/web/viewer.html?file=test.pdf#page=6&zoom=page-fit,0,540>
HTH |
48,250,698 | I have table with more than 25 Fields in it. It has some column with huge data (`nvarchar(MAX)`). It has **User** table like :
```
ID // Primary key
Name
Mail
Contact
RegFees
.
.
. // about 25 Fields
Narration // Nvarchar(Max) may have upto 10000 chars
Tag // Nvarchar(Max) may have upto 15000 chars
```
... | 2018/01/14 | [
"https://Stackoverflow.com/questions/48250698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6479082/"
] | You can follow the below approach for updating few fields in a table.
```
dc.Database.ExecuteSqlCommand("Update [User] Set Name = @Name, Mail = @Mail, Contact = @Contact Where ID = @ID", new SqlParameter("@Name", "YourName"), new SqlParameter("@Mail", "newMail"), new SqlParameter("@Contact", "newContact"), new SqlPara... | Add a stored procedure to the database for updating the few fields in the table. You can use the entity framework to call a stored procedure which updates the fields in the database
One of these articles should help
<http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx>
<https://www.mikes... |
48,250,698 | I have table with more than 25 Fields in it. It has some column with huge data (`nvarchar(MAX)`). It has **User** table like :
```
ID // Primary key
Name
Mail
Contact
RegFees
.
.
. // about 25 Fields
Narration // Nvarchar(Max) may have upto 10000 chars
Tag // Nvarchar(Max) may have upto 15000 chars
```
... | 2018/01/14 | [
"https://Stackoverflow.com/questions/48250698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6479082/"
] | If you want a EFish approach (no SQL statement) you can treat your `UPDATE` as a batch statement using [Entity Framework Extensions](https://github.com/zzzprojects/EntityFramework.Extended/wiki/Batch-Update-and-Delete), now re-branded [Entity Framework plus](http://entityframework-plus.net/?z=ef-extended).
I have use... | Add a stored procedure to the database for updating the few fields in the table. You can use the entity framework to call a stored procedure which updates the fields in the database
One of these articles should help
<http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx>
<https://www.mikes... |
98,609 | I'm new to options and I was on the robinhood options chain for selling VSAT puts with expiration data AUG 17 and noticed that the stock was trading at $63.79 with premiums $0.08 and $2.40 for respective strikes of $60 and $50/$40.
I am wondering why this is the case? Wouldn't a writer prefer the $40 strike with prem... | 2018/08/15 | [
"https://money.stackexchange.com/questions/98609",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/74023/"
] | Helpful first post suggestions: When you describe an option position, you need to specify all of the details. In this case, are these puts or calls? Are you quoting the bid, the ask or the last trade? The details are apparent when I look at an option chain but the reader shouldn't have to look up the quotes.
Now, some... | OP,
1. The prices (both history, and current bid/ask) you are seeing are literally **totally meaningless.**
2. The fundamental issue is, it looks like you have not yet got the idea that "prices" **are, quite simply, meaningless** in very thin markets.
The important point to understand is that, because we often talk a... |
5,494,811 | Hey everyone,
A friend of a friend has asked me for help to setup a website. I haven’t really created a website on my own. Although I know HTML, CSS, and Javascript my background has primarily been in Java, Flex, and ActionScript. I don’t mind doing this friend a favor but my time is valuable (New York City is expen... | 2011/03/31 | [
"https://Stackoverflow.com/questions/5494811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/554327/"
] | I totally see where you're coming from. You're charging for your time, and your time includes CUSTOMISING WordPress. Some people think it's easy. But if you're going into deep-level programming and making more efficient code, then you're really using your expertise in programming and scripting, PHP or otherwise.
I've... | WP based site with 5-10 static pages and simple design is something around 150-200$ at least we charge somewhere around that. |
13,446,807 | I wonder if there is a command to straight away copy a character or a word above the cursor and paste it at the current position?
Example:
```
sig1 : in std_logic;
sig2 : in std_logic;
sig3 : ^
```
Consider the situation above, and my cursor is at the `^` position, I would like to duplicate the `in std_lo... | 2012/11/19 | [
"https://Stackoverflow.com/questions/13446807",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/75579/"
] | In insert mode, you can use `Ctrl+Y` to copy characters from the corresponding character position on the previous line. Just hold down the key and wait for the keyboard repeat to get you to the end of the line. | Although Greg's answer is spot on I have modified my `ctrl`+`y` to copy word-wise as I find it more helpful in my workflows. I have the following in my `~/.vimrc` file:
```
inoremap <expr> <c-y> pumvisible() ? "\<c-y>" : matchstr(getline(line('.')-1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
```
Basically this expres... |
24,290,331 | I am working on a hybrid application using IBM worklight and Dojo toolkit. On IOS8, only the button clicks are working. Rest all the elements do not respond to any click. Has anyone tried using Dojo toolkit 1.9 with IOS8? Does this version of Dojo supports IOS8.
Thanks. | 2014/06/18 | [
"https://Stackoverflow.com/questions/24290331",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3731989/"
] | >
> if there are any concerns or gotchas I need to be aware
>
>
>
No. Just use the same folder for `SVNParentPath` in Apache and for `-r` of svnserve (for simplicity - same hotname, only protocol will differ) | Accessing a repository using different protocols will work, but in my experience using mod\_dav\_svn for all user access has many advantages:
* no user account for SVN access required, use LDAP, and/or "basic" authentication instead,
* easy tool integration through HTTP(S) transport
* powerful Apache integration (mod\... |
10,698,706 | How can the following produce an "invalid cast exception" ???
```
foreach (KeyValuePair<String,Object> entry in HttpRuntime.Cache)
{
if (entry.Value.GetType() == typeof(MyClass))
{
MyClass mc = (MyClass)entry.Value; // ===> Invalid Cast Exception !!!
```
(To those who are asking why I want to do this... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10698706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409737/"
] | Are you in an environment that does dynamic (re-)compilation? ASP.NET Websites, for example, recompile pages at runtime if the code file changes. They will compile that page to an assembly and load that assembly. Even if the runtime unloads the old assembly at some point, this still gives you a new type that is not com... | No idea why your code fails, but you can try this with a 'softcast':
```
foreach (KeyValuePair<String,Object> entry in HttpRuntime.Cache)
{
MyClass mc = entry.Value as MyClass;
if (mc != null)
{
//Do your stuff
``` |
10,698,706 | How can the following produce an "invalid cast exception" ???
```
foreach (KeyValuePair<String,Object> entry in HttpRuntime.Cache)
{
if (entry.Value.GetType() == typeof(MyClass))
{
MyClass mc = (MyClass)entry.Value; // ===> Invalid Cast Exception !!!
```
(To those who are asking why I want to do this... | 2012/05/22 | [
"https://Stackoverflow.com/questions/10698706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409737/"
] | OK I finally made it.
First of all, my apologies, I was erroneously reading my log file. The exception did not come form
```
MyClass mc = (MyClass)entry.Value;
```
but from
```
foreach (KeyValuePair<String,Object> entry in HttpRuntime.Cache)
```
It appears the Cache can't be iterated with a KeyValuePair (a code ... | No idea why your code fails, but you can try this with a 'softcast':
```
foreach (KeyValuePair<String,Object> entry in HttpRuntime.Cache)
{
MyClass mc = entry.Value as MyClass;
if (mc != null)
{
//Do your stuff
``` |
9,632,521 | Is there any best practice in handling "support tables" in Django?
I dislike `Field.choices`, as it doesn't really enforce integrity (it doesn't even create check constraints), so I prefer creating a full-blown model (and often, I find myself adding additional fields in the support table).
Now, if I use a full model,... | 2012/03/09 | [
"https://Stackoverflow.com/questions/9632521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/26787/"
] | Django ORM checks integrity if you specify choices attribute (when you insert/update data via user forms).
You also can set validation logic to database level and use database ENUM field if you db support this.
**UPD**:
```
class EnumField(models.Field):
def __init__(self, *args, **kwargs):
super(EnumFi... | I have also a use case for database-backed Enum models. I came up with a solution that uses Python descriptors to implement [django choices](https://docs.djangoproject.com/en/2.2/ref/models/fields/#choices)-like interface to the enum values:
```
from django.db import models
class ModelInstance:
"""Descriptor that... |
17,382,613 | Is there a way to view the raw http request that a jquery ajax request is sending to the server?
I am seeing different behaviors on some different devices with regards to an ajax request. If I can view the raw http request I might be able to diagnose the issue...This is mostly related to mobile devices so normal tool... | 2013/06/29 | [
"https://Stackoverflow.com/questions/17382613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/223823/"
] | Well, first I would say you're probably safer to refuse the order and tell the user to come back, because you should be doing things like checking stock, price, etc. in your product table before verifying a purchase.
Anyway, this should solve your immediate problem:
```
INSERT IGNORE INTO products (id, name, isDummy)... | I decided to go with this solution:
>
> INSERT INTO purchases (fk\_productid, buyerName) VALUES ((SELECT id FROM product WHERE id=10 LIMIT 1), "Andreas");
>
>
>
I agree that in production this case should never happen - don't worry, it won't. This was more of a simple description of a larger problem I had. ;-)
T... |
31,668,905 | I'm beginner in android and want show something with this plan:
[](https://i.stack.imgur.com/Fx7bk.png)
and my xml file is this:
```
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:too... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31668905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4923413/"
] | The 1st figure is your requirement. So i will first answer what would be the best way to achieve your desired result. Using `LinearLayout` instead of `FrameLayout` would be recommended in this case. Then you should use `layout_weight` attribute for your `ImageView` and `TextView` along with `layout_height="0dp"`. Note ... | Replace xml file with this:
```
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Lin... |
31,668,905 | I'm beginner in android and want show something with this plan:
[](https://i.stack.imgur.com/Fx7bk.png)
and my xml file is this:
```
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:too... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31668905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4923413/"
] | The 1st figure is your requirement. So i will first answer what would be the best way to achieve your desired result. Using `LinearLayout` instead of `FrameLayout` would be recommended in this case. Then you should use `layout_weight` attribute for your `ImageView` and `TextView` along with `layout_height="0dp"`. Note ... | You can use a LinearLayout with weights:
```
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainAct... |
31,668,905 | I'm beginner in android and want show something with this plan:
[](https://i.stack.imgur.com/Fx7bk.png)
and my xml file is this:
```
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:too... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31668905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4923413/"
] | The 1st figure is your requirement. So i will first answer what would be the best way to achieve your desired result. Using `LinearLayout` instead of `FrameLayout` would be recommended in this case. Then you should use `layout_weight` attribute for your `ImageView` and `TextView` along with `layout_height="0dp"`. Note ... | Try this :
```
<LinearLayout
android:id="@+id/ll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="5"
android:orientation="vertical" >
<ImageView
android:layout_height="0dp"
... |
31,668,905 | I'm beginner in android and want show something with this plan:
[](https://i.stack.imgur.com/Fx7bk.png)
and my xml file is this:
```
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:too... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31668905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4923413/"
] | The 1st figure is your requirement. So i will first answer what would be the best way to achieve your desired result. Using `LinearLayout` instead of `FrameLayout` would be recommended in this case. Then you should use `layout_weight` attribute for your `ImageView` and `TextView` along with `layout_height="0dp"`. Note ... | You can try this one as I am able to get proper output as you needed.
```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="1">... |
8,052,663 | We're attempting to upgrade our site from framework 3.5 to 4.0. Everything appears to be fine server side - My only problem so far is the IDs of a handful of custom controls.
The Controls deceleration looks like:
```
<div runat="server" id="gglSelectedItemsImage" class="gplSelectedItemsText">None selected</div>
... | 2011/11/08 | [
"https://Stackoverflow.com/questions/8052663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693342/"
] | Try this
```
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
``` | You should access the client id's like this in your .ASPX file:
```
<%=gglSelectedItemsImage.ClientID%>
``` |
8,052,663 | We're attempting to upgrade our site from framework 3.5 to 4.0. Everything appears to be fine server side - My only problem so far is the IDs of a handful of custom controls.
The Controls deceleration looks like:
```
<div runat="server" id="gglSelectedItemsImage" class="gplSelectedItemsText">None selected</div>
... | 2011/11/08 | [
"https://Stackoverflow.com/questions/8052663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693342/"
] | In the second example you're using a master page, which explains why the `ClientID` is different. It shouldn't make a difference though if you're referencing the control by `ClientID`:
```
var ctrl = $("#<%=gglSelectedItemsImage.ClientID%>");
``` | You should access the client id's like this in your .ASPX file:
```
<%=gglSelectedItemsImage.ClientID%>
``` |
55,727,212 | 1. How i can undo a command in jupyter notebook, let suppose in the provided code i treated outliers in my `data['age']` column by replacing them by a value 72 for all the outliers which lies beyond 72 (as shown in the below code). But after few more finding i thought it would be appropriate if i replace values which i... | 2019/04/17 | [
"https://Stackoverflow.com/questions/55727212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11373628/"
] | You simply can't.
If you overwrite your variable then there is no way to go to a previous state unless you reload your data, run your script up to the point you wish to modify and then run a different command.
In your two examples, you will have to reload `data`. | A very good question, but it seems there isn't anyway to undo an executed command since the machine has already learned the command which you mistakenly executed.
```
Wished if there was a way like erasing the events in memory, as in the move men in black!!
The only way around for now is to reload the data back to ... |
62,900,752 | I'm trying to check if my forEach loop is not at the last index so I can separate the numbers with commas. Currently it still uses a comma on the last number which I don't want.
```
const repeatNums = function(data) {
let ans = '';
data.forEach(function(item, index, arrsy) {
ans += item[0].toString().r... | 2020/07/14 | [
"https://Stackoverflow.com/questions/62900752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6775809/"
] | You should use `map` and then `join` instead, which handles that for you.
```
return data.map(([first,second])=>first.toString().repeat(second)).join(', ');
```
Your current code is wrong because the index can never be negative; the last index of the array is one less than its length, as arrays are zero-indexed.
``... | You can just check the `index` argument in the loop to see if it is one less than `arrsy.length`.
Or, you could just use [`Array.join()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join):
```js
let ary = ["A","B","C","D"];
console.log(ary.join(","));
``` |
62,900,752 | I'm trying to check if my forEach loop is not at the last index so I can separate the numbers with commas. Currently it still uses a comma on the last number which I don't want.
```
const repeatNums = function(data) {
let ans = '';
data.forEach(function(item, index, arrsy) {
ans += item[0].toString().r... | 2020/07/14 | [
"https://Stackoverflow.com/questions/62900752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6775809/"
] | You should use `map` and then `join` instead, which handles that for you.
```
return data.map(([first,second])=>first.toString().repeat(second)).join(', ');
```
Your current code is wrong because the index can never be negative; the last index of the array is one less than its length, as arrays are zero-indexed.
``... | Maybe this helps
```js
let arr = [1, 2, 3];
let joined = arr.join(', ');
console.log(joined);
``` |
62,900,752 | I'm trying to check if my forEach loop is not at the last index so I can separate the numbers with commas. Currently it still uses a comma on the last number which I don't want.
```
const repeatNums = function(data) {
let ans = '';
data.forEach(function(item, index, arrsy) {
ans += item[0].toString().r... | 2020/07/14 | [
"https://Stackoverflow.com/questions/62900752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6775809/"
] | You should use `map` and then `join` instead, which handles that for you.
```
return data.map(([first,second])=>first.toString().repeat(second)).join(', ');
```
Your current code is wrong because the index can never be negative; the last index of the array is one less than its length, as arrays are zero-indexed.
``... | Just modify your function like this:
```
const repeatNums = function(data) {
let ans = '';
data.forEach(function(item, index, arrsy) {
ans += item[0].toString().repeat(item[1]);
if (index !== arrsy.length -1) {
ans += ', '
}
});
return ans;
};
``` |
16,452,394 | I have a quicktime object i am reading with av foundation.
I can see it's tracks and I would like to be able to read the 'tmcd' track (timecode) and get it's output as a string i can use in an NSTextView.
With an NSLog and a [track formatDescriptions] i see:
{\n\tmediaType:'tmcd' \n\tmediaSubType:'tmcd' \n\tmediaSpe... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16452394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/668846/"
] | Try using [avfprobe](https://github.com/mself/avfprobe). It will decode all of the track info for you, including the `CMFormatDescription` that you mentioned in your question. You'll see something like this:
```
formatDescriptions = [
{
mediaType = kCMMediaType_TimeCode; // = 'tmcd'
mediaSubType = ... | You could try this:
```
NSArray* arrFormat = [tTrack formatDescriptions];
NSInteger nCountArr = [arrFormat count];
CMTimeCodeFormatDescriptionRef refCmFormat = (__bridge CMTimeCodeFormatDescriptionRef)(arrFormat[0]);
NSDictionary* dictFormat = (__bri... |
65,057,140 | I have been doing a course on intermediate machine learning from Kaggle. In the explanation, in order to label categorical data they have used `LabelEncoder` library from sklearn.preprocessing.

Here, for training dataset they have used fit\_transform... | 2020/11/29 | [
"https://Stackoverflow.com/questions/65057140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10304159/"
] | fit\_transform both fits the transformer to the dataset and also transforms the given data.
Transform just transforms the given dataset.
Generally you use fit\_transform on the training dataset to both fit the transformer to the dataset and transform your dataset.
On your testing and validation dataset you only want... | We use fit in creating machine learning models,but fit\_transform is used whenever we want
to fit the data as well as transforming those values.
For ex - In case of Label Encoding and Feature Scaling we want to change or scale our values. So whenever we want to transform the values we use fit\_transform.
But We don'... |
693,765 | I am new to the Ubuntu. I tried to install `pycharm-community-5.0.tar.gz` with following command:
```
tar -xzf pycharm-community-5.0.tar.gz
cd pycharm-community-5.0
./configure
```
it says
```
./configure: No such file or directory
``` | 2015/11/04 | [
"https://askubuntu.com/questions/693765",
"https://askubuntu.com",
"https://askubuntu.com/users/461499/"
] | Use the below two options for installing pycharm in Ubuntu:
1. ```
sudo add-apt-repository ppa:mystic-mirage/pycharm
sudo apt-get update
sudo apt-get install pycharm
```
2. Follow the steps mentioned in this [link](http://exponential.io/blog/2015/02/10/install-pycharm-on-ubuntu-linux/) | The archive `pycharm-community-5.0.tar.gz` doesn't contain a `configure`. Extract the archive and run PyCharm
```
sudo tar xf pycharm-community-5.0.tar.gz -C /opt
/opt/pycharm-community-5.0/bin/pycharm.sh
```
For a better integration in your desktop, create a desktop file:
```
nano ~/.local/share/applications/pycha... |
582,918 | I am trying to use StructureMap and have essentially 3 levels of abstraction. I have a service a repository and database interface. So the IService depends on IRepo and IRepo depends on IDatabase. My issue is that my IDatabase concrete type takes in db connection information. I am going to create these on the fly, tryi... | 2009/02/24 | [
"https://Stackoverflow.com/questions/582918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11907/"
] | The old adage is this.
>
> When you use a spreadsheet to solve a problem, you now have two problems.
>
>
>
Database is for records of the business. Long-lasting. Permanent.
Other configuration files are for other configuration information -- not long-lasting business records. Current settings and what-not are n... | For me, I want all of the core data to be stored in a database. Two reasons:
* to allow adhoc reporting access to the data
* to allow applications to share data.
Databases should contain all of the domain data, and occasionally some on-the-fly data (user preferences for example). Relational databases are most popular... |
582,918 | I am trying to use StructureMap and have essentially 3 levels of abstraction. I have a service a repository and database interface. So the IService depends on IRepo and IRepo depends on IDatabase. My issue is that my IDatabase concrete type takes in db connection information. I am going to create these on the fly, tryi... | 2009/02/24 | [
"https://Stackoverflow.com/questions/582918",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11907/"
] | The old adage is this.
>
> When you use a spreadsheet to solve a problem, you now have two problems.
>
>
>
Database is for records of the business. Long-lasting. Permanent.
Other configuration files are for other configuration information -- not long-lasting business records. Current settings and what-not are n... | Spreadsheets are documents, databases are repositories for information, configuration files store rules for how a specific instance of an application should behave. If you think of it that way, it's usually not hard to make a call. |
2,346,606 | I am trying to build an iPhone application that has a Tab bar as the root controller and several navigation bars. My doubt is, shall I create one NavigationBarController class for each navigation bar that I want to put in the application? Or is it possible to create only a single navigation controller that manages all ... | 2010/02/27 | [
"https://Stackoverflow.com/questions/2346606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236650/"
] | The common way to achieve this is to create a Tab Bar application and then change each item in the tab bar to be a UINavigationController. If you do this, you can definitely use self to access the navigationController - specifically you can use `self.navigationController`. | Insert a unique `UINavigationController` for each tab.
You can't have a single controller manage across multiple tabs, since a navigation controller can only have a single linear stack of view controllers. Each tab should have it's own navigation controller with a different root controller in each one. |
2,346,606 | I am trying to build an iPhone application that has a Tab bar as the root controller and several navigation bars. My doubt is, shall I create one NavigationBarController class for each navigation bar that I want to put in the application? Or is it possible to create only a single navigation controller that manages all ... | 2010/02/27 | [
"https://Stackoverflow.com/questions/2346606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236650/"
] | The common way to achieve this is to create a Tab Bar application and then change each item in the tab bar to be a UINavigationController. If you do this, you can definitely use self to access the navigationController - specifically you can use `self.navigationController`. | Watch out for possible leak in this part of the above code:
```
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:tools];
```
You could use this instead:
```
UIBarButtonItem* rightButtonBar = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonIte... |
2,346,606 | I am trying to build an iPhone application that has a Tab bar as the root controller and several navigation bars. My doubt is, shall I create one NavigationBarController class for each navigation bar that I want to put in the application? Or is it possible to create only a single navigation controller that manages all ... | 2010/02/27 | [
"https://Stackoverflow.com/questions/2346606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236650/"
] | The common way to achieve this is to create a Tab Bar application and then change each item in the tab bar to be a UINavigationController. If you do this, you can definitely use self to access the navigationController - specifically you can use `self.navigationController`. | >
> The common way to achieve this is to create a Tab Bar application and
> then change each item in the tab bar to be a UINavigationController.
>
>
>
This is THE way of achieving this. I have loaded 5 navigation controllers into a tab bar controllor. The key tip is to plan the navigations of the App, as every na... |
2,346,606 | I am trying to build an iPhone application that has a Tab bar as the root controller and several navigation bars. My doubt is, shall I create one NavigationBarController class for each navigation bar that I want to put in the application? Or is it possible to create only a single navigation controller that manages all ... | 2010/02/27 | [
"https://Stackoverflow.com/questions/2346606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236650/"
] | Watch out for possible leak in this part of the above code:
```
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:tools];
```
You could use this instead:
```
UIBarButtonItem* rightButtonBar = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonIte... | Insert a unique `UINavigationController` for each tab.
You can't have a single controller manage across multiple tabs, since a navigation controller can only have a single linear stack of view controllers. Each tab should have it's own navigation controller with a different root controller in each one. |
2,346,606 | I am trying to build an iPhone application that has a Tab bar as the root controller and several navigation bars. My doubt is, shall I create one NavigationBarController class for each navigation bar that I want to put in the application? Or is it possible to create only a single navigation controller that manages all ... | 2010/02/27 | [
"https://Stackoverflow.com/questions/2346606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/236650/"
] | Watch out for possible leak in this part of the above code:
```
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:tools];
```
You could use this instead:
```
UIBarButtonItem* rightButtonBar = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonIte... | >
> The common way to achieve this is to create a Tab Bar application and
> then change each item in the tab bar to be a UINavigationController.
>
>
>
This is THE way of achieving this. I have loaded 5 navigation controllers into a tab bar controllor. The key tip is to plan the navigations of the App, as every na... |
116,883 | I think I need some help as I run out of ideas.
In my database I have a simple table like this:
```
CREATE TABLE dbo.Invoices
(
CashDiscounts MONEY,
Cost MONEY
)
GO
```
and a stored procedure that uses this table in SELECT context:
```
CREATE PROCEDURE Reporting.pLoadTest
AS
BEGIN
... | 2015/10/03 | [
"https://dba.stackexchange.com/questions/116883",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/77399/"
] | This is a bug in SQL Server and here is a Connect item to vote for if you want a change.
[dm\_sql\_referenced\_entities does not shows columnes when temporary tables are used in statement](https://connect.microsoft.com/SQLServer/feedback/details/489390/dm-sql-referenced-entities-does-not-shows-columnes-when-temporary-... | Thanks for the answer. Just before I posted a question here I did a search Microsoft Connect bug list however nothing came up here and I used dm\_sql\_referenced\_entities as keyword. I've posted the same bug and that's available at <https://connect.microsoft.com/SQLServer/feedback/details/1859356>.
Let's say I under... |
6,393,157 | I have a class called Regions and another class I will call Area. In the main class Area, I need to have an array of Region class objects.
Here is my region class:
```
class Region
{
public:
// Constructor
Region();
// Get/set functions
bool getPoly() {return poly;}
bool setPoly(bo... | 2011/06/18 | [
"https://Stackoverflow.com/questions/6393157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/804132/"
] | Yes it is possible - do you have the classes defined in the same file? It sounds like they might be in separate files and you haven't included the header file for `Region` in the `Area` file.
Edit: Also, you have getter functions for the data in `Region`, so there is no need to make `Area` a friend of `Region`. I woul... | Other common problem is the `friend class Area;` declaration inside the class without a forward declaration first (I'm almost sure this is the case, are you using GCC?)
In Region.h
```
class Area; // <- this is a forward declaration
clasee Region {
...
friend class Area;
};
```
Regards |
6,393,157 | I have a class called Regions and another class I will call Area. In the main class Area, I need to have an array of Region class objects.
Here is my region class:
```
class Region
{
public:
// Constructor
Region();
// Get/set functions
bool getPoly() {return poly;}
bool setPoly(bo... | 2011/06/18 | [
"https://Stackoverflow.com/questions/6393157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/804132/"
] | It seems to me that the problem is that you are referring to a class you have not yet defined. That is the: `Region* regionArray;` line in the `Area` class.
If this is the case you have to remember to include the header containing the `Region` class in the header file containing the `Area` class. Or add `class Region;... | Other common problem is the `friend class Area;` declaration inside the class without a forward declaration first (I'm almost sure this is the case, are you using GCC?)
In Region.h
```
class Area; // <- this is a forward declaration
clasee Region {
...
friend class Area;
};
```
Regards |
6,393,157 | I have a class called Regions and another class I will call Area. In the main class Area, I need to have an array of Region class objects.
Here is my region class:
```
class Region
{
public:
// Constructor
Region();
// Get/set functions
bool getPoly() {return poly;}
bool setPoly(bo... | 2011/06/18 | [
"https://Stackoverflow.com/questions/6393157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/804132/"
] | Yes, that is possible. In your case, the problem isn't array. but (most likely) you've not included some header files in some other files.
By the way, you can use `std::vector` as well, which in my opinion would be a better choice, in comparison to raw pointer.
```
#include <vector>
#include "Region.h" //must includ... | Other common problem is the `friend class Area;` declaration inside the class without a forward declaration first (I'm almost sure this is the case, are you using GCC?)
In Region.h
```
class Area; // <- this is a forward declaration
clasee Region {
...
friend class Area;
};
```
Regards |
26,664,602 | I'd like to have the application at example.com use In Proc. And all other applications (example.com/app1, example.com/other\_app, etc) use SQL state. Is this possible? I have created distinct application pools for each application. | 2014/10/30 | [
"https://Stackoverflow.com/questions/26664602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3435345/"
] | I added a `<location>` element to all of my web.configs:
```
<location path="." inheritInChildApplications="false" allowOverride="false">
<system.web>
<sessionState />
</system.web>
</location>
```
This seems to keep everything separate now. I can now use "In Proc" in my parent app and "SQL session" ... | Should just work with multiple applications. This setting is per application.
Haven't you tried this? |
17,604,826 | I am trying to do a lesson, learning javascript objects and so forth... I am having a problem with this for in loop and I suppose the object literal itself
```
var darkness = {
add: function(a,b) {
for(var title in b) {
alert(a+ " is the "+ b.title );
alert(a+ " holds many of"+b.dream);
}
}
};
... | 2013/07/11 | [
"https://Stackoverflow.com/questions/17604826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1760670/"
] | The clause `WHERE spyypp BETWEEN 201305 AND 201305` has the consequence of coercing your join into an INNER JOIN, as it is performed **after** the join is completed.
In order to achieve the effect you desire you must move this clause into the ON condition like this so that the clause is applied **before** the join is... | There seems to be multiple problems. This predicate:
```
WHERE spyypp BETWEEN 201305 AND 201305
```
is probably eliminating some of the "outer joined" rows. Those rows are going to have a NULL for spyypp. (The grouping by spsku is a bit odd, but that may actually not be a problem, you're just going to get separate... |
17,604,826 | I am trying to do a lesson, learning javascript objects and so forth... I am having a problem with this for in loop and I suppose the object literal itself
```
var darkness = {
add: function(a,b) {
for(var title in b) {
alert(a+ " is the "+ b.title );
alert(a+ " holds many of"+b.dream);
}
}
};
... | 2013/07/11 | [
"https://Stackoverflow.com/questions/17604826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1760670/"
] | The clause `WHERE spyypp BETWEEN 201305 AND 201305` has the consequence of coercing your join into an INNER JOIN, as it is performed **after** the join is completed.
In order to achieve the effect you desire you must move this clause into the ON condition like this so that the clause is applied **before** the join is... | Thank you all for you suggestions. I did restructure the SQL to have both this year and last year nested inside a with clause. The fatal flaw I was over looking is sku's that existed only in the Last Year dataset were not being included unless I selected/grouped by sku in the main clause.
To solve the issue, I used th... |
5,888,124 | I need to be able to replace all occurrences of the word "and" ONLY when it occurs between single quotes. For example replacing "and" with "XXX" in the string:
`This and that 'with you and me and others' and not 'her and him'`
Results in:
`This and that 'with you XXX me XXX others' and not 'her XXX him'`
I have b... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5888124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/193278/"
] | Try this code:
```
str = "This and that 'with you and me and others' and not 'her and him'";
Matcher matcher = Pattern.compile("('[^']*?')").matcher(str);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(sb, matcher.group(1).replaceAll("and", "XXX"));
}
matcher.appendTail(sb)... | ```
String str = "This and that 'with you and me and others' and not 'her and him'";
Pattern p = Pattern.compile("(\\s+)and(\\s+)(?=[^']*'(?:[^']*+'[^']*+')*+[^']*+$)");
System.out.println(p.matcher(str).replaceAll("$1XXX$2"));
```
The idea is, each time you find the complete word `and`, you you scan from the curren... |
332,328 | Which of the following two is more correct? And why? And what is the difference? Both produce identical outputs.
Also, what is the correct place for a `\newcommand` - before `\begin{document}` or after?
Here is the MWE:
```
\documentclass{article}
\newcommand{\Variable}{World}
\begin{document}
Hello \Variable{}! Wel... | 2016/10/03 | [
"https://tex.stackexchange.com/questions/332328",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/18495/"
] | A macro -- more specifically, a control word that consists of one or more *letters* -- usually gobbles any space to its right (The exception are the macros with a single non-letter character). This allows the macro to take the next characters as first argument, so `\fbox abc` does the same as `\fbox{a}bc`. Unfortunatel... | Both uses are sufficient in the context you show, since they produce the same result:
[](https://i.stack.imgur.com/OuBVo.png)
However, in a slightly different context - removing the punctuation `!` immediately following the macro use, the results are... |
44,218,914 | I have created a simple list getter from rest api:
```
def list: Future[Iterable[ProductResource]] = {
ProductService.listAllProducts.map { postDataList =>
postDataList.map(postData => createProductResource(postData))
}
}
```
It convert product objects into json with this writer:
```
object ProductR... | 2017/05/27 | [
"https://Stackoverflow.com/questions/44218914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4541597/"
] | your controller must return a Future of JsValue (`Future[JsValue]`).
But your are returning Iterable of ProductResource (`Iterable[ProductResource]`).
to convert your Iterable[ProductResource] to JsValue.
* convert each individual ProductResource objects to JsObject
* do a `foldLeft` action to convert the sequence of... | Problem fixed my change in `ProdcutResource` object
```
case class ProductResource(id: Option[Long], name: String, description: String, price: BigDecimal, amount: Int)
object ProductResource {
implicit val implicitWrites = new Writes[ProductResource] {
def writes(product: ProductResource): JsValue = {
Jso... |
9,721,790 | As a simplified example, consider a `ListView` that can contain both sub-categories and book titles. If a book title is clicked, a new activity should start that shows the cover image. If a sub-category is clicked, a new list of books and categories is displayed.
A `Row` interface is defined as follows.
```
interfac... | 2012/03/15 | [
"https://Stackoverflow.com/questions/9721790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/403455/"
] | Forgive my chicken-scratched "UML" below, but here's how I do it.
```
class ListAdapter extends ArrayAdapter<Row<?>> {
...
public View getView(int position, View convertView, ViewGroup parent) {
View view = listViewRowViewRecycler.getView(convertView);
rowProvider.get().getRow(position).draw(view)... | Another possibility is to use the setTag/getTag methods on each item's View in the list - this allows you to attach the 'Book' or 'Category' to its appropriate row.
For this to work each of the 'listed' items should implement a common interface that has an appropriate method to be called when it is clicked.
For insta... |
3,127,154 | I need to find $\lim\_{n \rightarrow \infty} \left[\int\_{ 0}^{ 1} \frac {(1+x+...+x^{n})^2}{1+x+...+x^{n+1}}dx - \ln (n)\right]$ and my idea is that after using some simplification the integral is equal to $\int\_{0}^{1} \frac{x^{2(n+1)}-2x^{(n+1)}+1}{(x-1)(x^{(n+2)}-1)}dx$ which, because $x$ is smaller than 1, is big... | 2019/02/26 | [
"https://math.stackexchange.com/questions/3127154",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Write $f\_n(x) = 1 + x + \cdots + x^n$. Denoting the expression inside the limit by $a\_n$, we find that
$$ a\_n = \int\_{0}^{1} \frac{f\_n(x)^2}{f\_n(x) + x^{n+1}} \, \mathrm{d}x - \log n. $$
We first examine the expression where $\log n$ is replaced by $\int\_{0}^{1} f\_n(x) \mathrm{d}x$. Then
$$ \left| \int\_{0}^... | $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\new... |
2,550,748 | Is it possible to capture full screen in visual studio (VC++), so that user don't have to press ATL+Enter. Kindly guide me how I can make it possible. | 2010/03/31 | [
"https://Stackoverflow.com/questions/2550748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67381/"
] | If you need to enter fullscreen mode in OpenGL per default, check out NeHe Productions, for instance his [second lesson](http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=02)
If you download his example at the bottom of the screen and check out the:
`BOOL CreateGLWindow(char* title, int width, int height, in... | It depends. If you are using `Direct3D` alt-enter enters full screen mode by default.
If your application is "normal" (ie, not a 3d application) then there is no actual full-screen mode. You can however create the illusion of it by maximizing the window and removing things like the top menu bar. |
39,332,625 | I've been stuck with this compiler error for a while now, my project is a UWP Universal Windows Platform, with Xamarin.Forms 4.1, along with a set of nuget packages, and for some time when enabled the .NET Native tool chain option I get the following error:
>
> C:\Program Files
> (x86)\MSBuild\Microsoft.NetNative\x8... | 2016/09/05 | [
"https://Stackoverflow.com/questions/39332625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/499989/"
] | The feedback from opencv github seems clear: you compiled with OpenCV 3.x but use OpenCV 2.4.8 at runtime. Since they are not binary compatible, it does not free properly the `cv::Mat`. Let export your `LD_LIBRARY_PATH` to the `OCV_DIST/lib` of OpenCV 3.x used to compile.
Note that if you `delete` the pointer you don'... | Quoted the following from the documentation page: (<http://docs.opencv.org/2.4.9/modules/core/doc/basic_structures.html#mat-release>):
*void Mat::release()
The method decrements the reference counter associated with the matrix data. When the reference counter reaches 0, the matrix data is deallocated and the data and... |
35,630,237 | My code will show the menu's submenu on hover, now I don't want to run this code if my button is clicked. How can I do this? Both ' subMenuDropDown.preventDefault(); ' and subMenuDropDown.stopPropagation(); don't do the trick.
**JsFiddle**: <https://jsfiddle.net/k4ftf4tx/>
```
$('.menu ul li ul').hide();
$('.menu u... | 2016/02/25 | [
"https://Stackoverflow.com/questions/35630237",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5804430/"
] | ```js
// Make submenu dropdown on hover
$('.menu ul li ul').hide();
$('.menu ul li').hover(function(subMenuDropDown) {
$(this).find("ul").first().stop(true, true).delay(60).slideDown('slow');
}, function() {
$(this).find("ul").first().stop(true, true).delay(60).slideUp('fast');
});
$('.mobileMenuBu... | To hover on desktop sites, but us the click on mobile sites you'd need to check to see if its a mobile device and implement your hover accordingly. If you're using a framework like Bootstrap, lots of that work is already done for you.
If not, you can check for mobile devices using something like this: [Detecting a mob... |
8,822,359 | I need to show label background color which is attached in following code. It's multiline label.
Here is code snippet.
```
self._coverTittle =[[FontLabel alloc] initWithFrame:CGRectMake(100, 650, 400, 200) fontName:@"futurlig-webfont" pointSize:48.0f];
self._coverTittle.backgroundColor = [UIColor colorWithRed:0 gree... | 2012/01/11 | [
"https://Stackoverflow.com/questions/8822359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289036/"
] | You should be fine.
Check the properties of your web app (and any other referenced projects you compile).
```
Properties -> Build -> Platform: should be set to: Any CPU.
```
This is the default, so unless you have changed it, you will be ok.
AnyCPU assembly's will be JITed to 32 or 64 bit code depending on the proc... | As Visual Studio is a 32-bit application, ASP.NET development is usually performed in a 32-bit environment. You won't be able to develop using any 64 bit assemblies (like the Azure assemblies, for example), but unless you need to do that it probably won't make any difference. |
8,822,359 | I need to show label background color which is attached in following code. It's multiline label.
Here is code snippet.
```
self._coverTittle =[[FontLabel alloc] initWithFrame:CGRectMake(100, 650, 400, 200) fontName:@"futurlig-webfont" pointSize:48.0f];
self._coverTittle.backgroundColor = [UIColor colorWithRed:0 gree... | 2012/01/11 | [
"https://Stackoverflow.com/questions/8822359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289036/"
] | No problem. Just make sure you build your app for Any CPU. If you use [MySQL Connector for .Net](http://dev.mysql.com/downloads/connector/net/), which is a 32-bits DLL, your Application Pool must be enabled to run 32-bits applications, which you can configure on IIS. | As Visual Studio is a 32-bit application, ASP.NET development is usually performed in a 32-bit environment. You won't be able to develop using any 64 bit assemblies (like the Azure assemblies, for example), but unless you need to do that it probably won't make any difference. |
5,660,338 | Has anybody gotten this ruby warning before? "warning: redundant nested repeat operator"
What does it mean?
I get it when I start Webrick
This is how my trace looks like:
```
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-mount-0.6.13/lib/rack/mount/strexp.rb:4
1: warning: redundant nested repeat operator
c:/Ruby192/lib/... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5660338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/226255/"
] | This happens when you have a regular expression with two repeat operators on a single atom. E.g.,
```
ruby-1.9.2-p180 :001 > re = /\w**/
~/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/irb/workspace.rb:80:
warning: redundant nested repeat operator: /\w**/
=> /\w**/
```
Given that the backtrace has what looks like... | @michael's response got me to find the real problem:
If you have the following in your routes.rb,
```
match "/foo(/bar(/something)))" => "controller#action"
```
You get the warning mentioned above. It exists to warn you that `/foo` works, so does `/foo/bar` and so does `/foo/bar/something` |
447,030 | My goal is to write a `\unitvector` command which produces bold upright symbols with a bold circumflex accent. Here's my MWE:
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Bonum}
\setmathfont{texgyrebonum-math.otf}
\newcommand\unitvectorA[1]{\symbfup{\hat{#1}}}
\newc... | 2018/08/21 | [
"https://tex.stackexchange.com/questions/447030",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/33233/"
] | You can just skip `unicode-math` and load `XITS Math Bold` as a LaTeX Symbol font:
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Bonum}
\setmathfont{texgyrebonum-math.otf}
% We could use fontspec to load these but I am not a big fontspec fan:
\DeclareFontFamily{TU}{x... | Works only with `lualatex`. For `xelatex` you can use the `FakeBold` option.
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Bonum}
\setmathfont{texgyrebonum-math.otf}
\usepackage[bold=0.8]{xfakebold}
\newcommand\unitvectorA[1]{\setBold\ensuremath{\hat{#1}}\unsetBold}
\... |
28,161,281 | Say I have the following...
```
double d = 1.6;
int q = ( ( int ) d );
```
Will this always drop the just decimal point according to the Java standard, or could it round up or down ***according to the standard*** (Which more or less exists)? | 2015/01/27 | [
"https://Stackoverflow.com/questions/28161281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4496759/"
] | Yes, it will drop the decimal point. That means it will round *towards zero*, so it will round down if it is positive, but it will round up if it is negative.
See [§5.1.3](http://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.1.3) in the JLS:
>
> Otherwise, if the floating-point number is not an infinity... | Casting a `double` to an `int` always floors the value to greatest integer less than it, but try this:
```
int q = (int) Math.round(d); // rounded instead of floored
``` |
36,190,294 | I'm trying to import a flat file into SQL Server and I'm having some issues. The column delimiter is `;~` and the row delimiter is `|~`. I'm using the SQL Server Import and Export Wizard but keep getting errors. Have any of you every had a similar issue? I think I'm doing it wrong from the start of the wizard. Can any ... | 2016/03/23 | [
"https://Stackoverflow.com/questions/36190294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The best way to do this is:
`gsutil -m acl ch -u 'AllUsers:R' gs://your-bucket/**`
will update ACLs for each existing object in the bucket.
If you want newly created objects in this bucket to also be public, you should also run:
`gsutil defacl ch -u 'AllUsers:R' gs://your-bucket`
This question was also asked [here... | ```
$> gsutil acl ch -g All:R -r gs://bucketName
```
gsutil is the command-line utility for GCS.
"acl ch" means "Modify an ACL."
"-g All:R" means "include read permissions for all users."
"-r" means "recursively"
and the rest is the path.
If you have a whole lot of files and you want MORE SPEED, you can use -m t... |
27,730,848 | Yes, the question has been asked so many times, but this one is a bit more specific. I need JavaScript code that shows/hides all elements of a certain `class`. The code must be compatible with the older browsers and Internet Explorer, and it must have an extremely small footprint. So, please don't post jQuery solutions... | 2015/01/01 | [
"https://Stackoverflow.com/questions/27730848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3664780/"
] | You need to use a shim or iterate through the dom and get elements with your class. See no other solutions. | I agree with Luba, here's a shim: [getElementsByClassName.polyfill.js](https://gist.github.com/eikes/2299607)
As commented by Hemang, link only answers are invalid due to link change so here's the code from the link. The link is a shim for the deficit of getElementsByClassName in pre-ie9. Initially the shim tests the ... |
27,730,848 | Yes, the question has been asked so many times, but this one is a bit more specific. I need JavaScript code that shows/hides all elements of a certain `class`. The code must be compatible with the older browsers and Internet Explorer, and it must have an extremely small footprint. So, please don't post jQuery solutions... | 2015/01/01 | [
"https://Stackoverflow.com/questions/27730848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3664780/"
] | Don't use the same iterator (var i) in an inner for loop because it collides with your current loop. Remove the second inner one and check if class x is set, then set your property, do a "continue" and vice versa:
```
var flip = document.getElementsByTagName(_tag);
if (trigger) {
for (var i = 0; i < flip.length; i++... | I agree with Luba, here's a shim: [getElementsByClassName.polyfill.js](https://gist.github.com/eikes/2299607)
As commented by Hemang, link only answers are invalid due to link change so here's the code from the link. The link is a shim for the deficit of getElementsByClassName in pre-ie9. Initially the shim tests the ... |
27,730,848 | Yes, the question has been asked so many times, but this one is a bit more specific. I need JavaScript code that shows/hides all elements of a certain `class`. The code must be compatible with the older browsers and Internet Explorer, and it must have an extremely small footprint. So, please don't post jQuery solutions... | 2015/01/01 | [
"https://Stackoverflow.com/questions/27730848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3664780/"
] | Here's a mockup of a classname-switcher, would that be an idea? If you use IE < 8, use `document.getElementsByTagName` instead of `document.querySelectorAll`.
```js
(function() {
document.querySelector('button').addEventListener('click', toggledivshidden);
function toggledivshidden() {
return toggle('div',... | I agree with Luba, here's a shim: [getElementsByClassName.polyfill.js](https://gist.github.com/eikes/2299607)
As commented by Hemang, link only answers are invalid due to link change so here's the code from the link. The link is a shim for the deficit of getElementsByClassName in pre-ie9. Initially the shim tests the ... |
72,513,468 | I'm trying to detect and differentiate the login of the normals users and admin. The user only shows "welcome user" and when an admin log-in's it shows all the users. I've tried if else but the statement is wrong it dosent work.
**LoginValidator.php**
```
<?php
session_start();
$users = array(
ar... | 2022/06/06 | [
"https://Stackoverflow.com/questions/72513468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13831923/"
] | I found problem in the if condition where you are checking for the admin.
```
if ($value['User'] == $users) {
```
Here, you are comparing a value with an array, which will not work.
This problem could be solved by comparing an array with an array.
For that, you just have to change above if condition to:
```
if (in... | You may try to type the value instead
```
if ($value['User'] == "ADMIN") {
echo "Welcome admin!";
echo print_r($mergedUsers);
echo print_r($users);
echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>';
} else
... |
926,517 | I only register (make an account/login stuff) on [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure) webpages. However, a webpage I wanted to register right now doesn't use HTTPS. I am wondering if I am connected to my company VPN, is it safe to register on a webpage that uses just [HTTP](http://en.wikipedia.org/wiki/Hyp... | 2015/06/11 | [
"https://superuser.com/questions/926517",
"https://superuser.com",
"https://superuser.com/users/311621/"
] | Your company VPN will NOT encrypt data from your computer to the website you want to register yourself, only the data from your computer to your company's VPN-server.
HTTPS (if used correctly) makes sure data from your machine to the website is safe and that you are not the victim of a [man-in-the-middle attack](https... | I guess you're worried about the details you enter onto the page being sent unencrypted.
The company VPN will secure the connection between you and the VPN server. The VPN server will still have to open an unencrypted connection between itself and the HTTP page/server, instead of your computer opening the connection i... |
926,517 | I only register (make an account/login stuff) on [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure) webpages. However, a webpage I wanted to register right now doesn't use HTTPS. I am wondering if I am connected to my company VPN, is it safe to register on a webpage that uses just [HTTP](http://en.wikipedia.org/wiki/Hyp... | 2015/06/11 | [
"https://superuser.com/questions/926517",
"https://superuser.com",
"https://superuser.com/users/311621/"
] | Your company VPN will NOT encrypt data from your computer to the website you want to register yourself, only the data from your computer to your company's VPN-server.
HTTPS (if used correctly) makes sure data from your machine to the website is safe and that you are not the victim of a [man-in-the-middle attack](https... | No, using a VPN does not make VPN traffic safe. When going out of the VPN tunnel (between the VPN server and the HTTP server) the traffic is (in general) not encrypted:
```
Unencrypted HTTP here
|
v
[ HTTP ]<--------------->[ HTTP ]
[ TCP ]<--... |
926,517 | I only register (make an account/login stuff) on [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure) webpages. However, a webpage I wanted to register right now doesn't use HTTPS. I am wondering if I am connected to my company VPN, is it safe to register on a webpage that uses just [HTTP](http://en.wikipedia.org/wiki/Hyp... | 2015/06/11 | [
"https://superuser.com/questions/926517",
"https://superuser.com",
"https://superuser.com/users/311621/"
] | Your company VPN will NOT encrypt data from your computer to the website you want to register yourself, only the data from your computer to your company's VPN-server.
HTTPS (if used correctly) makes sure data from your machine to the website is safe and that you are not the victim of a [man-in-the-middle attack](https... | Seeing as my comments on other answers are getting pretty long I figured I'd separate it out:
**It is impossible to answer if a corporate VPN connection offers equivalent security compared to SSL to a web server without knowing the exact specifics of the connection in question, which the OP hasn't specified.**
Howeve... |
926,517 | I only register (make an account/login stuff) on [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure) webpages. However, a webpage I wanted to register right now doesn't use HTTPS. I am wondering if I am connected to my company VPN, is it safe to register on a webpage that uses just [HTTP](http://en.wikipedia.org/wiki/Hyp... | 2015/06/11 | [
"https://superuser.com/questions/926517",
"https://superuser.com",
"https://superuser.com/users/311621/"
] | I guess you're worried about the details you enter onto the page being sent unencrypted.
The company VPN will secure the connection between you and the VPN server. The VPN server will still have to open an unencrypted connection between itself and the HTTP page/server, instead of your computer opening the connection i... | No, using a VPN does not make VPN traffic safe. When going out of the VPN tunnel (between the VPN server and the HTTP server) the traffic is (in general) not encrypted:
```
Unencrypted HTTP here
|
v
[ HTTP ]<--------------->[ HTTP ]
[ TCP ]<--... |
926,517 | I only register (make an account/login stuff) on [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure) webpages. However, a webpage I wanted to register right now doesn't use HTTPS. I am wondering if I am connected to my company VPN, is it safe to register on a webpage that uses just [HTTP](http://en.wikipedia.org/wiki/Hyp... | 2015/06/11 | [
"https://superuser.com/questions/926517",
"https://superuser.com",
"https://superuser.com/users/311621/"
] | I guess you're worried about the details you enter onto the page being sent unencrypted.
The company VPN will secure the connection between you and the VPN server. The VPN server will still have to open an unencrypted connection between itself and the HTTP page/server, instead of your computer opening the connection i... | Seeing as my comments on other answers are getting pretty long I figured I'd separate it out:
**It is impossible to answer if a corporate VPN connection offers equivalent security compared to SSL to a web server without knowing the exact specifics of the connection in question, which the OP hasn't specified.**
Howeve... |
926,517 | I only register (make an account/login stuff) on [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure) webpages. However, a webpage I wanted to register right now doesn't use HTTPS. I am wondering if I am connected to my company VPN, is it safe to register on a webpage that uses just [HTTP](http://en.wikipedia.org/wiki/Hyp... | 2015/06/11 | [
"https://superuser.com/questions/926517",
"https://superuser.com",
"https://superuser.com/users/311621/"
] | Seeing as my comments on other answers are getting pretty long I figured I'd separate it out:
**It is impossible to answer if a corporate VPN connection offers equivalent security compared to SSL to a web server without knowing the exact specifics of the connection in question, which the OP hasn't specified.**
Howeve... | No, using a VPN does not make VPN traffic safe. When going out of the VPN tunnel (between the VPN server and the HTTP server) the traffic is (in general) not encrypted:
```
Unencrypted HTTP here
|
v
[ HTTP ]<--------------->[ HTTP ]
[ TCP ]<--... |
9,202 | I have a Sam Coupé and the last time I turn it on, i noticed a smell of components overheating.
After opening the power supply I came to the conclusion that is the resistance R1 (50ºc with IR thermometer).
I took the power supply to two technicians who measured the values in the components and the final output. Both ... | 2019/02/15 | [
"https://retrocomputing.stackexchange.com/questions/9202",
"https://retrocomputing.stackexchange.com",
"https://retrocomputing.stackexchange.com/users/11959/"
] | 50 ºC is nothing for a 4 W power resistor, so the 'overheating' smell was probably coming from something else.
As this power supply has a single-sided pcb (tracks on the bottom side only) I would examine all the joints and resolder any that look cracked or burnt. You might also consider testing the electrolytic capaci... | The "overheating" smell might emerge from the dust accreted on the heating components, if the device was off for a long time. So you could try to clean the dust off the PCB and components to get rid of the smell. |
44,666,553 | If I start a new project in .net 4.5 and hit manage nuget packages, search for ajax, then hit install for ajax unobtrusive. I can then go into my cshtml file and type @Ajax.\_\_\_ e.g. @Ajax.beginForm
If I create a new project with Dot Net Core... I cannot, where instead it gives me the useless error:
"The name 'Ajax... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44666553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/297201/"
] | While the `Ajax.BeginForm()` methods do not work, the actual unobtrusive Ajax html does. The C# methods just help generate the Html form tags. Forgive me in thse syntax is wrong, this is from memory, but you get the idea
```
@using (Ajax.BeginForm("EmployeeMaster", "Home", new AjaxOptions { HttpMethod = "POST", Update... | What is the equlivalent of OnSuccess
```
@using (Ajax.BeginForm("EmployeeMaster", "Home", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "divEmp", OnSuccess="ShowMessage" }))
{
//form content
}
``` |
130,233 | I started using subversion for one of my projects and it would be absolutely amazing if I could just export the latest version from the repository on my production server by for example running a php or perl script.
The production site is hosted with a shared hosting provider who doesn't allow shell access or for exam... | 2008/09/24 | [
"https://Stackoverflow.com/questions/130233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5005/"
] | As far as I know there is no SVN client fully written in PHP or Perl. SO without exec you're out of luck.
Workarounds:
* Depending on your own OS and what methods you have to access your web space you might be able to mount the web space in your local file system and just use your system's SVN client for checking ou... | SVN supports access over WebDAV (i.e. HTTPS). This means for simple read access you don't actually need an SVN client to access an SVN repository. You can even use a web browser, or in your case any PHP function that accepts a URL as its argument. SVN has to be set up on the server side to work with apache, for more in... |
130,233 | I started using subversion for one of my projects and it would be absolutely amazing if I could just export the latest version from the repository on my production server by for example running a php or perl script.
The production site is hosted with a shared hosting provider who doesn't allow shell access or for exam... | 2008/09/24 | [
"https://Stackoverflow.com/questions/130233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5005/"
] | As far as I know there is no SVN client fully written in PHP or Perl. SO without exec you're out of luck.
Workarounds:
* Depending on your own OS and what methods you have to access your web space you might be able to mount the web space in your local file system and just use your system's SVN client for checking ou... | Have a look on this:
<http://www.randomsequence.com/articles/svn-backup-script/>
Of course, you still need exec for that, but as said it won't be difficult to code something in PHP that runs an http call to your svn server.
Or else, something like:
palaniraja.wordpress.com/2008/09/20/svn-export-only-updated-files-b... |
57,262,974 | How can I track a yellow object in python using opencv? And, if possible, how can I get the position of the object?
I've tried using the following method but i can't figure out how to lower and upper ranges work.
```
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while True:
screen = np.array(ImageGrab... | 2019/07/30 | [
"https://Stackoverflow.com/questions/57262974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11731680/"
] | You can convert the image to HSV then use color thresholding. Using this example image
[](https://i.stack.imgur.com/NecuP.jpg)
With lower/upper ranges of
```
lower = np.array([22, 93, 0])
upper = np.array([45, 255, 255])
```
We can isolate yellow
... | The lower and upper value is always depends on the range you want to choose. There is no hard and fast rule that it should be in this range for a particular color. because it might vary even because of the lighting conditions.
With respect to your tracking, I would recommend you to follow this tutorial.
<https://ww... |
5,382,438 | I need a login to let 10 students to view educational material. Simple is good.
Perhaps it just redirects to a page if student logs in correctly. **Can you send me a link or example, or best tutorial?**
I was told JavaScript alone doesn't work, so the next simplest thing is preferred.
If there's an example where I... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5382438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/643573/"
] | I used this when I was learning to do secure logon using PHP.
<http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script/1/>
Found it quite helpful. | It depends on exactly what you're trying to do. If you want a pure-JS login system, you could do something fairly simple like XOR'ing a redirect page with a password, storing that in the page and then XOR'ing it again when they type in a password.
If you want an actual login-system, you need a back-end running some se... |
5,382,438 | I need a login to let 10 students to view educational material. Simple is good.
Perhaps it just redirects to a page if student logs in correctly. **Can you send me a link or example, or best tutorial?**
I was told JavaScript alone doesn't work, so the next simplest thing is preferred.
If there's an example where I... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5382438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/643573/"
] | You could possibly "do" it with JavaScript if you did some kind of AJAX function which called a php page, and then returned your value. This could work, and it's how a lot of sites do their logins actually. So, your client wouldn't have to rename their site, and you could just set up an array of logins on the php page.... | It depends on exactly what you're trying to do. If you want a pure-JS login system, you could do something fairly simple like XOR'ing a redirect page with a password, storing that in the page and then XOR'ing it again when they type in a password.
If you want an actual login-system, you need a back-end running some se... |
5,382,438 | I need a login to let 10 students to view educational material. Simple is good.
Perhaps it just redirects to a page if student logs in correctly. **Can you send me a link or example, or best tutorial?**
I was told JavaScript alone doesn't work, so the next simplest thing is preferred.
If there's an example where I... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5382438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/643573/"
] | Simple...
Create a file called functions and insert the following:
```
session_start();
$_GLOBALS['users'] = array(
//'username' => 'password'
'robert' => 'my_pass'
);
function isAuthed()
{
if(empty($_SESSION['logged_in']))
{
if(!empty($_REQUEST['username']) || !empty($_REQUEST['password']))... | It depends on exactly what you're trying to do. If you want a pure-JS login system, you could do something fairly simple like XOR'ing a redirect page with a password, storing that in the page and then XOR'ing it again when they type in a password.
If you want an actual login-system, you need a back-end running some se... |
61,816,693 | I am new to c++
I tried to create a simple calculator.
I am not sure why but when I run this code, it prints weird results, for example: 15 \* 5 = 753
```
int a;
int b;
char param;
printf("Enter Two numbers:\n");
scanf_s("%d %d", &a, &b);
printf("%d %d\n", a, b);
... | 2020/05/15 | [
"https://Stackoverflow.com/questions/61816693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13353615/"
] | There is no break between cases which explain that your example enter in case '\*' print 75 (15 \* 5) as there is no break continue to '/' and print 3 (15 / 5). And that's what you got 753.
```
switch (param)
{
case ('+'):
result = a + b;
printf("%d", result);
break;
case ('-'):
result = a - b;
pri... | Remember to [include `break;` statement](https://beginnersbook.com/2017/08/cpp-switch-case/) after each `case`
```
int a;
int b;
char param;
printf("Enter Two numbers:\n");
scanf_s("%d %d", &a, &b);
printf("%d %d\n", a, b);
printf("Enter mathematical operator *-/+\n");
int result;
s... |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | You have quite a number of options:
**cygwin**
Install [cygwin](http://www.cygwin.com/). It will give you a bash.
**mingw**
The [minimal GNU for windows](http://www.mingw.org/). Comes with set of commands, compilers. This came with my Git on Windows and now the default shell for small scripts
**VM, such as Virtua... | There is cygwin , that's a linux console for windows.. so you can execute all the linux command with it. |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | Install Cygwin to execute the commands. However you can use NotePad++ as editor which has native windows binaries.
<http://www.cygwin.com/>
<http://notepad-plus-plus.org/> | I had a similar problem.
I like both Linux and Windows, and I am working on both systems, but for programming (and generally, for text editing) I use Windows, for different reasons. For example, I write C/C++ code on Windows, using the Windows DevC++ IDE, then I can compile this project on Linux, by sharing the files o... |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | You have quite a number of options:
**cygwin**
Install [cygwin](http://www.cygwin.com/). It will give you a bash.
**mingw**
The [minimal GNU for windows](http://www.mingw.org/). Comes with set of commands, compilers. This came with my Git on Windows and now the default shell for small scripts
**VM, such as Virtua... | Install Cygwin to execute the commands. However you can use NotePad++ as editor which has native windows binaries.
<http://www.cygwin.com/>
<http://notepad-plus-plus.org/> |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | If you want to use a simple environment emulating all Linux environment as alternative to cygwin (more lightweight) you can try [mingw](http://www.mingw.org/) and you can use notepad++ or emacs or vim to provide some syntax highlight on sh scripts. | Install Cygwin to execute the commands. However you can use NotePad++ as editor which has native windows binaries.
<http://www.cygwin.com/>
<http://notepad-plus-plus.org/> |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | I prefer [Gow](https://github.com/bmatzelle/gow/wiki) (Gnu on Windows) over Cygwin. Both will give you bash on Windows, but Cygwin has unnatural conventions for filesystem access (`/cygdive/c/some/path` instead of `c:\some\path`).
The native windows command terminal is pretty lame, take a look at [Conemu](https://cone... | Install Cygwin to execute the commands. However you can use NotePad++ as editor which has native windows binaries.
<http://www.cygwin.com/>
<http://notepad-plus-plus.org/> |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | You have quite a number of options:
**cygwin**
Install [cygwin](http://www.cygwin.com/). It will give you a bash.
**mingw**
The [minimal GNU for windows](http://www.mingw.org/). Comes with set of commands, compilers. This came with my Git on Windows and now the default shell for small scripts
**VM, such as Virtua... | If you want to use a simple environment emulating all Linux environment as alternative to cygwin (more lightweight) you can try [mingw](http://www.mingw.org/) and you can use notepad++ or emacs or vim to provide some syntax highlight on sh scripts. |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | You have quite a number of options:
**cygwin**
Install [cygwin](http://www.cygwin.com/). It will give you a bash.
**mingw**
The [minimal GNU for windows](http://www.mingw.org/). Comes with set of commands, compilers. This came with my Git on Windows and now the default shell for small scripts
**VM, such as Virtua... | Everyone has said to go full Linux or use various mocks.
Cloud9.io is a good option if you don't need that much.
You can set up a "workspace" which can be accessed online, lets you write in literally any language similar to np++, but the best part is, it's an online Linux, so you have a terminal, with all your shell ... |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | The Bash shell is coming to Windows 10 in the upcoming Anniversary Update (Redstone).
The Bash shell is coming to Windows. Yes, the real Bash is coming to Windows, said Microsoft's Kevin Gallo at Build 2016 keynote. This is not a VM [Virtual Machine]. This is not cross-compiled tools. This is native."
Here's the step... | There is cygwin , that's a linux console for windows.. so you can execute all the linux command with it. |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | For Eclipse Luna Should use this one old version fails on UI error
```
Help > Install New Software… > Add…
```
Name: ShellEd
Location: <http://sourceforge.net/projects/shelled/files/shelled/update/> | I had a similar problem.
I like both Linux and Windows, and I am working on both systems, but for programming (and generally, for text editing) I use Windows, for different reasons. For example, I write C/C++ code on Windows, using the Windows DevC++ IDE, then I can compile this project on Linux, by sharing the files o... |
12,293,503 | I was just thinking that in a large web application where tens of connections are made to database for every client using the application, there is a possibility that very few of the connections are gone unclosed. *Though it is strictly up to us that we must close all connections explicitly* but, you know, there may be... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12293503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343275/"
] | Since you need to write linux shell scripts, you are learning Linux. So you should install Linux on your machine (preferably on its own partition and boot from it, otherwise in a VM).
Using `cygwin` or whatever imitation of Linux shell is not using Linux. You'll learn a lot more by installing and using Linux (and by ... | There is cygwin , that's a linux console for windows.. so you can execute all the linux command with it. |
21,182,948 | I have a php/apache page that takes a long time to load. Basically, it looks like this:
```
<?php
doHeavyStuff_1();
doHeavyStuff_2();
doHeavyStuff_3();
printResults();
?>
```
It happens from time to time that the client disconnects in the middle of the processing, say, between step1 and step2... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21182948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/989121/"
] | Look into using the [connection\_aborted](http://php.net/manual/en/function.connection-aborted.php) function. | Normally PHP (as an apache module) should stop automatically if the user disconnects. No work is necessary.
Just if you are interested: if you want PHP to continue processing there is the function [`ignore_user_abort()`](http://www.php.net/manual/en/function.ignore-user-abort.php). You should start to read the manual ... |
53,136,376 | I am trying to make some buttons to control some things in my canvas. I want them to appear in the right side of canvas, so i use css to style and move them. I also made a timer which stars when pressing the green button START and stops when pressing FINISH. My problem is that the first buttons do not work or pressed w... | 2018/11/03 | [
"https://Stackoverflow.com/questions/53136376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9958802/"
] | try adding z-index to button wrapper and a position relative for canvas
`.both {z-index:99;}
canvas{position:relative;z-index:10;}` | Your code isn't working because you're trying to set a timeout on a string, not a function:
```
function timedCount() {
var elapsedTime = Date.now() - startTime;
document.getElementById("timer").innerHTML = (elapsedTime / 1000).toFixed(3);
t = setTimeout("timedCount()", 100);
}
```
Change this line:
```
t = s... |
14,775,587 | I have a number of projects which are joined into a solution. Every project has it's own directory structure, and csproj files are located on diferrent level of folder structure.
Every csproj has OutputPath property specified. OutputPath - is a relative path and it varies from project to project in such a way so all pr... | 2013/02/08 | [
"https://Stackoverflow.com/questions/14775587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354554/"
] | Well, I was able to find out what was causing this. That was custom .targets file, which was inferring SolutionDir property at the start of any msbuild.
I did find out that by using MSBuild Explorer. The tool proved to be very useful in my case - I was not aware of third party .target files on my system. | From [Msbuild Import Element description](http://msdn.microsoft.com/en-us/library/92x05xfs.aspx)
>
> Relative paths in imported projects are interpreted relative to the
> directory of the importing project. Therefore, if a project file is
> imported into several project files in different locations, the
> relative... |
20,819,876 | I have a MVC application and inject my repositories to my controller what works properly.
Additionally I have a Webservice in my solution which uses exactly the same repositories but when my Webservice is called my repository properties are null.
I register my repositories the following way:
```
container.Register(Cl... | 2013/12/28 | [
"https://Stackoverflow.com/questions/20819876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1845959/"
] | The backbutton text is set in the navigation view before displaying the detailed view.
```
Ext.define('mimo.view.PostPanel', {
extend: 'Ext.NavigationView',
```
`xtype: 'postPanel',
requires: [
'mimo.view.post.PostList'
],
config: {
title: 'Blog',
iconCls: 'home',
// set the back button text he... | You are extending Ext.Panel. Ext.Panel does not accept the navigationBar configuration, you probably want to use Ext.navigation.View. Then on that view you can pass the defaultBackButtonText property. Otherwise if you want to customize the button further, inside of navigationBar object you want to specify a button obje... |
56,352,970 | I am using a 3rd-party library it will hide iOS status bar when calling. After that, I can't show the status bar back on screen.
I can control status bar by `StatusBar` component in React Native normally.
However, I tried to call a iOS library <https://www.dynamsoft.com/Products/dynamsoft-webcam-sdk.aspx> it will hid... | 2019/05/29 | [
"https://Stackoverflow.com/questions/56352970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7897319/"
] | Use [`np.isin`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.isin.html) -
```
In [8]: b[np.isin(b[:,0],a)]
Out[8]:
array([[ 10, 8, 52, 30, 15],
[ 11, 81, 152, 54, 112],
[ 13, 82, 84, 63, 24]])
```
With sorted `a`, we can also use [`np.searchsorted`](https://docs.scipy.org/doc/... | Use list comprehension:
```
c = [l for l in b if l[0] in a]
```
Output:
```
[[10, 8, 52, 30, 15], [11, 81, 152, 54, 112], [13, 82, 84, 63, 24]]
```
If your `list` or `array`s are considerably large, using `numpy.isin` can be significantly faster:
```
b[np.isin(b[:, 0], a), :]
```
Benchmark:
```
a = [10, 11, 1... |
56,352,970 | I am using a 3rd-party library it will hide iOS status bar when calling. After that, I can't show the status bar back on screen.
I can control status bar by `StatusBar` component in React Native normally.
However, I tried to call a iOS library <https://www.dynamsoft.com/Products/dynamsoft-webcam-sdk.aspx> it will hid... | 2019/05/29 | [
"https://Stackoverflow.com/questions/56352970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7897319/"
] | Use list comprehension:
```
c = [l for l in b if l[0] in a]
```
Output:
```
[[10, 8, 52, 30, 15], [11, 81, 152, 54, 112], [13, 82, 84, 63, 24]]
```
If your `list` or `array`s are considerably large, using `numpy.isin` can be significantly faster:
```
b[np.isin(b[:, 0], a), :]
```
Benchmark:
```
a = [10, 11, 1... | You are doing it reverse. It is better to loop through the elements of b array and check if it is present in a. If yes then print that element of b. See the answer below.
```
a = [10, 11, 12, 13, 14]
b = [[9, 23, 45, 67, 56, 23, 54], [10, 8, 52, 30, 15, 47, 109], [11, 81, 152, 54, 112, 78, 167], [13, 82, 84, 63, 24, 2... |
56,352,970 | I am using a 3rd-party library it will hide iOS status bar when calling. After that, I can't show the status bar back on screen.
I can control status bar by `StatusBar` component in React Native normally.
However, I tried to call a iOS library <https://www.dynamsoft.com/Products/dynamsoft-webcam-sdk.aspx> it will hid... | 2019/05/29 | [
"https://Stackoverflow.com/questions/56352970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7897319/"
] | Use [`np.isin`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.isin.html) -
```
In [8]: b[np.isin(b[:,0],a)]
Out[8]:
array([[ 10, 8, 52, 30, 15],
[ 11, 81, 152, 54, 112],
[ 13, 82, 84, 63, 24]])
```
With sorted `a`, we can also use [`np.searchsorted`](https://docs.scipy.org/doc/... | You are doing it reverse. It is better to loop through the elements of b array and check if it is present in a. If yes then print that element of b. See the answer below.
```
a = [10, 11, 12, 13, 14]
b = [[9, 23, 45, 67, 56, 23, 54], [10, 8, 52, 30, 15, 47, 109], [11, 81, 152, 54, 112, 78, 167], [13, 82, 84, 63, 24, 2... |
9,291,411 | Is it possible for a User control to receive an update whenever a user control changes value? I have a form with a save button and I want to activate it as soon as a value changes.
Currently I am ding this using my View but I have to add a call to every property when it changes. This is OK but for edit boxes it means ... | 2012/02/15 | [
"https://Stackoverflow.com/questions/9291411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1145533/"
] | There is no such thing as this working reliably with a single script: You have little control over buffering on the server side - `flush()` might or might not work as expected, depending on wether you use `mod_php`, `CGI`, `FCGI` or whatever, and you have absolutely no control over buffering at the client (IE is notori... | Will something like the following not work?
```
$output = shell_exec($theScript);
file_put_contents($someFile, $output, FILE_APPEND);
```
Or have I got the wrong end of the stick? |
1,888 | Hydrogen is the lightest element, so it's cable of lifting the most weight in out atmosphere (probably not the best terminology there, but you get the picture)
Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
Would a higher or lower density of hydrogen in a ballon lift more?
If you cou... | 2010/12/13 | [
"https://physics.stackexchange.com/questions/1888",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/4/"
] | >
> Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
>
>
>
Yes. Though I suppose the fire danger goes up, and you certainly can't use a propane burner to warm it...
>
> Would a higher or lower density of hydrogen in a ballon lift more?
>
>
>
Lower density always means highe... | [dmckee's answer](https://physics.stackexchange.com/questions/1888/balloons-and-lifting-gases/1889#1889) is a great not-too-technical description of buoyancy. Read that first. But in case you're interested, I thought I would go into some more detail.
The buoyant force on a submerged object (e.g. a balloon submerged in... |
1,888 | Hydrogen is the lightest element, so it's cable of lifting the most weight in out atmosphere (probably not the best terminology there, but you get the picture)
Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
Would a higher or lower density of hydrogen in a ballon lift more?
If you cou... | 2010/12/13 | [
"https://physics.stackexchange.com/questions/1888",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/4/"
] | >
> Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
>
>
>
Yes. Though I suppose the fire danger goes up, and you certainly can't use a propane burner to warm it...
>
> Would a higher or lower density of hydrogen in a ballon lift more?
>
>
>
Lower density always means highe... | Approximate mean atomic mass of air: 29
Approximate mean atomic mass of hydrogen: 2
So with both gases at the same temperature and pressure, you are getting $\frac{27}{29}=93\%$ of the theoretical lifting capacity.
You would have to heat the hydrogen to about 200 C in order to get to 95% efficiency. It would be ... |
1,888 | Hydrogen is the lightest element, so it's cable of lifting the most weight in out atmosphere (probably not the best terminology there, but you get the picture)
Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
Would a higher or lower density of hydrogen in a ballon lift more?
If you cou... | 2010/12/13 | [
"https://physics.stackexchange.com/questions/1888",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/4/"
] | >
> Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
>
>
>
Yes. Though I suppose the fire danger goes up, and you certainly can't use a propane burner to warm it...
>
> Would a higher or lower density of hydrogen in a ballon lift more?
>
>
>
Lower density always means highe... | A vacuum balloon is a possibility, but I doubt it can provide more lift than a hydrogen balloon: you need a rigid shell to prevent implosion of the vacuum balloon, and my feeling is the shell will be too heavy. However, while vacuum balloons cannot compete on lift, they can have better altitude control: you can bleed a... |
1,888 | Hydrogen is the lightest element, so it's cable of lifting the most weight in out atmosphere (probably not the best terminology there, but you get the picture)
Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
Would a higher or lower density of hydrogen in a ballon lift more?
If you cou... | 2010/12/13 | [
"https://physics.stackexchange.com/questions/1888",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/4/"
] | [dmckee's answer](https://physics.stackexchange.com/questions/1888/balloons-and-lifting-gases/1889#1889) is a great not-too-technical description of buoyancy. Read that first. But in case you're interested, I thought I would go into some more detail.
The buoyant force on a submerged object (e.g. a balloon submerged in... | Approximate mean atomic mass of air: 29
Approximate mean atomic mass of hydrogen: 2
So with both gases at the same temperature and pressure, you are getting $\frac{27}{29}=93\%$ of the theoretical lifting capacity.
You would have to heat the hydrogen to about 200 C in order to get to 95% efficiency. It would be ... |
1,888 | Hydrogen is the lightest element, so it's cable of lifting the most weight in out atmosphere (probably not the best terminology there, but you get the picture)
Would hot hydrogen (in the same sense as hot air) be able to lift even more mass?
Would a higher or lower density of hydrogen in a ballon lift more?
If you cou... | 2010/12/13 | [
"https://physics.stackexchange.com/questions/1888",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/4/"
] | [dmckee's answer](https://physics.stackexchange.com/questions/1888/balloons-and-lifting-gases/1889#1889) is a great not-too-technical description of buoyancy. Read that first. But in case you're interested, I thought I would go into some more detail.
The buoyant force on a submerged object (e.g. a balloon submerged in... | A vacuum balloon is a possibility, but I doubt it can provide more lift than a hydrogen balloon: you need a rigid shell to prevent implosion of the vacuum balloon, and my feeling is the shell will be too heavy. However, while vacuum balloons cannot compete on lift, they can have better altitude control: you can bleed a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.