qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | When you wish to edit a shape, you need to unlock the protection attributes applied on the shape. None of the answers here have informed you how to show the "Shape Data".
1. You need to select File menu on the top. Select "Options" and select "Advanced"
2. Scroll down till the end and select "Run in Developer mode". P... | Select the shape.
use this menu: [Home] -> [Tools] -> [Text]
now text editing is available on the shape.
Now by just hitting shift+enter on every place you want to end the line, you can wrap text manually.
Good Luck |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | Try editing the TextBox properties in the object properties dialog. | click into the text box and hit enter between the text you want on the next line. |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | 1. Right-click the use case.
2. Select "Show ShapeSheet".
3. Scroll down to the "Protection" section.
4. Change the value near "LockTextEdit" to `0`.
5. Close the ShapeSheet.
Now press `F2` and edit the name. Add line breaks with `Enter`.
It is tedious to unprotect each use case individually. If you are starting a ne... | click into the text box and hit enter between the text you want on the next line. |
3,508,560 | I'm relatively new to programming in general so be gentle =| I'm trying to start a new activity from a basic one that displays a couple of text inputs, a checkbox, and a button. When the button is pressed I want it to switch to the new activity. The code compiles but when I press the button in Android it simply crashes... | 2010/08/18 | [
"https://Stackoverflow.com/questions/3508560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/423519/"
] | The most common mistake here is forgetting to register the 'That' activity in your AndroidManifest.xml. Have you done that?
Also, it would be much easier to help you if you pasted the stack trace from your crash. You can see crash info, amongst other logging, by running `adb logcat`. | Never forget to add the `<activity>` tag in the Manifest.xml.
=============================================================
All activities **MUST** be added in the Manifest File. Android Activity is an essential Android Component which should be registered.
### Why?
The Activity is started and destroyed by Android ... |
479,205 | I am working on a project where I need to generate random numbers for a given task time which is normally distributed with mean = 40, and standard deviation = 150.
Because of the high SD, I will get some negative values and low values when I generated numbers directly which is unrealistic.
Is there any way where I ca... | 2020/07/27 | [
"https://stats.stackexchange.com/questions/479205",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/292467/"
] | This sounds like you want to sample from [truncated normal distribution](https://en.wikipedia.org/wiki/Truncated_normal_distribution). If you only want to truncate the tails of the distribution (regions with low probability), than the approach suggested by *Dave* is probably enough. In other cases it might however quic... | I could imagine something where you use some if/else logic to screen for unrealistic values. There would be some kind of recursion where you keep drawing random numbers u til you’ve gotten 1000 (or whatever) realistic values. Some pseudocode:
```
i=0
while i < 1000:
x = make your draw here
# (np.random.normal... |
479,205 | I am working on a project where I need to generate random numbers for a given task time which is normally distributed with mean = 40, and standard deviation = 150.
Because of the high SD, I will get some negative values and low values when I generated numbers directly which is unrealistic.
Is there any way where I ca... | 2020/07/27 | [
"https://stats.stackexchange.com/questions/479205",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/292467/"
] | I could imagine something where you use some if/else logic to screen for unrealistic values. There would be some kind of recursion where you keep drawing random numbers u til you’ve gotten 1000 (or whatever) realistic values. Some pseudocode:
```
i=0
while i < 1000:
x = make your draw here
# (np.random.normal... | While your question is not entirely clear about what you are trying to achieve (*how* do you wish to go from a Gaussian distribution to a distribution that is truncated at 0?)...
... I thought that it was interesting to show something about the limit of the ratio between the mean and standard deviation of a Gaussian d... |
479,205 | I am working on a project where I need to generate random numbers for a given task time which is normally distributed with mean = 40, and standard deviation = 150.
Because of the high SD, I will get some negative values and low values when I generated numbers directly which is unrealistic.
Is there any way where I ca... | 2020/07/27 | [
"https://stats.stackexchange.com/questions/479205",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/292467/"
] | This sounds like you want to sample from [truncated normal distribution](https://en.wikipedia.org/wiki/Truncated_normal_distribution). If you only want to truncate the tails of the distribution (regions with low probability), than the approach suggested by *Dave* is probably enough. In other cases it might however quic... | Whilst it is certainly quite simple to generate from a truncated normal distribution, if it is unrealistic to have negative values, you should rethink whether this distribution is appropriate. In the present case the lower-bound for the truncation occurs very close to the mean, and so the resulting distribution does no... |
479,205 | I am working on a project where I need to generate random numbers for a given task time which is normally distributed with mean = 40, and standard deviation = 150.
Because of the high SD, I will get some negative values and low values when I generated numbers directly which is unrealistic.
Is there any way where I ca... | 2020/07/27 | [
"https://stats.stackexchange.com/questions/479205",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/292467/"
] | This sounds like you want to sample from [truncated normal distribution](https://en.wikipedia.org/wiki/Truncated_normal_distribution). If you only want to truncate the tails of the distribution (regions with low probability), than the approach suggested by *Dave* is probably enough. In other cases it might however quic... | While your question is not entirely clear about what you are trying to achieve (*how* do you wish to go from a Gaussian distribution to a distribution that is truncated at 0?)...
... I thought that it was interesting to show something about the limit of the ratio between the mean and standard deviation of a Gaussian d... |
479,205 | I am working on a project where I need to generate random numbers for a given task time which is normally distributed with mean = 40, and standard deviation = 150.
Because of the high SD, I will get some negative values and low values when I generated numbers directly which is unrealistic.
Is there any way where I ca... | 2020/07/27 | [
"https://stats.stackexchange.com/questions/479205",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/292467/"
] | Whilst it is certainly quite simple to generate from a truncated normal distribution, if it is unrealistic to have negative values, you should rethink whether this distribution is appropriate. In the present case the lower-bound for the truncation occurs very close to the mean, and so the resulting distribution does no... | While your question is not entirely clear about what you are trying to achieve (*how* do you wish to go from a Gaussian distribution to a distribution that is truncated at 0?)...
... I thought that it was interesting to show something about the limit of the ratio between the mean and standard deviation of a Gaussian d... |
114,120 | Using GIMP I masked out an unwanted person who was situated in the background of my image. This person was partially concealed by my subject. I used the path tool to trace the outlines of my subject and then masked out the backgound using clone and heal.
My problem is that this left very sharp borders on some out-of-f... | 2020/01/15 | [
"https://photo.stackexchange.com/questions/114120",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/88987/"
] | >
> I wonder, what algorithms are used to achieve such conversion of colorful noise to colorless one? Is it some high-ISO-optimized demosaicing? Or is it a special denoising algorithm applied after demosaicing? Or something else?
>
>
>
**Yes.**
There are different algorithms that can be applied at various stages ... | The most common form of noise is called "fixed-pattern". This is a static like function that occurs when the camera logic turns up the amplification applied to the imaging chip. Their is an amplifier in each light sensitive photosite. Each will have a slightly different efficiency. When the amplification is turned up t... |
114,120 | Using GIMP I masked out an unwanted person who was situated in the background of my image. This person was partially concealed by my subject. I used the path tool to trace the outlines of my subject and then masked out the backgound using clone and heal.
My problem is that this left very sharp borders on some out-of-f... | 2020/01/15 | [
"https://photo.stackexchange.com/questions/114120",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/88987/"
] | >
> I wonder, what algorithms are used to achieve such conversion of colorful noise to colorless one? Is it some high-ISO-optimized demosaicing? Or is it a special denoising algorithm applied after demosaicing? Or something else?
>
>
>
**Yes.**
There are different algorithms that can be applied at various stages ... | There are many algorithms, for instance the Selective Blur in Gimp:
>
> The Selective Gaussian Blur plug-in doesn't act on all pixels: blur is applied only if the difference between its value and the value of the surrounding pixels is less than a defined Delta value. So, contrasts are preserved because difference is ... |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | I cracked it with the help of one of my friend .
>
> In the properties of the Excel Source >> Custom Properties >> Open Rowset >>
> **SheetName$A12:J**
>
>
>
It means skip the rows till A12. And the data is taken into account from A12 though end of J column.
Problem solved. | The way to solve this is to use q SQL command in the data access mode.
```
Select * FROM [Sheet1$A20:K]
```
This will read the data correctly and no preview errors will occur. |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | I cracked it with the help of one of my friend .
>
> In the properties of the Excel Source >> Custom Properties >> Open Rowset >>
> **SheetName$A12:J**
>
>
>
It means skip the rows till A12. And the data is taken into account from A12 though end of J column.
Problem solved. | I was getting this same error trying to import a .xlsx file into SSIS 2008. I first saved the file as .xls (Excel 97-2003). I was still getting the above error and couldn't preview the data with the new file.
In case this link breaks in the future: <https://connect.microsoft.com/SQLServer/feedback/details/557049/ssis... |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | I cracked it with the help of one of my friend .
>
> In the properties of the Excel Source >> Custom Properties >> Open Rowset >>
> **SheetName$A12:J**
>
>
>
It means skip the rows till A12. And the data is taken into account from A12 though end of J column.
Problem solved. | In my case I was trying to export from SQL into an Excel file and receiving "Index and Length must refer to a location within the string" while trying to preview the destination data.
Removing the space from the Excel Sheet in the Excel Destination Editor fixed it for me. |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | I cracked it with the help of one of my friend .
>
> In the properties of the Excel Source >> Custom Properties >> Open Rowset >>
> **SheetName$A12:J**
>
>
>
It means skip the rows till A12. And the data is taken into account from A12 though end of J column.
Problem solved. | After trying all the other answers with no luck, I renamed the spreadsheet.
In the Excel connection manager, I browsed to the renamed spreadsheet and unchecked first row contains column names. I was then able to view the data in the preview window. |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | The way to solve this is to use q SQL command in the data access mode.
```
Select * FROM [Sheet1$A20:K]
```
This will read the data correctly and no preview errors will occur. | I was getting this same error trying to import a .xlsx file into SSIS 2008. I first saved the file as .xls (Excel 97-2003). I was still getting the above error and couldn't preview the data with the new file.
In case this link breaks in the future: <https://connect.microsoft.com/SQLServer/feedback/details/557049/ssis... |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | The way to solve this is to use q SQL command in the data access mode.
```
Select * FROM [Sheet1$A20:K]
```
This will read the data correctly and no preview errors will occur. | In my case I was trying to export from SQL into an Excel file and receiving "Index and Length must refer to a location within the string" while trying to preview the destination data.
Removing the space from the Excel Sheet in the Excel Destination Editor fixed it for me. |
27,431,195 | I am using SQL Server 2008 BIDS. I am trying to read in an Excel file, having multiple sheets. The names are mostly alphabetical( and few with special char '&'). The data starts at row 8. I have skipped the blank rows by setting the rows and columns in the open rowset property for the Excel source. I get the exact mapp... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27431195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760136/"
] | The way to solve this is to use q SQL command in the data access mode.
```
Select * FROM [Sheet1$A20:K]
```
This will read the data correctly and no preview errors will occur. | After trying all the other answers with no luck, I renamed the spreadsheet.
In the Excel connection manager, I browsed to the renamed spreadsheet and unchecked first row contains column names. I was then able to view the data in the preview window. |
7,116,040 | This really bugs me - a lot.
After wading through google maps v3 generated client side code in firebug, I'm about ready to drive down the street and give some of these engineers a piece of my mind... arrrgh :P
The infowWindow class produces HTML that personally I would think is simply nuts. maybe someone can help me ... | 2011/08/19 | [
"https://Stackoverflow.com/questions/7116040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/836028/"
] | Have you tried InfoBox?
<http://googlegeodevelopers.blogspot.com/2010/04/infobox-10-highly-customizable.html>
or InfoBubble?
<http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html/>
They both give you a bit more control over the appearance of infowindows, while still abstra... | You try styling with CSS? The below example shows this. This is the most straight forward way to change the UI.
<http://code.google.com/apis/maps/documentation/javascript/overlays.html#InfoWindows> |
7,116,040 | This really bugs me - a lot.
After wading through google maps v3 generated client side code in firebug, I'm about ready to drive down the street and give some of these engineers a piece of my mind... arrrgh :P
The infowWindow class produces HTML that personally I would think is simply nuts. maybe someone can help me ... | 2011/08/19 | [
"https://Stackoverflow.com/questions/7116040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/836028/"
] | After much trial and eror I decided the best way to resolve this is to use OverlayView class and simply custom build a container. Well, "simply" is an understatement, but it works. And now I have full control over layout and functionality. | You try styling with CSS? The below example shows this. This is the most straight forward way to change the UI.
<http://code.google.com/apis/maps/documentation/javascript/overlays.html#InfoWindows> |
21,248,263 | I have the following two XPath selectors working individually, but am unable to combine them to return the same element as a result:
```
//*[@customAttribute="banana"]//*[contains(@style,'width:100px')]
//*[@customAttribute="banana"]//*[contains(label,'Name')]
```
The source around the element being targeted is a... | 2014/01/21 | [
"https://Stackoverflow.com/questions/21248263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1668057/"
] | This one should do the trick:
```
//*[@customAttribute="banana"]//*[contains(label,'Name')][contains(@style,'width:100px')]
``` | This ended up doing the trick:
```
(//*[@customAttribute="banana"]//*[contains(label,'Name')])//*[contains(@style,'width:100px')]
``` |
28,412,559 | I have the following problem:
I have set up that the branch I currently reside in, is shown in my command prompt like this:
**"[Current\_working\_dir] (master)"**
however every time I switch branch I get the following error and the branch isn't refreshed:
```
[work_environment] (master) git checkout test
M bash/... | 2015/02/09 | [
"https://Stackoverflow.com/questions/28412559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1213904/"
] | Your problem is the double quotes on this line:
```
export PS1="\[\e[0;34m\][\[\e[1;34m\]\W\\[\e[0;34m\]]\[\e[0m\]\[\e[0;32m\]$(__git_ps1)\[\e[0m\] "
```
That line is being evaluated *immediately* and `__git_ps1` is being called only once.
Try `echo "$PS1"` to see what I mean.
You want single quotes there. The val... | Use single quotes around your PS1 declaration rather than double quotes. At the moment the variables are evaluated and then set to PS1. You want them to be evaluated everytime PS1 is used. |
26,995,762 | I am trying use gtest with ndk, the ndk-build finds the dependences, but I have a sintax error on internal gtest file gtest-printers.h
```
external/gtest/include/gtest/gtest-printers.h:170:9: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char, std::char_traits<char... | 2014/11/18 | [
"https://Stackoverflow.com/questions/26995762",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2999490/"
] | My problem was try to call static gtest lib directly, instead of, I had to do it before:
```
include $(CLEAR_VARS)
GTEST_DIR := ${NDK_ROOT}/sources/third_party/googletest/googletest
LOCAL_MODULE := gtest
# flag for c++11
LOCAL_CPPFLAGS += -std=c++11
LOCAL_C_INCLUDES += ${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.... | It looks like C++11 + stlport is the bad combination for gtest. This isn't terribly surprising, given that stlport doesn't actually have any support for C++11 (some parts of it will work, others apparently won't). If this only causes problems when *building* gtest, you could just not use C++11 when building gtest, but ... |
26,995,762 | I am trying use gtest with ndk, the ndk-build finds the dependences, but I have a sintax error on internal gtest file gtest-printers.h
```
external/gtest/include/gtest/gtest-printers.h:170:9: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char, std::char_traits<char... | 2014/11/18 | [
"https://Stackoverflow.com/questions/26995762",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2999490/"
] | We have encountered the same issue, and working solution was to use:
```
LOCAL_CPPFLAGS += -std=gnu++11
```
instead of `LOCAL_CPPFLAGS+=-std=c++11`. It must have set some different mappings of `long long int` in `stlport`. | It looks like C++11 + stlport is the bad combination for gtest. This isn't terribly surprising, given that stlport doesn't actually have any support for C++11 (some parts of it will work, others apparently won't). If this only causes problems when *building* gtest, you could just not use C++11 when building gtest, but ... |
26,995,762 | I am trying use gtest with ndk, the ndk-build finds the dependences, but I have a sintax error on internal gtest file gtest-printers.h
```
external/gtest/include/gtest/gtest-printers.h:170:9: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char, std::char_traits<char... | 2014/11/18 | [
"https://Stackoverflow.com/questions/26995762",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2999490/"
] | My problem was try to call static gtest lib directly, instead of, I had to do it before:
```
include $(CLEAR_VARS)
GTEST_DIR := ${NDK_ROOT}/sources/third_party/googletest/googletest
LOCAL_MODULE := gtest
# flag for c++11
LOCAL_CPPFLAGS += -std=c++11
LOCAL_C_INCLUDES += ${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.... | We have encountered the same issue, and working solution was to use:
```
LOCAL_CPPFLAGS += -std=gnu++11
```
instead of `LOCAL_CPPFLAGS+=-std=c++11`. It must have set some different mappings of `long long int` in `stlport`. |
43,616,399 | I need some assistance from the database people here. I need to be able to store sports statistics for games that a sports player plays and then display that data sequentially in a timeline (sort of the player's sports career). A player can play one or more sports.
Here are two schemas I came up with, but both have is... | 2017/04/25 | [
"https://Stackoverflow.com/questions/43616399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7560542/"
] | You used regex atoms `\1` and `\2` (match what the first or second capture captured) outside of a regex pattern. You meant to use `$1` and `$2` (as you did in another spot).
Further more, dollar signs inside double-quoted strings have meaning to your shell. It's best to use single quotes around your program[1].
```
e... | Why torture yourself, just use a branch reset.
Find `(?|(abcd)|ab())`
Replace `$1` |
43,616,399 | I need some assistance from the database people here. I need to be able to store sports statistics for games that a sports player plays and then display that data sequentially in a timeline (sort of the player's sports career). A player can play one or more sports.
Here are two schemas I came up with, but both have is... | 2017/04/25 | [
"https://Stackoverflow.com/questions/43616399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7560542/"
] | You used regex atoms `\1` and `\2` (match what the first or second capture captured) outside of a regex pattern. You meant to use `$1` and `$2` (as you did in another spot).
Further more, dollar signs inside double-quoted strings have meaning to your shell. It's best to use single quotes around your program[1].
```
e... | And a couple of even better ways
Find `abcd(*SKIP)(*FAIL)|ab`
Replace `""`
Find `(?:abcd)*\Kab`
Replace `""`
These use regex wisely.
There is really no need nowadays to have to use the *eval* form
of the regex substitution construct `s///e` in conjunction with defined().
This is especially true whe... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | Another way to accomplish this is using [user stories](http://en.wikipedia.org/wiki/User_story) | Whether you call them functional specs, business requirements, or user stories, they are all very beneficial to the development process.
The issue with them comes when they are chiseled in stone and used as a device to pass blame around when the system utimately doesn't fit with the user's real needs. I prefer to use... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | It took me more than 10 years to get it beat into my head to write a functional spec before doing any code. Now I will write one for anything taking more than a day to write. The level of detail, and level of assumptions should be as much as needed to clearly define what needs to be done and communicate it to others (o... | I'll second [Codeslave's](https://stackoverflow.com/users/685/codeslave) reference to [Painless Functional Specification.](http://www.joelonsoftware.com/articles/fog0000000036.html) It's a good series of articles on specifications. See also [this Stackoverflow post](https://stackoverflow.com/questions/379371/what-makes... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | I find well-written functional specs very useful. A well organized functional specification can also help organize your tests (many-to-many mapping from individual requirements to test cases).
`<p style="tongue: in-cheek">`They also prove useful for finger-pointing in larger organizations (The requirements were inaccu... | One interesting substitute for a func spec or user stories that I have seen advocated is to write a user manual for the software first.
Even if this is only notional (i.e. if you do not intend to ship any manual - which you probably shouldn't as nobody will read it), it can be a useful and reasonably lightweight way ... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | Another way to accomplish this is using [user stories](http://en.wikipedia.org/wiki/User_story) | I have seen and written many specs, some were very good, most weren't. The main thing that they all had in common is that they were never followed. They all had cobwebs on them by the 3rd day of coding.
Write the spec if you want, the best time to do it is at the end of the project. It will be useless for developers t... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | Frankly, the Functional Specifications should already be part of your Big-M (Waterfall) methodology. Your functional specification is WHAT you are going to build; not necessarily how you are going to build it (which would be your detailed design/specification and the next step in the waterfall).
If you haven't written... | I think they're a lovely idea, and should be tried. |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | I work with mostly the Waterfall model, and solely with functional specs. When working on my own (where I can set my own model and program any way I want) I start by writing up functional specs and then implementing them. It gives me a much better idea of the size and scope of the work, helps me estimate the time invol... | It took me more than 10 years to get it beat into my head to write a functional spec before doing any code. Now I will write one for anything taking more than a day to write. The level of detail, and level of assumptions should be as much as needed to clearly define what needs to be done and communicate it to others (o... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | I work with mostly the Waterfall model, and solely with functional specs. When working on my own (where I can set my own model and program any way I want) I start by writing up functional specs and then implementing them. It gives me a much better idea of the size and scope of the work, helps me estimate the time invol... | In my experience, functional specs have a fine line between not saying enough and saying too much.
If they don't say enough, then they leave areas open to misunderstanding.
If they say too much, they don't leave enough "wiggle room" to improve the solution.
And they should **always** be open to a process of revision... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | I'll second [Codeslave's](https://stackoverflow.com/users/685/codeslave) reference to [Painless Functional Specification.](http://www.joelonsoftware.com/articles/fog0000000036.html) It's a good series of articles on specifications. See also [this Stackoverflow post](https://stackoverflow.com/questions/379371/what-makes... | One interesting substitute for a func spec or user stories that I have seen advocated is to write a user manual for the software first.
Even if this is only notional (i.e. if you do not intend to ship any manual - which you probably shouldn't as nobody will read it), it can be a useful and reasonably lightweight way ... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | In my experience, functional specs have a fine line between not saying enough and saying too much.
If they don't say enough, then they leave areas open to misunderstanding.
If they say too much, they don't leave enough "wiggle room" to improve the solution.
And they should **always** be open to a process of revision... | One interesting substitute for a func spec or user stories that I have seen advocated is to write a user manual for the software first.
Even if this is only notional (i.e. if you do not intend to ship any manual - which you probably shouldn't as nobody will read it), it can be a useful and reasonably lightweight way ... |
381,216 | Does the functional spec help or hinder your expectations? Do programmers who practice the waterfall methodology, are they open to functional specs? I'm a web designer/developer working with a team of 5 programmers and would like to write a functional spec to explain what we need, so that when I begin my work - I know ... | 2008/12/19 | [
"https://Stackoverflow.com/questions/381216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28454/"
] | I work with mostly the Waterfall model, and solely with functional specs. When working on my own (where I can set my own model and program any way I want) I start by writing up functional specs and then implementing them. It gives me a much better idea of the size and scope of the work, helps me estimate the time invol... | I think they're a lovely idea, and should be tried. |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | The path calculation is done relative to the symlink. Let's understand using an example,
`ln -s path/to/file symlink/file`
Here, the path to the file should actually be the relative path from the symlink path.
The system actually calculates the file path as `symlink/path/path/to/file`
The above command sho... | why not just
cp ./hooks/\* .git/hooks/
this worked for me in Mac OS |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | you just used wrong path, it should be:
```
ln -s -f ../../hooks/post-merge .git/hooks/post-merge
``` | Utilizing Michael Cihar's comment, here is an example of a bash script I wrote to simply create these symlinks. This script is located in git\_hooks/ dir which is at the project root. My .git/ folder is also in the same directory level.
```
#!/usr/bin/env bash
pwd=$(pwd);
# Script is designed to be ran from git_hook... |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | you just used wrong path, it should be:
```
ln -s -f ../../hooks/post-merge .git/hooks/post-merge
``` | The path calculation is done relative to the symlink. Let's understand using an example,
`ln -s path/to/file symlink/file`
Here, the path to the file should actually be the relative path from the symlink path.
The system actually calculates the file path as `symlink/path/path/to/file`
The above command sho... |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | While you can use symbolic links, you can also change the hooks folder for your project in your git settings with :
```
git config core.hooksPath hooks/
```
Which is local by default so it won't ruin git hooks for your other projects. It works for all hook in this repository, so it's especially useful if you have mo... | why not just
cp ./hooks/\* .git/hooks/
this worked for me in Mac OS |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | you just used wrong path, it should be:
```
ln -s -f ../../hooks/post-merge .git/hooks/post-merge
``` | Changing directory before linking
```
cd /path/to/project-repo/.git/hooks
ln -s -f ../../hooks/post-merge ./post-merge
``` |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | While you can use symbolic links, you can also change the hooks folder for your project in your git settings with :
```
git config core.hooksPath hooks/
```
Which is local by default so it won't ruin git hooks for your other projects. It works for all hook in this repository, so it's especially useful if you have mo... | Changing directory before linking
```
cd /path/to/project-repo/.git/hooks
ln -s -f ../../hooks/post-merge ./post-merge
``` |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | While you can use symbolic links, you can also change the hooks folder for your project in your git settings with :
```
git config core.hooksPath hooks/
```
Which is local by default so it won't ruin git hooks for your other projects. It works for all hook in this repository, so it's especially useful if you have mo... | Utilizing Michael Cihar's comment, here is an example of a bash script I wrote to simply create these symlinks. This script is located in git\_hooks/ dir which is at the project root. My .git/ folder is also in the same directory level.
```
#!/usr/bin/env bash
pwd=$(pwd);
# Script is designed to be ran from git_hook... |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | Changing directory before linking
```
cd /path/to/project-repo/.git/hooks
ln -s -f ../../hooks/post-merge ./post-merge
``` | Utilizing Michael Cihar's comment, here is an example of a bash script I wrote to simply create these symlinks. This script is located in git\_hooks/ dir which is at the project root. My .git/ folder is also in the same directory level.
```
#!/usr/bin/env bash
pwd=$(pwd);
# Script is designed to be ran from git_hook... |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | Changing directory before linking
```
cd /path/to/project-repo/.git/hooks
ln -s -f ../../hooks/post-merge ./post-merge
``` | why not just
cp ./hooks/\* .git/hooks/
this worked for me in Mac OS |
4,592,838 | I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tri... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4592838",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/217019/"
] | Utilizing Michael Cihar's comment, here is an example of a bash script I wrote to simply create these symlinks. This script is located in git\_hooks/ dir which is at the project root. My .git/ folder is also in the same directory level.
```
#!/usr/bin/env bash
pwd=$(pwd);
# Script is designed to be ran from git_hook... | why not just
cp ./hooks/\* .git/hooks/
this worked for me in Mac OS |
37,565,216 | I am trying to create an object which contains an array of objects in javascript
```
var alertArray = {
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exc... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37565216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5283633/"
] | You forgot the array-part:
```
var alertArray = {
someArray: [{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', time: '6:34 PM'},
{thresh... | If you want to use an array you should have used square brackets:
```
var alertArray = [
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', time: '6:3... |
37,565,216 | I am trying to create an object which contains an array of objects in javascript
```
var alertArray = {
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exc... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37565216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5283633/"
] | You forgot the array-part:
```
var alertArray = {
someArray: [{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', time: '6:34 PM'},
{thresh... | Array of Objects is something like `[{},{},{},...]`
and Object of array of an objects is something like that `{data:[{},{},{},...]}`
```
var alertArray = {
data: [{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', dev... |
37,565,216 | I am trying to create an object which contains an array of objects in javascript
```
var alertArray = {
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exc... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37565216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5283633/"
] | JS objects must have keys.
**You could switch to an array of objects:**
```
var alertArray = [
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', ti... | If you want to use an array you should have used square brackets:
```
var alertArray = [
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', time: '6:3... |
37,565,216 | I am trying to create an object which contains an array of objects in javascript
```
var alertArray = {
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exc... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37565216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5283633/"
] | JS objects must have keys.
**You could switch to an array of objects:**
```
var alertArray = [
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', ti... | Array of Objects is something like `[{},{},{},...]`
and Object of array of an objects is something like that `{data:[{},{},{},...]}`
```
var alertArray = {
data: [{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', dev... |
37,565,216 | I am trying to create an object which contains an array of objects in javascript
```
var alertArray = {
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exc... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37565216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5283633/"
] | If you want to use an array you should have used square brackets:
```
var alertArray = [
{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', deviceName: 'Device Leaf-12-22', text: 'Memory utilization exceeding 40%', time: '6:3... | Array of Objects is something like `[{},{},{},...]`
and Object of array of an objects is something like that `{data:[{},{},{},...]}`
```
var alertArray = {
data: [{threshold: 'critical', deviceName: 'Device Agg-02-01', text: 'CPU exceeding policy threshold of 80%', time: '7:00 PM'},
{threshold: 'critical', dev... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | You may want to have a look at John Lakos `Large-Scale C++ Software Design`. Basically, you can do that, but your packages should (as in Java) have an acyclic dependency graph. Also, it may be opportune for each package to document which headers are exported and which aren't, maybe like so:
```
src/
|- package1/
... | You can arrange your files however you like; you'll just need to adjust your build tools' include paths and source paths to match.
Giving each directory it's own namespace is overkill and probably a bad idea, as it will make for confusing code. I'd recommend one namespace per project at most, or even just one namespac... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | There's no reason not to and will really help people reading your code. Some things to watch out for:
1. Don't **over**-nest folders, this can be confusing for readers of your code.
2. Be consistent in the organization of your code, e.g. don't put **any** view code in the controllers sub-directory, or vice-versa.
3. K... | You can arrange your files however you like; you'll just need to adjust your build tools' include paths and source paths to match.
Giving each directory it's own namespace is overkill and probably a bad idea, as it will make for confusing code. I'd recommend one namespace per project at most, or even just one namespac... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | I've always liked the namespace for each folder. Mostly because when I have to maintain somebody else's code, the namespace helps me find where the class was originally defined.
Well named header files can also help with this though. I also wouldn't suggest going more than 2-3 namespaces, as then it just becomes obnox... | There's no reason not to divide your source code into different directories; it makes sense if there are many files and clear logical groupings.
It is not necessary to create a distinct file for each small class though - in large projects, that tends to slow compilation (as the implementation files often have to inclu... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | You may want to have a look at John Lakos `Large-Scale C++ Software Design`. Basically, you can do that, but your packages should (as in Java) have an acyclic dependency graph. Also, it may be opportune for each package to document which headers are exported and which aren't, maybe like so:
```
src/
|- package1/
... | There's no reason not to and will really help people reading your code. Some things to watch out for:
1. Don't **over**-nest folders, this can be confusing for readers of your code.
2. Be consistent in the organization of your code, e.g. don't put **any** view code in the controllers sub-directory, or vice-versa.
3. K... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | There's no reason not to divide your source code into different directories; it makes sense if there are many files and clear logical groupings.
It is not necessary to create a distinct file for each small class though - in large projects, that tends to slow compilation (as the implementation files often have to inclu... | There's no reason not to and will really help people reading your code. Some things to watch out for:
1. Don't **over**-nest folders, this can be confusing for readers of your code.
2. Be consistent in the organization of your code, e.g. don't put **any** view code in the controllers sub-directory, or vice-versa.
3. K... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | I've always liked the namespace for each folder. Mostly because when I have to maintain somebody else's code, the namespace helps me find where the class was originally defined.
Well named header files can also help with this though. I also wouldn't suggest going more than 2-3 namespaces, as then it just becomes obnox... | The src/ is a common place there c/c++ programmers put their sources within the project root.
For example:
```
doc/ <- documentation
libs/ <- additional libraries
po/ <- gettext translations
src/ <- sources
```
it common to create subdirectories underneath src/ if you've got a lot of sources files but th... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | You may want to have a look at John Lakos `Large-Scale C++ Software Design`. Basically, you can do that, but your packages should (as in Java) have an acyclic dependency graph. Also, it may be opportune for each package to document which headers are exported and which aren't, maybe like so:
```
src/
|- package1/
... | The src/ is a common place there c/c++ programmers put their sources within the project root.
For example:
```
doc/ <- documentation
libs/ <- additional libraries
po/ <- gettext translations
src/ <- sources
```
it common to create subdirectories underneath src/ if you've got a lot of sources files but th... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | There's no reason not to divide your source code into different directories; it makes sense if there are many files and clear logical groupings.
It is not necessary to create a distinct file for each small class though - in large projects, that tends to slow compilation (as the implementation files often have to inclu... | You can arrange your files however you like; you'll just need to adjust your build tools' include paths and source paths to match.
Giving each directory it's own namespace is overkill and probably a bad idea, as it will make for confusing code. I'd recommend one namespace per project at most, or even just one namespac... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | The src/ is a common place there c/c++ programmers put their sources within the project root.
For example:
```
doc/ <- documentation
libs/ <- additional libraries
po/ <- gettext translations
src/ <- sources
```
it common to create subdirectories underneath src/ if you've got a lot of sources files but th... | You can arrange your files however you like; you'll just need to adjust your build tools' include paths and source paths to match.
Giving each directory it's own namespace is overkill and probably a bad idea, as it will make for confusing code. I'd recommend one namespace per project at most, or even just one namespac... |
4,240,984 | i'm coming into C++ from Java/AS3-land, and i'm used to the package-cum-folder structure for my classes. and i like it.
i understand the very basics of namespaces in c++, and i'm happy to leave it at just the basics. but, as my project gets more complex, i'd like to keep my folder structure organized in a way i can ke... | 2010/11/21 | [
"https://Stackoverflow.com/questions/4240984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/222356/"
] | There's no reason not to divide your source code into different directories; it makes sense if there are many files and clear logical groupings.
It is not necessary to create a distinct file for each small class though - in large projects, that tends to slow compilation (as the implementation files often have to inclu... | The src/ is a common place there c/c++ programmers put their sources within the project root.
For example:
```
doc/ <- documentation
libs/ <- additional libraries
po/ <- gettext translations
src/ <- sources
```
it common to create subdirectories underneath src/ if you've got a lot of sources files but th... |
72,308 | The Hill's [Pope blasts Russia’s ‘infantile’ war](https://thehill.com/news/wire/3257104-pope-blasts-russias-infantile-war/) says:
>
> Francis has to date avoided referring to Russia or Putin by name. But Saturday’s personalization of the powerful figure responsible marked a new level of outrage for the pope.
>
>
> ... | 2022/04/02 | [
"https://politics.stackexchange.com/questions/72308",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/16047/"
] | Patriarch Kiril [referred to the war in Ukraine as a "metaphysical" struggle against a godless international order.](https://theweek.com/russo-ukrainian-war/1011020/war-in-ukraine-is-a-metaphysical-battle-against-a-civilization-built-on) That sounds like a strong support, doesn't it?
On the other hand [some other prie... | In 2014, the largest church in Ukraine was УПЦ (МП), that is Ukrainian Orthdox Church of Moscow Patriarchate, a subdivision of Russian Orthdox Church. Since their Ukrainian branch was a sizable share of their whole operation, the Moscow Patriarchate was actually reluctant to do anything which would look unfriendly to U... |
30,823,681 | I have this batch to kill some process typed of course by the user and it works 5/5 when the user for example typed **Calc.exe** with the extension, but my issue now is to improve this batch in order to add automatically with this program if the user has omitted to add extension **.exe** like **Calc** without extension... | 2015/06/13 | [
"https://Stackoverflow.com/questions/30823681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3080770/"
] | If your files have never any other extension than `.exe`, you can use `"%~n1.exe"` to get the filename with `.exe`.
`%~n1` is just the filename without extension. Than add `.exe`, and put quotes around it in case the filename contains a space.
But this will fail if your executable is `example.program.exe`, and the u... | Something like
```
:loopMain
set /p "process=Entrer le(s) nom(s) de(s) processus> "
if "%process:.exe=%"=="%process%" goto :loopMain
```
or
```
:loopMain
set /p "process=Entrer le(s) nom(s) de(s) processus> "
if /I not "%process:~-4%"==".exe" goto :loopMain
```
or `set "process=%process%.exe"` instead of `goto :... |
30,823,681 | I have this batch to kill some process typed of course by the user and it works 5/5 when the user for example typed **Calc.exe** with the extension, but my issue now is to improve this batch in order to add automatically with this program if the user has omitted to add extension **.exe** like **Calc** without extension... | 2015/06/13 | [
"https://Stackoverflow.com/questions/30823681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3080770/"
] | Just i want to share with you the hole script with a dynamic menu, perhaps it would be helpful for other people and thank you for all your contributions ;)
(Translated some french words to english)
```
@Echo off & cls & color 0B
Mode con cols=72 lines=10
Set TmpFile=TmpFile.txt
Set Resultat=KillResult.txt
If Exist %T... | Something like
```
:loopMain
set /p "process=Entrer le(s) nom(s) de(s) processus> "
if "%process:.exe=%"=="%process%" goto :loopMain
```
or
```
:loopMain
set /p "process=Entrer le(s) nom(s) de(s) processus> "
if /I not "%process:~-4%"==".exe" goto :loopMain
```
or `set "process=%process%.exe"` instead of `goto :... |
30,823,681 | I have this batch to kill some process typed of course by the user and it works 5/5 when the user for example typed **Calc.exe** with the extension, but my issue now is to improve this batch in order to add automatically with this program if the user has omitted to add extension **.exe** like **Calc** without extension... | 2015/06/13 | [
"https://Stackoverflow.com/questions/30823681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3080770/"
] | If your files have never any other extension than `.exe`, you can use `"%~n1.exe"` to get the filename with `.exe`.
`%~n1` is just the filename without extension. Than add `.exe`, and put quotes around it in case the filename contains a space.
But this will fail if your executable is `example.program.exe`, and the u... | Just i want to share with you the hole script with a dynamic menu, perhaps it would be helpful for other people and thank you for all your contributions ;)
(Translated some french words to english)
```
@Echo off & cls & color 0B
Mode con cols=72 lines=10
Set TmpFile=TmpFile.txt
Set Resultat=KillResult.txt
If Exist %T... |
68,218,385 | While deploying mule application in Anypoint studio getting below error :
```
org.mule.runtime.core.api.retry.policy.ConnectNotifier: Failed to connect/reconnect:
Message Source Reconnection. Root Exception was: An error occurred while executing the operation:
AUTHORIZE AGAINST BROKER. Cause: Can not login into broker... | 2021/07/02 | [
"https://Stackoverflow.com/questions/68218385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11053410/"
] | This issue is related to the fact that there maybe a client app which is using wrong authentification. Trying to authenticate several times with a wrong client id/ client secret blocks all request for the organisation for AMQ. | It usually means that there are too many concurrent operations from clients using the same credentials. It could be one application or more than one.
Just in case also ensure that the application is using the [last release of the Anypoint MQ connector](https://docs.qax.mulesoft.com/release-notes/connector/anypoint-mq-... |
53,737,159 | In flutter app i am using Url\_launcher dependency to open phone application with content to dial using following function
Url\_launcher.launch("tel:\\*5\*250#" ).
It does open the application but # symbol is not dialed in there else everything works ok ... Any workaround to include # ??? | 2018/12/12 | [
"https://Stackoverflow.com/questions/53737159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10761101/"
] | An HTTP stream wrapper does not support seeking.
You have to download the bucket to a temporary file or variable. A simple `file_get_contents()` should do it:
```
$fileContent = file_get_contents('https://path/to/s3/file','rb');
// ...
$pdf->setSourceFile(StreamReader::createByString($fileContent));
``` | For those who try to load the file from the same server (not apply to this case but could help others solve this error): change *<http://example.com/path/file.pdf>* to a local path like this */home/user/public\_html/path/file.pdf* |
36,107,070 | My goal is to put div with width=100vw, after that div there should be second div with width for example 300px (so that second div should be out of screen). I tried many things with float, display inline and so on, now I don't have any more ideas.
```
<div id="div1"></div>
<div id="div2"></div>
```
Here is fiddle w... | 2016/03/19 | [
"https://Stackoverflow.com/questions/36107070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3752988/"
] | This is really very straightforward using the [`Text::CSV`](https://p3rl.org/Text::CSV) to handle the nastiness of CSV data
Here's an example, which works fine with the sample data you have shown. As long as your input file is plain ASCII and the rows are about the size you have shown it should work fine
It prints it... | I guess I should have been braver and had a crack with Text::CSV to start with rather than asking a question.
Many thanks to Сухой27 and choroba for pointing me in the right direction.
Here is the code I ended up with. Probably not the tidiest.
```
use strict;
use warnings;
use Text::CSV;
my $file = "DEM_Export.csv... |
64,790,393 | I am setting up a remote SSH interpreter in PyCharm, but when I try to select the interpreter's location on the remote machine, I get the following error:
```
Indicated packet length 1952805748 too large
```
How can I fix this?
[](https://i.stac... | 2020/11/11 | [
"https://Stackoverflow.com/questions/64790393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2305095/"
] | I got this error because my `.bashrc` file printed to stdout. `.bashrc` is sourced when PyCharm connects to a remote interpreter's machine over SFTP. It has to be silent, otherwise it interferes with the SFTP protocol.
The solution is to exit `.bashrc` early when not running interactively by putting this line at the t... | I got a similar issues. I was pip updating a bunch of software in the cluster each time I logged in. So if pycharm runs the bashrc in the cluster each time it pushes and for some reason it processes it's output then this is an issue. I removed all lines that print in my bashrc in the remote/cluster. |
64,790,393 | I am setting up a remote SSH interpreter in PyCharm, but when I try to select the interpreter's location on the remote machine, I get the following error:
```
Indicated packet length 1952805748 too large
```
How can I fix this?
[](https://i.stac... | 2020/11/11 | [
"https://Stackoverflow.com/questions/64790393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2305095/"
] | I got this error because my `.bashrc` file printed to stdout. `.bashrc` is sourced when PyCharm connects to a remote interpreter's machine over SFTP. It has to be silent, otherwise it interferes with the SFTP protocol.
The solution is to exit `.bashrc` early when not running interactively by putting this line at the t... | After a little bit check, I found the final solution for this problem.
It is not a problem about `pycharm` or `intellij` actually.
The underlying working principle of `sync` files to the remote server is using `sftp` to upload files and download files from a remote server.
Maybe you have noticed that it works when u... |
64,790,393 | I am setting up a remote SSH interpreter in PyCharm, but when I try to select the interpreter's location on the remote machine, I get the following error:
```
Indicated packet length 1952805748 too large
```
How can I fix this?
[](https://i.stac... | 2020/11/11 | [
"https://Stackoverflow.com/questions/64790393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2305095/"
] | After a little bit check, I found the final solution for this problem.
It is not a problem about `pycharm` or `intellij` actually.
The underlying working principle of `sync` files to the remote server is using `sftp` to upload files and download files from a remote server.
Maybe you have noticed that it works when u... | I got a similar issues. I was pip updating a bunch of software in the cluster each time I logged in. So if pycharm runs the bashrc in the cluster each time it pushes and for some reason it processes it's output then this is an issue. I removed all lines that print in my bashrc in the remote/cluster. |
317,671 | Which phrase is the most common for a person who was born in Britain of the parents who were also born in Britain to identify his nationality?
1. "I am a citizen of Britain"?
2. "I am a subject of the British crown"?
3. "I am a British national"?
And is there a better alternative? | 2022/06/22 | [
"https://ell.stackexchange.com/questions/317671",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/650/"
] | The first of your suggestions is best, but I would like to suggest a better alternative:
>
> I am a British citizen
>
>
> | We need to be careful here. It may be better to ask this question on the Law site.
There are actually six forms of British nationality - with different names. And the mere fact that a person is born in Britain, even if both parents were born in Britain does not necessarily, I feel sure, make them British, under any of... |
12,177 | My Due is interfaces with a DAC which I need to update with freq 1MHz. The nice solution seems to be a timer interrupt. I found a thread here called "Arduino Due - creating an 8Mhz clock signal". I tried the following code to see if I can get 4MHz on P41. No luck. Any help will be greatly appreciated. Thanks.
```
vola... | 2015/05/27 | [
"https://arduino.stackexchange.com/questions/12177",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/10310/"
] | I'm not 100% certain without my Due in front of me to test this, but as far as I can see, you are configuring your clock to run at 42MHz with "TC\_CMR\_TCCLKS\_TIMER\_CLOCK1" and are getting the timer to trigger when the count is "1" with "TC\_SetRC(tc, channel, 1);", which would give you 42MHz, not 4MHz.
Since the cl... | When I'm working with timers on my Due I always keep my code low level so my solution for your problem would be:
```
// These are the clock frequencies available to the timers /2,/8,/32,/128
// 84Mhz/2 = 42.000 MHz
// 84Mhz/8 = 10.500 MHz
// 84Mhz/32 = 2.625 MHz
// 84Mhz/128 = 656.250 KHz
//
// 42Mhz/44.1Khz = 952.38
... |
12,177 | My Due is interfaces with a DAC which I need to update with freq 1MHz. The nice solution seems to be a timer interrupt. I found a thread here called "Arduino Due - creating an 8Mhz clock signal". I tried the following code to see if I can get 4MHz on P41. No luck. Any help will be greatly appreciated. Thanks.
```
vola... | 2015/05/27 | [
"https://arduino.stackexchange.com/questions/12177",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/10310/"
] | I'm not 100% certain without my Due in front of me to test this, but as far as I can see, you are configuring your clock to run at 42MHz with "TC\_CMR\_TCCLKS\_TIMER\_CLOCK1" and are getting the timer to trigger when the count is "1" with "TC\_SetRC(tc, channel, 1);", which would give you 42MHz, not 4MHz.
Since the cl... | This works
```
int unsigned A[2500];
int unsigned S;
void setup()
{
Serial.begin(9600);
//pinMode(30, OUTPUT);
REG_PIOB_OWER = 0xFFFFFFFF; // Enable PORT B
REG_PIOB_OER = 0xFFFFFFFF; // Set PORT B as output port
REG_PIOD_OWER = 0xFFFFFFFF; // Enable PORT D
REG_PIOD_OER = 0xFFFFFFFF; // S... |
12,177 | My Due is interfaces with a DAC which I need to update with freq 1MHz. The nice solution seems to be a timer interrupt. I found a thread here called "Arduino Due - creating an 8Mhz clock signal". I tried the following code to see if I can get 4MHz on P41. No luck. Any help will be greatly appreciated. Thanks.
```
vola... | 2015/05/27 | [
"https://arduino.stackexchange.com/questions/12177",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/10310/"
] | I'm not 100% certain without my Due in front of me to test this, but as far as I can see, you are configuring your clock to run at 42MHz with "TC\_CMR\_TCCLKS\_TIMER\_CLOCK1" and are getting the timer to trigger when the count is "1" with "TC\_SetRC(tc, channel, 1);", which would give you 42MHz, not 4MHz.
Since the cl... | >
> I need to update with freq 1MHz. ...No luck.
>
>
>
no kidding.
think about interrupt overhead. and how much it takes away the processing power if you interrupt at 1 million times a second.
think DMA if available on your chip. If not, think a faster chip or compromise on your 1Mhz expectation. |
12,177 | My Due is interfaces with a DAC which I need to update with freq 1MHz. The nice solution seems to be a timer interrupt. I found a thread here called "Arduino Due - creating an 8Mhz clock signal". I tried the following code to see if I can get 4MHz on P41. No luck. Any help will be greatly appreciated. Thanks.
```
vola... | 2015/05/27 | [
"https://arduino.stackexchange.com/questions/12177",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/10310/"
] | When I'm working with timers on my Due I always keep my code low level so my solution for your problem would be:
```
// These are the clock frequencies available to the timers /2,/8,/32,/128
// 84Mhz/2 = 42.000 MHz
// 84Mhz/8 = 10.500 MHz
// 84Mhz/32 = 2.625 MHz
// 84Mhz/128 = 656.250 KHz
//
// 42Mhz/44.1Khz = 952.38
... | This works
```
int unsigned A[2500];
int unsigned S;
void setup()
{
Serial.begin(9600);
//pinMode(30, OUTPUT);
REG_PIOB_OWER = 0xFFFFFFFF; // Enable PORT B
REG_PIOB_OER = 0xFFFFFFFF; // Set PORT B as output port
REG_PIOD_OWER = 0xFFFFFFFF; // Enable PORT D
REG_PIOD_OER = 0xFFFFFFFF; // S... |
12,177 | My Due is interfaces with a DAC which I need to update with freq 1MHz. The nice solution seems to be a timer interrupt. I found a thread here called "Arduino Due - creating an 8Mhz clock signal". I tried the following code to see if I can get 4MHz on P41. No luck. Any help will be greatly appreciated. Thanks.
```
vola... | 2015/05/27 | [
"https://arduino.stackexchange.com/questions/12177",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/10310/"
] | When I'm working with timers on my Due I always keep my code low level so my solution for your problem would be:
```
// These are the clock frequencies available to the timers /2,/8,/32,/128
// 84Mhz/2 = 42.000 MHz
// 84Mhz/8 = 10.500 MHz
// 84Mhz/32 = 2.625 MHz
// 84Mhz/128 = 656.250 KHz
//
// 42Mhz/44.1Khz = 952.38
... | >
> I need to update with freq 1MHz. ...No luck.
>
>
>
no kidding.
think about interrupt overhead. and how much it takes away the processing power if you interrupt at 1 million times a second.
think DMA if available on your chip. If not, think a faster chip or compromise on your 1Mhz expectation. |
18,578,718 | I'm trying to create a link from mysql results:
```
while($row = $result->fetch_assoc()){
echo "<a class=post_link href=http://localhost:8888/search.php?loc=".$row['loc']."<=".$row['lt']."&lg=".$row['lg'].">".$row['loc'].": ".$row['lt'].", ".$row['lg']."</a><br>" ;
}
```
The problem is, when 'loc' row contains... | 2013/09/02 | [
"https://Stackoverflow.com/questions/18578718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2699508/"
] | Use the PHP function `urlencode()`. This function is convenient when encoding a string to be used in a query part of a URL. More information: <http://php.net/manual/en/function.urlencode.php>
```
while($row = $result->fetch_assoc()){
echo "<a class=post_link href=http://localhost:8888/search.php?loc=".urlencode($r... | Or you can use ereg\_replace, since urlencode (supposedly, no personal experience) sometimes acts a bit weird:
```
while($row = $result->fetch_assoc()){
$loc = ereg_replace("[ \t\n\r]+", "%", $row['loc']);
echo "<a class=post_link href=http://localhost:8888/search.php?loc=".$loc."<=".$row['lt']."&lg=".$row['... |
68,997,651 | I'm using the `getifaddrs` Linux function to get information about network interfaces on a Linux machine running Debian Jessie kernel 3.16.0.
Among the info I want to know is network statistics (packets dropped, sent, etc.) which, as the manpage for getifaddrs states, is contained in a `rtnl_link_stats` structure poin... | 2021/08/31 | [
"https://Stackoverflow.com/questions/68997651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13083573/"
] | Thanks to @sawdust for pointing me to the answer.
The problem was that I'm running an ubuntu docker container in Manjaro (Arch) OS, and on Arch ttyUSB is owned by uucp (group id 987), while on ubuntu it's owned by dialout (group id 20).
So when mounting /dev/ttyUSB0 into the docker container, it's still owned by gid ... | If it is still relevant, the following solution did work for me:
```
docker run --gpus all -it --privileged --name [container_name] \
-v "$(pwd)/..":/home/app \
-v /dev/bus/usb:/dev/bus/usb \
-v /dev/ttyACM0:/dev/ttyACM0 \
[image_container_name] bash
```
Note that you might not need i... |
68,997,651 | I'm using the `getifaddrs` Linux function to get information about network interfaces on a Linux machine running Debian Jessie kernel 3.16.0.
Among the info I want to know is network statistics (packets dropped, sent, etc.) which, as the manpage for getifaddrs states, is contained in a `rtnl_link_stats` structure poin... | 2021/08/31 | [
"https://Stackoverflow.com/questions/68997651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13083573/"
] | Thanks to @sawdust for pointing me to the answer.
The problem was that I'm running an ubuntu docker container in Manjaro (Arch) OS, and on Arch ttyUSB is owned by uucp (group id 987), while on ubuntu it's owned by dialout (group id 20).
So when mounting /dev/ttyUSB0 into the docker container, it's still owned by gid ... | using "docker run --rm --group-add 986 -it --privileged ... " resolves.
if you call groups, show error but works.
$ groups
dcuser dialout staff groups: cannot find name for group ID 986
986 |
35,321,078 | I have a tab-separated text file that has 4 columns of data:
```
StudentId Student Name GPA Major
```
I have to write a shell command that will stores the student names that are CS majors to another file. I used `grep cs students.txt` which works to display just students that are `cs`, but I do not... | 2016/02/10 | [
"https://Stackoverflow.com/questions/35321078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4774214/"
] | Assuming that your input file is tab-separated (so you can have spaces in names):
```
awk -F'\t' '$4 == "cs" { print $2 }' <infile >outfile
```
This matches column 4 (major) against "cs", and prints column 2 when it is an exact match. | Got it:
```
grep cs students.txt | cut -f2 >file1
``` |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | I am one of these guys who learned how to work with the STL and heard a lot about RAII and good C++ programming practices from day 1. Looks like some of the most recommended books for learning C++ today (like Accelerated C++ and the Effective C++ series) focus on using STL tools instead of rolling up your own stuff, an... | In my experience it vastly depends on the age of the software product/project. Most new projects that I am aware of do use modern C++ (RAII, STL, Boost). However, there are many C++ projects that are more than 10 years old, and you don't see modern C++ there.
Also, keep in mind that some of the most popular STL implem... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | In my C++ jobs, I've found the modern features to be increasingly used, and more people asked me about them in phone screenings and interviews. As far as I can tell, they're catching on.
I learned C++ originally as something like C with Classes; although the language had advanced far beyond that, the books I read and ... | I think the biggest barrier I've encountered is toolchain support, especially on cross-platform projects. Until a few years ago, it was common to see build notes saying "x platform needs STLport to work because their compiler is borked". Even now, I see issues with people trying to use multiple third-party dependencies... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | In my experience it vastly depends on the age of the software product/project. Most new projects that I am aware of do use modern C++ (RAII, STL, Boost). However, there are many C++ projects that are more than 10 years old, and you don't see modern C++ there.
Also, keep in mind that some of the most popular STL implem... | Many teams I've been on and heard about consider the big "are we using exceptions?" question. This is code for "are we using modern C++?"
Once you aren't using exceptions, you are precluded from using the full power of the language and its libraries.
But many older codebases are exception-less, and it is perceived to... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | In my experience it vastly depends on the age of the software product/project. Most new projects that I am aware of do use modern C++ (RAII, STL, Boost). However, there are many C++ projects that are more than 10 years old, and you don't see modern C++ there.
Also, keep in mind that some of the most popular STL implem... | The best book for learning C++. "Accelerated C++" by Koenig & Moo, teaches what you describe as modern C++, so I guess most people these days are using it. For those of us that have been using C++ for quite a while (since the mid 80s in my case), modern C++ is a great relief from the tedious tasks of writing our own ar... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | I think you just had a bad experience starting off.
You need to get yourself [Scott Meyers](http://www.aristeia.com/) Effective C++ books. I started on C++ in anger in 1999, my team lead made me sit and read Effective C++ and More Effective C++ before I was allowed to check in ANY code.
Most of his advice is on the l... | While working on the project I am presently involved with, there's a lot of C++ code which has evolved over a significant period of time (over 10 years now). The evolution you speak of is clearly visible there: the older code is often "C with classes" - raw pointers, `char*` strings and use of associated C functions, a... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | Here's how I think things have evolved.
The first generation of C++ programmers were C programmers, who were in fact using C++ as C with classes. Plus, the STL wasn't in place yet, so that's what C++ essentially was.
When the STL came out, that advanced things, but most of the people writing books, putting together c... | I think you just had a bad experience starting off.
You need to get yourself [Scott Meyers](http://www.aristeia.com/) Effective C++ books. I started on C++ in anger in 1999, my team lead made me sit and read Effective C++ and More Effective C++ before I was allowed to check in ANY code.
Most of his advice is on the l... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | In the days of Windows 3.1, C was the standard. When C++ hit the developer market and later became ANSI standard, it was the new hotness. It popularized the OOP acronym and some of the basic design patterns using polymorphism.
Now, with the greater acceptance of low-barrier-to-entry managed platforms, like C#/.NET, th... | I have looked at [C++ Jobs on indeed](http://www.indeed.com/jobtrends?q=c%2B%2B+Qt%2C+c%2B%2B+boost%2C+c%2B%2B+stl%2C+c%2B%2B+mfc&l=) and "modern" libraries are more and more used in job descriptions, MFC which is quite an "old-style" c++ library is less used. |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | Here's how I think things have evolved.
The first generation of C++ programmers were C programmers, who were in fact using C++ as C with classes. Plus, the STL wasn't in place yet, so that's what C++ essentially was.
When the STL came out, that advanced things, but most of the people writing books, putting together c... | I am one of these guys who learned how to work with the STL and heard a lot about RAII and good C++ programming practices from day 1. Looks like some of the most recommended books for learning C++ today (like Accelerated C++ and the Effective C++ series) focus on using STL tools instead of rolling up your own stuff, an... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | In my experience (Spanish University), unfortunately, the norm is to not to consider languages in itself. They use the easiest languages to teach programming (i.e. Java), because it is supposed to be easy for teachers and students, and then they use C for the OS classes and such.
C++ is introduced very slightly (at an... | Before answering such a question, you'd have to agree on what "Modern" is. This not likely to happen, since "Modern" is a poorly defined word, and means different things to different people. The title of Alexandrescu's book (Modern C++ Design) doesn't really help either, since it is largely a book on Template Metaprogr... |
536,439 | When I first learned C++ 6-7 years ago, what I learned was basically "C with Classes". `std::vector` was definitely an advanced topic, something you could learn about if you *really* wanted to. And there was certainly no one telling me that destructors could be harnessed to help manage memory.
Today, everywhere I look... | 2009/02/11 | [
"https://Stackoverflow.com/questions/536439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33213/"
] | I wouldn't say that std::vector qualifies as "modern" these days. It is really basic.
Generally my impression is that people have gained some experience with modern C++ style and sobered up a little. Just to take a simple example, STL for\_each was interesting but in practice it does not add a terrible lot of value ov... | Before answering such a question, you'd have to agree on what "Modern" is. This not likely to happen, since "Modern" is a poorly defined word, and means different things to different people. The title of Alexandrescu's book (Modern C++ Design) doesn't really help either, since it is largely a book on Template Metaprogr... |
71,554 | I just completed a haloform reaction experiment, using acetophenone and sodium hypochlorite to form benzoic acid and chloroform.
My lab report has a question regarding balancing the equation of the reaction. I have been working on it for quite a while, and I can't figure out how to do it. I've tried looking up methods... | 2017/03/30 | [
"https://chemistry.stackexchange.com/questions/71554",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/43220/"
] | As you noted, you need to find the limiting reactant. This is most of the time done by taking the one with a 1:1 ratio of educt:product.
So in this case, the $\ce{ROCH\_3}$. So you take that once. Now you see immediately that you need 2 $\ce{Na}$ on the right side, so you can put a 2 in front of the $\ce{NaOH}$. You ... | The coefficients should be
1 3 4 1 1 3 3, from left to right. The limiting reagent is acetophenone.
Used this website to find the answer.
<http://www.chem.ucalgary.ca/courses/350/Carey5th/Ch18/ch18-3-2b.html>
-- a fellow owl ;) |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | Try this:
```
<%= link_to k, root_url + 'system/test.png' %>
``` | You can add assets host in your production.rb
```
config.action_controller.asset_host = 'https://www.example.com'
```
You can fine more about assets [here](http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html) |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | Try this:
```
<%= link_to k, root_url + 'system/test.png' %>
``` | You could use `<%= link_to k, "#{Rails.root}/system/test.png" %>`
Hope this is what you are looking for. |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | Try this:
```
<%= link_to k, root_url + 'system/test.png' %>
``` | ```
<%= link_to k, asset_url('/public/system/test.jpeg')%>
```
this will generate link as:-
```
https://example.com/public/system/test.jpeg
```
and your html code will generate like this: --
```
<a href="https://example.com/public/system/test.jpeg">k</a>
``` |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | Try this:
```
<%= link_to k, root_url + 'system/test.png' %>
``` | Try to the following
This code is tested
```
<%= link_to image_tag("/system/test.png"), root_url %>
```
`image_tag` by default located the public folder and `root_url` will redirect to the home page after click image
Or solution two
```
<a href="<%= root_url %>">
<%= image_tag "#{Rails.root}/public/system/te... |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | You can add assets host in your production.rb
```
config.action_controller.asset_host = 'https://www.example.com'
```
You can fine more about assets [here](http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html) | You could use `<%= link_to k, "#{Rails.root}/system/test.png" %>`
Hope this is what you are looking for. |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | You can add assets host in your production.rb
```
config.action_controller.asset_host = 'https://www.example.com'
```
You can fine more about assets [here](http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html) | Try to the following
This code is tested
```
<%= link_to image_tag("/system/test.png"), root_url %>
```
`image_tag` by default located the public folder and `root_url` will redirect to the home page after click image
Or solution two
```
<a href="<%= root_url %>">
<%= image_tag "#{Rails.root}/public/system/te... |
48,335,609 | In the mailer template i want to generate correct url for the path public/system/test.png
Suppose in the mailer template
```
<%= link_to k, "/system/test.png" %> <br />
```
how can i generate the full path such as
```
https://www.example.com/system/test.png
```
I appreciate any help! Thanks! | 2018/01/19 | [
"https://Stackoverflow.com/questions/48335609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734861/"
] | ```
<%= link_to k, asset_url('/public/system/test.jpeg')%>
```
this will generate link as:-
```
https://example.com/public/system/test.jpeg
```
and your html code will generate like this: --
```
<a href="https://example.com/public/system/test.jpeg">k</a>
``` | You could use `<%= link_to k, "#{Rails.root}/system/test.png" %>`
Hope this is what you are looking for. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.