qid
int64
question
string
date
string
metadata
list
response_j
string
response_k
string
58,717,068
I created a setup project using Microsoft Visual Studio Installer Projects (0.9.3, this is latest for Visual Studio 2019). After setup is executed it installs Nuget package assemblies that are different from the assemblies generated during build. Why is it doing that and how can I make it to chose assemblies consiste...
2019/11/05
[ "https://Stackoverflow.com/questions/58717068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11007419/" ]
> > Install retrieves assembly from: C:\Program Files (x86)\Reference > Assemblies\Microsoft\Framework.NETFramework\v4.7.2\Facades\System.ValueTuple.dll > > > Which way do you reference that package? I can only reproduce this issue when I add reference manually.(Right-click project=>Add reference=>Browse...) If y...
It seems that the root cause of the problem is the usage of the BuiltProjectOutputGroupDependencies target by visual studio setup projects instead of the ReferenceCopyLocalPathsOutputGroup target (see [PackageReferences put ref instead of lib assemblies in the output group used by VS installer projects](https://github....
32,641,990
I am creating a metronome as part of a larger app and I have a few very short wav files to use as the individual sounds. I would like to use AVAudioEngine because NSTimer has significant latency problems and Core Audio seems rather daunting to implement in Swift. I'm attempting the following, but I'm currently unable t...
2015/09/18
[ "https://Stackoverflow.com/questions/32641990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4139760/" ]
I was able to make a buffer containing sound from file and silence of required length. Hope this will help: ``` // audioFile here – an instance of AVAudioFile initialized with wav-file func tickBuffer(forBpm bpm: Int) -> AVAudioPCMBuffer { audioFile.framePosition = 0 // position in file from where to read, require...
I think that one of possible ways to have sounds played at with lowest possible time error is providing audio samples directly via callback. In iOS you could do this with `AudioUnit`. In this callback you could track sample count and know at what sample you are now. From sample counter you could go to time value (usin...
32,641,990
I am creating a metronome as part of a larger app and I have a few very short wav files to use as the individual sounds. I would like to use AVAudioEngine because NSTimer has significant latency problems and Core Audio seems rather daunting to implement in Swift. I'm attempting the following, but I'm currently unable t...
2015/09/18
[ "https://Stackoverflow.com/questions/32641990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4139760/" ]
I was able to make a buffer containing sound from file and silence of required length. Hope this will help: ``` // audioFile here – an instance of AVAudioFile initialized with wav-file func tickBuffer(forBpm bpm: Int) -> AVAudioPCMBuffer { audioFile.framePosition = 0 // position in file from where to read, require...
To expand upon 5hrp's answer: Take the simple case where you have two beats, an upbeat (tone1) and a downbeat (tone2), and you want them out of phase with each other so the audio will be (up, down, up, down) to a certain bpm. You will need two instances of AVAudioPlayerNode (one for each beat), let's call them *audio...
52,953,184
I'm attempting to create a parameter for when `jodrtg.fdescnum <> inmastx.fbin1`. I want to be able to use this in a dropdown list selection for my report. I have tried a number of combinations but keep getting syntax errors near the `<`or `=`.I'd be appreciative if anyone can point me in the right direction. I've neve...
2018/10/23
[ "https://Stackoverflow.com/questions/52953184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10177680/" ]
I learned that you can only use one operator at a time but they can be combined using bool logic. `WHERE (jodrtg.fdescnum <> inmastx.fbin1 OR @ParameterName = 'Unfiltered')`
``` AND (jodrtg.fdescnum <> inmastx.fbin1) OR @MoldPress = 0 ```
2,560,649
I have written an application on my x64 machine in Visual Studio 2008. The application will be sent to someone, and I have two questions that I need answers to. 1. What requirements will they need to have installed. I am assuming the .NET 3.5 redistributable. Are there anything else though? (The application does not c...
2010/04/01
[ "https://Stackoverflow.com/questions/2560649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304684/" ]
``` awk '/INSERT/{ if ($3=="donextsit"){ gsub("change","servicechange"); print } }' file ``` since this is homework, something is still not working..you should find out for yourself
``` sed ' /^INSERT/ ! d; /^ *[^ ]\+ *[^ ]\+ *donextsit / s/change)/servicechange)/g; ' -i file ``` Edit: Incorporated Jonathan Leffler's suggestions.
3,890,028
I have an asp.net web app which holds its data in an sql server 08 r2 db. I have a silverlight admin interface on the same web app, and I will have a win forms app which will need to add/retrieve data from the sql db. Is there a way I can use linq in both clients? I mean something like linq2twitter, where in the silv...
2010/10/08
[ "https://Stackoverflow.com/questions/3890028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/368070/" ]
Based on what you've posted, I'm guessing that perhaps there's a primary or unique key on the Patient table's FirstName and LastName columns, and the second time you try to insert data into the database this constraint is causing the inserts to fail. Just a guess. Post more information and perhaps we can narrow it dow...
Delete the previous database. Create a new database with the new XML.
1,237,281
I'm a bit stumped by the Facebook implementation of Javascript. I want to set up a listener on a checkbox so that when checked, it changes the class of an element I can get by ID. I've been using the test console and have tried various permutations. Javascript is NOT my first language, nor my second, third... COuld an...
2009/08/06
[ "https://Stackoverflow.com/questions/1237281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82203/" ]
FBJS has its own getters and setters. Getting "checked" and setting/removing classes are different. And, you would have to remove the `red` class if you are adding the `green` class and visa versa. Or, if you just want to overwrite all the classes of the element, you can use the `setClassName(class)` method instead, I'...
For the onclick event you need to use... ``` this.checked ``` Then your function will look like this: ``` var setColor = function(isChecked) { var myElement = document.getElementById("one"); if (isChecked) { myElement.className = "myGreenClass"; } else { myElement.className = "myRedClass...
1,237,281
I'm a bit stumped by the Facebook implementation of Javascript. I want to set up a listener on a checkbox so that when checked, it changes the class of an element I can get by ID. I've been using the test console and have tried various permutations. Javascript is NOT my first language, nor my second, third... COuld an...
2009/08/06
[ "https://Stackoverflow.com/questions/1237281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82203/" ]
FBJS has its own getters and setters. Getting "checked" and setting/removing classes are different. And, you would have to remove the `red` class if you are adding the `green` class and visa versa. Or, if you just want to overwrite all the classes of the element, you can use the `setClassName(class)` method instead, I'...
kmiyashiro is mostly right except for the getters and setters for the class name it should be ``` if (isChecked) { p.setClassName("green"); } else { p.setClassName("red"); } ``` Since its just a set meothod and there are no remove methods, you don't need to worry about removiing the class name, it will jus...
36,743,222
Suppose you are given an **n** sized array **A** and a integer **k** Now you have to follow this function: ```c long long sum(int k) { long long sum=0; for(int i=0;i<n;i++){ sum+=min(A[i],k); } return sum; } ``` what is the most efficient way to find sum? EDIT: if I am given **m***(<=1000...
2016/04/20
[ "https://Stackoverflow.com/questions/36743222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4213470/" ]
You can do way better than that **if** you can sort the array `A[i]` and have a secondary array prepared once. The idea is: * Count how many items are less than `k`, and just compute the equivalent sum by the formula: `count*k` * Prepare an helper array which will give you the sum of the items superior to `k` directl...
What you do seems absolutely fine. Unless this is really absolutely time critical (that is customers complain that your app is too slow and you measured it, and this function is the problem, in which case you can try some non-portable vector instructions, for example). Often you can do things more efficiently by look...
36,743,222
Suppose you are given an **n** sized array **A** and a integer **k** Now you have to follow this function: ```c long long sum(int k) { long long sum=0; for(int i=0;i<n;i++){ sum+=min(A[i],k); } return sum; } ``` what is the most efficient way to find sum? EDIT: if I am given **m***(<=1000...
2016/04/20
[ "https://Stackoverflow.com/questions/36743222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4213470/" ]
If set of queries changes with each `k` then you can't do better than in O(n). Your only options for optimizing is to use multiple threads (each thread sums some region of array) or at least ensure that your loop is properly vectorized by compiler (or write vectorized version manually using intrinsics). But if set of ...
What you do seems absolutely fine. Unless this is really absolutely time critical (that is customers complain that your app is too slow and you measured it, and this function is the problem, in which case you can try some non-portable vector instructions, for example). Often you can do things more efficiently by look...
36,743,222
Suppose you are given an **n** sized array **A** and a integer **k** Now you have to follow this function: ```c long long sum(int k) { long long sum=0; for(int i=0;i<n;i++){ sum+=min(A[i],k); } return sum; } ``` what is the most efficient way to find sum? EDIT: if I am given **m***(<=1000...
2016/04/20
[ "https://Stackoverflow.com/questions/36743222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4213470/" ]
You can do way better than that **if** you can sort the array `A[i]` and have a secondary array prepared once. The idea is: * Count how many items are less than `k`, and just compute the equivalent sum by the formula: `count*k` * Prepare an helper array which will give you the sum of the items superior to `k` directl...
Suppose there are x elements of array A which are no larger than k and set B contains those elements which are larger than k and belongs to A. Then the result of function sum(k) equals ``` k * x + sum_b ``` ,where sum\_b is the sum of elements belonging to B. You can firstly sort the the array A, and calculate t...
36,743,222
Suppose you are given an **n** sized array **A** and a integer **k** Now you have to follow this function: ```c long long sum(int k) { long long sum=0; for(int i=0;i<n;i++){ sum+=min(A[i],k); } return sum; } ``` what is the most efficient way to find sum? EDIT: if I am given **m***(<=1000...
2016/04/20
[ "https://Stackoverflow.com/questions/36743222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4213470/" ]
If set of queries changes with each `k` then you can't do better than in O(n). Your only options for optimizing is to use multiple threads (each thread sums some region of array) or at least ensure that your loop is properly vectorized by compiler (or write vectorized version manually using intrinsics). But if set of ...
You can do way better than that **if** you can sort the array `A[i]` and have a secondary array prepared once. The idea is: * Count how many items are less than `k`, and just compute the equivalent sum by the formula: `count*k` * Prepare an helper array which will give you the sum of the items superior to `k` directl...
36,743,222
Suppose you are given an **n** sized array **A** and a integer **k** Now you have to follow this function: ```c long long sum(int k) { long long sum=0; for(int i=0;i<n;i++){ sum+=min(A[i],k); } return sum; } ``` what is the most efficient way to find sum? EDIT: if I am given **m***(<=1000...
2016/04/20
[ "https://Stackoverflow.com/questions/36743222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4213470/" ]
If set of queries changes with each `k` then you can't do better than in O(n). Your only options for optimizing is to use multiple threads (each thread sums some region of array) or at least ensure that your loop is properly vectorized by compiler (or write vectorized version manually using intrinsics). But if set of ...
Suppose there are x elements of array A which are no larger than k and set B contains those elements which are larger than k and belongs to A. Then the result of function sum(k) equals ``` k * x + sum_b ``` ,where sum\_b is the sum of elements belonging to B. You can firstly sort the the array A, and calculate t...
61,618,687
I'm finding information on how to change sheet names and even naming and placing copies of files in Drive but is there any simple way to just have the string in a cell be added to the file name (no copies, just replacing the current one)? I have a script to clear certain cells, and this cell would be included so it's p...
2020/05/05
[ "https://Stackoverflow.com/questions/61618687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9211606/" ]
I hope I understood your question correctly, but I think this should do it. You add the value from cell A1 (= row 1, column 1) into the tittle of your current active spreadsheet. ```html function changeSpeadsheetName() { var sheet = SpreadsheetApp.getActiveSpreadsheet(); var range = sheet.getActiveSheet().getRang...
This function will allow you to set your spreadsheet File Name: ``` function onOpen() { SpreadsheetApp.getUi().createMenu('CaseMenu') .addItem('Change Case Number', 'changeCaseNumber') .addToUi(); } function changeCaseNumber() { const ss=SpreadsheetApp.getActive(); const sh=ss.getSheetByName('Cases'); con...
3,732,602
[![Question](https://i.stack.imgur.com/BtxyR.png)](https://i.stack.imgur.com/BtxyR.png) **OPTIONS:** A) 10 B) 15 C) 25 D) None of the above
2020/06/24
[ "https://math.stackexchange.com/questions/3732602", "https://math.stackexchange.com", "https://math.stackexchange.com/users/428996/" ]
**ABSOLUTE VALUE FUNCTION:** $ f(x) = |x| = \begin{cases} x &\text{if } x\geq0\\ -x &\text{if } x<0 \\ \end{cases} $ **SOLUTION:** ------------- --- --- PART I: ------- First let us find the rational numbers $x$ that make $a,b,c$ an arithmetic progression (AP). $a,b,c$ must be in the form $t\_1,t\_1+d,t\_1+2d$...
The only correct option is A) $10$. The proofs for the following two claims are written at the end of the answer. **Claim 1** : The only rational numbers $x$ satisfying $t\_2-t\_1=t\_3-t\_2$ are $x=0,\frac 53,2$. **Claim 2** : $|S|=5$. Let $d$ be the common difference. Also, let $S\_{15}$ be the sum of the first $1...
37,915,413
In a recent interview, question I faced was > > How can you handle null pointer when iterator encounters a null key > while iteration over a hashmap. assume my developer has inserted a > null key by mistake > > > My answer was: Just we need to check `null!=entry.getKey()`. he was not satisfied and said before t...
2016/06/20
[ "https://Stackoverflow.com/questions/37915413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2003821/" ]
``` map.remove(null) ``` From JavaDocs: > > Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key. > > > If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's a...
I guess the key point that he want to test by this question is What happend when called the method `next()` on the object `Iterator`. He maybe want to know whether or not you will programming like the following way when you want to iterate a map: ``` Map map = new HashMap(); Iterator iter = map.keySet().iterator(); w...
278,686
I have to evaluate this integral: $\int^{\infty}\_{-\infty}\int^{x}\_{-\infty}xe^{-x^2}e^{-y^2}dydx$ I know how to evaluate the next integral: $\int^{\infty}\_{-\infty}e^{-x^2}dx$ But I just cant figure out how to do first one. I need hints.
2013/01/14
[ "https://math.stackexchange.com/questions/278686", "https://math.stackexchange.com", "https://math.stackexchange.com/users/36818/" ]
Interchange the order of the variables: $$ \int\_{-\infty}^\infty \int\_{-\infty}^x x e^{-x^2} e^{-y^2}\ dy\ dx = \int\_{-\infty}^\infty e^{-y^2} \int\_{y}^\infty x e^{-x^2}\ dx\ dy $$
$$\int\_{-\infty}^\infty xe^{-x^2} \int\_{-\infty}^x e^{-y^2}\, dy \, dx = \frac{\sqrt \pi}{2} \int\_{-\infty}^\infty xe^{-x^2} \left[\operatorname{erf}x \right]\_{-\infty}^x \, dx = \frac{\sqrt \pi}{2}\int\_{-\infty}^\infty (\operatorname{erf} x+1)x e^{-x^2} \, dx = \frac{\sqrt{\pi}}{2\sqrt 2}$$ and the last integr...
278,686
I have to evaluate this integral: $\int^{\infty}\_{-\infty}\int^{x}\_{-\infty}xe^{-x^2}e^{-y^2}dydx$ I know how to evaluate the next integral: $\int^{\infty}\_{-\infty}e^{-x^2}dx$ But I just cant figure out how to do first one. I need hints.
2013/01/14
[ "https://math.stackexchange.com/questions/278686", "https://math.stackexchange.com", "https://math.stackexchange.com/users/36818/" ]
Interchange the order of the variables: $$ \int\_{-\infty}^\infty \int\_{-\infty}^x x e^{-x^2} e^{-y^2}\ dy\ dx = \int\_{-\infty}^\infty e^{-y^2} \int\_{y}^\infty x e^{-x^2}\ dx\ dy $$
You can integrate by parts: $$ \begin{eqnarray} \int\_{-\infty}^{\infty} x e^{-x^2} \left(\int\_{-\infty}^{x} e^{-y^2} dy\right) dx &=& -\frac{1}{2}\int\_{-\infty}^{\infty} \left(\int\_{-\infty}^{x} e^{-y^2} dy\right)d(e^{-x^2}) \\ &=&\frac{1}{2}\int\_{-\infty}^{\infty}e^{-x^2}d\left(\int\_{-\infty}^{x} e^{-y^2} dy\rig...
278,686
I have to evaluate this integral: $\int^{\infty}\_{-\infty}\int^{x}\_{-\infty}xe^{-x^2}e^{-y^2}dydx$ I know how to evaluate the next integral: $\int^{\infty}\_{-\infty}e^{-x^2}dx$ But I just cant figure out how to do first one. I need hints.
2013/01/14
[ "https://math.stackexchange.com/questions/278686", "https://math.stackexchange.com", "https://math.stackexchange.com/users/36818/" ]
Interchange the order of the variables: $$ \int\_{-\infty}^\infty \int\_{-\infty}^x x e^{-x^2} e^{-y^2}\ dy\ dx = \int\_{-\infty}^\infty e^{-y^2} \int\_{y}^\infty x e^{-x^2}\ dx\ dy $$
Hint: Change the order of integration. It turns into two known integrals.
20,520,549
I've made this class BigInt, and it it has derived transformation constructors such as ``` BigInt::BigInt(int l):InfInt(l){} ``` Yet when I do something like this: ``` for(i=0;BigInt::pow(2,i+1)<exponent;i++); ``` The compiler yells at me for: ``` error: ambiguous overload for ‘operator+’ (operand types are ‘Big...
2013/12/11
[ "https://Stackoverflow.com/questions/20520549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3077150/" ]
You also have an `operator int()`, don't you? That, plus the constructor that takes an `int`, produces the ambiguity. The compiler can call `BigInt::operator+()` by converting the `int` argument to a `BigInt`, or it can call the built-in `+` by converting the `BigInt` object to an `int`. Mark the `operator int()` `expl...
Not sure what the problem is. Does comparing against this help: ``` #include <iostream> struct MyInt { MyInt(int i) : m_i(i) {} MyInt operator+(const MyInt& myint) const { return MyInt(m_i+myint.m_i); } int m_i; }; int main() { MyInt a(10); MyInt b(5); MyInt c1 = a ...
10,033,953
I think understand the idea of duck typing, and would like to use it more often in my code. However, I am concerned about one potential problem: name collision. Suppose I want an object to do something. I know the appropriate method, so I simply call it and see what happens. In general, there are three possible outcom...
2012/04/05
[ "https://Stackoverflow.com/questions/10033953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336527/" ]
Well, if this is *critical*, you probably should not be using duck typing... In practice, programs are finite systems, and the range of possible types passed into any particular routine does not cause the issues you are worrying about (most often there's only ever one type passed in). But if you want address this iss...
If you are following good programming practice or let me rather say if your code is Pythoic then chances are you would seldom face such issues. Refer the [FAQ What are the “best practices” for using import in a module?](http://docs.python.org/faq/programming.html#what-are-the-best-practices-for-using-import-in-a-module...
10,033,953
I think understand the idea of duck typing, and would like to use it more often in my code. However, I am concerned about one potential problem: name collision. Suppose I want an object to do something. I know the appropriate method, so I simply call it and see what happens. In general, there are three possible outcom...
2012/04/05
[ "https://Stackoverflow.com/questions/10033953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336527/" ]
Well, if this is *critical*, you probably should not be using duck typing... In practice, programs are finite systems, and the range of possible types passed into any particular routine does not cause the issues you are worrying about (most often there's only ever one type passed in). But if you want address this iss...
To address your problem, look at [abstract base classes](http://docs.python.org/library/abc.html). They're a Pythonic way to deal with this issue; you can define common behavior in a base class, and even define ways to determine if a particular object is a "virtual baseclass" of the abstract base class. This somewhat m...
10,033,953
I think understand the idea of duck typing, and would like to use it more often in my code. However, I am concerned about one potential problem: name collision. Suppose I want an object to do something. I know the appropriate method, so I simply call it and see what happens. In general, there are three possible outcom...
2012/04/05
[ "https://Stackoverflow.com/questions/10033953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336527/" ]
Well, if this is *critical*, you probably should not be using duck typing... In practice, programs are finite systems, and the range of possible types passed into any particular routine does not cause the issues you are worrying about (most often there's only ever one type passed in). But if you want address this iss...
If you are worried that the lack of static type checking will let some bugs get through, the answer isn't to bolt on type checking, it is to write tests. In the presence of unit tests, a type checking system becomes largely redundant as a means of catching bugs. While it is true that a type checking system can catch s...
131,834
given a `SparseArray` ``` s = SparseArray[{1, 10} -> 1, {1, 10}, a] ``` I can extract the background value (see [What are SparseArray Properties? How and when should they be used?](https://mathematica.stackexchange.com/q/83721/2079) ) ``` s["Background"] ``` > > a > > > but is there a direct way to change it...
2016/11/22
[ "https://mathematica.stackexchange.com/questions/131834", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/2079/" ]
You can change the background using replacement; here making the background `"x"`: ``` s = SparseArray[{1, 10} -> 1, {1, 10}, a] s /. (sa : SparseArray)[a_, b_, background_, d_] :> sa[a, b, "x", d] ``` [![enter image description here](https://i.stack.imgur.com/Mnu9p.png)](https://i.stack.imgur.com/Mnu9p.png)
``` s = SparseArray[{1, 10} -> 1, {1, 10}, a]; s2 = SparseArray[s["NonzeroPositions"] -> s["NonzeroValues"], Dimensions[s], b]; ``` A slightly slower way using `ArrayRules`: ``` s3 = SparseArray[Most@ArrayRules[s], Dimensions[s], b]; ``` I haven't tested these on later versions.
331,614
A standard pitfall of disk encryption on Linux is needing /boot unencrypted. Specifically the bootloader and initrd. Encrypting the entire disk means putting those somewhere else, e.g. on a USB stick. edit: I have now learned that grub can now decrypt a filesystem containing the kernel at boot so it's only the bootloa...
2018/07/20
[ "https://apple.stackexchange.com/questions/331614", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/296313/" ]
At the most basic level, Apple controls the firmware and stores the absolute minimum information needed to present the illusion that an OS is running at the pre-boot log in screen when FileVault is enabled. This is documented quite extensively by Apple: * <https://support.apple.com/en-us/HT201159> - Product security ...
The boot partition doesn't needs to be on a stick, it can also be on the drive itself (`Boot OS X`): ``` pse@Mithos:~$ diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *121.3 GB disk0 ...
20,542,934
I'm trying to learn myself some PHP, finally. I've decided that I would like to build my own website, with a CMS instead of just downloading something premade. I found this great guide (<http://www.elated.com/articles/cms-in-an-afternoon-php-mysql/#step1>) to get me started. So far so good, I've followed the guide, c...
2013/12/12
[ "https://Stackoverflow.com/questions/20542934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930260/" ]
You forgot `:` after `case`. Corrected Code: ``` <?php require( "config.php" ); $action = isset( $_GET['action'] ) ? $_GET['action'] : ""; switch ( $action ) { case 'jobs'://Add : here jobs(): break; case 'viewJob'://Add : here viewJob(); // Replace `:` by `;` ...
``` jobs(): ``` needs to be ; for all functions in the switch statement except in the `case 'jobs':`
20,542,934
I'm trying to learn myself some PHP, finally. I've decided that I would like to build my own website, with a CMS instead of just downloading something premade. I found this great guide (<http://www.elated.com/articles/cms-in-an-afternoon-php-mysql/#step1>) to get me started. So far so good, I've followed the guide, c...
2013/12/12
[ "https://Stackoverflow.com/questions/20542934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930260/" ]
You forgot `:` after `case`. Corrected Code: ``` <?php require( "config.php" ); $action = isset( $_GET['action'] ) ? $_GET['action'] : ""; switch ( $action ) { case 'jobs'://Add : here jobs(): break; case 'viewJob'://Add : here viewJob(); // Replace `:` by `;` ...
It should be something like this: ``` switch ( $action ) { case 'jobs': jobs(); break; case 'viewJob': viewJob(); break; default: homepage(); } ```
20,542,934
I'm trying to learn myself some PHP, finally. I've decided that I would like to build my own website, with a CMS instead of just downloading something premade. I found this great guide (<http://www.elated.com/articles/cms-in-an-afternoon-php-mysql/#step1>) to get me started. So far so good, I've followed the guide, c...
2013/12/12
[ "https://Stackoverflow.com/questions/20542934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930260/" ]
It should be something like this: ``` switch ( $action ) { case 'jobs': jobs(); break; case 'viewJob': viewJob(); break; default: homepage(); } ```
``` jobs(): ``` needs to be ; for all functions in the switch statement except in the `case 'jobs':`
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Generally, banks will report your loan to at least one (if not all three) credit bureaus - although that is [not required by law](http://www.bankrate.com/finance/credit/lenders-report-credit-bureaus.aspx). The interest you're paying, in addition to your insurance isn't justifiable for building credit. I would recommend...
Pay it off. Pay it off. Pay it off! ----------------------------------- Credit reports have line items that, if all is well, say "paid as agreed." A car loan almost certainly gets reported. In your case it probably says the happy "paid as agreed." It will continue to say that if you pay it off in full. You can get th...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Your plan isn't bad, but it probably isn't worth the cost for the small amount of credit building it will achieve. If you do decide to continue with it though, you'll save in interest if you make the big payment now rather than in 6 months. In other words, you can take the minimum payment, multiply it by 5, subtract th...
Pay it off....I've only ever paid interest on mortgages to buy the houses I've lived in (I paid both mortgages of years ahead of schedule) & as a result my credit rating's way above average, I use credit cards for everything, pay 'em off in full every month unless I'm paid not to (currently have around 8,000 sitting in...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Contrary to popular belief, you can build your credit (if that is important to you) without paying a penny in interest. This is done through the responsible use of credit cards, paying the bill in full each month without accruing any interest charges. If I were you, I would pay off the loan today, if possible. After t...
Your plan isn't bad, but it probably isn't worth the cost for the small amount of credit building it will achieve. If you do decide to continue with it though, you'll save in interest if you make the big payment now rather than in 6 months. In other words, you can take the minimum payment, multiply it by 5, subtract th...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Personally, I don't think that the interest from the car loan is worth the credit history you're building through it. There are other ways to build credit that don't require you to pay interest, like the credit card you mentioned (so long as you keep paying off the balance). So I'd go that route: ditch the auto loan an...
Pay it off....I've only ever paid interest on mortgages to buy the houses I've lived in (I paid both mortgages of years ahead of schedule) & as a result my credit rating's way above average, I use credit cards for everything, pay 'em off in full every month unless I'm paid not to (currently have around 8,000 sitting in...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Personally, I don't think that the interest from the car loan is worth the credit history you're building through it. There are other ways to build credit that don't require you to pay interest, like the credit card you mentioned (so long as you keep paying off the balance). So I'd go that route: ditch the auto loan an...
Something I'd like to plant firmly into your mind - If you're able to save up enough money to buy the things you want outright, credit will be of little use to you. Many people find once they've accumulated very good credit scores by use of good financial habits, that they rarely end up using credit, and get little ou...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Generally, banks will report your loan to at least one (if not all three) credit bureaus - although that is [not required by law](http://www.bankrate.com/finance/credit/lenders-report-credit-bureaus.aspx). The interest you're paying, in addition to your insurance isn't justifiable for building credit. I would recommend...
Typically the power of capitalized interest would work in your favor and you could carry the loan paying it down while investing the original sum which would earn interest. BUT you aren't going to get any sort of return to compare with 15% so *pay off that loan immediately*. Also contrary to popular belief (and reiter...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Contrary to popular belief, you can build your credit (if that is important to you) without paying a penny in interest. This is done through the responsible use of credit cards, paying the bill in full each month without accruing any interest charges. If I were you, I would pay off the loan today, if possible. After t...
Pay it off....I've only ever paid interest on mortgages to buy the houses I've lived in (I paid both mortgages of years ahead of schedule) & as a result my credit rating's way above average, I use credit cards for everything, pay 'em off in full every month unless I'm paid not to (currently have around 8,000 sitting in...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Personally, I don't think that the interest from the car loan is worth the credit history you're building through it. There are other ways to build credit that don't require you to pay interest, like the credit card you mentioned (so long as you keep paying off the balance). So I'd go that route: ditch the auto loan an...
Generally, banks will report your loan to at least one (if not all three) credit bureaus - although that is [not required by law](http://www.bankrate.com/finance/credit/lenders-report-credit-bureaus.aspx). The interest you're paying, in addition to your insurance isn't justifiable for building credit. I would recommend...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Personally, I don't think that the interest from the car loan is worth the credit history you're building through it. There are other ways to build credit that don't require you to pay interest, like the credit card you mentioned (so long as you keep paying off the balance). So I'd go that route: ditch the auto loan an...
First, **don't owe (much) money on a car that's out of warranty.** If you have an engine blow up and repairs will cost the lion's share of the car's bluebook value, *the entire car loan immediately comes due* because the collateral is now worthless. This puts you in a very miserable situation because you must pay off t...
80,869
I saw [another question like this](https://money.stackexchange.com/questions/11605/should-i-pay-off-my-car-loan-within-first-year-or-wait-until-at-least-one-year-h), but I am in a bit of a different situation. I am 19 years old, in college, and have no credit history. I saved up enough money to buy a car, but decid...
2017/06/15
[ "https://money.stackexchange.com/questions/80869", "https://money.stackexchange.com", "https://money.stackexchange.com/users/57624/" ]
Generally, banks will report your loan to at least one (if not all three) credit bureaus - although that is [not required by law](http://www.bankrate.com/finance/credit/lenders-report-credit-bureaus.aspx). The interest you're paying, in addition to your insurance isn't justifiable for building credit. I would recommend...
First, **don't owe (much) money on a car that's out of warranty.** If you have an engine blow up and repairs will cost the lion's share of the car's bluebook value, *the entire car loan immediately comes due* because the collateral is now worthless. This puts you in a very miserable situation because you must pay off t...
20,766
I don't print a TON of my photos, but when I do it's because it's really important to me. I've got a MacBook Pro attached to a Samsung 2300 display and an [HP Photosmart 7760](http://rads.stackoverflow.com/amzn/click/B0000ACOW0) printer. I typically use Lightroom for OSX, but occasionally will make use of Aperture if t...
2012/03/01
[ "https://photo.stackexchange.com/questions/20766", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1404/" ]
**Calibration** First off, the obvious stuff: Calibrate your monitor, and use appropriate ICC profiles for your printer/ink/papers. You mentioned you already have a calibrated monitor, and for the most part, you should be able to find quality ICC profiles for your printer and the papers you use on the net (I use a Can...
You got your screen calibrated, that is the first step. Next is to have the printer "calibrated". It is important to realize that the printer will act differently depending on which type of paper you print on. So you will need an ICC profile for your specific combination of paper and printer. If you buy the same bran...
20,766
I don't print a TON of my photos, but when I do it's because it's really important to me. I've got a MacBook Pro attached to a Samsung 2300 display and an [HP Photosmart 7760](http://rads.stackoverflow.com/amzn/click/B0000ACOW0) printer. I typically use Lightroom for OSX, but occasionally will make use of Aperture if t...
2012/03/01
[ "https://photo.stackexchange.com/questions/20766", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1404/" ]
**Calibration** First off, the obvious stuff: Calibrate your monitor, and use appropriate ICC profiles for your printer/ink/papers. You mentioned you already have a calibrated monitor, and for the most part, you should be able to find quality ICC profiles for your printer and the papers you use on the net (I use a Can...
The only way to reliably get a color match between display and printer is to: 1. Calibrate your monitor. Do it the same day as you plan to print. 2. Calibrate your printer. Do it with the inks you will be using and the paper to which you will be printing. This might be overkill for the printer you currently have, but...
45,795,821
I have just started Android and i am working on Simple Login Page,where user can use their email and password to login with some conditions while login. When user login as a "store owner",his name and email is shown on the next page (i.e on the Fragment class) which is working fine but whenever user login as a "public ...
2017/08/21
[ "https://Stackoverflow.com/questions/45795821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6037137/" ]
try this to set Shared Pref ``` String userId=yourstring; SharedPreferences settings = PreferenceManager .getDefaultSharedPreferences(youractivity.this); Editor edit = settings.edit(); edit.putString("name", userId); settings.commit; ``` to get shared pref ``` Sha...
Override `newInstance()` method in your fragment like this. ``` public static YourFragment newInstance(Bundle bundle) { ActivityFeedListFragment fragment = new ActivityFeedListFragment(); fragment.setArguments(bundle); return fragment; } ``` And pass `bundle` object.
45,795,821
I have just started Android and i am working on Simple Login Page,where user can use their email and password to login with some conditions while login. When user login as a "store owner",his name and email is shown on the next page (i.e on the Fragment class) which is working fine but whenever user login as a "public ...
2017/08/21
[ "https://Stackoverflow.com/questions/45795821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6037137/" ]
try this to set Shared Pref ``` String userId=yourstring; SharedPreferences settings = PreferenceManager .getDefaultSharedPreferences(youractivity.this); Editor edit = settings.edit(); edit.putString("name", userId); settings.commit; ``` to get shared pref ``` Sha...
You have to use a bundle and a serializable object to pass.: * From the **activity**: > > > ``` > Fragment fragment = new YourFragment(); > Bundle bundle = new Bundle(); > bundle.putSerializable(ARGUMENT_KEY, objectSerializable); > fragment.setArguments(bundle); showFragment(fragment) > > ``` > > * On the **fra...
259,798
I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this: ``` SqlCommand cmd = new SqlCommand("CREATE VIEW @na...
2008/11/03
[ "https://Stackoverflow.com/questions/259798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26286/" ]
Maybe I've not understood it correctly, but what prevents you to do: ``` viewname="foo"; viewwhere="* from bar"; SqlCommand cmd = new SqlCommand("CREATE VIEW "+viewname+" AS SELECT "+viewwhere); ```
It looks to me like you are trying to create a dynamic query using parameters, which is not how a parameterized query is intended to work. They do not simply get concatenated into the string. If what you are trying to prevent is SQL injection, what I would do is validate that the view name only contains alphanumerics...
259,798
I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this: ``` SqlCommand cmd = new SqlCommand("CREATE VIEW @na...
2008/11/03
[ "https://Stackoverflow.com/questions/259798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26286/" ]
Maybe I've not understood it correctly, but what prevents you to do: ``` viewname="foo"; viewwhere="* from bar"; SqlCommand cmd = new SqlCommand("CREATE VIEW "+viewname+" AS SELECT "+viewwhere); ```
SQL injection. You want it, that's the point. You should be concatenating this stuff.
259,798
I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this: ``` SqlCommand cmd = new SqlCommand("CREATE VIEW @na...
2008/11/03
[ "https://Stackoverflow.com/questions/259798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26286/" ]
Parameters are not simply string substitutions. That is why your code won't work. Its like you cant do sql = "select \* from orders where orders\_id in (?)" and pass "1,2,3,5" as parameter. Parameters are type checked and can only contain scalar values IIRC.
It looks to me like you are trying to create a dynamic query using parameters, which is not how a parameterized query is intended to work. They do not simply get concatenated into the string. If what you are trying to prevent is SQL injection, what I would do is validate that the view name only contains alphanumerics...
259,798
I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this: ``` SqlCommand cmd = new SqlCommand("CREATE VIEW @na...
2008/11/03
[ "https://Stackoverflow.com/questions/259798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26286/" ]
Parameters are not simply string substitutions. That is why your code won't work. Its like you cant do sql = "select \* from orders where orders\_id in (?)" and pass "1,2,3,5" as parameter. Parameters are type checked and can only contain scalar values IIRC.
SQL injection. You want it, that's the point. You should be concatenating this stuff.
259,798
I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this: ``` SqlCommand cmd = new SqlCommand("CREATE VIEW @na...
2008/11/03
[ "https://Stackoverflow.com/questions/259798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26286/" ]
SQL injection. You want it, that's the point. You should be concatenating this stuff.
It looks to me like you are trying to create a dynamic query using parameters, which is not how a parameterized query is intended to work. They do not simply get concatenated into the string. If what you are trying to prevent is SQL injection, what I would do is validate that the view name only contains alphanumerics...
34,582,266
I'm learning Swift and trying to programmatically change a Label value with a Slider. I get an error in the func says paybackLabel is an unresolved identifier. How should this be done? ``` import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() //C...
2016/01/03
[ "https://Stackoverflow.com/questions/34582266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3931359/" ]
Just Correct Your code as i suggest on here. 1.) Define both variable for Outside for publicly accessing and modifying labels value ``` var paybackLabel : UILabel = UILabel() var paybackSlider : UISlider = UISlider() ``` 2.) Put below code in viewDidload() ``` //Create Label paybackLabel = UILabel(frame: CGRectMa...
Globally Declare outside of ViewDidLoad() ``` var paybackLabel = UILabel() var paybackSlider = UISlider() ``` and Also don't forget to set userInteractionEnabled to true ``` paybackLabel.userInteractionEnabled = true paybackSlider.userInteractionEnabled = true ```
1,131,662
I'm running Ubuntu 18.04. I've installed nodejs, but I think I may have messed up somewhere along the way. I'm trying to start an ionic app with `ionic serve --devappcd`. Then I get this error message: ```none ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobro...
2019/04/06
[ "https://askubuntu.com/questions/1131662", "https://askubuntu.com", "https://askubuntu.com/users/942024/" ]
You can indeed install multiple linux versions that each reside on encrypted partitions. "Full disk encryption" does not really mean that the entire disk is encrypted. It rather means that all partitions involved in the installation are encrypted, with the exception of a separate /boot partition. A boot partition canno...
If the computer is powerful enough, there is a simple solution: Let the system, where you need most 'horsepower' be the main one and host system for a virtual machine. Assume that you want the work system to be the main one. * Install VirtualBox or KVM+VirtualBox or another tool for virtualization. * Create a guest o...
174,526
I am creating a custom module that has a button on the module's configuration page. When the button is clicked, a custom php function (located in the `custom_module.module` file) needs to run to perform some task. How can I create a button on the custom module's configuration page that allows me to click the button t...
2015/09/16
[ "https://drupal.stackexchange.com/questions/174526", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/50875/" ]
To achieve this you have to use Rules as well as Scheduler module. Please follow the documentation links: Rules documentation: <https://www.drupal.org/documentation/modules/rules> Scheduler documentation: <https://www.drupal.org/node/108984> You can also refer: <http://www.webwash.net/tutorials/how-send-follow-emails-...
This question seems like a variation of the question about "[Rule to store user's last post date and scheduled rule based 30 day reminder](https://drupal.stackexchange.com/questions/157666)". I don't think it is a duplicate of it, but [my answer to that question](https://drupal.stackexchange.com/questions/157666/rule-t...
1,073,543
Whenever I open a page with a flash in it, It is replaced with with a white background, writing that says "Plugin not supported", and a grey puzzle piece above the writing. Any thoughts on how to fix this error?
2018/09/09
[ "https://askubuntu.com/questions/1073543", "https://askubuntu.com", "https://askubuntu.com/users/869382/" ]
To enable *Flash* in *Chromium* on *Ubuntu* 18.04, you do **not** install the packages `flashplugin-installer` and/or `ubuntu-restricted-extras`. Instead you need to enable the repository "Canonical Partners" in "Software Properties", then install the package `adobe-flashplugin`. To test flash support go to <https://g...
This isn't really a solution if you still want to use chromium, but going to the google chrome website and downloading the closed source version worked for me. chrome simply updated flash, and now it works without fail.
13,556,813
Before appending more code, I want to make sure: ``` <a href='index.php?option=com_content&view=article&id=36'>Hello</a> ``` isn't already on the html page inside the div where id='faqs' ``` <div id='faqs'> <a href='index.php?option=com_content&view=article&id=36'>Hello</a> </div> ``` What is the best way of doin...
2012/11/25
[ "https://Stackoverflow.com/questions/13556813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503513/" ]
I had never worked with this API before. Interesting stuff. This version loops through all the file inputs and loads their preview images. The function is triggered by a button click. ``` $(function(){ $("#btnLoadPreviews").click(loadPreviews_click); }) function loadPreviews_click(e) { $(".image").each(func...
This is how I would do it. Assign the target to the reader object itself and use it later. ``` function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); // set where you want to attach the preview reader.target_elem = $(input).parent().find('preview'); ...
54,336
My friend and I have two different saxes, Tenor and alto, B flat, and E flat. We would like to harmonize in church to the song, Just as I am. What do we have to do in order for us to play together even though we have two different saxes keyed in two different keys. Must we rewrite the song for one sax in order to harmo...
2017/03/13
[ "https://music.stackexchange.com/questions/54336", "https://music.stackexchange.com", "https://music.stackexchange.com/users/37675/" ]
Well, it's probably you and he and the piano, or a guitar - and they're in concert pitch (C). Let's suppose the piano music for the song is on "white" keys like C. The tenor is going to play it in the key of `D`, and the alto is going to play in the key of A. So you go up a major second, and he goes down a minor thir...
If the song is written in Eb concert pitch, then the Tenor part will be written in F (one flat) and the Alto part will be written in C (no sharps or flats). Work out the harmony in whatever key you like (probably Eb since that is what you have the song in), then transpose the parts into the keys I've stated.
17,992,054
I've just pushed a new server under prodution and his load average seems to be very high, but I've read a lot of stuff about multiprocessors and load average and I can't tell if my server is overloaded right now... It displays an average load of : **15,57, 15,64, 15,60** In my /proc/cpuinfo, I have **eight entries** ...
2013/08/01
[ "https://Stackoverflow.com/questions/17992054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1966569/" ]
This [particular processor](http://ark.intel.com/products/28035) has 4 cores and is not hyperthreaded, so you have 2 physical CPUs each with 4 cores. With 2 x 4 cores, you can execute 8 processes at any one time. Therefore as soon as your load average is above 8, you are queuing processes. Your box is "overloaded...
No, it means that each of your 8 processors is overloaded with 1 idle process because you have 8 processors and your load is 16 on average.
5,424,263
I have the following class: ``` class IndexItem { private String word; private HashMap<String, Integer> docs; private Integer total; public IndexItem(String word) { this.total = 0; this.docs = new HashMap<String, Integer>(); this.word = word; } public IndexItem() { ...
2011/03/24
[ "https://Stackoverflow.com/questions/5424263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18992/" ]
Sorry to answer my own question, but... Make sure the white space is cleaned up around your JSON string before sending it to Gson.
What version of Gson are you using? I've tried this on 1.3, 1.4, 1.5 and 1.6 and it worked perfectly
60,165,526
I have created a JUNIT test case for my DynamoDB CRUD operation. I have used assertions to handle the unexpected exception giver in below code. ``` @Test void createItemsInTable() throws Exception { Assertions.assertThrows(UnexpectedException.class, () -> { ResponseEntity Res; CatalogItems cat =...
2020/02/11
[ "https://Stackoverflow.com/questions/60165526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11792899/" ]
``` public class Main { public static void main(String[] args){ Animal parrot = new Bird(); parrot.move(); } } interface Animal{ void eat(); void move(); } class Bird implements Animal{ @Override public void eat() {} public void move(){fly();} public void fly(){} } ``...
The parrot class should extend the Bird class, then you can call the fly method from a parrot object directly and without need to cast. ``` public class Parrot extends Bird{ //have some filed or method } ```
26,280,831
I'm having the weirdest problem. I have a web app hosted on an IIS server that won't work in IE8, which is the standard browser at this company. It works in chrome. I've also put identical files hosted on my google drive, and it works there, even in IE8. It also works when the files are just on my desktop, even in IE8....
2014/10/09
[ "https://Stackoverflow.com/questions/26280831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4125693/" ]
Turns out it was a compatibility view issue. Code works with compatibility view is off. Since all our computers view intranet sites in compatibility view I added `<meta http-equiv="X-UA-Compatible" content="IE=8" />` to the html head to prevent compatibility view. The app works now.
IE8 may not support a string as an array of chars. See this question [How do you get a string to a character array in JavaScript?](https://stackoverflow.com/questions/4547609/how-do-you-get-a-string-to-a-character-array-in-javascript) It may even be down to your server changing the compatibility mode of the browser. ...
11,611,875
I got a superclass like this: ``` public class SuperClass extends Activity ``` and a child class ``` public class ChildClass extends SuperClass ``` The SuperClass contains a function to set a layout ``` public void setTabBar(String layout){ inflater.inflate(...., ...); } ``` The only thing that differen...
2012/07/23
[ "https://Stackoverflow.com/questions/11611875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835585/" ]
``` int layoutFromString = Integer.parseInt("R.layout."+layout); ``` gives you a NumberFormatException, because String "R.layout.yourLayoutId" not a number, its String. To find id for layoutName use: ``` getResources().getIdentifier("YOUR_LAYOUT_NAME", "layout", context.getPackageName()); ```
Something like this should work: ``` public abstract class SuperClass extends Activity{ public void setTabBar(String layout){ inflater.inflate(getResId(), null); } protected abstract int getResId(); } public class ChildClass extends SuperClass{ @Override protected abstract int getResId()...
11,611,875
I got a superclass like this: ``` public class SuperClass extends Activity ``` and a child class ``` public class ChildClass extends SuperClass ``` The SuperClass contains a function to set a layout ``` public void setTabBar(String layout){ inflater.inflate(...., ...); } ``` The only thing that differen...
2012/07/23
[ "https://Stackoverflow.com/questions/11611875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835585/" ]
You're trying to parse an integer from the string passed in to setTabBar. Reflection would be required to convert the variable name to the actual value, and I personally wouldn't want to tread down that rabbit hole. Why not just specify that the parameter passed in is an integer? ``` public void setTabBar(int layoutI...
Something like this should work: ``` public abstract class SuperClass extends Activity{ public void setTabBar(String layout){ inflater.inflate(getResId(), null); } protected abstract int getResId(); } public class ChildClass extends SuperClass{ @Override protected abstract int getResId()...
96,779
Source: Bekker Number 1106B, Line 20, *Nicomachean Ethics* (2012) by Aristotle, translated by Joe Sachs > >   I am speaking of virtue of character, for this is concerned with feelings and actions, and among these there is excess and deficiency, and the mean. For instance, it is possible to be afraid or be confident o...
2016/07/19
[ "https://ell.stackexchange.com/questions/96779", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
First off, let's unravel the parallel construction. "For the reasons for the sake of which" is one of multiple alternatives, so let's simplify the sentence by eliminating the others, and trimming out some other less-important parts. "To feel [pleasure or pain] for the reasons for the sake of which one ought, is [...] ...
On its own, "one ought" is a clause.  It doesn't serve as the subject of anything. I will agree that reformatting the matrix clause in question, along with reintroducing what was lost through ellipsis, can expose its internal structure:  > > but > >       to feel them when one ought [to feel them] , > >    ...
68,334,656
I have this image as shown below. **It is a binary mask** [![enter image description here](https://i.stack.imgur.com/84TDL.png)](https://i.stack.imgur.com/84TDL.png) I created this image using the below code. Basically I got the `x_idx`, `y_idx` for just those white pixels, and I know the actual image size, so I firs...
2021/07/11
[ "https://Stackoverflow.com/questions/68334656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11971761/" ]
Since you're just looking to connect the region gaps in data, the Bresenham algorithm (which many know as a common line-drawing algorithm) should perform well in this case. <https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm> **Pseudo Algorithm:** 1. Get all (x, y) coordinate pairs from the binary mask 2. So...
Here is a simple approach using the extreme points of contours. **Advantage?** This approach has a slight advantage. For every contour obtained, there are 4 extreme points; these are the topmost, bottommost, rightmost and leftmost points of a contour. We **only** iterate these 4 points for every contour. Unlike the a...
3,373,391
I am generating a group of check-boxes from a MySQL database with this code. ``` $connection=mysql_connect ("localhost", "foo", "bar") or die ("I cannot connect to the database."); $db=mysql_select_db ("database", $connection) or die (mysql_error()); $query = "SELECT type FROM typelist ORDER BY type ASC"; $sql_result ...
2010/07/30
[ "https://Stackoverflow.com/questions/3373391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243533/" ]
``` $('.foo:gt(2)').remove(); ``` **Try it out:** <http://jsfiddle.net/MYY9m/> This uses the `greater-than` selector to select all elements who's index is greater than the number provided. * <http://api.jquery.com/gt-selector/>
Not as elegant as Patrick DW's solution, but this also works: ``` $('.foo').eq(2).nextAll().remove(); ``` See <http://api.jquery.com/nextAll/>
3,373,391
I am generating a group of check-boxes from a MySQL database with this code. ``` $connection=mysql_connect ("localhost", "foo", "bar") or die ("I cannot connect to the database."); $db=mysql_select_db ("database", $connection) or die (mysql_error()); $query = "SELECT type FROM typelist ORDER BY type ASC"; $sql_result ...
2010/07/30
[ "https://Stackoverflow.com/questions/3373391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243533/" ]
``` $('.foo:gt(2)').remove(); ``` **Try it out:** <http://jsfiddle.net/MYY9m/> This uses the `greater-than` selector to select all elements who's index is greater than the number provided. * <http://api.jquery.com/gt-selector/>
You can also do: ``` $('.foo').slice(3).remove(); ``` See <http://api.jquery.com/slice/>
3,373,391
I am generating a group of check-boxes from a MySQL database with this code. ``` $connection=mysql_connect ("localhost", "foo", "bar") or die ("I cannot connect to the database."); $db=mysql_select_db ("database", $connection) or die (mysql_error()); $query = "SELECT type FROM typelist ORDER BY type ASC"; $sql_result ...
2010/07/30
[ "https://Stackoverflow.com/questions/3373391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243533/" ]
``` $('.foo:gt(2)').remove(); ``` **Try it out:** <http://jsfiddle.net/MYY9m/> This uses the `greater-than` selector to select all elements who's index is greater than the number provided. * <http://api.jquery.com/gt-selector/>
It is efficient to use slice or eq since gt does not accept variables. for example //will not work `var items_to_remove = 8;` `$("li:gt(items_to_remove)").remove();` //will work `var items_to_remove = 8;` `$('li').slice(items_to_remove).remove();`
3,373,391
I am generating a group of check-boxes from a MySQL database with this code. ``` $connection=mysql_connect ("localhost", "foo", "bar") or die ("I cannot connect to the database."); $db=mysql_select_db ("database", $connection) or die (mysql_error()); $query = "SELECT type FROM typelist ORDER BY type ASC"; $sql_result ...
2010/07/30
[ "https://Stackoverflow.com/questions/3373391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243533/" ]
Not as elegant as Patrick DW's solution, but this also works: ``` $('.foo').eq(2).nextAll().remove(); ``` See <http://api.jquery.com/nextAll/>
It is efficient to use slice or eq since gt does not accept variables. for example //will not work `var items_to_remove = 8;` `$("li:gt(items_to_remove)").remove();` //will work `var items_to_remove = 8;` `$('li').slice(items_to_remove).remove();`
3,373,391
I am generating a group of check-boxes from a MySQL database with this code. ``` $connection=mysql_connect ("localhost", "foo", "bar") or die ("I cannot connect to the database."); $db=mysql_select_db ("database", $connection) or die (mysql_error()); $query = "SELECT type FROM typelist ORDER BY type ASC"; $sql_result ...
2010/07/30
[ "https://Stackoverflow.com/questions/3373391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243533/" ]
You can also do: ``` $('.foo').slice(3).remove(); ``` See <http://api.jquery.com/slice/>
It is efficient to use slice or eq since gt does not accept variables. for example //will not work `var items_to_remove = 8;` `$("li:gt(items_to_remove)").remove();` //will work `var items_to_remove = 8;` `$('li').slice(items_to_remove).remove();`
264,162
I know that *enjoying **the** sun* is appropriate in this sentence: 1. We passed by the harbor where some kids were taking a dip and other people were **enjoying the sun**. But I have noticed that just plain *sun* sometimes occurs **without** the requisite definite article *the*, such as in these sentences from some d...
2020/10/22
[ "https://ell.stackexchange.com/questions/264162", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
They mean different things. In "people were enjoying the sun" they are enjoying that object in the sky. In "The plant needs full sun" the meaning is that the plant needs sunlight.
You only use definite articles with specified things, for example, in 'enjoying the sun' we are not referring to the star itself but the light, mood and warmth emitted by it. However, in 'plants need sun' we are referring to the star itself therefore it is considered as a whole concrete noun, so we use 'the' when refer...
1,062,636
In my project when I create a webusercontrol or a webform it creates the code behind, but it also creates a .ascx.designer.cs file. What is this file for? Can I prevent it from being added when I create a new webform/webusercontrol?
2009/06/30
[ "https://Stackoverflow.com/questions/1062636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66975/" ]
In .NET 1.x, the code that allowed the Visual Studio designer to create a visual representation of the page was included within the code behind file itself. It was usually encapsulated within a region called "Designer generated code". (IIRC!) New developers often inadvertently made changes to those code sections caus...
This is normally the IDE-generated code that sets up the form (which you configure by drag-n-drop or inserting values into property windows). Probably not such a good idea to get rid of it since your application would need it (unless you plan to handcode everything).
70,466,099
Good evening, i need an advice, googling i couldn't find a proper direction. I need to make a method available only within the class (i.e other methods or functions), if called from the program as a method of the object referring to the class i want: * the method to be invisible/not available to the intellisense * if ...
2021/12/23
[ "https://Stackoverflow.com/questions/70466099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4499370/" ]
There's no private methods in python. Common usage dictates to precede a method that's only supposed to be used internally with one or two underscores, depending on the case. See here: [What is the meaning of single and double underscore before an object name?](https://stackoverflow.com/questions/1301346/what-is-the-me...
As others have mentioned there are no private methods in Python. I also don't know how to make it invisible for intelisense (probably there is some setting), but what you could theoretically do is this: ```py import re def make_private(func): def inner(*args, **kwargs): name = func.__name__ patter...
70,466,099
Good evening, i need an advice, googling i couldn't find a proper direction. I need to make a method available only within the class (i.e other methods or functions), if called from the program as a method of the object referring to the class i want: * the method to be invisible/not available to the intellisense * if ...
2021/12/23
[ "https://Stackoverflow.com/questions/70466099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4499370/" ]
There's no private methods in python. Common usage dictates to precede a method that's only supposed to be used internally with one or two underscores, depending on the case. See here: [What is the meaning of single and double underscore before an object name?](https://stackoverflow.com/questions/1301346/what-is-the-me...
OK Solved, to hide the method to the ide's Intellisense i added the double underscore (works fine with pycharm, not with vscode) then i used the accessify module to prevent forced execution calling myobj.\_myclass\_\_somemethod() ``` from accessify import private class myclass: @private def __somemethod(self)...
70,466,099
Good evening, i need an advice, googling i couldn't find a proper direction. I need to make a method available only within the class (i.e other methods or functions), if called from the program as a method of the object referring to the class i want: * the method to be invisible/not available to the intellisense * if ...
2021/12/23
[ "https://Stackoverflow.com/questions/70466099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4499370/" ]
As others have mentioned there are no private methods in Python. I also don't know how to make it invisible for intelisense (probably there is some setting), but what you could theoretically do is this: ```py import re def make_private(func): def inner(*args, **kwargs): name = func.__name__ patter...
OK Solved, to hide the method to the ide's Intellisense i added the double underscore (works fine with pycharm, not with vscode) then i used the accessify module to prevent forced execution calling myobj.\_myclass\_\_somemethod() ``` from accessify import private class myclass: @private def __somemethod(self)...
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
[Windows perfmon](http://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx?pr=blog) is great for this kind of stuff. You have counters for all the managed heaps and for private bytes, if you need to cross correlate with iteration counts you can [publish your own](http://msdn.microsoft.com/en-us/library/ms979204.a...
when you want to profile the mem usage of your apps, here is a piece of code you can use. First you have to declare an instance of the PerformanceCounter class ``` Assembly a = Assembly.GetExecutingAssembly(); _PerfCounter = new PerformanceCounter(".NET CLR Memory", "# Bytes in al...
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
[Windows perfmon](http://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx?pr=blog) is great for this kind of stuff. You have counters for all the managed heaps and for private bytes, if you need to cross correlate with iteration counts you can [publish your own](http://msdn.microsoft.com/en-us/library/ms979204.a...
Maybe [this tool](http://memprofiler.com/) can do everything you want.
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
There are several ways to do this: ### Perfmon UI You can use the Performance Montior control panel applet (in Administrative Tools) that comes with Windows to monitor your application. Have a look at the .Net CLR Memory category and the counters inside it. You can also limit the monitoring to just your process. This...
[Windows perfmon](http://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx?pr=blog) is great for this kind of stuff. You have counters for all the managed heaps and for private bytes, if you need to cross correlate with iteration counts you can [publish your own](http://msdn.microsoft.com/en-us/library/ms979204.a...
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
[Windows perfmon](http://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx?pr=blog) is great for this kind of stuff. You have counters for all the managed heaps and for private bytes, if you need to cross correlate with iteration counts you can [publish your own](http://msdn.microsoft.com/en-us/library/ms979204.a...
Better late than never, but in response to M3ntat's comment, you'll need to add ".vshost" onto the assembly name parameter if you're running from within Visual Studio, e.g. ``` a.GetName().Name + ".vshost" ```
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
when you want to profile the mem usage of your apps, here is a piece of code you can use. First you have to declare an instance of the PerformanceCounter class ``` Assembly a = Assembly.GetExecutingAssembly(); _PerfCounter = new PerformanceCounter(".NET CLR Memory", "# Bytes in al...
Maybe [this tool](http://memprofiler.com/) can do everything you want.
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
There are several ways to do this: ### Perfmon UI You can use the Performance Montior control panel applet (in Administrative Tools) that comes with Windows to monitor your application. Have a look at the .Net CLR Memory category and the counters inside it. You can also limit the monitoring to just your process. This...
when you want to profile the mem usage of your apps, here is a piece of code you can use. First you have to declare an instance of the PerformanceCounter class ``` Assembly a = Assembly.GetExecutingAssembly(); _PerfCounter = new PerformanceCounter(".NET CLR Memory", "# Bytes in al...
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
when you want to profile the mem usage of your apps, here is a piece of code you can use. First you have to declare an instance of the PerformanceCounter class ``` Assembly a = Assembly.GetExecutingAssembly(); _PerfCounter = new PerformanceCounter(".NET CLR Memory", "# Bytes in al...
Better late than never, but in response to M3ntat's comment, you'll need to add ".vshost" onto the assembly name parameter if you're running from within Visual Studio, e.g. ``` a.GetName().Name + ".vshost" ```
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
There are several ways to do this: ### Perfmon UI You can use the Performance Montior control panel applet (in Administrative Tools) that comes with Windows to monitor your application. Have a look at the .Net CLR Memory category and the counters inside it. You can also limit the monitoring to just your process. This...
Maybe [this tool](http://memprofiler.com/) can do everything you want.
1,097,589
I have a long running console app running through millions of iterations. I want to **benchmark if memory usage increases linerally as the number of iterations increases**. What would be the best way to go about this? I think I really only need to be concerned with **Peak memory usage** during a run right? I basicall...
2009/07/08
[ "https://Stackoverflow.com/questions/1097589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127659/" ]
There are several ways to do this: ### Perfmon UI You can use the Performance Montior control panel applet (in Administrative Tools) that comes with Windows to monitor your application. Have a look at the .Net CLR Memory category and the counters inside it. You can also limit the monitoring to just your process. This...
Better late than never, but in response to M3ntat's comment, you'll need to add ".vshost" onto the assembly name parameter if you're running from within Visual Studio, e.g. ``` a.GetName().Name + ".vshost" ```
14,706,207
I am developing a simple registration system in which all the events will be listed in a GridView and the user will be able click on register in the event by clicking on the Register button that will be displayed besides the event. The is working fine but I only have one problem with it which is the following: When the...
2013/02/05
[ "https://Stackoverflow.com/questions/14706207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1897016/" ]
After hitting the breakpoint enter `bt` (backtrace) command in the gdb shell. This will print the stack trace (a sequence of function calls leading to the error). To get the variable name you can now use `up` command to navigate upwards in the stack and see what variables where used in each of those functions.
Put a breakpoint on `std::out_of_range::out_of_range`. An exception object, like all C++ objects, starts its life after its constructor exits. [EDIT] Comment made it clear: the problem the string produced by `std::out_of_range::what()`. That's implementation-defined. Obviously in your case it's composed from `__FUNCTI...
14,706,207
I am developing a simple registration system in which all the events will be listed in a GridView and the user will be able click on register in the event by clicking on the Register button that will be displayed besides the event. The is working fine but I only have one problem with it which is the following: When the...
2013/02/05
[ "https://Stackoverflow.com/questions/14706207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1897016/" ]
Put a breakpoint on `std::out_of_range::out_of_range`. An exception object, like all C++ objects, starts its life after its constructor exits. [EDIT] Comment made it clear: the problem the string produced by `std::out_of_range::what()`. That's implementation-defined. Obviously in your case it's composed from `__FUNCTI...
To avoid hitting a break point at every exception thrown and stop only at`std::out_of_range` use this command in `gdb`: ``` catch throw std::out_of_range ``` Then run the commad `bt` or `where` when the breack point is hit to see where in the code the exception was thrown
14,706,207
I am developing a simple registration system in which all the events will be listed in a GridView and the user will be able click on register in the event by clicking on the Register button that will be displayed besides the event. The is working fine but I only have one problem with it which is the following: When the...
2013/02/05
[ "https://Stackoverflow.com/questions/14706207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1897016/" ]
After hitting the breakpoint enter `bt` (backtrace) command in the gdb shell. This will print the stack trace (a sequence of function calls leading to the error). To get the variable name you can now use `up` command to navigate upwards in the stack and see what variables where used in each of those functions.
To avoid hitting a break point at every exception thrown and stop only at`std::out_of_range` use this command in `gdb`: ``` catch throw std::out_of_range ``` Then run the commad `bt` or `where` when the breack point is hit to see where in the code the exception was thrown
45,796,527
I have a small framework with Client/Server Architecture I use this Tools in my Business Layer: DI = SimpleInjector DynamicProxy For Interception = Castle.Core now i need to validate some validations! for example look at this method: ``` public void DeleteFakeItem (Guid userId, Guid fakeItemId) { userAccountSe...
2017/08/21
[ "https://Stackoverflow.com/questions/45796527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8324370/" ]
I just solve my problem with combine reflection with generic interfaces, so the only thing I need is to implement the generic interface for every entity. I have an interceptor that intercepts all methods. and its works for me. but can anyone give me some information about the performance? is it a correct way to do val...
My solution to the problem is the following ([you can find it here](https://gist.github.com/ognyandim/91a6c2db6b914fa97809948e5b6e269e)) : 1. Interface and implementation class in order to be able to change the validation logic - there maybe bugs or change in validation logic. 2. Make most of the methods void and thro...
65,556,850
I am trying to convert the following 3D array into a 2D array. Currently, my data has the following structure. ``` [ [[0,0,345], [1,0,555], ... [9,0,333]], ... [[0,9,1000], [1,9,987], ... [9,9,129]] ] ``` into ``` [[0,0,345], [1,0,355], ... [9,0,333], [0,1,1000], [1,1,987], ... [9,9,129]] ``` so the first element...
2021/01/04
[ "https://Stackoverflow.com/questions/65556850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14806207/" ]
You can directly use `Array#flat`. ```js const arr = [ [[0,0,345], [1,0,555], [9,0,333]], [[0,9,1000], [1,9,987], [9,9,129]] ]; const res = arr.flat(); console.log(JSON.stringify(res)); ```
you can try this flatmap. Example below. ``` let data = [[["creative fee (example)"], [1000]], [["Item 1...", "Item 2..."], [600, 1000]], [["Item 3...", "Item 4..."], [400, 600]]], result = data.flatMap(([l, r]) => l.map((v, i) => [v, r[i]])); console.log(result); ```
6,946,746
What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between `./` and `../`?
2011/08/04
[ "https://Stackoverflow.com/questions/6946746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798183/" ]
Well, in most languages backslashes need to be escaped in string literals, slashes do not. Further backslashes only work on Windows, while slashes work pretty much everywhere. On the other hand, when passing path names as arguments to Windows programs, using slashes might not work because many Windows programs use sla...
Microsoft operating systems (e.g. DOS and Windows) use backslashes (\), UNIX-based operating systems (e.g. Linux) use slashes (/). The dot (.) means the current working directory, it's like saying "here". The double dot (..) means the parent directory.
6,946,746
What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between `./` and `../`?
2011/08/04
[ "https://Stackoverflow.com/questions/6946746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798183/" ]
Microsoft operating systems (e.g. DOS and Windows) use backslashes (\), UNIX-based operating systems (e.g. Linux) use slashes (/). The dot (.) means the current working directory, it's like saying "here". The double dot (..) means the parent directory.
The difference between slash and backslash in Windows are from my tests at least non-existing, but I believe that in earlier editions they used backslash. UNIX systems uses slash. The difference between `./` and `../` is that `./` represents the position in the hierarchy where you are standing while `../` is the paren...
6,946,746
What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between `./` and `../`?
2011/08/04
[ "https://Stackoverflow.com/questions/6946746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798183/" ]
Microsoft operating systems (e.g. DOS and Windows) use backslashes (\), UNIX-based operating systems (e.g. Linux) use slashes (/). The dot (.) means the current working directory, it's like saying "here". The double dot (..) means the parent directory.
Backslash is used for: File names in DOS and Windows, e.g. D:\documents\office, C:\java\jdk escape sequences in C, Unix, and other languages/systems that borrow the same syntax (C++, Java, etc.). For example, \n means newline and \t means tab. Forward slash is used for: * File names on Unix (and Mac OS X, since it i...
6,946,746
What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between `./` and `../`?
2011/08/04
[ "https://Stackoverflow.com/questions/6946746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798183/" ]
Well, in most languages backslashes need to be escaped in string literals, slashes do not. Further backslashes only work on Windows, while slashes work pretty much everywhere. On the other hand, when passing path names as arguments to Windows programs, using slashes might not work because many Windows programs use sla...
The difference between slash and backslash in Windows are from my tests at least non-existing, but I believe that in earlier editions they used backslash. UNIX systems uses slash. The difference between `./` and `../` is that `./` represents the position in the hierarchy where you are standing while `../` is the paren...
6,946,746
What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between `./` and `../`?
2011/08/04
[ "https://Stackoverflow.com/questions/6946746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798183/" ]
Well, in most languages backslashes need to be escaped in string literals, slashes do not. Further backslashes only work on Windows, while slashes work pretty much everywhere. On the other hand, when passing path names as arguments to Windows programs, using slashes might not work because many Windows programs use sla...
Backslash is used for: File names in DOS and Windows, e.g. D:\documents\office, C:\java\jdk escape sequences in C, Unix, and other languages/systems that borrow the same syntax (C++, Java, etc.). For example, \n means newline and \t means tab. Forward slash is used for: * File names on Unix (and Mac OS X, since it i...
6,946,746
What is the difference in using a forward slash and backslash in navigating file systems. Also what is the difference between `./` and `../`?
2011/08/04
[ "https://Stackoverflow.com/questions/6946746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798183/" ]
The difference between slash and backslash in Windows are from my tests at least non-existing, but I believe that in earlier editions they used backslash. UNIX systems uses slash. The difference between `./` and `../` is that `./` represents the position in the hierarchy where you are standing while `../` is the paren...
Backslash is used for: File names in DOS and Windows, e.g. D:\documents\office, C:\java\jdk escape sequences in C, Unix, and other languages/systems that borrow the same syntax (C++, Java, etc.). For example, \n means newline and \t means tab. Forward slash is used for: * File names on Unix (and Mac OS X, since it i...
1,334,411
I was struggling with how to use TFS as a source code repository for iPhone development. My boss will never let me use Subversion (or God forbid Perforce), so I was stuck with TFS source control. The solution is to go and buy tools to bridge Mac to TFS, and I am not trying to advertise here, but the Teamprise Client ...
2009/08/26
[ "https://Stackoverflow.com/questions/1334411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149910/" ]
As [Louis](https://stackoverflow.com/questions/1334411/how-can-i-use-tfs-for-iphone-development/1334518#1334518) states, XCode doesn't currently provide a publicly accessible plug-in model for us ([Teamprise](http://www.teamprise.com)) to provide a TFS integration with - it is something that we would love to do. We've...
While internally Xcode is using a plugin system to support different version control systems, it is not public or documented. Aside from minimal support like running some commandline scripts there is no supported way to use any version control systems except for those Xcode ships with. You should [file](http://bugrepo...
1,334,411
I was struggling with how to use TFS as a source code repository for iPhone development. My boss will never let me use Subversion (or God forbid Perforce), so I was stuck with TFS source control. The solution is to go and buy tools to bridge Mac to TFS, and I am not trying to advertise here, but the Teamprise Client ...
2009/08/26
[ "https://Stackoverflow.com/questions/1334411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149910/" ]
As [Louis](https://stackoverflow.com/questions/1334411/how-can-i-use-tfs-for-iphone-development/1334518#1334518) states, XCode doesn't currently provide a publicly accessible plug-in model for us ([Teamprise](http://www.teamprise.com)) to provide a TFS integration with - it is something that we would love to do. We've...
If you must integrate with a TFS server, your best route at this time is to use [SVNBridge](http://www.codeplex.com/SvnBridge) and then connect to the bridge via Xcode's built-in subversion functionality. Also, installing a VisualSVN server for the first time took me less than 15 minutes for a base install and another...
7,322,342
Is the a way to write something to a buffer, but once the buffer gets to large, start writing to a file? I would like this whole process to be automatic. Basically, I would like to write to a buffer, and have the library make sure I don't run out of memory. I never want to block the writing process. If the buffer get...
2011/09/06
[ "https://Stackoverflow.com/questions/7322342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/403397/" ]
The [Heritix](http://crawler.archive.org/) project includes a class called [RecordingOutputStream](http://crawler.archive.org/apidocs/org/archive/io/RecordingOutputStream.html). From the javadocs: > > The RecordingOutputStream uses an in-memory buffer and backing disk > file to allow it to record streams of arbitrar...
@Grae: what is your app server...may be your app server provides such functionality.. for e.g. if your app server is websphere application server, then you can use dyna cache services provided by WAS and use "Disk offload" feature of it. More detail:[WAS cache](http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/inde...
7,322,342
Is the a way to write something to a buffer, but once the buffer gets to large, start writing to a file? I would like this whole process to be automatic. Basically, I would like to write to a buffer, and have the library make sure I don't run out of memory. I never want to block the writing process. If the buffer get...
2011/09/06
[ "https://Stackoverflow.com/questions/7322342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/403397/" ]
EHCache does exactly that. All you need to do is configure it so that when it holds a certain limit of objects, they'll be automatically flushed to the disk storage
@Grae: what is your app server...may be your app server provides such functionality.. for e.g. if your app server is websphere application server, then you can use dyna cache services provided by WAS and use "Disk offload" feature of it. More detail:[WAS cache](http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/inde...
44,865,480
Hi I am still relatively new to android programming and I recently stumbled upon a rather abstract question on AsyncTasks. To my understanding, after AsyncTask executes runInBackground, it returns a value to onPostExecute, where it does UI thread things with the result. Now, what if I want to do different things with ...
2017/07/01
[ "https://Stackoverflow.com/questions/44865480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5000320/" ]
Since links to solutions apparently get downvoted, this is the solution: ``` export default function* rootSaga() { yield all([ call(saga()), ]); } ```
The examples in the redux-saga repository mostly use this form: ``` export default function* rootSaga() { yield all([ fork(saga1), fork(saga2), // ... ]) } ``` See for instance their [real-world example](https://github.com/redux-saga/redux-saga/blob/master/examples/real-world/sagas/in...
4,810,841
How can I display JSON in an easy-to-read (for human readers) format? I'm looking primarily for indentation and whitespace, with perhaps even colors / font-styles / etc.
2011/01/26
[ "https://Stackoverflow.com/questions/4810841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298406/" ]
You can use `console.dir()`, which is a shortcut for `console.log(util.inspect())`. (The only difference is that it bypasses any custom `inspect()` function defined on an object.) It uses **syntax-highlighting**, **smart indentation**, **removes quotes from keys** and just makes the output as pretty as it gets. ``` c...
I'd like to show my `jsonAnalyze` method here, it does a **pretty print of the JSON structure only**, but in some cases can be more usefull that printing the whole JSON. Say you have a complex JSON like this: ``` let theJson = { 'username': 'elen', 'email': 'elen@test.com', 'state': 'married', 'profiles': [ {'nam...
4,810,841
How can I display JSON in an easy-to-read (for human readers) format? I'm looking primarily for indentation and whitespace, with perhaps even colors / font-styles / etc.
2011/01/26
[ "https://Stackoverflow.com/questions/4810841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298406/" ]
**[Pretty-printing is implemented natively in `JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)**. The third argument enables pretty printing and sets the spacing to use: ``` var str = JSON.stringify(obj, null, 2); // spacing level = 2 ``` If you nee...
Here is a simple JSON format/color component written in React: ``` const HighlightedJSON = ({ json }: Object) => { const highlightedJSON = jsonObj => Object.keys(jsonObj).map(key => { const value = jsonObj[key]; let valueType = typeof value; const isSimpleValue = ["string", "number", "b...
4,810,841
How can I display JSON in an easy-to-read (for human readers) format? I'm looking primarily for indentation and whitespace, with perhaps even colors / font-styles / etc.
2011/01/26
[ "https://Stackoverflow.com/questions/4810841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298406/" ]
I use the [JSONView Chrome extension](https://chrome.google.com/extensions/detail/chklaanhfefbnpoihckbnefhakgolnmc) (it is as pretty as it gets :): Edit: added `jsonreport.js` I've also released an online stand-alone JSON pretty print viewer, jsonreport.js, that provides a human readable HTML5 report you can use to v...
It works well: ``` console.table() ``` Read more here: <https://developer.mozilla.org/pt-BR/docs/Web/API/Console/table>
4,810,841
How can I display JSON in an easy-to-read (for human readers) format? I'm looking primarily for indentation and whitespace, with perhaps even colors / font-styles / etc.
2011/01/26
[ "https://Stackoverflow.com/questions/4810841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298406/" ]
If you're looking for a nice library to prettify json on a web page... Prism.js is pretty good. <http://prismjs.com/> I found using JSON.stringify(obj, undefined, 2) to get the indentation, and then using prism to add a theme was a good approach. If you're loading in JSON via an ajax call, then you can run one of P...
``` <!-- here is a complete example pretty print with more space between lines--> <!-- be sure to pass a json string not a json object --> <!-- use line-height to increase or decrease spacing between json lines --> <style type="text/css"> .preJsonTxt{ font-size: 18px; text-overflow: ellipsis; overflow: hidden; ...