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 |
|---|---|---|---|---|---|
87,929 | I'm reading a paper on jet engines that repeatedly mentions the stagnation pressure and temperature. What does this mean? Is it the point where the jet engine stalls in performance/efficiency/thrust, etc?
I'm a bit confused. 99% of the information on stagnation pressure is the static pressure, or the about stagnation ... | 2021/06/25 | [
"https://aviation.stackexchange.com/questions/87929",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/44452/"
] | [](https://i.stack.imgur.com/RtPh1.png)[Image source](https://www.researchgate.net/figure/Smoke-visualisation-and-flow-topology-of-the-airflow-around-a-cylinder_fig7_260045652)
Stagnation pressure is used as a synonym for total pressure. An object in ... | The analytical formula for the stagnation pressure $p\_{st}$ is :
$$p\_{st} = p\_{\infty} + \frac{1}{2} \rho V^2$$
with $p\_∞$ static pressure, $\rho$ = air density, $V$ = air speed for incompressible flow.
The point where the fluid is at rest is the point where stagnation pressure = static pressure ($p\_{\infty} = ... |
25,688,287 | How can I execute a calculation in python (2.7) and capture the output in the variable 'results'?
**Input:**
```
let calculation = '(3*15)/5'
let formatting = '\\%2d'
let grouping = '0'
exe "python -c \"import math, locale; locale.format(formatting, calculation, grouping)\""
```
and capture the output in a varia... | 2014/09/05 | [
"https://Stackoverflow.com/questions/25688287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/662967/"
] | Hmm… `:let foo = (3*15)/15`.
Anyway, you can capture the output of an external command with `:let foo = system('mycommand')`:
```
:let foo = system("python -c 'print (15*3)/5'")
```
It's up to you to put the string together. | I ever wrote a script to do number calculation in vim. It supports three expression evaluation engines: `GNU bc, vimscript and python`.
It is called `HowMuch` : <https://github.com/sk1418/HowMuch>
For the python part, you could check here:
<https://github.com/sk1418/HowMuch/blob/master/autoload/HowMuch.vim#L285>
ho... |
59,287,801 | need help
I have a task count of 250.
I want all these tasks to be done via a fixed no of threads. ex 10
so, I want to feed each thread one task
```
t1 =1
t2=2
.
.
.
```
currently I have written the code in such a way that, among those 10 threads each thread picks one task.
and I will wait till all the 10 threads a... | 2019/12/11 | [
"https://Stackoverflow.com/questions/59287801",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12518808/"
] | You're reinventing the wheel; this is not neccessary. Java already contains functionality to have a fixed number of threads plus a number of tasks, and then having this fixed number of threads process all the tasks: [Executors](https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/concurrent/Executors.... | ```
ExecutorService pool = Executors.newFixedThreadPool(20);
int count=0;
while(count<finData.size()){
if (pool instanceof ThreadPoolExecutor) {
if(((ThreadPoolExecutor) pool).getActiveCount()<20){
System.out.println("Pointer -----"+count);
Runnable r = new FeeConfigCheck(fi... |
5,279,503 | Looking for some help with my bash script. I am trying to write this shell script to do the following:
1. find files in a dir named:
`server1-date.done`
`server2-date.done`
`server3-date.done`
`...`
`server10-date.done`
2. print to a `listA`
3. find files in a dir (\*.gz) and print to a `listB`
4. if `listA` has a co... | 2011/03/11 | [
"https://Stackoverflow.com/questions/5279503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/374916/"
] | First of all, I really recommend that you as the default approach always [test for exceptions](http://dl.dropbox.com/u/20930447/index.html), and do not include the "normal" case inside a test unless that is necessary.
```
...
FLG_VAL=`wc -l < $FLGLIST` # no need for cat, and no space before '='
export $FL... | ```
FLG_VAL =`cat $FLGLIST | wc -l`
```
Should be:
```
FLG_VAL=`cat $FLGLIST | wc -l`
``` |
5,279,503 | Looking for some help with my bash script. I am trying to write this shell script to do the following:
1. find files in a dir named:
`server1-date.done`
`server2-date.done`
`server3-date.done`
`...`
`server10-date.done`
2. print to a `listA`
3. find files in a dir (\*.gz) and print to a `listB`
4. if `listA` has a co... | 2011/03/11 | [
"https://Stackoverflow.com/questions/5279503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/374916/"
] | I do not know if this will work, but it will fix all the obvious problems:
```
#!/bin/sh
#Directories
GZDIR=/mydumps/mytest
FINALDIR=/mydumps/mytest/final
FLGDIR=/backup/mytest/flags
export GZDIR FINALDIR FLGDIR
#lists
FLGLIST="/mydumps/mytest/lists/userflgs.lst"
GZLIST="/mydumps/mytest/lists/gzfiles.lst"
#Find file... | ```
FLG_VAL =`cat $FLGLIST | wc -l`
```
Should be:
```
FLG_VAL=`cat $FLGLIST | wc -l`
``` |
5,279,503 | Looking for some help with my bash script. I am trying to write this shell script to do the following:
1. find files in a dir named:
`server1-date.done`
`server2-date.done`
`server3-date.done`
`...`
`server10-date.done`
2. print to a `listA`
3. find files in a dir (\*.gz) and print to a `listB`
4. if `listA` has a co... | 2011/03/11 | [
"https://Stackoverflow.com/questions/5279503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/374916/"
] | I do not know if this will work, but it will fix all the obvious problems:
```
#!/bin/sh
#Directories
GZDIR=/mydumps/mytest
FINALDIR=/mydumps/mytest/final
FLGDIR=/backup/mytest/flags
export GZDIR FINALDIR FLGDIR
#lists
FLGLIST="/mydumps/mytest/lists/userflgs.lst"
GZLIST="/mydumps/mytest/lists/gzfiles.lst"
#Find file... | First of all, I really recommend that you as the default approach always [test for exceptions](http://dl.dropbox.com/u/20930447/index.html), and do not include the "normal" case inside a test unless that is necessary.
```
...
FLG_VAL=`wc -l < $FLGLIST` # no need for cat, and no space before '='
export $FL... |
16,781 | I am trying to design a filter whose magnitude is the same as that of a given signal. The given signal is wind turbine noise, so it has significant low-frequency content. After designing the filter, I want to filter white Gaussian noise so as to create a model of wind turbine noise. The two signals, that is the origina... | 2014/06/10 | [
"https://dsp.stackexchange.com/questions/16781",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/10166/"
] | if you are only interested in designing a signal representing the wind turbine noise, you could just generate it from your magnitude. E.g., with your magnitude $A$ over frequency $f$ you can generate a random phase $\phi$ for each frequency and over a time $t$ and then add all together. Here a small code for illustrati... | Does [*remez()*](https://octave.sourceforge.io/signal/function/remez.html) help you? Matlab has a similar one. This function receives some points of the spectrum response (PSD) and returns the coefficients of a filter with the desired response. |
33,554,536 | I want to create a string array between From and To input.
like From = 2000 To = 2003
I want to create a string[] as below:
>
>
> ```
> string[] arrayYear = new string[]{"2000","2001","2002","2003"};
>
> ```
>
>
Is there any easy way of building it dynamically for any range of year?
Please suggest me. | 2015/11/05 | [
"https://Stackoverflow.com/questions/33554536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1893874/"
] | You can use `Enumerable.Range`
```
int startYear = 2000, endYear = 2004;
string[] arrayYear = Enumerable.Range(startYear, endYear - startYear + 1).Select(i => i.ToString()).ToArray();
``` | You can use `Enumerable.Range()`
```
var arrayList = Enumerable.Range(2000, 2015-2000+1).ToList();
string[] arrayYear = arrayList.Select(i => i.ToString()).ToArray();
``` |
35,840 | I am using Cucumber through IntelliJ and am working on fixing a broken test. I was wondering when debugging, is there a way to save the state of the system up to a certain step in the feature file, if they all pass. For example, take this exaggerated example below
```
Given I am a New User
And There is an Event ... | 2018/09/28 | [
"https://sqa.stackexchange.com/questions/35840",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/29912/"
] | Cucumber executes the step definitions glue that you provide it with, so it can't in any way control the state of your system. If you need to save snapshots of the system after each step, call a function that would do that for you at the end of every step. | ### Why don't use application to save state of data?
In similar situations, we saved the data state in the application itself as the automation cannot save the application state in the tests.
As we were working on the orders so we could save the order just before the payment. So that we can just the pick up the order... |
45,767 | Every now and then, I find myself reading papers/text talking about how *this* equation is a constraint but *that* equation is an equation of motion which satisfies *this* constraint.
For example, in the Hamiltonian formulation of Maxwell's theory, Gauss' law $\nabla\cdot\mathbf{E}=0$ is a constraint, whereas $\partia... | 2012/12/03 | [
"https://physics.stackexchange.com/questions/45767",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10456/"
] | In general, a dynamical equation of motion or evolution equation is a (hyperbolic) second order in time differential equation. They determine the evolution of the system.
$\partial\_{\mu}F^{i\mu}$ is a dynamical equation.
However, a constraint is a condition that must be verified at *every* time and, in particular, t... | In field theory, a conservation law just states that some quantity is conserved: if $\partial\_\mu \, \star = 0$ where $\star$ is a vector or a tensor, you can associate a conserved charge etc. - you know the spiel I guess.
Constraints are something you impose by hand (or by experiment).
Finally, equations of motion... |
45,767 | Every now and then, I find myself reading papers/text talking about how *this* equation is a constraint but *that* equation is an equation of motion which satisfies *this* constraint.
For example, in the Hamiltonian formulation of Maxwell's theory, Gauss' law $\nabla\cdot\mathbf{E}=0$ is a constraint, whereas $\partia... | 2012/12/03 | [
"https://physics.stackexchange.com/questions/45767",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10456/"
] | An equation of motion is a (system of) equation for the basic observables of a system involving a time derivative, for which some initial-value problem is well-posed.
Thus a continuity equation is normally not an equation of motion, though it can be part of one, if currents are basic fields. | In field theory, a conservation law just states that some quantity is conserved: if $\partial\_\mu \, \star = 0$ where $\star$ is a vector or a tensor, you can associate a conserved charge etc. - you know the spiel I guess.
Constraints are something you impose by hand (or by experiment).
Finally, equations of motion... |
45,767 | Every now and then, I find myself reading papers/text talking about how *this* equation is a constraint but *that* equation is an equation of motion which satisfies *this* constraint.
For example, in the Hamiltonian formulation of Maxwell's theory, Gauss' law $\nabla\cdot\mathbf{E}=0$ is a constraint, whereas $\partia... | 2012/12/03 | [
"https://physics.stackexchange.com/questions/45767",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10456/"
] | In general, a dynamical equation of motion or evolution equation is a (hyperbolic) second order in time differential equation. They determine the evolution of the system.
$\partial\_{\mu}F^{i\mu}$ is a dynamical equation.
However, a constraint is a condition that must be verified at *every* time and, in particular, t... | OP wrote(v2):
>
> *What makes an equation an 'equation of motion'?*
>
>
>
As David Zaslavsky mentions in a comment, in full generality, there isn't an exact definition. Loosely speaking, [equations of motion](http://en.wikipedia.org/wiki/Equations_of_motion) are [evolution equations](http://www.encyclopediaofmath... |
45,767 | Every now and then, I find myself reading papers/text talking about how *this* equation is a constraint but *that* equation is an equation of motion which satisfies *this* constraint.
For example, in the Hamiltonian formulation of Maxwell's theory, Gauss' law $\nabla\cdot\mathbf{E}=0$ is a constraint, whereas $\partia... | 2012/12/03 | [
"https://physics.stackexchange.com/questions/45767",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10456/"
] | An equation of motion is a (system of) equation for the basic observables of a system involving a time derivative, for which some initial-value problem is well-posed.
Thus a continuity equation is normally not an equation of motion, though it can be part of one, if currents are basic fields. | OP wrote(v2):
>
> *What makes an equation an 'equation of motion'?*
>
>
>
As David Zaslavsky mentions in a comment, in full generality, there isn't an exact definition. Loosely speaking, [equations of motion](http://en.wikipedia.org/wiki/Equations_of_motion) are [evolution equations](http://www.encyclopediaofmath... |
17,228 | I'm working with the following op-amps:
LM308AN
LM358P
UA741CP
I want to make a small box that will control the power to any string of christmas lights based off of music that is playing. I would like it to pulse with the base. I want the input to be the signal from the headphone jack of my computer and I want the ou... | 2011/07/22 | [
"https://electronics.stackexchange.com/questions/17228",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5100/"
] | Sometimes, simply stating what you're trying to accomplish is better than asking the question you *think* you want to ask. This could very well be the case here. So, indulge me as I try to restate your situation and provide some sort of answer.
You have a headphone jack with some music on it, and you want that music t... | **\* See important addition at end \***
You have not provided enough information to allow a good answer. Provide more information and I'll upgrade this answer progressively.
You don't explain what you are trying to do. Do you you want the relay to operate on sound peaks, or when sound is present at all, or to latch ... |
7,809,215 | I have a project of business objects and a data layer that could potentially be implemented in multiple interfaces (web site, web services, console app, etc).
My question deals with how to properly implement caching in the methods dealing with data retrieval. I'll be using SqlCacheDependency to determine when the cach... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7809215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30006/"
] | You can use "-sync y" on your qsub to cause the qsub to wait until the job(s) are finished. | Jenkins allows for you to submit the results of a build using a web based API. I currently use this to monitor a job remotely for a grid at my orginization. If you have the ability to perform a web post to the jenkins server you could use the below script to accomplish the job.
```
#!/bin/bash
MESSAGE="Some message a... |
7,809,215 | I have a project of business objects and a data layer that could potentially be implemented in multiple interfaces (web site, web services, console app, etc).
My question deals with how to properly implement caching in the methods dealing with data retrieval. I'll be using SqlCacheDependency to determine when the cach... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7809215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30006/"
] | You can use "-sync y" on your qsub to cause the qsub to wait until the job(s) are finished. | The [Jenkins SGE Cloud plugin](https://wiki.jenkins-ci.org/display/JENKINS/SGE+Cloud+Plugin) submits builds to the Sun Grid Engine (SGE) batch scheduler. Both the open source version of SGE and the commercial Univa Grid Engine (UGE) are supported.
This plugin adds a new type of build step *Run job on SGE* that submits... |
7,809,215 | I have a project of business objects and a data layer that could potentially be implemented in multiple interfaces (web site, web services, console app, etc).
My question deals with how to properly implement caching in the methods dealing with data retrieval. I'll be using SqlCacheDependency to determine when the cach... | 2011/10/18 | [
"https://Stackoverflow.com/questions/7809215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30006/"
] | Jenkins allows for you to submit the results of a build using a web based API. I currently use this to monitor a job remotely for a grid at my orginization. If you have the ability to perform a web post to the jenkins server you could use the below script to accomplish the job.
```
#!/bin/bash
MESSAGE="Some message a... | The [Jenkins SGE Cloud plugin](https://wiki.jenkins-ci.org/display/JENKINS/SGE+Cloud+Plugin) submits builds to the Sun Grid Engine (SGE) batch scheduler. Both the open source version of SGE and the commercial Univa Grid Engine (UGE) are supported.
This plugin adds a new type of build step *Run job on SGE* that submits... |
161,751 | I've created a custom user role and am attempting to change the users role from CUSTOMER to ADVOCATE on purchase of a particular product (using WooCommerce). I'm really close but struggling to get the correctly serialized data into my table:
```
$order = new WC_Order( $order_id );
$items = $order->get_items();
$new_... | 2014/09/17 | [
"https://wordpress.stackexchange.com/questions/161751",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/45504/"
] | I think you are not handling the array part correctly.
The right syntax is -
```
$new_role = array("advocate" => 1);
```
The syntax that you have used is shown when you print some array on your screen but it should be written in above format in your PHP code. Currently, you are capturing it as a string and not an a... | In addition to syntax correction from WisdmLabs above I also found that I was effectively serialising the string TWICE as it will be automatically serialized when using update\_user\_meta. Not sure at which point I started serialising it myself but apparently that was completely unnecessary.
<http://codex.wordpress.o... |
161,751 | I've created a custom user role and am attempting to change the users role from CUSTOMER to ADVOCATE on purchase of a particular product (using WooCommerce). I'm really close but struggling to get the correctly serialized data into my table:
```
$order = new WC_Order( $order_id );
$items = $order->get_items();
$new_... | 2014/09/17 | [
"https://wordpress.stackexchange.com/questions/161751",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/45504/"
] | I think you are not handling the array part correctly.
The right syntax is -
```
$new_role = array("advocate" => 1);
```
The syntax that you have used is shown when you print some array on your screen but it should be written in above format in your PHP code. Currently, you are capturing it as a string and not an a... | The b in the serialized string means boolean. So you need to use true instead of one. And serializing it results in double serialization which explains "s:25:" in the beginning. Try this:
```
update_user_meta(46, 'wp_capabilities', array('employer'=>true));
``` |
161,751 | I've created a custom user role and am attempting to change the users role from CUSTOMER to ADVOCATE on purchase of a particular product (using WooCommerce). I'm really close but struggling to get the correctly serialized data into my table:
```
$order = new WC_Order( $order_id );
$items = $order->get_items();
$new_... | 2014/09/17 | [
"https://wordpress.stackexchange.com/questions/161751",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/45504/"
] | In addition to syntax correction from WisdmLabs above I also found that I was effectively serialising the string TWICE as it will be automatically serialized when using update\_user\_meta. Not sure at which point I started serialising it myself but apparently that was completely unnecessary.
<http://codex.wordpress.o... | The b in the serialized string means boolean. So you need to use true instead of one. And serializing it results in double serialization which explains "s:25:" in the beginning. Try this:
```
update_user_meta(46, 'wp_capabilities', array('employer'=>true));
``` |
37,826,786 | I need to create ordered lists for a specific type of genealogy report called a register. In a register, all children are numbered with lower-case Roman numerals, and those with descendants also get an Arabic numeral, like this:
```
First Generation
1. Joe Smith
2 i. Joe Smith Jr.
ii. Fred Smith
3 iii... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37826786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5559646/"
] | The problem in that query is the semicolon, which is the default query delimiter.
In order to change the delimiter in HeidiSQL, add the DELIMITER client command above the `CREATE PROCEDURE` query:
```
DELIMITER \\
SELECT 1\\
CREATE PROCEDURE ...\\
DELIMITER ;
```
HeidiSQL also has a procedure designer, with no need... | Try this one
```
DELIMITER //
CREATE PROCEDURE SP_FORM20_POST(
P_SESSIONID VARCHAR(256)
)
BEGIN
INSERT INTO tbForm20
( SESSIONID, RegDT)
VALUES
( P_SESSIONID, NOW());
END //
DELIMITER;
``` |
37,826,786 | I need to create ordered lists for a specific type of genealogy report called a register. In a register, all children are numbered with lower-case Roman numerals, and those with descendants also get an Arabic numeral, like this:
```
First Generation
1. Joe Smith
2 i. Joe Smith Jr.
ii. Fred Smith
3 iii... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37826786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5559646/"
] | The problem is this. The database reads the `;` in your code as an end of the procedure. You probably don't intend it like that :). The `DELIMITER` command takes care of that by changing `;` to something customizable, like `$$`. Try this:
```
DELIMITER $$
CREATE PROCEDURE SP_FORM20_POST(
P_SESSIONID VARCHAR(25... | Try this one
```
DELIMITER //
CREATE PROCEDURE SP_FORM20_POST(
P_SESSIONID VARCHAR(256)
)
BEGIN
INSERT INTO tbForm20
( SESSIONID, RegDT)
VALUES
( P_SESSIONID, NOW());
END //
DELIMITER;
``` |
3,151,938 | I want to create a site using a cms, but I want to use my own look and feel. I want to be able to upload downloadable content such as mp3 files with a flash player. I also want users to sign up and login. I want to be able to track and log downloads and uploads done by users. Any suggestions? | 2010/06/30 | [
"https://Stackoverflow.com/questions/3151938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220007/"
] | There are dozens of different CMS systems and each works slightly different and is geared for a specific use case. Some of the most popular PHP CMS systems are:
[Drupal](http://drupal.org) - One of my favorites. Very powerful and extensible but a large learning curve and for most projects it can be overkill.
[Joomla]... | Sounds like [Drupal](http://drupal.org/) could satisfy your requirements.
* It would allow you to create a template for your own look and feel
* You can use the CCK and Views modules to create your own content types that support your downloadable files.
* Drupal has a robust built-in user account system.
* There are a... |
3,151,938 | I want to create a site using a cms, but I want to use my own look and feel. I want to be able to upload downloadable content such as mp3 files with a flash player. I also want users to sign up and login. I want to be able to track and log downloads and uploads done by users. Any suggestions? | 2010/06/30 | [
"https://Stackoverflow.com/questions/3151938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220007/"
] | There are dozens of different CMS systems and each works slightly different and is geared for a specific use case. Some of the most popular PHP CMS systems are:
[Drupal](http://drupal.org) - One of my favorites. Very powerful and extensible but a large learning curve and for most projects it can be overkill.
[Joomla]... | The two major ones that I can pick out off the top of my head are Drupal and Joomla, so I'd check both of those out. For a good comparison, read [this](http://www.topnotchthemes.com/blog/090224/drupal-vs-joomla-frank-comparison-ibm-consultant) article. |
3,151,938 | I want to create a site using a cms, but I want to use my own look and feel. I want to be able to upload downloadable content such as mp3 files with a flash player. I also want users to sign up and login. I want to be able to track and log downloads and uploads done by users. Any suggestions? | 2010/06/30 | [
"https://Stackoverflow.com/questions/3151938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220007/"
] | There are dozens of different CMS systems and each works slightly different and is geared for a specific use case. Some of the most popular PHP CMS systems are:
[Drupal](http://drupal.org) - One of my favorites. Very powerful and extensible but a large learning curve and for most projects it can be overkill.
[Joomla]... | I prefer [Typo3](http://typo3.org/).
Very powerful and great extension repository. For you requirements you dont even need any extension. But it will take a lot of time to get in. |
5,476,647 | I'm running into a problem submitting my application through the Application Loader. I'm receiving the message "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK."
I've installed Xcode 4.0.1 w/SDK 4.3 ("4A1006", March 24), and I've reinstalled both MonoDevelop an... | 2011/03/29 | [
"https://Stackoverflow.com/questions/5476647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29152/"
] | Apple changed the keys required in the application manifest in iOS SDK 4.3.1. We've released a new MonoDevelop build to track this. | Xcode 4.0.1 was released last week with the iOS 4.3.1 SDK, you need to install that. |
5,476,647 | I'm running into a problem submitting my application through the Application Loader. I'm receiving the message "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK."
I've installed Xcode 4.0.1 w/SDK 4.3 ("4A1006", March 24), and I've reinstalled both MonoDevelop an... | 2011/03/29 | [
"https://Stackoverflow.com/questions/5476647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29152/"
] | Apple changed the keys required in the application manifest in iOS SDK 4.3.1. We've released a new MonoDevelop build to track this. | One thought: Double-check that you're building/signing for release, and not e.g. for ad-hoc distribution. |
5,476,647 | I'm running into a problem submitting my application through the Application Loader. I'm receiving the message "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK."
I've installed Xcode 4.0.1 w/SDK 4.3 ("4A1006", March 24), and I've reinstalled both MonoDevelop an... | 2011/03/29 | [
"https://Stackoverflow.com/questions/5476647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29152/"
] | Apple changed the keys required in the application manifest in iOS SDK 4.3.1. We've released a new MonoDevelop build to track this. | i had this problem for one week and i just solve it today , it seems that SDK 4.3 has a problem with the monotouch anyway
the one works with me i uninstall the SDK and install SDK 4.2 with Xcode 3.2.5 and Remove monorouch 3.2.6 and install 3.2.3 . and it will work. |
13,594,537 | what does the "overused deferral" warning mean in iced coffeescript? It seems to happen when I throw an uncaught error in the code. How can I let the error bubble up as I need it be an uncaught error for unit testing. For instance, if my getByName method throws an error it bubbles up that iced coffeescript warning rath... | 2012/11/27 | [
"https://Stackoverflow.com/questions/13594537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/611750/"
] | This error is generated when a callback generated by `defer` is called more than once. In your case, it could be that `Profile.getByName` is calling its callback twice (or more). This warning almost always indicates an error in my experience.
You can disable this warning if you create a callback from a Rendezvous and ... | On top of Max's answer, the appropriate usage of the continuation style programming should be to replace the one-off callbacks, not the repetitive callbacks. All `await` does is to wait for all its deferrals to complete so it can move on. The following example using `node.js`'s `fs` module to read a large file would re... |
107,653 | In legal texts, at least in Sweden and Germany, it is common to print some parts of the body text in a smaller font. Is there a name for this typographic convention?
Examples:
[](https://i.stack.imgur.com/sLyzz.jpg)
[![Schmitt 2... | 2018/04/05 | [
"https://graphicdesign.stackexchange.com/questions/107653",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/12723/"
] | I believe it is called an "Inline Citation" or "In-Text Citation"
<https://owl.english.purdue.edu/owl/resource/560/02/>
Here: <http://www.easybib.com/guides/citation-guides/chicago-turabian/notes/> I believe they could be referring to the "same thing" but lacking an actual citation (as in your example) simply as a "n... | In Polish text Norm such things are called "Additions", "interjected terms" by publishers and "bracket definition" by lawyers. Or "Parenthesis" by linguistics.
The short definition of such text is
>
> two-side isolated intra-wording sequence
>
>
>
And in proofreading marks they are symbolised by **[p]** and **... |
22,348,782 | I'm using Json.Net to DeserializeObject Json data.
This is my Json
```
string datosContratos = {"Total":1,"Contrato":[{"Numero":1818,"CUPS":"ES003L0P","Direccion":"C. O ","TextoCiudad":"MADRID","Tarifa":"2"}]}
```
My classes are:
```
public class Contrato
{
public int Numero;
public String Cups;
publi... | 2014/03/12 | [
"https://Stackoverflow.com/questions/22348782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/979048/"
] | Just `IF(@CustomerID IS NULL)` is enough
```
IF(@CustomerID IS NULL)
BEGIN
--insert here..
INSERT INTO [tblCustomerMaster]
([CustomerName]
VALUES
(CustomerName)
SET @CustomerID = Scope_Identity() -- sql server syntax to get the ID after insert..
END
ELSE
BEGIN
-- update perhaps..
END... | You may try like this:
```
if (isnull(@customerID) == 1)
BEGIN
--Your code
END
ELSE
BEGIN
-- code
END
```
Also change this line
```
declare @CustomerID numeric(18,0)= (SELECT distinct [CustomerID] FROM [tblCustomerMaster] where CustomerName = @CustomerName)
```
with this:
```
declare @CustomerID n... |
22,340,864 | I am a VHDL coder, and haven't coded much with Verilog. I am going through someone else's code, and I came across this:
```
always@(posedge asix_clk_bufg or negedge pll_asix_locked)
begin
if (~pll_asix_locked)
asix_rst <= 0;
else if (timer[5]) // 355us between asix_clk and asix_rst (min is 200us)
... | 2014/03/12 | [
"https://Stackoverflow.com/questions/22340864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2002041/"
] | This is the way to infer a flip-flop with a positive edge clock (asix\_clk\_bufg) an asynchronous active low reset (pll\_asix\_locked) and a clock enable (timer[5]). There is a D input (tied to 1) and a Q output (asix\_rst).
I assume that the PLL starts off not locked so `asix_rst` is 0 until the first clock edge whe... | Latches are only generated with combinational always blocks. Since the signal in the sensitivity list is looking for the posedge of the clock, the code is generating sequential logic. Sequential logic will never generate a latch.
For more information read about [how transparent latches are created and how to avoid in... |
25,291,730 | I have and 3 images that I need to change like so:
Image 1 > Image 2 > Image 3 > Image 1 and so on in that loop.
**JavaScript**
```
function changeImage() {
if (document.getElementById("imgClickAndChange").src = "Webfiles/SUB15_15A.bmp")
{
document.getElementById("imgClickAndChange").src = "Webfiles... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25291730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3854096/"
] | On *img* click change the *src* attribute of the img tag and using a counter would help more rather checking the previous image source.
HTML :
```
<img src="http://www.clipartbest.com/cliparts/RiA/66K/RiA66KbMT.png" id="imgClickAndChange" onclick="changeImage()" usemap="#SUB15" />
```
JS :
```
var counter = 1;
im... | Use the triple equals '===' to check when if the src is equivalent or not. Using one equal '=' means you are assigning the value so you'll never get past the first if. |
25,291,730 | I have and 3 images that I need to change like so:
Image 1 > Image 2 > Image 3 > Image 1 and so on in that loop.
**JavaScript**
```
function changeImage() {
if (document.getElementById("imgClickAndChange").src = "Webfiles/SUB15_15A.bmp")
{
document.getElementById("imgClickAndChange").src = "Webfiles... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25291730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3854096/"
] | On *img* click change the *src* attribute of the img tag and using a counter would help more rather checking the previous image source.
HTML :
```
<img src="http://www.clipartbest.com/cliparts/RiA/66K/RiA66KbMT.png" id="imgClickAndChange" onclick="changeImage()" usemap="#SUB15" />
```
JS :
```
var counter = 1;
im... | You're using an assignment operator instead of a comparison operator in your if statements
```
if (document.getElementById("imgClickAndChange").src = "Webfiles/SUB15_15A.bmp")
```
should be
```
if (document.getElementById("imgClickAndChange").src == "Webfiles/SUB15_15A.bmp")
// ... |
63,844,611 | In most recent django documentation "Overriding from the project’s templates directory"
<https://docs.djangoproject.com/en/3.1/howto/overriding-templates/>
it shows that you can use the following path for templates:
```
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'... | 2020/09/11 | [
"https://Stackoverflow.com/questions/63844611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5934625/"
] | In order to use `BASE_DIR / 'templates'`, you need `BASE_DIR` to be a [`Path()`](https://docs.python.org/3/library/pathlib.html#pathlib.Path).
```
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
```
I suspect that your settings.py was created with an earlier version of Django, and therefo... | Thank you
```
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
``` |
3,486,881 | Group $G$ is abelian and finite. $\langle g\rangle = G$. $p$ is order of $G$ (and $\langle g\rangle$). $p=mn$, $m > 1$, $n > 1$. Why $\langle g^m\rangle < G$ (not $\langle g^m\rangle \le G$)? | 2019/12/25 | [
"https://math.stackexchange.com/questions/3486881",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/736839/"
] | Basic result in theory of cyclic groups: $\langle g\rangle =G\implies |g^m|=\dfrac n{\operatorname {gcd}(n,m)}$, where $n=|G|$. | As $|\langle g^m \rangle | = \dfrac {|G|} m$ and $m > 1$, so $|\langle g^m \rangle | < |G|$. |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | App Exposé
==========
Trigger using swipe gesture:
* **System Preferences → Trackpad → More Gestures → App Exposé**
Trigger using keys or mouse:
* **System Preferences → Mission Control**

Dock Icon:
* You can trigger App Exposé by right-clickin... | You can use `⌘` + `~` to toggle between multiple windows of the same app.
This is an OS X-wide keyboard shortcut, so it works in Word for Mac 2011, too. |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | App Exposé
==========
Trigger using swipe gesture:
* **System Preferences → Trackpad → More Gestures → App Exposé**
Trigger using keys or mouse:
* **System Preferences → Mission Control**

Dock Icon:
* You can trigger App Exposé by right-clickin... | In system preferences you can turn on the gesture for Application Exposè which is essentially Mission Control but only for either the current application or the one your cursor was hovering over in the dock at the time.
This should make it easier to see what it what, but overall it's simply not realistic to force Wind... |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | * [Hyperdock](http://hyperdock.bahoom.com/) will give you window previews of each open window
belonging to an application by hovering over the dock icon, which you
can then click to activate.

* [Witch](http://manytricks.com/witch/) has a popup panel ... | App Exposé
==========
Trigger using swipe gesture:
* **System Preferences → Trackpad → More Gestures → App Exposé**
Trigger using keys or mouse:
* **System Preferences → Mission Control**

Dock Icon:
* You can trigger App Exposé by right-clickin... |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | You can use `⌘` + `~` to toggle between multiple windows of the same app.
This is an OS X-wide keyboard shortcut, so it works in Word for Mac 2011, too. | In system preferences you can turn on the gesture for Application Exposè which is essentially Mission Control but only for either the current application or the one your cursor was hovering over in the dock at the time.
This should make it easier to see what it what, but overall it's simply not realistic to force Wind... |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | * [Hyperdock](http://hyperdock.bahoom.com/) will give you window previews of each open window
belonging to an application by hovering over the dock icon, which you
can then click to activate.

* [Witch](http://manytricks.com/witch/) has a popup panel ... | You can use `⌘` + `~` to toggle between multiple windows of the same app.
This is an OS X-wide keyboard shortcut, so it works in Word for Mac 2011, too. |
45,724 | I just made the switch from Windows to Mac, and one thing that's been bothering me is that on a Mac, I can't see multiple Word documents that I have open. On Windows, they all appear in the taskbar (after checking the option to not collapse instances of the same program) and I can quickly switch between them, which is ... | 2012/03/24 | [
"https://apple.stackexchange.com/questions/45724",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/20621/"
] | * [Hyperdock](http://hyperdock.bahoom.com/) will give you window previews of each open window
belonging to an application by hovering over the dock icon, which you
can then click to activate.

* [Witch](http://manytricks.com/witch/) has a popup panel ... | In system preferences you can turn on the gesture for Application Exposè which is essentially Mission Control but only for either the current application or the one your cursor was hovering over in the dock at the time.
This should make it easier to see what it what, but overall it's simply not realistic to force Wind... |
26,683,840 | I am trying to create a ListView inside a ListFragment. My list is customize, so it has been created with an adapter. But the aplication crass and give me this error *your content must have a listview whose id attribute is 'android.r.id.list*
This is the ListFragment class:
```
public static class DummySectionFragmen... | 2014/10/31 | [
"https://Stackoverflow.com/questions/26683840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507510/"
] | Ignoring the issue of non-linear state machines, I've found the following to work well for my needs on a few projects with simple state machines:
```
# Check if the stage is in or before the supplied stage (stage_to_check).
def in_or_before_stage?(stage_to_check)
if stage_to_check.present? && self.stage.present?
... | The problem here is that you don't have order inside state machine. You need to provide and declare one.
I would stick to this solution:
1. first declare constant in your model, containing states (in order!), so:
`STATES = [:new, :in_process, :done, :verified]`
2. And later, inside your model:
```
def current_state_... |
26,683,840 | I am trying to create a ListView inside a ListFragment. My list is customize, so it has been created with an adapter. But the aplication crass and give me this error *your content must have a listview whose id attribute is 'android.r.id.list*
This is the ListFragment class:
```
public static class DummySectionFragmen... | 2014/10/31 | [
"https://Stackoverflow.com/questions/26683840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3507510/"
] | Ignoring the issue of non-linear state machines, I've found the following to work well for my needs on a few projects with simple state machines:
```
# Check if the stage is in or before the supplied stage (stage_to_check).
def in_or_before_stage?(stage_to_check)
if stage_to_check.present? && self.stage.present?
... | If one takes care in defining the correct order in AASM and makes sure *not* to override any states (to specify extra options, for example), it is possible to use them.
The following mixin defines scopes like `Model.done_or_before` and `Model.in_process_or_after`, as well as methods like `m.done_or_before?`.
```
modu... |
34,051,203 | I had a question about the return statement that is by itself in the control flow.
```
var rockPaperScissors = function(n) {
var rounds = n;
var results = [];
var weapons = ['rock', 'paper', 'scissors'];
var recurse = function(roundsLeft, played) {
if( roundsLeft === 0) {
result... | 2015/12/02 | [
"https://Stackoverflow.com/questions/34051203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4785557/"
] | You don't need to find the item, you can use `wxMenuBar::IsChecked()`, which will do it for you, directly. And you can either just store the menu bar in `self.menuBar` or retrieve it from the frame using its `GetMenuBar()` method. | It's a bit convoluted, but not too bad. Basically you need to use the menu's `FindItem` method, which takes the string name of the menu item. This returns its id, which you can then use the menu's `FindItemById` method for. Here's a quick and dirty example:
```
import wx
##############################################... |
34,051,203 | I had a question about the return statement that is by itself in the control flow.
```
var rockPaperScissors = function(n) {
var rounds = n;
var results = [];
var weapons = ['rock', 'paper', 'scissors'];
var recurse = function(roundsLeft, played) {
if( roundsLeft === 0) {
result... | 2015/12/02 | [
"https://Stackoverflow.com/questions/34051203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4785557/"
] | It's a bit convoluted, but not too bad. Basically you need to use the menu's `FindItem` method, which takes the string name of the menu item. This returns its id, which you can then use the menu's `FindItemById` method for. Here's a quick and dirty example:
```
import wx
##############################################... | Use the event to access the data you want.
```
print event.Id
print event.Selection # returns 1 if checked 0 if not checked
print event.IsChecked() # returns True if checked False if not checked
```
print out all of the attributes with:
```
print dir(event)
``` |
34,051,203 | I had a question about the return statement that is by itself in the control flow.
```
var rockPaperScissors = function(n) {
var rounds = n;
var results = [];
var weapons = ['rock', 'paper', 'scissors'];
var recurse = function(roundsLeft, played) {
if( roundsLeft === 0) {
result... | 2015/12/02 | [
"https://Stackoverflow.com/questions/34051203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4785557/"
] | You don't need to find the item, you can use `wxMenuBar::IsChecked()`, which will do it for you, directly. And you can either just store the menu bar in `self.menuBar` or retrieve it from the frame using its `GetMenuBar()` method. | Use the event to access the data you want.
```
print event.Id
print event.Selection # returns 1 if checked 0 if not checked
print event.IsChecked() # returns True if checked False if not checked
```
print out all of the attributes with:
```
print dir(event)
``` |
73,752,793 | We are using ObjectMapper. When using ObjectMapper with RowMapper, should it be declared inside each mapRow (seen below), or outside of mapRow as a class public member? I assume it should be outside as a public class member per this article. [Should I declare Jackson's ObjectMapper as a static field?](https://stackover... | 2022/09/17 | [
"https://Stackoverflow.com/questions/73752793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15435022/"
] | An [`ObjectMapper`](https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/ObjectMapper.html) instance is not immutable but, as stated in the documentation:
>
> Mapper instances are fully thread-safe provided that ALL configuration of the instance occurs before ANY
> read or write cal... | Yes, probably you should declare it is a class level field.
It's never recommended to create redundant objects. |
19,666,102 | >
> A certain string-processing language offers a primitive operation which splits a string into two pieces. Since this operation involves copying the original string, it takes n units of time for a string of length n, regardless of the location of the cut. Suppose, now, that you want to break a string into many piece... | 2013/10/29 | [
"https://Stackoverflow.com/questions/19666102",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2925372/"
] | I think your recurrence relation can become more better. Here's what I came up with, define cost(i,j) to be the cost of cutting the string from index i to j. Then,
```
cost(i,j) = min {length of substring + cost(i,k) + cost(k,j) where i < k < j}
``` | ```
void s_cut()
{
int l,p;
int temp=0;
//ArrayList<Integer> al = new ArrayList<Integer>();
int al[];
Scanner s=new Scanner(System.in);
int table[][];
ArrayList<Integer> values[][];
int low=0,high=0;
int min=0;
l=s.nextInt();
p=s.nextInt();
System.out.println("T... |
54,794,538 | I have two dataframes
**df1**
```
+----+-------+
| | Key |
|----+-------|
| 0 | 30 |
| 1 | 31 |
| 2 | 32 |
| 3 | 33 |
| 4 | 34 |
| 5 | 35 |
+----+-------+
```
**df2**
```
+----+-------+--------+
| | Key | Test |
|----+-------+--------|
| 0 | 30 | Test4 |
| 1 | 30 | Test... | 2019/02/20 | [
"https://Stackoverflow.com/questions/54794538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10540565/"
] | Check with `crosstab`
```
pd.crosstab(df2.Key,df2.Test).reindex(df1.Key).replace({0:''})
``` | Here another solution with groupby & pivot. Using this solution you don't need df1 at all.
```
# | create some dummy data
tests = ['Test' + str(i) for i in range(1,7)]
df = pd.DataFrame({'Test': np.random.choice(tests, size=100), 'Key': np.random.randint(30, 35, size=100)})
df['Count Variable'] = 1
# | group & count ... |
4,712,335 | I want to convert a string which contains the date in `yyyyMMdd` format to `mm-dd-yyyy` DateTime format. How do I get it? | 2011/01/17 | [
"https://Stackoverflow.com/questions/4712335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578083/"
] | ```
var dateString = "20050802";
var date = myDate = DateTime.ParseExact(dateString,
"yyyyMMdd",
System.Globalization.CultureInfo.InvariantCulture);
``` | ```
public static DateTime ConvertDate(string date, string pattern)
{
DateTime retval = DateTime.MinValue;
if (System.DateTime.TryParseExact(date, pattern, System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.None, out retval))
return retval;
// Could not convert date..
return DateT... |
4,712,335 | I want to convert a string which contains the date in `yyyyMMdd` format to `mm-dd-yyyy` DateTime format. How do I get it? | 2011/01/17 | [
"https://Stackoverflow.com/questions/4712335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578083/"
] | ```
var dateString = "20050802";
var date = myDate = DateTime.ParseExact(dateString,
"yyyyMMdd",
System.Globalization.CultureInfo.InvariantCulture);
``` | ```
CultureInfo provider = CultureInfo.CreateSpecificCulture("en-UK");
string dateString = "19850121"; //in yyyyMMdd format
string oldFormat = "yyyyMMdd";
DateTime result = DateTime.ParseExact(dateString, oldFormat, provider); //MM/dd/yyyyformat
``` |
4,712,335 | I want to convert a string which contains the date in `yyyyMMdd` format to `mm-dd-yyyy` DateTime format. How do I get it? | 2011/01/17 | [
"https://Stackoverflow.com/questions/4712335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578083/"
] | ```
public static DateTime ConvertDate(string date, string pattern)
{
DateTime retval = DateTime.MinValue;
if (System.DateTime.TryParseExact(date, pattern, System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.None, out retval))
return retval;
// Could not convert date..
return DateT... | ```
CultureInfo provider = CultureInfo.CreateSpecificCulture("en-UK");
string dateString = "19850121"; //in yyyyMMdd format
string oldFormat = "yyyyMMdd";
DateTime result = DateTime.ParseExact(dateString, oldFormat, provider); //MM/dd/yyyyformat
``` |
75,038 | I want it to perform good enough as a multimedia machine. Should I get one that is fan cooled or passively cooled? I think I want one with an HDMI port.
What chipset should I look for? | 2009/11/25 | [
"https://superuser.com/questions/75038",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | I agree with an Ion chipset, there's really no competition in the quiet/ITX space. I've got one of [these](http://www.newegg.com/Product/Product.aspx?Item=N82E16813500035&cm_re=zotac-_-13-500-035-_-Product) powering a secondary HTPC for my bedroom. It has a [Celeron 430](http://www.newegg.com/Product/Product.aspx?Item=... | If you want a really small system, look for a machine based on Nvidia ION - basically, it has a Atom CPU and can do 1080p output whilst keeping electricity usage low.
I have not seen many machines recently that are passively cooled, but a lot of the newer Atom boards have low noise fans. |
75,038 | I want it to perform good enough as a multimedia machine. Should I get one that is fan cooled or passively cooled? I think I want one with an HDMI port.
What chipset should I look for? | 2009/11/25 | [
"https://superuser.com/questions/75038",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | I agree with an Ion chipset, there's really no competition in the quiet/ITX space. I've got one of [these](http://www.newegg.com/Product/Product.aspx?Item=N82E16813500035&cm_re=zotac-_-13-500-035-_-Product) powering a secondary HTPC for my bedroom. It has a [Celeron 430](http://www.newegg.com/Product/Product.aspx?Item=... | +1 for an ion as a multimedia machine. low power (both CPU and Wattage) but with a graphics chipset that can hadnle FULL 1080p HD.
some even come with an HDMI port.
If you want a nice easy answer, some pre built ion nettops exist such as the Acer revo, or asus ionstar |
2,305 | Over on Twitter, @kelvinfichter [gave an analysis](https://twitter.com/kelvinfichter/status/1425217046636371969) (included below) of the recent Poly Network hack.
***Without any of the benefits of hindsight, are there reasons why the exploit would have been less likely to occur in Plutus on Cardano?***
>
> Poly has ... | 2021/08/11 | [
"https://cardano.stackexchange.com/questions/2305",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/1903/"
] | This one is a bit technical it has to do with looking up and updating the constraints of an already existing transaction (that belongs to the script address). See Case ii) to skip my synopsis.
Just a little synopsis for future readers: The [`Core.hs`](https://github.com/input-output-hk/plutus-pioneer-program/blob/main... | I share your confusion around this. I think a lot of it is due to the flux in the codebase.
On the other hand, I don't think it is anything complicated. The main purpose of Lookups, and thus also those two lines is to supply information needed for the transaction.
I noted that `Constraints.otherScript` seems to be co... |
72,528,078 | I have a csv file that looks like:
```
,,,,,,,,
,,,,a,b,c,d,e
,,,"01.01.2022, 00:00 - 01:00",82.7,57.98,0.0,0.0,0.0
,,,"01.01.2022, 01:00 - 02:00",87.6,50.05,15.0,25.570000000000004,383.55000000000007
,,,"01.01.2022, 02:00 - 03:00",87.6,41.33,0.0,0.0,0.0
```
And I want to import headers first and then the data, and ... | 2022/06/07 | [
"https://Stackoverflow.com/questions/72528078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15184843/"
] | like this?
```
data.table::fread(',,,,,,,,
,,,,a,b,c,d,e
,,,"01.01.2022, 00:00 - 01:00",82.7,57.98,0.0,0.0,0.0
,,,"01.01.2022, 01:00 - 02:00",87.6,50.05,15.0,25.570000000000004,383.55000000000007
,,,"01.01.2022, 02:00 - 03:00",87.6,41.33,0.0,0.0,0... | Without using any libraries:
```r
colClasses <- c("NULL", "NULL", "NULL", "character", "numeric", "numeric", "numeric", "numeric")
read.csv(file, header = TRUE, skip = 1, colClasses = colClasses)
# X.3 a b c d
# 1 01.01.2022, 00:00 - 01:00 82.7 57.98 0 0.00
# 2 01.01.2022, 01:0... |
3,349,400 | I have a question, which might also fit on stackoverflow, but due to I think I made some mistake in my mathematical considerations I think math.stackexchange is more proper for my question.
Currently I'm writing a (python) program, where a small part of it deals with matrix logarithms. Due to I'm looking for a mistake... | 2019/09/09 | [
"https://math.stackexchange.com/questions/3349400",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/432130/"
] | Well, a quick search revealed the following answer (from [Wikipedia](https://en.wikipedia.org/wiki/Logarithm_of_a_matrix)):
>
> The answer is more involved in the real setting. **A real matrix has a real logarithm if and only if it is invertible and each Jordan block belonging to a negative eigenvalue occurs an even ... | It's clear that the logarithm of a real matrix *can* be complex; for example if $A=[-1]$ then $\log A=[\log -1]$. For equally simple $n\times n$ examples with $n>1$ consider diagonal matrices... |
66,025,267 | On Qt Creator `Tools`>`Options`>`Build & Run`>`Default Build Properties` the `Default build directory`
has the value defined in terms of variables
```
../%{JS: Util.asciify("_build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}")}
```
which result in something like
```
_build-Project1-Desk... | 2021/02/03 | [
"https://Stackoverflow.com/questions/66025267",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5082463/"
] | This worked for me.
```
:host ::ng-deep .multiselect-dropdown .dropdown-btn {
padding: 6px 24px 6px 12px !important;
}
``` | ```
.multiselect-dropdown .dropdown-btn {
padding :6px 12px !important;
}
``` |
66,025,267 | On Qt Creator `Tools`>`Options`>`Build & Run`>`Default Build Properties` the `Default build directory`
has the value defined in terms of variables
```
../%{JS: Util.asciify("_build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}")}
```
which result in something like
```
_build-Project1-Desk... | 2021/02/03 | [
"https://Stackoverflow.com/questions/66025267",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5082463/"
] | This worked for me.
```
:host ::ng-deep .multiselect-dropdown .dropdown-btn {
padding: 6px 24px 6px 12px !important;
}
``` | This worked for me.
```
:host ::ng-deep .multiselect-dropdown .dropdown-btn .selected-item {
width: 90%;
}
``` |
29,413,180 | I have a multiple select option that display the result in a div container, when click on ctrl+"orange""apple""banana" the result display: "orange, apple, banana" in one line, but i want to display each result in a new single line with a link that goes to different page like this:
Orange - "goes to a link"
Apple -... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29413180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742303/"
] | You can try adding `<br/>` element after every selected option. I have used `<label>` element but you can add link or any other element you want
```
$(document).ready( function ()
{
$('#select-custom-19').change(function(){
$('#yourfruit').empty();
var values = $(this).val();
for(v... | try below
```
<script src="jquery-mobile/jquery-1.8.3.min.js" type="text/javascript"></script>
<select name="" multiple="multiple" id="select-custom-19">
<option>Add Fruits</option>
<option value="orange" selected>orange</option>
<option value="apple">apple</option>
<option value="banana">banana</option>
</sel... |
29,413,180 | I have a multiple select option that display the result in a div container, when click on ctrl+"orange""apple""banana" the result display: "orange, apple, banana" in one line, but i want to display each result in a new single line with a link that goes to different page like this:
Orange - "goes to a link"
Apple -... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29413180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742303/"
] | You can iterate throug items and display them, append an anchor (`<a />`) and use `<br />` for a new line.
Make sure to add `.empty()` to clean the fruits from list before `.append()` other items to `$('#yourfruit')`, like in example below.
```
var fruits = $(this).val();
$('#yourfruit').empty();
for (var fruit in f... | try below
```
<script src="jquery-mobile/jquery-1.8.3.min.js" type="text/javascript"></script>
<select name="" multiple="multiple" id="select-custom-19">
<option>Add Fruits</option>
<option value="orange" selected>orange</option>
<option value="apple">apple</option>
<option value="banana">banana</option>
</sel... |
29,413,180 | I have a multiple select option that display the result in a div container, when click on ctrl+"orange""apple""banana" the result display: "orange, apple, banana" in one line, but i want to display each result in a new single line with a link that goes to different page like this:
Orange - "goes to a link"
Apple -... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29413180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742303/"
] | You can try adding `<br/>` element after every selected option. I have used `<label>` element but you can add link or any other element you want
```
$(document).ready( function ()
{
$('#select-custom-19').change(function(){
$('#yourfruit').empty();
var values = $(this).val();
for(v... | You may add `HTML` tags as per your requirements, like `<a>` or `</br>`
```js
$(document).ready(function () {
$('#select-custom-19').change(function () {
$('#yourfruit').text("");
if($(this).val() != null)
{
$(this).val().forEach(function (value, index) {
$('... |
29,413,180 | I have a multiple select option that display the result in a div container, when click on ctrl+"orange""apple""banana" the result display: "orange, apple, banana" in one line, but i want to display each result in a new single line with a link that goes to different page like this:
Orange - "goes to a link"
Apple -... | 2015/04/02 | [
"https://Stackoverflow.com/questions/29413180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4742303/"
] | You can iterate throug items and display them, append an anchor (`<a />`) and use `<br />` for a new line.
Make sure to add `.empty()` to clean the fruits from list before `.append()` other items to `$('#yourfruit')`, like in example below.
```
var fruits = $(this).val();
$('#yourfruit').empty();
for (var fruit in f... | You may add `HTML` tags as per your requirements, like `<a>` or `</br>`
```js
$(document).ready(function () {
$('#select-custom-19').change(function () {
$('#yourfruit').text("");
if($(this).val() != null)
{
$(this).val().forEach(function (value, index) {
$('... |
72,889,130 | I am currently doing the US Medical Insurance Cost Portfolio Project through Code Academy and am having trouble combining two lists into a single dictionary. I created two new lists (`smoking_status` and `insurance_costs`) in hope of investigating how insurance costs differ between smokers and non-smokers. When I try t... | 2022/07/06 | [
"https://Stackoverflow.com/questions/72889130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19497618/"
] | >
> Is there a way to update Progressbar from another thread
>
>
>
Short answer: No. A control can only be updated on the thread on which it was originally created.
What you can do is to display the `ProgressBar` in another window that runs on another thread and then close this window when the `RichTextBox` on th... | Create a method on your form to update the element you want to update and use invoke to run it from your thread
like that:
```
private void Form1_Load(object sender, EventArgs e)
{
Thread _thread = new Thread(() =>
{
//do some work
upDateUiElements();... |
72,889,130 | I am currently doing the US Medical Insurance Cost Portfolio Project through Code Academy and am having trouble combining two lists into a single dictionary. I created two new lists (`smoking_status` and `insurance_costs`) in hope of investigating how insurance costs differ between smokers and non-smokers. When I try t... | 2022/07/06 | [
"https://Stackoverflow.com/questions/72889130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19497618/"
] | >
> Is there a way to update Progressbar from another thread
>
>
>
Short answer: No. A control can only be updated on the thread on which it was originally created.
What you can do is to display the `ProgressBar` in another window that runs on another thread and then close this window when the `RichTextBox` on th... | You can add this to your usings:
```
using System.Windows.Threading;
```
For .NET 5/6, that is enough. For .NET framework you must also add a reference to `System.Windows.Presentation.dll`.
And this type of code will work fine:
```
private void Button_Click(object sender, RoutedEventArgs e)
{
// here we're in ... |
26,480,683 | I used code for sum cells of `datagridview1` like below
```
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
int sum = 0;
for (i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
if (dataGridView1.Rows[i].Cells[0].Value != null)
{
sum += Con... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26480683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4085654/"
] | Try this solution:
```
int sum = 0;
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
//for 1st column
if (dataGridView1.Rows[i].Cells[0].Value != null && !String.IsNullOrEmpty(dataGridView1.Rows[i].Cells[0].Value.ToString()))
sum += Convert.ToInt32(dataGridView1.Rows[i].Cells[0].Value.ToString(... | I think i have a solution for you, but it requires a Gridview, and not a datagridview so leave a comment if you will use it otherwise ill delete this.
```
foreach(GridViewRow row in gridCriteria.Rows)
{
foreach(TableCell cell in row.Cells)
{
if(cell.Text != "")
{
int... |
49,646,601 | So I've literally copy-pasted the code from <https://codepen.io/hellokatili/pen/rVvMZb> (HTML in a template, CSS in styles.css and JS using this plugin <https://wordpress.org/plugins/header-and-footer-scripts/>)
I added the JS script within tags.
Here is the above code from codepen (after converting from HAML to HTML... | 2018/04/04 | [
"https://Stackoverflow.com/questions/49646601",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1889865/"
] | You can also try the code by writing inside **jquery** ready :
```
(function($){
'use strict';
var prevButton = '<button type="button" data-role="none" class="slick-prev" aria-label="prev"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" version="1.1"><path fill="#FFFFFF" d="M 16,16.46 11.415,11.875... | **Can you try to add this jquery script in theme's footer.php for testing purpose like:**
var prevButton = '',
nextButton = '';
```
jQuery('.single-item').slick({
infinite: true,
dots: true,
autoplay: true,
autoplaySpeed: 4000,
speed: 1000,
cssEase: 'ease-in-out',
prevArrow: prevButton,
nextArrow: ne... |
53,111,297 | My function is given a 'to\_find\_value' then I have 2 lists which are the same in length and index values. Once I find the index value in list 1 that 'to\_find\_value' is in, I want to take that index of list 2 and return the value found at list 2.
Ex:
```
function_name('tree', ['bush', 'tree', 'shrub'], ['red', '... | 2018/11/02 | [
"https://Stackoverflow.com/questions/53111297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438529/"
] | Something like:
```
def f(a,b,c):
return c[b.index(a)]
```
Then call it like:
```
print(f('tree', ['bush', 'tree', 'shrub'], ['red', 'green', 'yellow']))
```
Output is:
```
green
``` | Use the index method:
```
return list2[list1.index(plant)]
``` |
53,111,297 | My function is given a 'to\_find\_value' then I have 2 lists which are the same in length and index values. Once I find the index value in list 1 that 'to\_find\_value' is in, I want to take that index of list 2 and return the value found at list 2.
Ex:
```
function_name('tree', ['bush', 'tree', 'shrub'], ['red', '... | 2018/11/02 | [
"https://Stackoverflow.com/questions/53111297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438529/"
] | Something like:
```
def f(a,b,c):
return c[b.index(a)]
```
Then call it like:
```
print(f('tree', ['bush', 'tree', 'shrub'], ['red', 'green', 'yellow']))
```
Output is:
```
green
``` | You can use index method for list
```
>>> ["foo", "bar", "baz"].index("bar")
1
```
This will return the index of the first occurrence |
53,111,297 | My function is given a 'to\_find\_value' then I have 2 lists which are the same in length and index values. Once I find the index value in list 1 that 'to\_find\_value' is in, I want to take that index of list 2 and return the value found at list 2.
Ex:
```
function_name('tree', ['bush', 'tree', 'shrub'], ['red', '... | 2018/11/02 | [
"https://Stackoverflow.com/questions/53111297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438529/"
] | Something like:
```
def f(a,b,c):
return c[b.index(a)]
```
Then call it like:
```
print(f('tree', ['bush', 'tree', 'shrub'], ['red', 'green', 'yellow']))
```
Output is:
```
green
``` | If I'm understanding you correctly, the function your looking for is index, which will return the index of the element in the list if it exists (and throw a value error if it doesn't). You can do something like this:
```
list2[list1.index("tree")]
```
list1.index("tree") will return 1, which you can then use to acc... |
53,111,297 | My function is given a 'to\_find\_value' then I have 2 lists which are the same in length and index values. Once I find the index value in list 1 that 'to\_find\_value' is in, I want to take that index of list 2 and return the value found at list 2.
Ex:
```
function_name('tree', ['bush', 'tree', 'shrub'], ['red', '... | 2018/11/02 | [
"https://Stackoverflow.com/questions/53111297",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10438529/"
] | Something like:
```
def f(a,b,c):
return c[b.index(a)]
```
Then call it like:
```
print(f('tree', ['bush', 'tree', 'shrub'], ['red', 'green', 'yellow']))
```
Output is:
```
green
``` | You can use the built-in `enumerate` function to keep track of the index and the item at the same time:
```
for idx, plant in enumerate(plant_data):
if plant in list1:
list1[idx] = list2[idx]
``` |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Just going to take an initial stab at this, I can update this is you add more tests cases or details to your question:
```
\w+="<.*>(.*)</.*>"
```
This matches your provided example, in addition it doesn't matter if:
* the variable name is different
* the tag or contents of the tag wrapping the text are different
... | No need for a regex, just parse the string with [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) and get the element and then use the DOM object methods/attributes
```
var parser = new DOMParser();
var str='<a href='www.google.com'>Google</a>";
var dom = parser.parseFromString(str,"text/xml");
... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Insert the HTML string into an element, and then just get the text ?
```
var str = "<a href=www.google.com>Google</a>";
var div = document.createElement('div');
div.innerHTML = str;
var txt = div.textContent ? div.textContent : div.innerText;
```
[**FIDDLE**](http://jsfiddle.net/ScacH/1/)
In jQuery this would be :... | No need for a regex, just parse the string with [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) and get the element and then use the DOM object methods/attributes
```
var parser = new DOMParser();
var str='<a href='www.google.com'>Google</a>";
var dom = parser.parseFromString(str,"text/xml");
... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Just going to take an initial stab at this, I can update this is you add more tests cases or details to your question:
```
\w+="<.*>(.*)</.*>"
```
This matches your provided example, in addition it doesn't matter if:
* the variable name is different
* the tag or contents of the tag wrapping the text are different
... | Assuming that you are using java, from the provided code.
I would recommend you to use [JSoup](http://jsoup.org/cookbook/extracting-data/attributes-text-html) to extract text inside anchor tag.
Here's a reason why. [Using regular expressions to parse HTML: why not?](https://stackoverflow.com/questions/590747/using-... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Insert the HTML string into an element, and then just get the text ?
```
var str = "<a href=www.google.com>Google</a>";
var div = document.createElement('div');
div.innerHTML = str;
var txt = div.textContent ? div.textContent : div.innerText;
```
[**FIDDLE**](http://jsfiddle.net/ScacH/1/)
In jQuery this would be :... | Well, if you're using JQuery this should be an easy task.
I would just create an invisible div and render this anchor () on it. Afterwards you could simply select the anchor and get it's inner text.
```
$('body').append('<div id="invisibleDiv" style="display:none;"></div>'); //create a new invisible div
$('#invisible... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | From the suggestions given by you all I got answer and works for me
```
function extractText(){
var anchText = "<a href=www.google.com>Google</a>";
var str1 = document.createElement('str1');
str1.innerHTML = anchText;
alert("hi "+str1.innerText);
return anc;
}
```
Thanks everyone for the suppor... | No need for a regex, just parse the string with [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) and get the element and then use the DOM object methods/attributes
```
var parser = new DOMParser();
var str='<a href='www.google.com'>Google</a>";
var dom = parser.parseFromString(str,"text/xml");
... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | From the suggestions given by you all I got answer and works for me
```
function extractText(){
var anchText = "<a href=www.google.com>Google</a>";
var str1 = document.createElement('str1');
str1.innerHTML = anchText;
alert("hi "+str1.innerText);
return anc;
}
```
Thanks everyone for the suppor... | Assuming that you are using java, from the provided code.
I would recommend you to use [JSoup](http://jsoup.org/cookbook/extracting-data/attributes-text-html) to extract text inside anchor tag.
Here's a reason why. [Using regular expressions to parse HTML: why not?](https://stackoverflow.com/questions/590747/using-... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I dont think you would like to use Regex for this. You may try simply like this:-
```
<a id="myLink" href="http://www.google.com">Google</a>
var anchor = document.getElementById("myLink");
alert(anchor.getAttribute("href")); // Extract link
alert(anchor.innerHTML); // Extract Text
```
[Sample DEMO](ht... | No need for a regex, just parse the string with [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) and get the element and then use the DOM object methods/attributes
```
var parser = new DOMParser();
var str='<a href='www.google.com'>Google</a>";
var dom = parser.parseFromString(str,"text/xml");
... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | From the suggestions given by you all I got answer and works for me
```
function extractText(){
var anchText = "<a href=www.google.com>Google</a>";
var str1 = document.createElement('str1');
str1.innerHTML = anchText;
alert("hi "+str1.innerText);
return anc;
}
```
Thanks everyone for the suppor... | Just going to take an initial stab at this, I can update this is you add more tests cases or details to your question:
```
\w+="<.*>(.*)</.*>"
```
This matches your provided example, in addition it doesn't matter if:
* the variable name is different
* the tag or contents of the tag wrapping the text are different
... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I dont think you would like to use Regex for this. You may try simply like this:-
```
<a id="myLink" href="http://www.google.com">Google</a>
var anchor = document.getElementById("myLink");
alert(anchor.getAttribute("href")); // Extract link
alert(anchor.innerHTML); // Extract Text
```
[Sample DEMO](ht... | Well, if you're using JQuery this should be an easy task.
I would just create an invisible div and render this anchor () on it. Afterwards you could simply select the anchor and get it's inner text.
```
$('body').append('<div id="invisibleDiv" style="display:none;"></div>'); //create a new invisible div
$('#invisible... |
19,166,342 | I am using a list view in which I have an xml referencing drawable/list as follows:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
//For the borders
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius... | 2013/10/03 | [
"https://Stackoverflow.com/questions/19166342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | No need for a regex, just parse the string with [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) and get the element and then use the DOM object methods/attributes
```
var parser = new DOMParser();
var str='<a href='www.google.com'>Google</a>";
var dom = parser.parseFromString(str,"text/xml");
... | Well, if you're using JQuery this should be an easy task.
I would just create an invisible div and render this anchor () on it. Afterwards you could simply select the anchor and get it's inner text.
```
$('body').append('<div id="invisibleDiv" style="display:none;"></div>'); //create a new invisible div
$('#invisible... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | A year? No. Babies already require 9 months in the womb to get to where they get. You're limited because many processes in growth require chemical processes that simply take time. Humans simply aren't cars to be manufactured.
A decade? Now its getting interesting. It is reasonable to assume that a human could grow fas... | Certainly not in a year, no. Growth is limited by multiple things, for example:
* bone ossification - bones need to both grow laterally and also get ossified. There's a few values for bone growth in children [in this paper](http://www.boneandjoint.org.uk/content/jbjsbr/44-B/1/42.full.pdf) - basically, a few centimeter... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | A year? No. Babies already require 9 months in the womb to get to where they get. You're limited because many processes in growth require chemical processes that simply take time. Humans simply aren't cars to be manufactured.
A decade? Now its getting interesting. It is reasonable to assume that a human could grow fas... | **18 weeks to 6 or 8 years, but it does not matter**
9 months to produce an infant is a long time compared to the initial growth rate of the embryo. At 4 weeks, the embryo is the size of a poppy seed (2 mm long), at 8 weeks, the size of a kidney bean (16 mm head to bottom). During that period, the human increased by a... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | A year? No. Babies already require 9 months in the womb to get to where they get. You're limited because many processes in growth require chemical processes that simply take time. Humans simply aren't cars to be manufactured.
A decade? Now its getting interesting. It is reasonable to assume that a human could grow fas... | It **REALLY** depends on what level of technology we're talking about here.
After all, given sufficiently advanced technology, we could "build" a person, atom by atom, to have all the same properties, education, mental and motor functions etc. as if they had developed the normal way over many years.
---
Let's assume... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | A year? No. Babies already require 9 months in the womb to get to where they get. You're limited because many processes in growth require chemical processes that simply take time. Humans simply aren't cars to be manufactured.
A decade? Now its getting interesting. It is reasonable to assume that a human could grow fas... | Human growth is subject to many limiting factors, including the ability of the mother to supply the required nutrients to the foetus, and after birth, the ability of the child to acquire the full range of expected social skills.
A young human is physically small in order to convey the impression of youth to other huma... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | Certainly not in a year, no. Growth is limited by multiple things, for example:
* bone ossification - bones need to both grow laterally and also get ossified. There's a few values for bone growth in children [in this paper](http://www.boneandjoint.org.uk/content/jbjsbr/44-B/1/42.full.pdf) - basically, a few centimeter... | **18 weeks to 6 or 8 years, but it does not matter**
9 months to produce an infant is a long time compared to the initial growth rate of the embryo. At 4 weeks, the embryo is the size of a poppy seed (2 mm long), at 8 weeks, the size of a kidney bean (16 mm head to bottom). During that period, the human increased by a... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | Certainly not in a year, no. Growth is limited by multiple things, for example:
* bone ossification - bones need to both grow laterally and also get ossified. There's a few values for bone growth in children [in this paper](http://www.boneandjoint.org.uk/content/jbjsbr/44-B/1/42.full.pdf) - basically, a few centimeter... | Human growth is subject to many limiting factors, including the ability of the mother to supply the required nutrients to the foetus, and after birth, the ability of the child to acquire the full range of expected social skills.
A young human is physically small in order to convey the impression of youth to other huma... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | It **REALLY** depends on what level of technology we're talking about here.
After all, given sufficiently advanced technology, we could "build" a person, atom by atom, to have all the same properties, education, mental and motor functions etc. as if they had developed the normal way over many years.
---
Let's assume... | **18 weeks to 6 or 8 years, but it does not matter**
9 months to produce an infant is a long time compared to the initial growth rate of the embryo. At 4 weeks, the embryo is the size of a poppy seed (2 mm long), at 8 weeks, the size of a kidney bean (16 mm head to bottom). During that period, the human increased by a... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | **18 weeks to 6 or 8 years, but it does not matter**
9 months to produce an infant is a long time compared to the initial growth rate of the embryo. At 4 weeks, the embryo is the size of a poppy seed (2 mm long), at 8 weeks, the size of a kidney bean (16 mm head to bottom). During that period, the human increased by a... | Human growth is subject to many limiting factors, including the ability of the mother to supply the required nutrients to the foetus, and after birth, the ability of the child to acquire the full range of expected social skills.
A young human is physically small in order to convey the impression of youth to other huma... |
31,355 | In my world human(oid)s are not born anymore, they are grown in pods which mirror the conditions of a natural womb.
Children are educated before birth and are "born" as fully mature adults with a standard education ready to join society.
How long would this process take? I assume that artificial growth could be much ... | 2015/12/12 | [
"https://worldbuilding.stackexchange.com/questions/31355",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/18/"
] | It **REALLY** depends on what level of technology we're talking about here.
After all, given sufficiently advanced technology, we could "build" a person, atom by atom, to have all the same properties, education, mental and motor functions etc. as if they had developed the normal way over many years.
---
Let's assume... | Human growth is subject to many limiting factors, including the ability of the mother to supply the required nutrients to the foetus, and after birth, the ability of the child to acquire the full range of expected social skills.
A young human is physically small in order to convey the impression of youth to other huma... |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | So if I get it right, on click of a button, you want to open up a modal that lists the values entered by the users followed by submitting it.
For this, you first change your `input type="submit"` to `input type="button"` and add `data-toggle="modal" data-target="#confirm-submit"` so that the modal gets triggered when ... | ```
$('form button[type="submit"]').on('click', function () {
$(this).parents('form').submit();
});
``` |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | So if I get it right, on click of a button, you want to open up a modal that lists the values entered by the users followed by submitting it.
For this, you first change your `input type="submit"` to `input type="button"` and add `data-toggle="modal" data-target="#confirm-submit"` so that the modal gets triggered when ... | It is easy to solve, only create an hidden submit:
```
<button id="submitCadastro" type="button">ENVIAR</button>
<input type="submit" id="submitCadastroHidden" style="display: none;" >
```
with jQuery you click the submit:
```
$("#submitCadastro").click(function(){
if($("#checkDocumentos").prop("checked") == fa... |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | So if I get it right, on click of a button, you want to open up a modal that lists the values entered by the users followed by submitting it.
For this, you first change your `input type="submit"` to `input type="button"` and add `data-toggle="modal" data-target="#confirm-submit"` so that the modal gets triggered when ... | I noticed some of the answers were not triggering the HTML5 `required` attribute (as stuff was being executed on the action of *clicking* rather than the action of *form send*, causing to bypass it when the inputs were empty):
1. Have a `<form id='xform'></form>` with some inputs with the required attribute and place ... |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | So if I get it right, on click of a button, you want to open up a modal that lists the values entered by the users followed by submitting it.
For this, you first change your `input type="submit"` to `input type="button"` and add `data-toggle="modal" data-target="#confirm-submit"` so that the modal gets triggered when ... | You can use browser default prompt window.
Instead of basic `<input type="submit" (...) >` try:
```
<button onClick="if(confirm(\'are you sure ?\')){ this.form.submit() }">Save</button>
``` |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | You can use browser default prompt window.
Instead of basic `<input type="submit" (...) >` try:
```
<button onClick="if(confirm(\'are you sure ?\')){ this.form.submit() }">Save</button>
``` | ```
$('form button[type="submit"]').on('click', function () {
$(this).parents('form').submit();
});
``` |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | You can use browser default prompt window.
Instead of basic `<input type="submit" (...) >` try:
```
<button onClick="if(confirm(\'are you sure ?\')){ this.form.submit() }">Save</button>
``` | It is easy to solve, only create an hidden submit:
```
<button id="submitCadastro" type="button">ENVIAR</button>
<input type="submit" id="submitCadastroHidden" style="display: none;" >
```
with jQuery you click the submit:
```
$("#submitCadastro").click(function(){
if($("#checkDocumentos").prop("checked") == fa... |
23,775,272 | I'm new to Modals, I have a Form and when the user clicks submit, It will show a Modal confirming if the user wants to submit, the modal also contains the user input from the form fields. I searched all over the internet but can't find the right one on my needs. And all I see is that they tag the click event to open mo... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23775272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3651491/"
] | You can use browser default prompt window.
Instead of basic `<input type="submit" (...) >` try:
```
<button onClick="if(confirm(\'are you sure ?\')){ this.form.submit() }">Save</button>
``` | I noticed some of the answers were not triggering the HTML5 `required` attribute (as stuff was being executed on the action of *clicking* rather than the action of *form send*, causing to bypass it when the inputs were empty):
1. Have a `<form id='xform'></form>` with some inputs with the required attribute and place ... |
22,168,437 | We have a Java project that we wish to distribute to users. It does not use any Java features beyond Java 1.5, so we wish it to run on Java 1.5 and above.
At this point, you might rightfully note that Java 1.6 is the oldest available currently, so why target Java 1.5? However, that does not change the generic nature o... | 2014/03/04 | [
"https://Stackoverflow.com/questions/22168437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1307749/"
] | The rt.jar is included with the JRE. You will be able to perform the cross compilation if you have, say, JDK 1.6 and JRE 1.5.
Using your JDK 1.6:
```
$ javac -source 1.5 -target 1.5 -bootclasspath jre1.5.0/lib/rt.jar Test.java
```
The advantage here is that the JRE can be as little as 1/3 the size of a full JDK. Yo... | This type of compilation is primarily motivated by needing to target a JRE that is already in production or an otherwise existing install, IME. In that case, pulling the JRE bootclasspath files from the existing install and making them available from the build system(s) would be the first task. The bootclasspath value ... |
38,470,462 | I have the following:
```
public class Car{
public Car()
{//some stuff
}
private Car [] carmodels ;
public Car [] getCarModel() {
return this.carmodels;
}
public void setcarModel(Car [] carmodels ) {
this.carmodels = carmodels;
}
```
Now on my test class, I have something like this
```
public void main (String ... | 2016/07/20 | [
"https://Stackoverflow.com/questions/38470462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3841581/"
] | If you insist on not using a temp value in the for loop you could use an [ArrayList](https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html) instead of an array for the carmodels.
than add a method
```
public void addCar(Car toadd)
{
carmodels.add(toadd);
}
```
than in your foor loop just call
```... | ```
for(int i =0;i<5;i++)
{
car.getCarModel()[i] =new Car();
}
```
or
Write another overloaded setter by passing index.
```
public void setCarModel(int index, Car c)
{
carmodels[index] = c;
}
for(int i =0;i<5;i++)
{
car.setCarModel(i, new Car());
}
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.