qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
67,463,541 | I was just trying to get a clearer understanding of what exactly multiple cores are being used for, and what the difference is between multiple cores and multiple CPUs.
I was trying to understand if having multiple cores is just to enable instruction-level parallelism within a given CPU, or if the multiple cores withi... | 2021/05/10 | [
"https://Stackoverflow.com/questions/67463541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4101137/"
] | ILP is purely within each physical core separately.
cross-site duplicate: [How does a single thread run on multiple cores?](https://softwareengineering.stackexchange.com/questions/349972/how-does-a-single-thread-run-on-multiple-cores/350024#350024)
(It doesn't - each core has multiple execution units and a wide f... | >
> what the difference is between multiple cores and multiple CPUs
>
>
>
Mulitple cores are on one piece of silicon and mulitple CPUs are on different pieces of silicon. That's pretty much the only difference between multiple cores and multiple CPUs.
Generally the term "core" is more precise these days -- it mea... |
2,792,694 | I am working on game. I want to highlight a spot on the screen when something happens.
I created a class to do this for me, and found a bit of code to draw the rectangle:
```
static private Texture2D CreateRectangle(int width, int height, Color colori)
{
Texture2D rectangleTexture = new Texture2D(game.GraphicsDev... | 2010/05/08 | [
"https://Stackoverflow.com/questions/2792694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267631/"
] | The [SafeArea demo](http://creators.xna.com/en-US/sample/safearea) on the XNA Creators Club site has code to do specifically that.
You don't have to create the Texture every frame, just in `LoadContent`. A very stripped down version of the code from that demo:
```
public class RectangleOverlay : DrawableGameComponent... | This is probably not the best solution, but you should be able to use a 1x1 pixel texture stretched to fit the rectangle. |
2,792,694 | I am working on game. I want to highlight a spot on the screen when something happens.
I created a class to do this for me, and found a bit of code to draw the rectangle:
```
static private Texture2D CreateRectangle(int width, int height, Color colori)
{
Texture2D rectangleTexture = new Texture2D(game.GraphicsDev... | 2010/05/08 | [
"https://Stackoverflow.com/questions/2792694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267631/"
] | This is how I did it. It is probably not the fastest or the best solution, but it works.
```
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Engine
{
/// <summary>
/// An extended version of the SpriteBatch class that supports line and
/// rectangle drawing.
... | This is probably not the best solution, but you should be able to use a 1x1 pixel texture stretched to fit the rectangle. |
2,792,694 | I am working on game. I want to highlight a spot on the screen when something happens.
I created a class to do this for me, and found a bit of code to draw the rectangle:
```
static private Texture2D CreateRectangle(int width, int height, Color colori)
{
Texture2D rectangleTexture = new Texture2D(game.GraphicsDev... | 2010/05/08 | [
"https://Stackoverflow.com/questions/2792694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267631/"
] | The [SafeArea demo](http://creators.xna.com/en-US/sample/safearea) on the XNA Creators Club site has code to do specifically that.
You don't have to create the Texture every frame, just in `LoadContent`. A very stripped down version of the code from that demo:
```
public class RectangleOverlay : DrawableGameComponent... | This is how I did it. It is probably not the fastest or the best solution, but it works.
```
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Engine
{
/// <summary>
/// An extended version of the SpriteBatch class that supports line and
/// rectangle drawing.
... |
124,920 | The organisation of Starfleet is [somewhere between military and civilian](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organization): Captain Picard and Gene Roddenberry both describe it as being non-military, but in some ways it has a very militarised structure, with military-lo... | 2016/04/12 | [
"https://scifi.stackexchange.com/questions/124920",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/31394/"
] | Starfleet personnel don't salute each other, even on formal occasions.
----------------------------------------------------------------------
Although Starfleet can be characterised as maintaining *[certain military traditions](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organiz... | ### Infrequently. Despite what most people think about the military, as an former military member, we don't actually spend a whole lot of time saluting each other.
In boot camp, we are trained and conditioned to salute anything that moves. The expression was: "Recruit, if it moves, salute it. If it doesn't, paint it."... |
124,920 | The organisation of Starfleet is [somewhere between military and civilian](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organization): Captain Picard and Gene Roddenberry both describe it as being non-military, but in some ways it has a very militarised structure, with military-lo... | 2016/04/12 | [
"https://scifi.stackexchange.com/questions/124920",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/31394/"
] | Starfleet personnel don't salute each other, even on formal occasions.
----------------------------------------------------------------------
Although Starfleet can be characterised as maintaining *[certain military traditions](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organiz... | Somewhere on my large shelf of books is one from approximately the time of The Motion Picture which has a lot of cast and writer interviews about the show. It includes a section where Gene Roddenberry is explaining that the culture of Starfleet sees all individuals as social equals, even if they are of different ranks ... |
124,920 | The organisation of Starfleet is [somewhere between military and civilian](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organization): Captain Picard and Gene Roddenberry both describe it as being non-military, but in some ways it has a very militarised structure, with military-lo... | 2016/04/12 | [
"https://scifi.stackexchange.com/questions/124920",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/31394/"
] | Starfleet personnel don't salute each other, even on formal occasions.
----------------------------------------------------------------------
Although Starfleet can be characterised as maintaining *[certain military traditions](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organiz... | In the U.S. services of naval tradition (USMC, Navy, Coast Guard) you do not (except for very specific circumstances) salute indoors or while actively in the field, and never without a cover (hat) on.
The nature of Star Trek means that 99.9% of the time they will be indoors or in the field (since when traveling about ... |
124,920 | The organisation of Starfleet is [somewhere between military and civilian](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organization): Captain Picard and Gene Roddenberry both describe it as being non-military, but in some ways it has a very militarised structure, with military-lo... | 2016/04/12 | [
"https://scifi.stackexchange.com/questions/124920",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/31394/"
] | ### Infrequently. Despite what most people think about the military, as an former military member, we don't actually spend a whole lot of time saluting each other.
In boot camp, we are trained and conditioned to salute anything that moves. The expression was: "Recruit, if it moves, salute it. If it doesn't, paint it."... | Somewhere on my large shelf of books is one from approximately the time of The Motion Picture which has a lot of cast and writer interviews about the show. It includes a section where Gene Roddenberry is explaining that the culture of Starfleet sees all individuals as social equals, even if they are of different ranks ... |
124,920 | The organisation of Starfleet is [somewhere between military and civilian](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organization): Captain Picard and Gene Roddenberry both describe it as being non-military, but in some ways it has a very militarised structure, with military-lo... | 2016/04/12 | [
"https://scifi.stackexchange.com/questions/124920",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/31394/"
] | ### Infrequently. Despite what most people think about the military, as an former military member, we don't actually spend a whole lot of time saluting each other.
In boot camp, we are trained and conditioned to salute anything that moves. The expression was: "Recruit, if it moves, salute it. If it doesn't, paint it."... | In the U.S. services of naval tradition (USMC, Navy, Coast Guard) you do not (except for very specific circumstances) salute indoors or while actively in the field, and never without a cover (hat) on.
The nature of Star Trek means that 99.9% of the time they will be indoors or in the field (since when traveling about ... |
124,920 | The organisation of Starfleet is [somewhere between military and civilian](https://scifi.stackexchange.com/questions/54154/is-starfleet-a-military-or-civilian-organization): Captain Picard and Gene Roddenberry both describe it as being non-military, but in some ways it has a very militarised structure, with military-lo... | 2016/04/12 | [
"https://scifi.stackexchange.com/questions/124920",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/31394/"
] | Somewhere on my large shelf of books is one from approximately the time of The Motion Picture which has a lot of cast and writer interviews about the show. It includes a section where Gene Roddenberry is explaining that the culture of Starfleet sees all individuals as social equals, even if they are of different ranks ... | In the U.S. services of naval tradition (USMC, Navy, Coast Guard) you do not (except for very specific circumstances) salute indoors or while actively in the field, and never without a cover (hat) on.
The nature of Star Trek means that 99.9% of the time they will be indoors or in the field (since when traveling about ... |
2,636,366 | Suppose that $a$ and $b$ are positive integers such that $ab$ divides $a + b$.
Prove that $a = b$, then prove that $a$ is either $1$ or $2$.
I was thinking using the theorem:
>
> If $n|a$ and $n|b$,then $n|(ax+by)$ for any $x,y\in \mathbb Z$.
>
>
>
Then I can derive that $ab$ divides $a$ and $b$. I could not go... | 2018/02/05 | [
"https://math.stackexchange.com/questions/2636366",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/528207/"
] | Your supposition is mistaken; $\wp(X\times X)$ is not the same as $\wp(X)\times\wp(X)$.
If you want actual equality as sets, then, as Rahul as mentioned, the elements of $\wp(X\times X)$ are sets of pairs of elements of $X$, while the elements of $\wp(X)\times\wp(X)$ are pairs of sets of elements of $X$.
If you just ... | Let (a,b) be any point in X×X.
Then {a}, {b} are open within X.
Thus {a}×{b} = {(a,b)} is open within in X×X.
Consequently, since every singleton in X×X is open, X×X is discrete. |
2,636,366 | Suppose that $a$ and $b$ are positive integers such that $ab$ divides $a + b$.
Prove that $a = b$, then prove that $a$ is either $1$ or $2$.
I was thinking using the theorem:
>
> If $n|a$ and $n|b$,then $n|(ax+by)$ for any $x,y\in \mathbb Z$.
>
>
>
Then I can derive that $ab$ divides $a$ and $b$. I could not go... | 2018/02/05 | [
"https://math.stackexchange.com/questions/2636366",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/528207/"
] | Careful: if $(X, \tau\_X)$ and $(Y, \tau\_Y)$ are topological spaces, then the product topology on $X \times Y$ is not $\tau\_X \times \tau\_Y$. Rather, it is the topology *generated by* $\tau\_X \times \tau\_Y$, by which I refer to the set $\{ U \times V \mid U \in \tau\_X,\ V \in \tau\_Y \}$, rather than the cartesia... | Let (a,b) be any point in X×X.
Then {a}, {b} are open within X.
Thus {a}×{b} = {(a,b)} is open within in X×X.
Consequently, since every singleton in X×X is open, X×X is discrete. |
2,636,366 | Suppose that $a$ and $b$ are positive integers such that $ab$ divides $a + b$.
Prove that $a = b$, then prove that $a$ is either $1$ or $2$.
I was thinking using the theorem:
>
> If $n|a$ and $n|b$,then $n|(ax+by)$ for any $x,y\in \mathbb Z$.
>
>
>
Then I can derive that $ab$ divides $a$ and $b$. I could not go... | 2018/02/05 | [
"https://math.stackexchange.com/questions/2636366",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/528207/"
] | Your supposition is mistaken; $\wp(X\times X)$ is not the same as $\wp(X)\times\wp(X)$.
If you want actual equality as sets, then, as Rahul as mentioned, the elements of $\wp(X\times X)$ are sets of pairs of elements of $X$, while the elements of $\wp(X)\times\wp(X)$ are pairs of sets of elements of $X$.
If you just ... | Careful: if $(X, \tau\_X)$ and $(Y, \tau\_Y)$ are topological spaces, then the product topology on $X \times Y$ is not $\tau\_X \times \tau\_Y$. Rather, it is the topology *generated by* $\tau\_X \times \tau\_Y$, by which I refer to the set $\{ U \times V \mid U \in \tau\_X,\ V \in \tau\_Y \}$, rather than the cartesia... |
68,143,181 | ```
int a[3]={1,2,3};
printf("%p\n", &a);
```
Array name is pointer constant. So that makes me think it is rvalue.
The & operator requires a lvalue.
The code above has no warnings or errors.
Can you give me an example of array name as lvalue? | 2021/06/26 | [
"https://Stackoverflow.com/questions/68143181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11308990/"
] | The [`datetime.datetime.astimezone()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.astimezone) method will return a `datetime` object with the same UTC time but in the local timezone. For your example times:
```
>>> dt_1 = datettime.fromisoformat(2021-06-25 15:00:08+00:00)
>>> dt_1.astimezone()
d... | You could use **pytz** library
```
from datetime import datetime
import pytz
dt_input = datetime.fromisoformat('2021-06-24 06:33:06-07:00')
print(dt_input) # prints datetime in input timezone
local_tz = pytz.timezone('Asia/Kolkata') #provide your timezone here
dt_local = dt_input.astimezone(local_tz)
print(dt_local... |
63,449,889 | I was wondering how can I change the table's width to minimum using HTML such that the TABLE displays as
>
> N
> A
> M
> E
>
> N
> A
> M
> E
> H
> E
>
> R
> E
>
>
>
>
This is the code
```
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>Name here</td>
</tr>
</table>
... | 2020/08/17 | [
"https://Stackoverflow.com/questions/63449889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10415786/"
] | ```
<table style="word-wrap: anywhere; max-width: 1px">
<tr>
<th>Name</th>
</tr>
<tr>
<td>Name here</td>
</tr>
</table>
``` | If you add spaces between each character it will work.
```html
<table width="1px">
<tr>
<th>N a m e</th>
</tr>
<tr>
<td>N a m e h e r e</td>
</tr>
</table>
``` |
63,449,889 | I was wondering how can I change the table's width to minimum using HTML such that the TABLE displays as
>
> N
> A
> M
> E
>
> N
> A
> M
> E
> H
> E
>
> R
> E
>
>
>
>
This is the code
```
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>Name here</td>
</tr>
</table>
... | 2020/08/17 | [
"https://Stackoverflow.com/questions/63449889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10415786/"
] | If you add spaces between each character it will work.
```html
<table width="1px">
<tr>
<th>N a m e</th>
</tr>
<tr>
<td>N a m e h e r e</td>
</tr>
</table>
``` | Try with in-line css at the table, or just a `style` at the start of the html. Having a css file would be much better tho. Just type `width: (value)` and put into the 'value' the one you want, you can try `min-width` or just 1px. Also what the friend above said. |
63,449,889 | I was wondering how can I change the table's width to minimum using HTML such that the TABLE displays as
>
> N
> A
> M
> E
>
> N
> A
> M
> E
> H
> E
>
> R
> E
>
>
>
>
This is the code
```
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>Name here</td>
</tr>
</table>
... | 2020/08/17 | [
"https://Stackoverflow.com/questions/63449889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10415786/"
] | ```
<table style="word-wrap: anywhere; max-width: 1px">
<tr>
<th>Name</th>
</tr>
<tr>
<td>Name here</td>
</tr>
</table>
``` | Try with in-line css at the table, or just a `style` at the start of the html. Having a css file would be much better tho. Just type `width: (value)` and put into the 'value' the one you want, you can try `min-width` or just 1px. Also what the friend above said. |
93,731 | Prelude:
I dumped a 5.2 GB database using the mysqldump command. I did this on an underpowered virtual server with only 512 MB of memory. It took about an hour. I'm now reloading that database on my desktop machine that has a dual core cpu and 2 GB of memory. The reload is on it's 9th hour and I don't know if it's even... | 2009/12/12 | [
"https://serverfault.com/questions/93731",
"https://serverfault.com",
"https://serverfault.com/users/47411/"
] | Since the transfer rates are the same, the output you provide says to me that the MD layer caches transactions and then writes them to the physical disk in larger chunks.
The slowness you're seeing with reloading the database is likely due to indexes, as you said. You can avoid this by just not having the indexes upda... | The transaction rate a given disk will support is a function of the track seek time. For SATA drives this is typically around 5-8ms, so I'd expect somewhere in the vicinity of 125-200 transactions per second.
You're seeing ~145 tps on each of the drives, so that seems pretty reasonable. |
93,731 | Prelude:
I dumped a 5.2 GB database using the mysqldump command. I did this on an underpowered virtual server with only 512 MB of memory. It took about an hour. I'm now reloading that database on my desktop machine that has a dual core cpu and 2 GB of memory. The reload is on it's 9th hour and I don't know if it's even... | 2009/12/12 | [
"https://serverfault.com/questions/93731",
"https://serverfault.com",
"https://serverfault.com/users/47411/"
] | That's a single iostat invocation, which does not provide meaningful data for "per second" values, only counters are useful - it can not calculate change per second from a single value, it needs to know two values and time between them.
To see real values, try something like :
```
iostat -d 1 2
```
The second output... | Since the transfer rates are the same, the output you provide says to me that the MD layer caches transactions and then writes them to the physical disk in larger chunks.
The slowness you're seeing with reloading the database is likely due to indexes, as you said. You can avoid this by just not having the indexes upda... |
93,731 | Prelude:
I dumped a 5.2 GB database using the mysqldump command. I did this on an underpowered virtual server with only 512 MB of memory. It took about an hour. I'm now reloading that database on my desktop machine that has a dual core cpu and 2 GB of memory. The reload is on it's 9th hour and I don't know if it's even... | 2009/12/12 | [
"https://serverfault.com/questions/93731",
"https://serverfault.com",
"https://serverfault.com/users/47411/"
] | That's a single iostat invocation, which does not provide meaningful data for "per second" values, only counters are useful - it can not calculate change per second from a single value, it needs to know two values and time between them.
To see real values, try something like :
```
iostat -d 1 2
```
The second output... | The transaction rate a given disk will support is a function of the track seek time. For SATA drives this is typically around 5-8ms, so I'd expect somewhere in the vicinity of 125-200 transactions per second.
You're seeing ~145 tps on each of the drives, so that seems pretty reasonable. |
9,773 | I'm looking for a good job and I came to know about vacancies in company dealing in capital market. Will my income be halal if I work in that company? | 2013/10/15 | [
"https://islam.stackexchange.com/questions/9773",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/3371/"
] | As far as i know, according to the view of Shia, it won't be Haram if there is not any negative or haram ponit in the different jobs. Hence apparently the mentioned job is not Haram.
(of course if u r sure that the essence of the mentioned occupation is not haram either. | Any company that is interest-based or deals with taking and giving interest, it is not allowed to work for that company. Even writing down or typing the interest transaction in computer is haram. Because the prophet has cursed the taker of interest, the giver of interest, and the man involved in writing down the intere... |
51,354,091 | I have a JSON object that contains strings of JSON at various levels in the JSON such as the one below that I want converted to as nested JSON.
Input:
```
{
"requestType": "POST",
"response": {
"size": 2,
"text": "{\"recordID\":1, \"title\":\"Hello\", \"content\":\"Lorem ipsum\"}"
},
"... | 2018/07/16 | [
"https://Stackoverflow.com/questions/51354091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3534227/"
] | If your jq has `walk` then you can simply write:
```
walk(if type=="string" then fromjson? // . else . end)
```
Otherwise, you can copy-and-paste the definition of `walk/1`, which can readily be found by googling `jq def walk`.
Roll your own
-------------
Alternatively:
```
def dej:
if type == "string" then fro... | Bash is not a good language for handling JSON data, best is to use a higher level language. Here is a sample implementation in Ruby 2.4 (for the `transform_values` method):
```
#!/usr/bin/env ruby
require 'json' ... |
21,099,852 | I am trying to enhance the performance of writing thousands of rows to a db using EF. I have found that the speed of SaveChanges() degrades over time within a single context, and disposing and recreating the context after n inserts can help this.
```
using(Context context = new Context())
{
for(int i = 0; i < numb... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21099852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3161282/"
] | Because identifiers inside of a `using` are read only, you can't just set it to a new object. I'd say the best option is to do exactly what you said you don't want to do and use a `try/finally` instead of a using:
```
Context context = null;
try
{
context = new Context();
for (int i = 0; i < numberOfLines; i+... | How's this:
```
const int ChunkSize = 100;
for(int i = 0; i < numberOfLines; i += ChunkSize)
{
using(Context context = new Context())
{
for(int j = i; j < i + ChunkSize && j < numberOfLines; j++)
{
// if needed, use j within this loop, not i
context.Collection.AddObject(... |
21,099,852 | I am trying to enhance the performance of writing thousands of rows to a db using EF. I have found that the speed of SaveChanges() degrades over time within a single context, and disposing and recreating the context after n inserts can help this.
```
using(Context context = new Context())
{
for(int i = 0; i < numb... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21099852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3161282/"
] | It sounds like you basically want to process a collection in batches. That's simple using [MoreLINQ](https://github.com/morelinq/MoreLINQ) ([also on NuGet](http://www.nuget.org/packages/morelinq)):
```
foreach (var batch in dataToUpload.Batch(100))
{
using (var context = new Context())
{
foreach (var i... | Because identifiers inside of a `using` are read only, you can't just set it to a new object. I'd say the best option is to do exactly what you said you don't want to do and use a `try/finally` instead of a using:
```
Context context = null;
try
{
context = new Context();
for (int i = 0; i < numberOfLines; i+... |
21,099,852 | I am trying to enhance the performance of writing thousands of rows to a db using EF. I have found that the speed of SaveChanges() degrades over time within a single context, and disposing and recreating the context after n inserts can help this.
```
using(Context context = new Context())
{
for(int i = 0; i < numb... | 2014/01/13 | [
"https://Stackoverflow.com/questions/21099852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3161282/"
] | It sounds like you basically want to process a collection in batches. That's simple using [MoreLINQ](https://github.com/morelinq/MoreLINQ) ([also on NuGet](http://www.nuget.org/packages/morelinq)):
```
foreach (var batch in dataToUpload.Batch(100))
{
using (var context = new Context())
{
foreach (var i... | How's this:
```
const int ChunkSize = 100;
for(int i = 0; i < numberOfLines; i += ChunkSize)
{
using(Context context = new Context())
{
for(int j = i; j < i + ChunkSize && j < numberOfLines; j++)
{
// if needed, use j within this loop, not i
context.Collection.AddObject(... |
252,765 | It's possible change flash settings on your computer at this URL:
<http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html>
However, given that Macromedia has no problems setting LSO cookies on your HDD that you cannot find, I am a little bit skeptical that the settings I've tweake... | 2011/03/03 | [
"https://superuser.com/questions/252765",
"https://superuser.com",
"https://superuser.com/users/41491/"
] | It seems like settings are stored under `~/.macromedia/Flash_Player`. Playing with the setting applet you linked changed files under `~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys`. | You can set (some?) settings in `/etc/adobe/mms.cfg`.
Here's a sample file:
```
#
# /etc/adobe/mms.cfg: Adobe Flash privacy and security settings
#
# For more details on the meaning of most of these options, please visit:
# http://www.adobe.com/devnet/flashplayer/articles/flash_player_admin_guide.html
#
# Lets you p... |
49,013,930 | I'm trying to write a program that draws shapes based on user input. I want it to print where each corner of the shape is based on using the `turtle.pos()` function, however I'm trying to get the printed output as so:
```
"The first corner is at: x, y, with a heading of: d."
```
Currently the print I'm using is
```... | 2018/02/27 | [
"https://Stackoverflow.com/questions/49013930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9419867/"
] | Figured it out- somehow I forgot about
```
turtle.xcor()/turtle.ycor()
```
And was able to print those as integers instead. | ```
print("The first corner is at:", turtle.position()[0], "with a heading of:"
turtle.heading() + ".")
``` |
25,928,924 | I am newbie in jtable. i want to create a jtable in following format as attached.
Please help me.
thanks in advance.
 | 2014/09/19 | [
"https://Stackoverflow.com/questions/25928924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1873106/"
] | You need TreeTable component. Out of box swing does not provide such a component. But there are a number of libraries having it. For example, swingx(<https://swingx.java.net/>) - JXTreeTable component.
As an alternative you may implement your own component. Just search the Internet 'swing treetable component' | As your image suggests, the component is generally referred to as a Property Editor. It's quite useful but Java Swing doesn't provide anything out of the box.
It's actually quite hard to do reliably, especially to support the various data types and not to mention the grouping aspect.
The speediest way of getting acce... |
36,152,206 | My insert procedure is working fine the way i want. But update is not working with scope identity.
```
SET ANSI_NULLS ON
ALTER PROCEDURE [dbo].[spr_unitCreation]
(
@Unit_Name VARCHAR(50) = NULL,
@Unit_Abbreviation VARCHAR(50) = NULL,
@Unit_type VARCHAR(50) = NULL,
@Decimal_Places VARCHAR(50) = NULL,
... | 2016/03/22 | [
"https://Stackoverflow.com/questions/36152206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6048840/"
] | SCOPE\_IDENTITY returns the last identity value inserted into an identity column. You are not inserting a row.
To update a row all you need is to pass a value to @unit\_Id when executing [spr\_unitCreation]. Also remove the line "SELECT @unit\_Id AS SCOPE\_IDENTITY" from your code.
Based on the comments, you need to ... | Another commonly used option is to use the OUTPUT clause of the UPDATE statement, inserting all the updated/"inserted" primary keys and Unit\_name into a tablevariable.
<https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-2017> |
23,893,690 | I have a project to create a messaging system for iOS, Android, web browser as the client. What kind of protocol can i use? I have read about the HTTP and Socket programming. Some solution that come up:
1. GET/POST HTTP
2. Socket
If we have the socket programming, how can we arrange the socket connection with the loa... | 2014/05/27 | [
"https://Stackoverflow.com/questions/23893690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2936719/"
] | I strongly recommend that you use an established protocol, IRC. For a general overview of IRC see <http://en.wikipedia.org/wiki/Internet_Relay_Chat>
Read about one Android library implementation at [IRC library for Android (From 2.3.3 to 4.0.3 )?](https://stackoverflow.com/questions/11131853/irc-library-for-android-fr... | You can check SignalR to use on the Website part. This will allow you to create real time connections. It uses WebSockets:
<http://signalr.net/> |
25,440,059 | I need to programmatically login users that were authenticated through Facebook API. The reason for that is that there are number of items that are associated to each user (for example shopping cart), therefore once user is authenticated using Facebook API, I need to log the user in using spring security as well to be ... | 2014/08/22 | [
"https://Stackoverflow.com/questions/25440059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3470841/"
] | Unfortunately it seems there is no "complete" support of programmatic login in Spring security. Here is how I've done it successfully:
```
@Autowired AuthenticationSuccessHandler successHandler;
@Autowired AuthenticationManager authenticationManager;
@Autowired AuthenticationFailureHandler failureHandler;
public vo... | This code is from [Grails' Spring Security Core -Plugin](http://grails.org/plugin/spring-security-core), which is released under the Apache 2.0 license. I've added the imports just to point out what the types are exactly. The original author is Burt Beckwith.
```
import org.springframework.security.core.userdetails.Us... |
28,726,352 | Suppose I have one table with the following values and columns:
```
ID1 | ID2
1 | 1
2 | 1
3 | 1
4 | 1
4 | 2
3 | 3
4 | 3
4 | 4
4 | 4
```
I'd like to retrieve the ID2 values that belong **exclusively** to records where ID1 = 4. So for the above example, I'd like to see the following response:
```
ID... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28726352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282180/"
] | Try working it out [contrapositively](http://en.wikipedia.org/wiki/Contraposition) like this.
Finding all elements where ID1 **is only** 4 is the same as finding all elements that **don't not** have ID1 = 4.
```
CREATE TABLE #temp (ID1 NVARCHAR(10), ID2 NVARCHAR(10))
INSERT INTO #temp(ID1,ID2) VALUES (N'1',N'1')
INS... | These queries will probably be useful to you for the more general cases (and by general I mean when ID1 is something other than 4):
```
select distinct t1.id1, t1.id2
from T as t1
where not exists (
select 1
from T as t2
where t2.ID1 <> t1.ID1 and t2.ID2 = t1.ID2
)
select t1.id1, count(distinct t1.id2)
fr... |
28,726,352 | Suppose I have one table with the following values and columns:
```
ID1 | ID2
1 | 1
2 | 1
3 | 1
4 | 1
4 | 2
3 | 3
4 | 3
4 | 4
4 | 4
```
I'd like to retrieve the ID2 values that belong **exclusively** to records where ID1 = 4. So for the above example, I'd like to see the following response:
```
ID... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28726352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282180/"
] | Try working it out [contrapositively](http://en.wikipedia.org/wiki/Contraposition) like this.
Finding all elements where ID1 **is only** 4 is the same as finding all elements that **don't not** have ID1 = 4.
```
CREATE TABLE #temp (ID1 NVARCHAR(10), ID2 NVARCHAR(10))
INSERT INTO #temp(ID1,ID2) VALUES (N'1',N'1')
INS... | You can also do this:
```
select 4,id2 from
(select distinct ID1 , ID2 from t) t1
group by id2
having count(*)=1
``` |
28,726,352 | Suppose I have one table with the following values and columns:
```
ID1 | ID2
1 | 1
2 | 1
3 | 1
4 | 1
4 | 2
3 | 3
4 | 3
4 | 4
4 | 4
```
I'd like to retrieve the ID2 values that belong **exclusively** to records where ID1 = 4. So for the above example, I'd like to see the following response:
```
ID... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28726352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282180/"
] | Try working it out [contrapositively](http://en.wikipedia.org/wiki/Contraposition) like this.
Finding all elements where ID1 **is only** 4 is the same as finding all elements that **don't not** have ID1 = 4.
```
CREATE TABLE #temp (ID1 NVARCHAR(10), ID2 NVARCHAR(10))
INSERT INTO #temp(ID1,ID2) VALUES (N'1',N'1')
INS... | There are a few ways to do this:
```
SELECT t1.id1, t1.id2
FROM mytable t1
WHERE t1.id1 = 4
AND NOT EXISTS ( SELECT 1 FROM mytable t2
WHERE t2.id2 = t1.id2
AND t2.id1 != 4 );
```
or:
```
SELECT id1, id2 FROM (
SELECT id1, id2
FROM mytable
GROUP BY id1... |
28,726,352 | Suppose I have one table with the following values and columns:
```
ID1 | ID2
1 | 1
2 | 1
3 | 1
4 | 1
4 | 2
3 | 3
4 | 3
4 | 4
4 | 4
```
I'd like to retrieve the ID2 values that belong **exclusively** to records where ID1 = 4. So for the above example, I'd like to see the following response:
```
ID... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28726352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282180/"
] | These queries will probably be useful to you for the more general cases (and by general I mean when ID1 is something other than 4):
```
select distinct t1.id1, t1.id2
from T as t1
where not exists (
select 1
from T as t2
where t2.ID1 <> t1.ID1 and t2.ID2 = t1.ID2
)
select t1.id1, count(distinct t1.id2)
fr... | You can also do this:
```
select 4,id2 from
(select distinct ID1 , ID2 from t) t1
group by id2
having count(*)=1
``` |
28,726,352 | Suppose I have one table with the following values and columns:
```
ID1 | ID2
1 | 1
2 | 1
3 | 1
4 | 1
4 | 2
3 | 3
4 | 3
4 | 4
4 | 4
```
I'd like to retrieve the ID2 values that belong **exclusively** to records where ID1 = 4. So for the above example, I'd like to see the following response:
```
ID... | 2015/02/25 | [
"https://Stackoverflow.com/questions/28726352",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282180/"
] | These queries will probably be useful to you for the more general cases (and by general I mean when ID1 is something other than 4):
```
select distinct t1.id1, t1.id2
from T as t1
where not exists (
select 1
from T as t2
where t2.ID1 <> t1.ID1 and t2.ID2 = t1.ID2
)
select t1.id1, count(distinct t1.id2)
fr... | There are a few ways to do this:
```
SELECT t1.id1, t1.id2
FROM mytable t1
WHERE t1.id1 = 4
AND NOT EXISTS ( SELECT 1 FROM mytable t2
WHERE t2.id2 = t1.id2
AND t2.id1 != 4 );
```
or:
```
SELECT id1, id2 FROM (
SELECT id1, id2
FROM mytable
GROUP BY id1... |
4,886,708 | I am reading this tutorial : <http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/>
because i need Save the product images in a independent model. However when Product.create execute don´t save the data for product images model.
NOTE: I use the new pack action because i need to use ajax f... | 2011/02/03 | [
"https://Stackoverflow.com/questions/4886708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/504998/"
] | You can't upload files using AJAX, just like you said. There are, however, alternate solutions.
The common technique to accomplish this is the usage of an iframe. Have a look [here](http://khamsouk.souvanlasy.com/articles/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent), this tutorial is oriented... | I found the solution together with my partner.
My error was in nested attributes form, no in Ajax.so I found the solution for to use paperclip with Ajax. Now I posted example code.
However I explain the code.
Models
Two models
Product and Product\_images
I wanted that when i created a product in ajax form (each ... |
4,886,708 | I am reading this tutorial : <http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/>
because i need Save the product images in a independent model. However when Product.create execute don´t save the data for product images model.
NOTE: I use the new pack action because i need to use ajax f... | 2011/02/03 | [
"https://Stackoverflow.com/questions/4886708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/504998/"
] | You can't upload files using AJAX, just like you said. There are, however, alternate solutions.
The common technique to accomplish this is the usage of an iframe. Have a look [here](http://khamsouk.souvanlasy.com/articles/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent), this tutorial is oriented... | You'll find two versions of ajax upload on <https://github.com/apneadiving/Pic-upload---Crop-in-Ajax>.
Branch `master`: it uses <http://aquantum-demo.appspot.com/file-upload>
Branch `uploadify`: It uses Uploadify: <http://www.uploadify.com/>
Both have built-in Crop. |
4,886,708 | I am reading this tutorial : <http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/>
because i need Save the product images in a independent model. However when Product.create execute don´t save the data for product images model.
NOTE: I use the new pack action because i need to use ajax f... | 2011/02/03 | [
"https://Stackoverflow.com/questions/4886708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/504998/"
] | You can't upload files using AJAX, just like you said. There are, however, alternate solutions.
The common technique to accomplish this is the usage of an iframe. Have a look [here](http://khamsouk.souvanlasy.com/articles/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent), this tutorial is oriented... | The problem Was nested attributes form.later I posted the code |
4,886,708 | I am reading this tutorial : <http://sleekd.com/general/adding-multiple-images-to-a-rails-model-with-paperclip/>
because i need Save the product images in a independent model. However when Product.create execute don´t save the data for product images model.
NOTE: I use the new pack action because i need to use ajax f... | 2011/02/03 | [
"https://Stackoverflow.com/questions/4886708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/504998/"
] | You can't upload files using AJAX, just like you said. There are, however, alternate solutions.
The common technique to accomplish this is the usage of an iframe. Have a look [here](http://khamsouk.souvanlasy.com/articles/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent), this tutorial is oriented... | Another gem to help with this issue I've just found when I've had the same problem is [remotipart](https://github.com/leppert/remotipart) - Highly recommended. |
39,955,166 | I'm using codeigniter to query a database, and I need to conditionally compare arrays in the where clause.
So basically I want to do: where\_in OR where\_in depending on what array has data in it. So I will have either an array of user\_id OR an array of area\_id's.
I'm not sure how to combine the where\_in compariso... | 2016/10/10 | [
"https://Stackoverflow.com/questions/39955166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1598452/"
] | Yes, there is a [or\_where\_in](https://codeigniter.com/userguide3/database/query_builder.html?highlight=or_where_in#CI_DB_query_builder::or_where_in) function in Codeigniter.
**Example**
```
$arr_price=array(20,40,80,30);
$this->db->or_where_in('price', $arr_price);
//SQL Query: OR price IN(20,40,80,30);
```
**Syn... | I'm not sure if this is what you want:
```
if(!empty($users)){
$this->db->where_in('user_id', $users);
}
elseif(!empty($areas)){
$this->db->where_in('area_id', $areas);
}
``` |
39,955,166 | I'm using codeigniter to query a database, and I need to conditionally compare arrays in the where clause.
So basically I want to do: where\_in OR where\_in depending on what array has data in it. So I will have either an array of user\_id OR an array of area\_id's.
I'm not sure how to combine the where\_in compariso... | 2016/10/10 | [
"https://Stackoverflow.com/questions/39955166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1598452/"
] | I'm not sure if this is what you want:
```
if(!empty($users)){
$this->db->where_in('user_id', $users);
}
elseif(!empty($areas)){
$this->db->where_in('area_id', $areas);
}
``` | When you are using "left" join then in any case never use "where condition" as `or_where_in` and `where_in` because it will make array() for that left query if it not found.
```
$this->db->join('users u', 'u.id = b.check_user_id and u.id=' . $users, 'left');
``` |
39,955,166 | I'm using codeigniter to query a database, and I need to conditionally compare arrays in the where clause.
So basically I want to do: where\_in OR where\_in depending on what array has data in it. So I will have either an array of user\_id OR an array of area\_id's.
I'm not sure how to combine the where\_in compariso... | 2016/10/10 | [
"https://Stackoverflow.com/questions/39955166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1598452/"
] | Yes, there is a [or\_where\_in](https://codeigniter.com/userguide3/database/query_builder.html?highlight=or_where_in#CI_DB_query_builder::or_where_in) function in Codeigniter.
**Example**
```
$arr_price=array(20,40,80,30);
$this->db->or_where_in('price', $arr_price);
//SQL Query: OR price IN(20,40,80,30);
```
**Syn... | When you are using "left" join then in any case never use "where condition" as `or_where_in` and `where_in` because it will make array() for that left query if it not found.
```
$this->db->join('users u', 'u.id = b.check_user_id and u.id=' . $users, 'left');
``` |
6,890,286 | How can this be done?
Now I use fulltextrssfeed.com and WP robot, but I don't really like it, because fulltextrssfeed.com posts only like 5 articles when it was more than 50 in the original RSS feed. And all the plugins I tested (FeedWordPress, RSS poster, WP-o-matic, WP robot) couldn't post full articles from every fe... | 2011/07/31 | [
"https://Stackoverflow.com/questions/6890286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/860478/"
] | The feeds themselves don't contain the full text of the articles.
What `fulltextrssfeed.com` does is fetching the URL of the feed entry and extracting the full text from there. This is what you have to do, too - if you want all the articles | you can use <http://www.feedsapi.com/> or <http://fivefilters.org/content-only/> |
6,890,286 | How can this be done?
Now I use fulltextrssfeed.com and WP robot, but I don't really like it, because fulltextrssfeed.com posts only like 5 articles when it was more than 50 in the original RSS feed. And all the plugins I tested (FeedWordPress, RSS poster, WP-o-matic, WP robot) couldn't post full articles from every fe... | 2011/07/31 | [
"https://Stackoverflow.com/questions/6890286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/860478/"
] | The feeds themselves don't contain the full text of the articles.
What `fulltextrssfeed.com` does is fetching the URL of the feed entry and extracting the full text from there. This is what you have to do, too - if you want all the articles | You can use the api provided by [full post rss feed](http://fullpostrssfeed.com/), which extracts 10 posts from the rss feed, it is basically hosted version of fiverfilter premium Api. Fivefilter regularly updates their templates to extract the content from the major themes and sites.
If it is not able to extract the... |
24,714,794 | I would like to know how can I make the numbers to stay at the textfield of my calculator instead of disappear like when I type 1 then hit the + sign the number 1 disappears from the textfield. I would like to have this (1+1) showing in the text field and also if try to press only + , \* , - , / to show error. My if el... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24714794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3832535/"
] | Use a view
```
xs.view.map(f).find(g)
``` | Instead of
```
xs.map(f).find(g)
```
just turn it around
```
xs.find(x => g(f(x)))
```
In both cases `Option[X]` is returned.
---
If you want `Option[Y]`, a recursive method would do the job:
```
@tailrec
def findFirst[X, Y](xs: List[X], f: X => Y, g: Y => Boolean): Option[Y] = {
xs match {
case... |
24,714,794 | I would like to know how can I make the numbers to stay at the textfield of my calculator instead of disappear like when I type 1 then hit the + sign the number 1 disappears from the textfield. I would like to have this (1+1) showing in the text field and also if try to press only + , \* , - , / to show error. My if el... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24714794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3832535/"
] | Use a view
```
xs.view.map(f).find(g)
``` | Another possibility would be to use `collectFirst`, which also returns an `Option`.
```
xs.collectFirst{case x if g(f(x)) => f(x)}
```
The only downside is that you evaluate `f(x)` twice if you find something that matches.
I'm not sure if it is somehow possible to bind the result `f(x)` to some variable. |
931,385 | is there any way **in MVC** to get the System.Net.Mail SendAsync to work, instead of the blocking Send method?
I tried using it but hit the "Page starting an asynchronous operation has to have the Async attribute" error, which I obviously can't resolve (or can I?) because there is no ASPX page with an @Page directive... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | It looks like you want [Asynchronous support for ASP.NET MVC](http://code.msdn.microsoft.com/AsyncMvc). See also "[Extend ASP.NET MVC for Asynchronous Action](http://weblogs.asp.net/jeffreyzhao/archive/2009/01/30/extend-asp-net-mvc-for-asynchronous-action.aspx)".
[This SO question](https://stackoverflow.com/questions/... | You may want to consider putting the email into a database table and then have a daemon that sends out emails by processing the queue.
```
a) if youre not sending billions of emails you can have a log of what you sent
b) you can resend if something fails.
```
depends how important these emails are, but if theyre imp... |
931,385 | is there any way **in MVC** to get the System.Net.Mail SendAsync to work, instead of the blocking Send method?
I tried using it but hit the "Page starting an asynchronous operation has to have the Async attribute" error, which I obviously can't resolve (or can I?) because there is no ASPX page with an @Page directive... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | If you're using a third party service such as gmail to send your email and relying on `SendEmail` or `SendAsync` you may want to set up your own SMTP server which will then relay onto gmail. The benefit is that `SendEmail` will return much faster and you may be able to forget the whole async thing.
That way if gmail r... | You may want to consider putting the email into a database table and then have a daemon that sends out emails by processing the queue.
```
a) if youre not sending billions of emails you can have a log of what you sent
b) you can resend if something fails.
```
depends how important these emails are, but if theyre imp... |
21,586,473 | So I'm trying to create a counter using jQuery but I can't get it to work for some reason.
I'm using 3 inputs. 1 number input and 2 buttons.
My html looks like this:
```
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="title">
... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21586473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276701/"
] | Here I have use `+`, which Force the engine to implicitly convert it by applying a math operator to it;
Convert input value to number
```
num = +$(".counter").val();
```
[**DEMO**](http://jsfiddle.net/satpalsingh/MYP75/1/)
Additionally, You are missing closing `)` of document ready handler.
I would also like to ... | `num = $(".counter").val();` is going to be a string, therefore "1" + "1" = "11"
Try:
```
num = parseInt($(".counter").val());
``` |
21,586,473 | So I'm trying to create a counter using jQuery but I can't get it to work for some reason.
I'm using 3 inputs. 1 number input and 2 buttons.
My html looks like this:
```
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="title">
... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21586473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276701/"
] | The reason it's failing is because the `val()` is returned as a string and the `+` is doing string concatenation, not addition.
However, since you already have the value stored in a variable, you really don't need to pull the value from the input each time. Here's a simpler version:
<http://jsfiddle.net/bcHWa/>
```... | `num = $(".counter").val();` is going to be a string, therefore "1" + "1" = "11"
Try:
```
num = parseInt($(".counter").val());
``` |
21,586,473 | So I'm trying to create a counter using jQuery but I can't get it to work for some reason.
I'm using 3 inputs. 1 number input and 2 buttons.
My html looks like this:
```
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="title">
... | 2014/02/05 | [
"https://Stackoverflow.com/questions/21586473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276701/"
] | Here I have use `+`, which Force the engine to implicitly convert it by applying a math operator to it;
Convert input value to number
```
num = +$(".counter").val();
```
[**DEMO**](http://jsfiddle.net/satpalsingh/MYP75/1/)
Additionally, You are missing closing `)` of document ready handler.
I would also like to ... | The reason it's failing is because the `val()` is returned as a string and the `+` is doing string concatenation, not addition.
However, since you already have the value stored in a variable, you really don't need to pull the value from the input each time. Here's a simpler version:
<http://jsfiddle.net/bcHWa/>
```... |
10,647,944 | I have made a code in javascript/jquery which populates a division with tweets of a specific handle.
```
$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+ handle + "&count=" + noOfTweets + "&include_rts=true&callback=?", function(data) {
//some code
});
```
Here is the code to displa... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392169/"
] | I would suggest something like a JSON based REST full API.
This makes your API language independent.
Once the API is made then you can make client libraries in popular languages. | If the API is JSON based, it is implemented for pretty much any popular language today. You can communicate between applications build in different languages with no issues.
You can see an extensive list of libraries for different languages at the [official JSON site](http://json.org/). |
10,647,944 | I have made a code in javascript/jquery which populates a division with tweets of a specific handle.
```
$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+ handle + "&count=" + noOfTweets + "&include_rts=true&callback=?", function(data) {
//some code
});
```
Here is the code to displa... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392169/"
] | On the server side, your JSON API would be written in one language on one platform, this could be PHP, .NET or any platform of your choice.
On the client side (iPhone, Android, etc) You would need to write a client that is capable of making requests and handling responses to your JSON API.
However, in order to enforc... | I would suggest something like a JSON based REST full API.
This makes your API language independent.
Once the API is made then you can make client libraries in popular languages. |
10,647,944 | I have made a code in javascript/jquery which populates a division with tweets of a specific handle.
```
$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+ handle + "&count=" + noOfTweets + "&include_rts=true&callback=?", function(data) {
//some code
});
```
Here is the code to displa... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392169/"
] | I would suggest something like a JSON based REST full API.
This makes your API language independent.
Once the API is made then you can make client libraries in popular languages. | I'm using a URL to request the JSON:
```
api.example.com/api.php?action=User.login&username=admin&password=111
```
The JSON response is:
```
{
"resultcode":100,
"resultdata":{
"id":"1",
"username":"admin",
"password":"$1$$TUPijxhaACBBZHMowbtgD.",
"name":"chenwendong",
"email":"md... |
10,647,944 | I have made a code in javascript/jquery which populates a division with tweets of a specific handle.
```
$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+ handle + "&count=" + noOfTweets + "&include_rts=true&callback=?", function(data) {
//some code
});
```
Here is the code to displa... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392169/"
] | On the server side, your JSON API would be written in one language on one platform, this could be PHP, .NET or any platform of your choice.
On the client side (iPhone, Android, etc) You would need to write a client that is capable of making requests and handling responses to your JSON API.
However, in order to enforc... | If the API is JSON based, it is implemented for pretty much any popular language today. You can communicate between applications build in different languages with no issues.
You can see an extensive list of libraries for different languages at the [official JSON site](http://json.org/). |
10,647,944 | I have made a code in javascript/jquery which populates a division with tweets of a specific handle.
```
$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+ handle + "&count=" + noOfTweets + "&include_rts=true&callback=?", function(data) {
//some code
});
```
Here is the code to displa... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392169/"
] | If the API is JSON based, it is implemented for pretty much any popular language today. You can communicate between applications build in different languages with no issues.
You can see an extensive list of libraries for different languages at the [official JSON site](http://json.org/). | I'm using a URL to request the JSON:
```
api.example.com/api.php?action=User.login&username=admin&password=111
```
The JSON response is:
```
{
"resultcode":100,
"resultdata":{
"id":"1",
"username":"admin",
"password":"$1$$TUPijxhaACBBZHMowbtgD.",
"name":"chenwendong",
"email":"md... |
10,647,944 | I have made a code in javascript/jquery which populates a division with tweets of a specific handle.
```
$.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+ handle + "&count=" + noOfTweets + "&include_rts=true&callback=?", function(data) {
//some code
});
```
Here is the code to displa... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392169/"
] | On the server side, your JSON API would be written in one language on one platform, this could be PHP, .NET or any platform of your choice.
On the client side (iPhone, Android, etc) You would need to write a client that is capable of making requests and handling responses to your JSON API.
However, in order to enforc... | I'm using a URL to request the JSON:
```
api.example.com/api.php?action=User.login&username=admin&password=111
```
The JSON response is:
```
{
"resultcode":100,
"resultdata":{
"id":"1",
"username":"admin",
"password":"$1$$TUPijxhaACBBZHMowbtgD.",
"name":"chenwendong",
"email":"md... |
20,006,965 | I am trying to send packets larger than 2 MB using BULKIO. I have modified giopMaxMsgSize in /etc/omniORB.cfg to be 8388608, but I am still receiving the following error message: "Call to pushPacket by BULKIO\_dataFloat\_Out\_i failed". Any suggestions on how to debug this? | 2013/11/15 | [
"https://Stackoverflow.com/questions/20006965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2370806/"
] | Try adjusting the omniORB logging level (see REDHAWK documentation, [Appendix H, section 3](http://redhawksdr.github.io/Documentation/mainap8.html#x34-433000H.3 "Appendix H, Section 3")). It can generate an awful lot of debug info, but it might help you narrow down your problem.
I tried this using two C++ components a... | Normally this type of error will occur when the total amount of data exceeds your giopMaxMsgSize, size in total bytes. If we do the math 8388608/4 = 2097152 float values, where there are 4 bytes in a float. Therefore your vector cannot exceed 2097152 real samples, or 1048576 complex samples.
The one method it check th... |
31,127,481 | I know how to do the above opposite. Have it only accept numbers, but how about for it to accept everything other then `0123456789`?
Code I use for numbers only.
```
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
My.Computer.Audio.PlaySystemSound(System.Me... | 2015/06/30 | [
"https://Stackoverflow.com/questions/31127481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4830458/"
] | try this one.
```
If Not Char.IsLetter(e.KeyChar) And Not e.KeyChar = Chr(Keys.Delete) And Not e.KeyChar = Chr(Keys.Back) Then
e.Handled = True
End If
``` | Just invert the condition?
```
If Not (Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57) Then
``` |
31,127,481 | I know how to do the above opposite. Have it only accept numbers, but how about for it to accept everything other then `0123456789`?
Code I use for numbers only.
```
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
My.Computer.Audio.PlaySystemSound(System.Me... | 2015/06/30 | [
"https://Stackoverflow.com/questions/31127481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4830458/"
] | You can use Char.IsDigit to tell if a character is a decimal digit.
```
If Char.IsDigit(e.KeyChar) Then
My.Computer.Audio.PlaySystemSound(System.Media.SystemSounds.Asterisk)
e.Handled = True
End If
``` | Just invert the condition?
```
If Not (Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57) Then
``` |
31,127,481 | I know how to do the above opposite. Have it only accept numbers, but how about for it to accept everything other then `0123456789`?
Code I use for numbers only.
```
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
My.Computer.Audio.PlaySystemSound(System.Me... | 2015/06/30 | [
"https://Stackoverflow.com/questions/31127481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4830458/"
] | You can use Char.IsDigit to tell if a character is a decimal digit.
```
If Char.IsDigit(e.KeyChar) Then
My.Computer.Audio.PlaySystemSound(System.Media.SystemSounds.Asterisk)
e.Handled = True
End If
``` | try this one.
```
If Not Char.IsLetter(e.KeyChar) And Not e.KeyChar = Chr(Keys.Delete) And Not e.KeyChar = Chr(Keys.Back) Then
e.Handled = True
End If
``` |
11,829,300 | I have two php scripts in the same directory-`a.php` and `b.php` . b.php creates an images and displays it.(Example [here](http://php.net/manual/en/function.imagecreate.php)).
`a.php`
```
<html>
<body>
<img src=<?php echo "b.php";?> alt="image"/>
</body>
</html>
```
Both `<?php echo "b.php";?>` and `<?php echo "ht... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11829300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513707/"
] | They should both be the same, as your browser would make a new request for the picture anyway, however I'd suggest you to *always* use `b.php`, or another kind of relative path instead of the full (absoloute) path (UNLESS the picture is on another server, of course). | This is irrelevant. The PHP script will execute in a fraction of a second and the browser needs to process the HTML. The browser will also process this in a fraction of a second. |
11,829,300 | I have two php scripts in the same directory-`a.php` and `b.php` . b.php creates an images and displays it.(Example [here](http://php.net/manual/en/function.imagecreate.php)).
`a.php`
```
<html>
<body>
<img src=<?php echo "b.php";?> alt="image"/>
</body>
</html>
```
Both `<?php echo "b.php";?>` and `<?php echo "ht... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11829300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513707/"
] | They should both be the same, as your browser would make a new request for the picture anyway, however I'd suggest you to *always* use `b.php`, or another kind of relative path instead of the full (absoloute) path (UNLESS the picture is on another server, of course). | Both are the same. The difference is just the relative or absolute path. |
11,829,300 | I have two php scripts in the same directory-`a.php` and `b.php` . b.php creates an images and displays it.(Example [here](http://php.net/manual/en/function.imagecreate.php)).
`a.php`
```
<html>
<body>
<img src=<?php echo "b.php";?> alt="image"/>
</body>
</html>
```
Both `<?php echo "b.php";?>` and `<?php echo "ht... | 2012/08/06 | [
"https://Stackoverflow.com/questions/11829300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1513707/"
] | This is irrelevant. The PHP script will execute in a fraction of a second and the browser needs to process the HTML. The browser will also process this in a fraction of a second. | Both are the same. The difference is just the relative or absolute path. |
50,408,557 | I have a zip file "test.zip" which contain many files and a picture called "dp.bmp". So i use below script to search and show that picture file. But unfortunately, the pic could'nt display correctly.
The image only show horizontal line of picture (not showing whole picture as it's height and width), like below pic : ... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50408557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6088267/"
] | The problem is that `project.package1.Thing` is **not visible outside the package** `project.package1`, but **public classes** must be defined **in their own files**. | Class `Thing` has package-private visibility. You wouldn't be able to access it outside `project.package1` package until it will be implemented as
```
public final class Thing implements IThing
``` |
19,238,293 | I have this piece of code which keeps throwing a 'buffer too small' error during debug.
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "),xAxis,(x+1));
yAxis.Format(_T("%s%s "),yAxi... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19238293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1222651/"
] | No! The real problem was:
1. xAxis Format starts and sees that there is need for more room. Based on the calculation of all the parameters given to Format.
2. Now xAxis storage is reallocated. The old pointer gets invalid and in the debug Version frees and overwrites it. So there is no 0 terminator any more. The memor... | Problem solved. Used;
```
xAxis.AppendFormat(_T("\n%s "),yAxis);
``` |
19,238,293 | I have this piece of code which keeps throwing a 'buffer too small' error during debug.
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "),xAxis,(x+1));
yAxis.Format(_T("%s%s "),yAxi... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19238293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1222651/"
] | If your objective is to reuse the variables, you can do:
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "), CString(xAxis),(x+1));
yAxis.Format(_T("%s%s "), Cstring(yAxis),dialog_test.str[x]);
}
... | Problem solved. Used;
```
xAxis.AppendFormat(_T("\n%s "),yAxis);
``` |
19,238,293 | I have this piece of code which keeps throwing a 'buffer too small' error during debug.
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "),xAxis,(x+1));
yAxis.Format(_T("%s%s "),yAxi... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19238293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1222651/"
] | The documentation for [CStringT::Format](https://msdn.microsoft.com/en-us/library/18he3sk6.aspx) contains the following remark:
>
> The call will fail if the string object itself is offered as a parameter to Format. For example, the following code will cause unpredictable results:
>
>
>
> ```
> CAtlString str = _T... | Problem solved. Used;
```
xAxis.AppendFormat(_T("\n%s "),yAxis);
``` |
19,238,293 | I have this piece of code which keeps throwing a 'buffer too small' error during debug.
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "),xAxis,(x+1));
yAxis.Format(_T("%s%s "),yAxi... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19238293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1222651/"
] | No! The real problem was:
1. xAxis Format starts and sees that there is need for more room. Based on the calculation of all the parameters given to Format.
2. Now xAxis storage is reallocated. The old pointer gets invalid and in the debug Version frees and overwrites it. So there is no 0 terminator any more. The memor... | If your objective is to reuse the variables, you can do:
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "), CString(xAxis),(x+1));
yAxis.Format(_T("%s%s "), Cstring(yAxis),dialog_test.str[x]);
}
... |
19,238,293 | I have this piece of code which keeps throwing a 'buffer too small' error during debug.
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "),xAxis,(x+1));
yAxis.Format(_T("%s%s "),yAxi... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19238293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1222651/"
] | No! The real problem was:
1. xAxis Format starts and sees that there is need for more room. Based on the calculation of all the parameters given to Format.
2. Now xAxis storage is reallocated. The old pointer gets invalid and in the debug Version frees and overwrites it. So there is no 0 terminator any more. The memor... | The documentation for [CStringT::Format](https://msdn.microsoft.com/en-us/library/18he3sk6.aspx) contains the following remark:
>
> The call will fail if the string object itself is offered as a parameter to Format. For example, the following code will cause unpredictable results:
>
>
>
> ```
> CAtlString str = _T... |
19,238,293 | I have this piece of code which keeps throwing a 'buffer too small' error during debug.
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "),xAxis,(x+1));
yAxis.Format(_T("%s%s "),yAxi... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19238293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1222651/"
] | The documentation for [CStringT::Format](https://msdn.microsoft.com/en-us/library/18he3sk6.aspx) contains the following remark:
>
> The call will fail if the string object itself is offered as a parameter to Format. For example, the following code will cause unpredictable results:
>
>
>
> ```
> CAtlString str = _T... | If your objective is to reuse the variables, you can do:
```
geoGraph.size=limit;
CString xAxis ="X axis: ",yAxis="Y axis: ";
for (int x = 0; x < limit; x++)
{
xAxis.Format(_T("%s%i "), CString(xAxis),(x+1));
yAxis.Format(_T("%s%s "), Cstring(yAxis),dialog_test.str[x]);
}
... |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | I'm a huge fan of SlideShow Pro Director!
I'm not sure there is anything out there off the shelf right now, like an add-on for example though, I hope I'm wrong.
With that said, have you considered using SSP Director along with it's DirectorPHP classes?
You could build your own add-on (recommended) or use PHP templat... | All ended up with me using a totally separate application for images, Koken, with added styling similar to the main site. |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | If you like SSP Director (as do I, very slick interface, I'd love to see something like that come to the EE control panel), then maybe keep an eye on Koken: <http://koken.me/>
Something new developed by the same developer as SSP with a public beta coming soon. | We typically just use either Channel Images, Assets, or in the past a Matrix field with File fields inside of it, coupled with one of the jQuery plugins that works based on a set of markup. You then read the selected module's data for the current entry out, and insert a bunch of `<li>`s in a `<ul>` or `<div>`s or whate... |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | I'm a huge fan of SlideShow Pro Director!
I'm not sure there is anything out there off the shelf right now, like an add-on for example though, I hope I'm wrong.
With that said, have you considered using SSP Director along with it's DirectorPHP classes?
You could build your own add-on (recommended) or use PHP templat... | EE doesn't have a real document/asset management addon, although one could certainly be built out of existing bits. I would start with Channel Images, because its directory structure really lends itself toward reuse of assets (it gives every asset a separate subdirectory).
Alternatively you could start with a separat... |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | If you like SSP Director (as do I, very slick interface, I'd love to see something like that come to the EE control panel), then maybe keep an eye on Koken: <http://koken.me/>
Something new developed by the same developer as SSP with a public beta coming soon. | EE doesn't have a real document/asset management addon, although one could certainly be built out of existing bits. I would start with Channel Images, because its directory structure really lends itself toward reuse of assets (it gives every asset a separate subdirectory).
Alternatively you could start with a separat... |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | If you like SSP Director (as do I, very slick interface, I'd love to see something like that come to the EE control panel), then maybe keep an eye on Koken: <http://koken.me/>
Something new developed by the same developer as SSP with a public beta coming soon. | Can you start by quantifying some numbers, I've built a few image/gallery'esque sites over time and it all comes down to the numbers.
The most used method is similar to a designers portfolio, one channel entry per shoot/location/project, 1 - 20 images per entry - matrix + assets - Add all the jquery/plugin magic you w... |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | Can you start by quantifying some numbers, I've built a few image/gallery'esque sites over time and it all comes down to the numbers.
The most used method is similar to a designers portfolio, one channel entry per shoot/location/project, 1 - 20 images per entry - matrix + assets - Add all the jquery/plugin magic you w... | All ended up with me using a totally separate application for images, Koken, with added styling similar to the main site. |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | Can you start by quantifying some numbers, I've built a few image/gallery'esque sites over time and it all comes down to the numbers.
The most used method is similar to a designers portfolio, one channel entry per shoot/location/project, 1 - 20 images per entry - matrix + assets - Add all the jquery/plugin magic you w... | EE doesn't have a real document/asset management addon, although one could certainly be built out of existing bits. I would start with Channel Images, because its directory structure really lends itself toward reuse of assets (it gives every asset a separate subdirectory).
Alternatively you could start with a separat... |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | If you like SSP Director (as do I, very slick interface, I'd love to see something like that come to the EE control panel), then maybe keep an eye on Koken: <http://koken.me/>
Something new developed by the same developer as SSP with a public beta coming soon. | All ended up with me using a totally separate application for images, Koken, with added styling similar to the main site. |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | We typically just use either Channel Images, Assets, or in the past a Matrix field with File fields inside of it, coupled with one of the jQuery plugins that works based on a set of markup. You then read the selected module's data for the current entry out, and insert a bunch of `<li>`s in a `<ul>` or `<div>`s or whate... | All ended up with me using a totally separate application for images, Koken, with added styling similar to the main site. |
141 | What are the experiences in building a photo oriented site in EE?
There are some really nice plugins out there, like Channel Images or Assets, but they are all oriented around "uploading as you go" and not for serving images from some kind of back-end (like slideshowpro director or similar).
For myself and fellow phot... | 2012/11/21 | [
"https://expressionengine.stackexchange.com/questions/141",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/43/"
] | We typically just use either Channel Images, Assets, or in the past a Matrix field with File fields inside of it, coupled with one of the jQuery plugins that works based on a set of markup. You then read the selected module's data for the current entry out, and insert a bunch of `<li>`s in a `<ul>` or `<div>`s or whate... | EE doesn't have a real document/asset management addon, although one could certainly be built out of existing bits. I would start with Channel Images, because its directory structure really lends itself toward reuse of assets (it gives every asset a separate subdirectory).
Alternatively you could start with a separat... |
31,534,099 | I'm trying to upload multiple images using the codeigniter file upload library but it only uploads one file even when multiple are selected. Kindly assist
```
//uploading images
public function upload_image() {
$this->load->helper('form');
$config = array(
'upload_path' => "./image_upl... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31534099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4651322/"
] | The markup defined by HTML, and understood by screen readers, to indicate what the next part of a document is about are the `<h1>` to `<h6>` series of heading elements. Screen readers typically include "Skip to next heading" features.
HTML also provides `<small>` to represent "side comments such as small print … discl... | You could add [`aria-hidden`](http://www.w3.org/TR/wai-aria/states_and_properties#aria-hidden) to the respective element. |
38,911,877 | I have two select boxes. The second select box populates from first select box.
I have applied a filter for the second select box to populate as per the options selected in first select box. The second select box populates from an array `var outputformats = [];`
This is my code
HTML
```
<select name="reporttype"id=... | 2016/08/12 | [
"https://Stackoverflow.com/questions/38911877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4331291/"
] | On your controller, watch the filtered options and act on that:
```
function myController ($scope) {
// watch the filtered output formats
$scope.$watchCollection("filteredOutputFormats", function(val) {
// select the first one when it changes
$scope.outputformat = val[0];
});
}
```
Make s... | Try this:-
```js
var myApp = angular.module('myApp',['myApp.outputformatfilter']);
myApp.controller('mainController',function($scope,$filter){
var outputformats = [];
$scope.outputFormatReport = {"1115":"HTML,PDF,CSV,EXCEL","1114":"PHP,HTML,PDF","default":"CSV,HTML"};
$scope.$watch('reporttype', func... |
50,711,534 | I was wondering how to get the values in a certain column if the checkbox or radio button on that particular row is checked. I've already started and came up with this:
```
<script>
var Step = <?php echo $_SESSION['Step'] ?>;
if(Step == 3 || Step == 4 ) { setInterval(ScriptUpdate, 1000); }
funct... | 2018/06/06 | [
"https://Stackoverflow.com/questions/50711534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4813949/"
] | This turned out to be a really interesting question - thanks for asking it! First, remember that you want your loss functions to be defined entirely of differential operations, so that you can back-propagation though it. This means that any old arbitrary logic won't necessarily do. To restate your problem: you want to ... | From what I understand, your current loss function is something like:
`loss = mean_square_error(y, y_pred)`
What you could do, is to add one other component to your loss, being this a component that penalizes negative numbers and does nothing with positive numbers. And you can choose a coefficient for how much you wa... |
128,621 | I would like to calculate the average for the same days (e.g. Monday, Tuesday, etc) in a selected period:
```
$data = array(
'2016-05-01' => 100,
'2016-05-02' => 150, // monday
'2016-05-03' => 5,
'2016-05-04' => 5,
'2016-05-05' => 25,
'2016-05-06' => 25,
'2016-05-07' => 25,
'2016-05-08... | 2016/05/17 | [
"https://codereview.stackexchange.com/questions/128621",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24544/"
] | I changed your `main` function a little bit to `LargestCollatz` which runs a bit faster on my machine. I'm not sure but I think the biggest improvement is in comparing two integers (`c < i`) instead of the `len` function (`i > len(list)`). Futhermore I used the impopular `break` statement and used `//` (which might be ... | The idea of reusing previous computations is correct, but you should use it to the full extent. As written, the code effectively throws away the whole trace of `i`. For example, when tracing `7`, (that is, `7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10`), you may immediately conclude that all of those numbers are not worth... |
128,621 | I would like to calculate the average for the same days (e.g. Monday, Tuesday, etc) in a selected period:
```
$data = array(
'2016-05-01' => 100,
'2016-05-02' => 150, // monday
'2016-05-03' => 5,
'2016-05-04' => 5,
'2016-05-05' => 25,
'2016-05-06' => 25,
'2016-05-07' => 25,
'2016-05-08... | 2016/05/17 | [
"https://codereview.stackexchange.com/questions/128621",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24544/"
] | I changed your `main` function a little bit to `LargestCollatz` which runs a bit faster on my machine. I'm not sure but I think the biggest improvement is in comparing two integers (`c < i`) instead of the `len` function (`i > len(list)`). Futhermore I used the impopular `break` statement and used `//` (which might be ... | ```
def main(n):
list = [1,2]
for i in range(3,n):
count = 0
while i > len(list):
if i % 2 == 0:
i = i/2
else:
i = 3*i+1
count += 1
list.append(count + list[int(i)-1])
return list.index(max(list))+1
print(main(10000... |
128,621 | I would like to calculate the average for the same days (e.g. Monday, Tuesday, etc) in a selected period:
```
$data = array(
'2016-05-01' => 100,
'2016-05-02' => 150, // monday
'2016-05-03' => 5,
'2016-05-04' => 5,
'2016-05-05' => 25,
'2016-05-06' => 25,
'2016-05-07' => 25,
'2016-05-08... | 2016/05/17 | [
"https://codereview.stackexchange.com/questions/128621",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/24544/"
] | I changed your `main` function a little bit to `LargestCollatz` which runs a bit faster on my machine. I'm not sure but I think the biggest improvement is in comparing two integers (`c < i`) instead of the `len` function (`i > len(list)`). Futhermore I used the impopular `break` statement and used `//` (which might be ... | Based on some of @Jan Kuiken recommendations
Instead of using `list.index(max(list))+1` which takes a bit of time and `len(list)` i created three more variables `index_position = 0` , `list_length = 2` and `result` in order to keep track of these numbers without having to calculate them again.
```
def LargestCollatz(... |
24,406,799 | I created a shared preference in one activity. The value is getting stored but when I try to access it in another activity it just returns the default value. Any idea what is wrong with my code?
activity 1:
```
public static final String MyPREFERENCES = "MyPrefs" ;
public static final String Monday = ... | 2014/06/25 | [
"https://Stackoverflow.com/questions/24406799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2507825/"
] | `.serializeArray()` creates an array of objects,`JSONStringify()` converts it to string
You can use
```
$( "form" ).submit(function( event ) {
console.log( $( this ).serializeArray() );
event.preventDefault();
});
``` | Don't stringify the array.
JSON's `.serializeArray()` method returns an array of the all the input values in the form |
9,564,322 | I got an interesting problem:
file1.csv has a few hundred rows like:
```
Code,DTime
1,2010-12-26 17:01
2,2010-12-26 17:07
2,2010-12-26 17:15
```
file2.csv has about 11 million rows like:
```
id,D,Sym,DateTime,Bid,Ask
1375022797,D,USD,2010-12-26 17:00:15,1.311400,1.311700
1375022965,D,USD,2010-12-26 17:00:56,1.3112... | 2012/03/05 | [
"https://Stackoverflow.com/questions/9564322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249464/"
] | If you don't have duplicate `DTime` values, this should work:
```
import csv
file1reader = csv.reader(open("file1.csv"), delimiter=",")
file2reader = csv.reader(open("file2.csv"), delimiter=",")
header1 = file1reader.next() #header
header2 = file2reader.next() #header
for Code, DTime in file1reader:
for id_, D,... | you can create a dictionary from file2, where the key is the prefix of the time you want, and the value is either first row, or all the rows matching this prefix.
then it's simply a matter of doing something like:
```
entries = file2Dict.get(file1Entry)
if entries:
print "First entry is %s" entries[0]
``` |
9,564,322 | I got an interesting problem:
file1.csv has a few hundred rows like:
```
Code,DTime
1,2010-12-26 17:01
2,2010-12-26 17:07
2,2010-12-26 17:15
```
file2.csv has about 11 million rows like:
```
id,D,Sym,DateTime,Bid,Ask
1375022797,D,USD,2010-12-26 17:00:15,1.311400,1.311700
1375022965,D,USD,2010-12-26 17:00:56,1.3112... | 2012/03/05 | [
"https://Stackoverflow.com/questions/9564322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249464/"
] | Unless you only need to do this once, you should really use a database. Add a column to table2 that contains DATETIME without the seconds, so that you can join on exact matches, not with LIKE.
It WILL be fast, and even faster if you index those columns. And if you can store file1.csv in the database too, you don't ne... | you can create a dictionary from file2, where the key is the prefix of the time you want, and the value is either first row, or all the rows matching this prefix.
then it's simply a matter of doing something like:
```
entries = file2Dict.get(file1Entry)
if entries:
print "First entry is %s" entries[0]
``` |
9,564,322 | I got an interesting problem:
file1.csv has a few hundred rows like:
```
Code,DTime
1,2010-12-26 17:01
2,2010-12-26 17:07
2,2010-12-26 17:15
```
file2.csv has about 11 million rows like:
```
id,D,Sym,DateTime,Bid,Ask
1375022797,D,USD,2010-12-26 17:00:15,1.311400,1.311700
1375022965,D,USD,2010-12-26 17:00:56,1.3112... | 2012/03/05 | [
"https://Stackoverflow.com/questions/9564322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249464/"
] | If you don't have duplicate `DTime` values, this should work:
```
import csv
file1reader = csv.reader(open("file1.csv"), delimiter=",")
file2reader = csv.reader(open("file2.csv"), delimiter=",")
header1 = file1reader.next() #header
header2 = file2reader.next() #header
for Code, DTime in file1reader:
for id_, D,... | Unless you only need to do this once, you should really use a database. Add a column to table2 that contains DATETIME without the seconds, so that you can join on exact matches, not with LIKE.
It WILL be fast, and even faster if you index those columns. And if you can store file1.csv in the database too, you don't ne... |
1,385,779 | Solve $3x^2 + 2x + 1 \equiv 0 \mod 11$
Additionally, I have an example problem, but a step in the middle has confused me:
$3x^2 + 5x - 7 \equiv 0 \mod 17$. Rearrange to get $3x^2 + 5x \equiv 7 \mod 17$.
$\implies 6\cdot 3x^2 + 6\cdot 5x \equiv 6\*7 \mod 17$.
The next line reads $x^2 + 30x \equiv 8 \mod 17$, which I... | 2015/08/05 | [
"https://math.stackexchange.com/questions/1385779",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/257731/"
] | One way is to multiply through by $3$ to get the equivalent congruence $9x^2+6x+3\equiv 0\pmod{11}$. Then rewrite as $(3x+1)^2+2\equiv 0\pmod{11}$. We get lucky because this can be rewritten as $(3x+1)^2\equiv 9\pmod{11}$.
**Remark:** In general, if we are looking at the congruence $ax^2+bx+c\equiv 0\pmod{m}$, where $... | Note that $3 \equiv 5^2$, therefore $3x^2 +2x +1 \equiv 5^2x^2 + 2 \cdot 5 \cdot 5^{-1} x + 5^{-2} - 5^{-2} +1$ and since $5^{-1} \equiv 9$ this means $3x^2 +2x +1 \equiv 5^2x^2 + 2 \cdot 5 \cdot 9 x + 9^2 - 3 \equiv (5x + 9)^2 - 3$, so you want to solve $(5x + 9)^2 \equiv 3 \equiv 5^2$, therefore $(5x + 9) \equiv \pm ... |
1,385,779 | Solve $3x^2 + 2x + 1 \equiv 0 \mod 11$
Additionally, I have an example problem, but a step in the middle has confused me:
$3x^2 + 5x - 7 \equiv 0 \mod 17$. Rearrange to get $3x^2 + 5x \equiv 7 \mod 17$.
$\implies 6\cdot 3x^2 + 6\cdot 5x \equiv 6\*7 \mod 17$.
The next line reads $x^2 + 30x \equiv 8 \mod 17$, which I... | 2015/08/05 | [
"https://math.stackexchange.com/questions/1385779",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/257731/"
] | One way is to multiply through by $3$ to get the equivalent congruence $9x^2+6x+3\equiv 0\pmod{11}$. Then rewrite as $(3x+1)^2+2\equiv 0\pmod{11}$. We get lucky because this can be rewritten as $(3x+1)^2\equiv 9\pmod{11}$.
**Remark:** In general, if we are looking at the congruence $ax^2+bx+c\equiv 0\pmod{m}$, where $... | $3x^2 + 2x + 1 \equiv 0 \pmod{11}$
Since $3 \cdot 4 \equiv 12 \equiv 1 \pmod{11}, \quad \frac 13 \equiv 4 \pmod{11}$
So, multiplying both sides by $4$, we get
$x^2 + 8x + 4 \equiv 0 \pmod{11}$
Half of $8$ is $4$ and $4^2 = 16 \equiv 5 \pmod{11}$. So
$x^2 + 8x + 4
\equiv x^2 + 8x + 5 - 1
\equiv (x+4)^2 - 1 \pmo... |
1,385,779 | Solve $3x^2 + 2x + 1 \equiv 0 \mod 11$
Additionally, I have an example problem, but a step in the middle has confused me:
$3x^2 + 5x - 7 \equiv 0 \mod 17$. Rearrange to get $3x^2 + 5x \equiv 7 \mod 17$.
$\implies 6\cdot 3x^2 + 6\cdot 5x \equiv 6\*7 \mod 17$.
The next line reads $x^2 + 30x \equiv 8 \mod 17$, which I... | 2015/08/05 | [
"https://math.stackexchange.com/questions/1385779",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/257731/"
] | $3x^2 + 2x + 1 \equiv 0 \pmod{11}$
Since $3 \cdot 4 \equiv 12 \equiv 1 \pmod{11}, \quad \frac 13 \equiv 4 \pmod{11}$
So, multiplying both sides by $4$, we get
$x^2 + 8x + 4 \equiv 0 \pmod{11}$
Half of $8$ is $4$ and $4^2 = 16 \equiv 5 \pmod{11}$. So
$x^2 + 8x + 4
\equiv x^2 + 8x + 5 - 1
\equiv (x+4)^2 - 1 \pmo... | Note that $3 \equiv 5^2$, therefore $3x^2 +2x +1 \equiv 5^2x^2 + 2 \cdot 5 \cdot 5^{-1} x + 5^{-2} - 5^{-2} +1$ and since $5^{-1} \equiv 9$ this means $3x^2 +2x +1 \equiv 5^2x^2 + 2 \cdot 5 \cdot 9 x + 9^2 - 3 \equiv (5x + 9)^2 - 3$, so you want to solve $(5x + 9)^2 \equiv 3 \equiv 5^2$, therefore $(5x + 9) \equiv \pm ... |
2,522,117 | I stumbled across an exercise in quantum mechanics concerning the self-adjointess of the radial momentum operator. In the exercise, the statement was made that this operator is self-adjoint for wave functions that satisfy
$$\lim\_{r\to0}r\psi\left(r\right)=\lim\_{r\to \infty}r\psi\left(r\right)=0$$
I was wondering, f... | 2017/11/15 | [
"https://math.stackexchange.com/questions/2522117",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/361559/"
] | $1/(a^2+r^2)$ will work for $a>0$; the normalisation constant is an exercise. | maybe $\varphi(r)=0$? that's a trivial example.
you can also take $\varphi(r)=2^{1+\varepsilon}$ for $r<1/2$ and $\varphi(r)=1/r^{1+\varepsilon}$ for $r\geq 1/2$ for every $\varepsilon>0$.
In particular, everything that is bounded in an interval around zero and tends to zero faster than $1/r$ as $r$ goes to infinity ... |
2,522,117 | I stumbled across an exercise in quantum mechanics concerning the self-adjointess of the radial momentum operator. In the exercise, the statement was made that this operator is self-adjoint for wave functions that satisfy
$$\lim\_{r\to0}r\psi\left(r\right)=\lim\_{r\to \infty}r\psi\left(r\right)=0$$
I was wondering, f... | 2017/11/15 | [
"https://math.stackexchange.com/questions/2522117",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/361559/"
] | How about $\psi(r) = \frac{1}{\sqrt{2\pi}\; r^2} \exp(-1/r)$?
It satisfies both of your limits, and also is normalized in the sense that
$$
\int\_0^\infty dr\, 4\pi r\; {\left|\psi(r)\right|}^2 = 1\, .
$$
Something like $\frac{8^{1/4}}{{\pi}^{3/4}} \exp(-r^2)$ also works in this regard. Come to think of it, any funct... | maybe $\varphi(r)=0$? that's a trivial example.
you can also take $\varphi(r)=2^{1+\varepsilon}$ for $r<1/2$ and $\varphi(r)=1/r^{1+\varepsilon}$ for $r\geq 1/2$ for every $\varepsilon>0$.
In particular, everything that is bounded in an interval around zero and tends to zero faster than $1/r$ as $r$ goes to infinity ... |
2,522,117 | I stumbled across an exercise in quantum mechanics concerning the self-adjointess of the radial momentum operator. In the exercise, the statement was made that this operator is self-adjoint for wave functions that satisfy
$$\lim\_{r\to0}r\psi\left(r\right)=\lim\_{r\to \infty}r\psi\left(r\right)=0$$
I was wondering, f... | 2017/11/15 | [
"https://math.stackexchange.com/questions/2522117",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/361559/"
] | How about $\psi(r) = \frac{1}{\sqrt{2\pi}\; r^2} \exp(-1/r)$?
It satisfies both of your limits, and also is normalized in the sense that
$$
\int\_0^\infty dr\, 4\pi r\; {\left|\psi(r)\right|}^2 = 1\, .
$$
Something like $\frac{8^{1/4}}{{\pi}^{3/4}} \exp(-r^2)$ also works in this regard. Come to think of it, any funct... | $1/(a^2+r^2)$ will work for $a>0$; the normalisation constant is an exercise. |
66,635,290 | I need to wait for two `fetch()` API calls and then to save data from each fetch to different window object. I found this article <https://gomakethings.com/waiting-for-multiple-all-api-responses-to-complete-with-the-vanilla-js-promise.all-method/> and tried following code to wait for the API calls:
```
Promise.all([
... | 2021/03/15 | [
"https://Stackoverflow.com/questions/66635290",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12054189/"
] | ```js
const fetchData = async () => {
try {
const responsesJSON = await Promise.all([
fetch('https://jsonplaceholder.typicode.com/todos/1'),
fetch('https://jsonplaceholder.typicode.com/todos/2')
]);
const [todoOne, todoTwo] = await Promise.all(responsesJSON.map(r => r.json()));
console... | please use axios for fetch data in js . react or angular etc...
<https://github.com/axios/axios>
please install with npm and read doc
```
$ npm install axios
```
```
axios.get('/user')
.then(function (response) {
console.log(response);
axios.get('/user') .then(function (res) {
console.log(res);
... |
66,635,290 | I need to wait for two `fetch()` API calls and then to save data from each fetch to different window object. I found this article <https://gomakethings.com/waiting-for-multiple-all-api-responses-to-complete-with-the-vanilla-js-promise.all-method/> and tried following code to wait for the API calls:
```
Promise.all([
... | 2021/03/15 | [
"https://Stackoverflow.com/questions/66635290",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12054189/"
] | ```js
const fetchData = async () => {
try {
const responsesJSON = await Promise.all([
fetch('https://jsonplaceholder.typicode.com/todos/1'),
fetch('https://jsonplaceholder.typicode.com/todos/2')
]);
const [todoOne, todoTwo] = await Promise.all(responsesJSON.map(r => r.json()));
console... | The problem was on my side. I was accidentally filtering the browser console. However thank you all for your help.
[](https://i.stack.imgur.com/1wcSp.png) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.