qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
33,079,298
I have a string value for amount that is coming from the DB. The local culture on my system is Portuguese(pt-br). As a result, the amount with decimal values is read as, for ex: 3,4 for 3.4. I need to parse this in such a way that it displays 3.4 but instead no matter what i try I'm getting 34. I have searched every wh...
2015/10/12
[ "https://Stackoverflow.com/questions/33079298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4243283/" ]
OK the issue with the click event binding. You need to bind the click event on nav a because of the page1.php have nav menu so the content is loaded using the ajax but click event is not bind on new menu item. So create new function called BindClickEvent ``` function BindClickEvent(){ $("ul#nav a").unbind(...
It is the issue of delegated function, just replace `$("ul#nav a").click(function(){` with `$(document).on('click', 'ul#nav a', function(){` your problem will be solved :)
4,214,992
> > What is the smallest number that can be written as the sum of three, four and five consecutive numbers? > > > I encountered this question while doing my Math summer homework. I have tried to make progress on this question. Sum of three consecutive numbers = $x + x+1 + x+2 = 3x+3$ Sum of four consecutive inte...
2021/08/02
[ "https://math.stackexchange.com/questions/4214992", "https://math.stackexchange.com", "https://math.stackexchange.com/users/955185/" ]
If we are talking about a non-negative integer, I have another method to propose. --- > > Sum of three consecutive numbers = $++1++2=3+3$ > > > > > Sum of four consecutive integers = $++1++2++3=4+6$ > > > > > Sum of five consecutive integers = $++1++2++3++4=5+10$ > > > Another way of formulating a solu...
Your final answer is fine, but your method looks highly suspect at one particular line which needs clarification. You write: > > The number must be the lowest common multiple of $3x+3$ , $4x+6$ and > $5x+10$, which is $60x + 30$. > > > But it’s not clear what you mean by this, as the lowest common multiple of tho...
4,214,992
> > What is the smallest number that can be written as the sum of three, four and five consecutive numbers? > > > I encountered this question while doing my Math summer homework. I have tried to make progress on this question. Sum of three consecutive numbers = $x + x+1 + x+2 = 3x+3$ Sum of four consecutive inte...
2021/08/02
[ "https://math.stackexchange.com/questions/4214992", "https://math.stackexchange.com", "https://math.stackexchange.com/users/955185/" ]
If we are talking about a non-negative integer, I have another method to propose. --- > > Sum of three consecutive numbers = $++1++2=3+3$ > > > > > Sum of four consecutive integers = $++1++2++3=4+6$ > > > > > Sum of five consecutive integers = $++1++2++3++4=5+10$ > > > Another way of formulating a solu...
Your reasoning contains a subtle (essentially notational) error, which does not greatly affect the result you obtain. You say: > > The number must be the lowest common multiple of $3x+3$, $4x+6$ and $5x+10$, which is $60x + 30$. > > > But the value of $x$ in each of $3x+3$, $4x+6$ and $5x+10$ is not the same; by ...
147,436
I'm running OpenXcom and wondered if there is any way to having the game automatically rename my soldiers in order to classify them by ability, i.e. high accuracy, strong, and so on. I think this was available as a patch to the original release of the game, and wondered if there was anything similar available.
2013/12/22
[ "https://gaming.stackexchange.com/questions/147436", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/16344/" ]
You can just click on a soldiers name in the stats menu to change his/her name. ![http://www.mobygames.com/images/shots/l/358315-x-com-ufo-defense-dos-screenshot-soldier-stats-s.png](https://i.stack.imgur.com/ddl2w.png)
You can use [Statstrings](https://www.ufopaedia.org/index.php/Statstrings). Check the built-in **XcomUtil StatStrings** mod as an example you can modify to your will.
46,085,660
In the following snippet, `MyClass` has a static method which returns its shared pointer. To make to code concise, we use the alias `MyClassPtr` for `std::shared_ptr<MyClass>`. However, to accomplish this, we declare the class before declaring the shared pointer alias, which then follows the actual class declaration....
2017/09/06
[ "https://Stackoverflow.com/questions/46085660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3697757/" ]
Make `Ptr` a member type: ``` class MyClass { public: using Ptr = std::shared_ptr<MyClass>; static Ptr createMyClassInstance(); private: /*Other members & method*/ }; // ... MyClass::Ptr p = MyClass::createMyClassInstance(); ```
Replace the return type with auto: ``` class MyClass { public: static auto createMyClassInstance(); private: /*Other members & method*/ } ``` [Demo](http://coliru.stacked-crooked.com/a/088a1b2702f777c8):
46,085,660
In the following snippet, `MyClass` has a static method which returns its shared pointer. To make to code concise, we use the alias `MyClassPtr` for `std::shared_ptr<MyClass>`. However, to accomplish this, we declare the class before declaring the shared pointer alias, which then follows the actual class declaration....
2017/09/06
[ "https://Stackoverflow.com/questions/46085660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3697757/" ]
Your question is somewhat vague, as you ask how the code can be *simplified*, yet you fail to provide any real code, only the outline of a class definition. Instead, I try to answer the more sensible question of how to *improve* your code. I suggest 1. Avoid the alias `MyClassPtr`, it's not really necessary (it should...
Replace the return type with auto: ``` class MyClass { public: static auto createMyClassInstance(); private: /*Other members & method*/ } ``` [Demo](http://coliru.stacked-crooked.com/a/088a1b2702f777c8):
46,085,660
In the following snippet, `MyClass` has a static method which returns its shared pointer. To make to code concise, we use the alias `MyClassPtr` for `std::shared_ptr<MyClass>`. However, to accomplish this, we declare the class before declaring the shared pointer alias, which then follows the actual class declaration....
2017/09/06
[ "https://Stackoverflow.com/questions/46085660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3697757/" ]
> > is there some way to reorganize the code so that > > > (1)keep the MyClassPtr alias (it is shared across the project) > > > (2) without "declaring" MyClass twice > > > You you accept to declare `MyClassPtr` twice, you can declare it inside the class and "export" it outside ``` #include <memory> class MyC...
Replace the return type with auto: ``` class MyClass { public: static auto createMyClassInstance(); private: /*Other members & method*/ } ``` [Demo](http://coliru.stacked-crooked.com/a/088a1b2702f777c8):
46,085,660
In the following snippet, `MyClass` has a static method which returns its shared pointer. To make to code concise, we use the alias `MyClassPtr` for `std::shared_ptr<MyClass>`. However, to accomplish this, we declare the class before declaring the shared pointer alias, which then follows the actual class declaration....
2017/09/06
[ "https://Stackoverflow.com/questions/46085660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3697757/" ]
Make `Ptr` a member type: ``` class MyClass { public: using Ptr = std::shared_ptr<MyClass>; static Ptr createMyClassInstance(); private: /*Other members & method*/ }; // ... MyClass::Ptr p = MyClass::createMyClassInstance(); ```
> > is there some way to reorganize the code so that > > > (1)keep the MyClassPtr alias (it is shared across the project) > > > (2) without "declaring" MyClass twice > > > You you accept to declare `MyClassPtr` twice, you can declare it inside the class and "export" it outside ``` #include <memory> class MyC...
46,085,660
In the following snippet, `MyClass` has a static method which returns its shared pointer. To make to code concise, we use the alias `MyClassPtr` for `std::shared_ptr<MyClass>`. However, to accomplish this, we declare the class before declaring the shared pointer alias, which then follows the actual class declaration....
2017/09/06
[ "https://Stackoverflow.com/questions/46085660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3697757/" ]
Your question is somewhat vague, as you ask how the code can be *simplified*, yet you fail to provide any real code, only the outline of a class definition. Instead, I try to answer the more sensible question of how to *improve* your code. I suggest 1. Avoid the alias `MyClassPtr`, it's not really necessary (it should...
> > is there some way to reorganize the code so that > > > (1)keep the MyClassPtr alias (it is shared across the project) > > > (2) without "declaring" MyClass twice > > > You you accept to declare `MyClassPtr` twice, you can declare it inside the class and "export" it outside ``` #include <memory> class MyC...
43,044,881
I am trying to change the Titles of 'doctors' in a database and was just wondering was there a SQL query which I could run to change them. [The column im trying to change](https://i.stack.imgur.com/Ca4iM.png) What I am asking is that there is any way I can update the column to add a 'Dr' infront of the names to repla...
2017/03/27
[ "https://Stackoverflow.com/questions/43044881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7251447/" ]
This example can be quite useful for you. ``` public partial class MainWindow: Window { DispatcherTimer dispatcherTimer = new DispatcherTimer(); Stopwatch stopWatch= new Stopwatch(); string currentTime = string.Empty; public MainWindow() ...
Full code. The Frontend XAML is as follows: ``` <Window x:Class="StopWatch.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Simple Stop Watch" Height="350" Width="525"> <Grid Background="BlanchedAlmond"> <TextBlo...
298,208
I am making a table where I need to adjust the row height. After adjusting the row height, the vertical lines on my second column do not extend to the correct height (they leave a gap). ``` \documentclass[11pt]{article} \usepackage{xcolor,colortbl} \definecolor{Gray}{gray}{0.85} \begin{document} \Large\centering \t...
2016/03/09
[ "https://tex.stackexchange.com/questions/298208", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/100324/" ]
the gaps are because you finished the rows early ``` Document Owner \\ ``` has no second cell, so does not get the vertical rules in that cell use ``` Document Owner & \\ ```
David pushed me in the right direction. The following code makes the table I want. ``` \documentclass[11pt]{article} \usepackage{multirow} \usepackage{xcolor,colortbl} \definecolor{Gray}{gray}{0.85} \begin{document} \Large\centering \textbf{APPROVALS} \\ \normalsize \begin{center} \begin{tabular}{|p{2in}|p{3.5in}|}...
46,345,027
I am having a `UICollectionView` with a horizontal scroll. Here is my `collectionView`: ``` fileprivate(set) lazy var collectionView: UICollectionView = { let width = UIScreen.main.bounds.width.multiplied(by: 0.9) let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() layout.item...
2017/09/21
[ "https://Stackoverflow.com/questions/46345027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594729/" ]
Here's the `UICollectionViewDelegateFlowLayout` I used in my test project to achieve what you want. ``` func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(...
@Jeremy provided a comprehensive solution. I just want to share how I achieve this with little effort ``` func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let frame = cvImages.frame return CGSize(...
54,793,479
I don't understand why this code compiles: ``` #include <iostream> class T { }; void fun(T) { std::cout << __PRETTY_FUNCTION__ << std::endl; } void fun(const T&) { // Why does this compile? std::cout << __PRETTY_FUNCTION__ << std::endl; } void fun(const T&&) { // Why does this compile? } int main() { ...
2019/02/20
[ "https://Stackoverflow.com/questions/54793479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5110937/" ]
The overloads are indeed conflicting (ambiguous) under ordinary overload resolution, but they are still resolvable by explicit means ``` T a; static_cast<void(*)(T)>(fun)(a); // calls `T` version static_cast<void(*)(const T &)>(fun)(a); // calls `const T &` version ``` although I don't immediately see any us...
I'll assume that you have defined the type `T` somewhere preceding this code snippet. Otherwise, of course, the code would not compile. It's not *quite* true that if one overload takes `T` and one takes `const T&`, then overload resolution can never select one of them over the other. For example, if the argument has t...
3,145,414
I need to write the series $$\sum\_{n=0}^N nx^n$$ in a form that does not involve the summation notation, for example $\sum\_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$. Does anyone have any idea how to do this? I've attempted multiple ways including using generating functions however no luck
2019/03/12
[ "https://math.stackexchange.com/questions/3145414", "https://math.stackexchange.com", "https://math.stackexchange.com/users/540784/" ]
I will give a sketch that every isometry $F:S^2\times \mathbb{R}\to S^2\times \mathbb{R}$ is of the form $F(p,y)=(A(p),B(y)).$ Fix arbitrary $p\in S^2$ and $y\in \mathbb{R}$. Let $q\in S^2$ and $r\in \mathbb{R}$ be given by $(q,r)=F(p,y)$. Observe that the tangent space at $(p,y)$ splits as an orthogonal sum \begin{eq...
Not every map $F: \mathbb{S}^2 \times \mathbb{R} \to \mathbb{S}^2 \times \mathbb{R}$ can be written in the form $F(\hat{x}, y) = (A(\hat{x}), B(y))$. As an analogy, consider a map from $\mathbb{R}^2$ to itself; is it true that every such map can be written in the form $F(x,y) = (f(x), g(y))$?
37,043,579
When i run my app, it takes about 10 min to display on my phone. And every change in code also takes 10 min. What should I do? I am using `Android Studio 2.0`.
2016/05/05
[ "https://Stackoverflow.com/questions/37043579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6183852/" ]
In android studio goto * **File > Settings > Build,Execution,Deployment > Build Tools > Gradle** and check the **Offline Work** option. * **File > Settings > Build,Execution,Deployment > Compiler** and check all four checkboxes. If you are using android 2.0 or higher and if you have enabled Instant Run. * **File > ...
Upgrade to the Android Studio 2.1. I also faced the same problem in 2.0 hope it will work.
74,389,848
In python tutorial(<https://docs.python.org/3/tutorial/introduction.html#strings>), slicing is explained as to think of the indices as pointing between characters, with the left edge of the first character numbered 0. Then the right edge of the last character of a string of n characters has index n, for example: [![en...
2022/11/10
[ "https://Stackoverflow.com/questions/74389848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10288870/" ]
uisng non local params ``` def main(): def egg(): nonlocal a print(a) #egg() # NameError: name 'a' is not defined **As excepted** a = 50 egg() main() ``` output ``` 50 ```
Callable class can be used to replicate this sort of behaviour without breaking the encapsulation of a function. ``` class Egg: def __init__(self, a): self.a = a def __call__(self): print(self.a) egg = Egg(50) egg() # 50 egg.a = 20 egg() # 20 ```
340,228
As the title says I'm having a very strange problem with SSH connections at my house, it seems that after about 3-5 minutes of inactivity any SSH sessions I have open will just shutdown and leave the SSH connection in an appeared active state as I do not receive a timeout or reset message and I cannot provide any input...
2011/12/12
[ "https://serverfault.com/questions/340228", "https://serverfault.com", "https://serverfault.com/users/76801/" ]
Check the timeout settings on the router at the server side (the system you're connecting to). I usually run into the 5-minute delay as a result of the default settings on Sonicwall firewalls. In these cases, I'll make the following changes on the ssh server *IF* I don't have access to correct this on the firewall side...
I have had similar problems with while connecting over bad connections. The following configuration did the trick for me. In the server's sshd\_config add the following ``` ClientAliveInterval 60 ``` For details you can lookup manual page of sshd\_config. Good luck : )
31,809,602
I have a viewController in which I have a scrollView in which I have 3 views. This is a scheme : * ScrollView (UIScrollView) + Header (UIView) + TabBar (UIView) + Container (UIView in which I load a ViewController) The main problem is that, in my container (in which there is a view controller), I have a collection...
2015/08/04
[ "https://Stackoverflow.com/questions/31809602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3369214/" ]
I just solved this problem for my own project. Assuming you are using storyboards, I made the UIView a child of UITableView and made the UITableView extend the full viewport of the device. Since UITableView implements UIScrollView you get full screen scrolling of your content. **General Rule** your parent view has t...
To do this, if you are not using auto layout or if you are adding views to container programmatically, you must manually set collection view frame to match its content size after you load some data on it. If you are using auto layout, you should create height constraint outlet and set its constant value based on collec...
31,809,602
I have a viewController in which I have a scrollView in which I have 3 views. This is a scheme : * ScrollView (UIScrollView) + Header (UIView) + TabBar (UIView) + Container (UIView in which I load a ViewController) The main problem is that, in my container (in which there is a view controller), I have a collection...
2015/08/04
[ "https://Stackoverflow.com/questions/31809602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3369214/" ]
I just solved this problem for my own project. Assuming you are using storyboards, I made the UIView a child of UITableView and made the UITableView extend the full viewport of the device. Since UITableView implements UIScrollView you get full screen scrolling of your content. **General Rule** your parent view has t...
You should set the frame of the container view to match the height of the view controller that it is loaded in it and set the contentsize of the scroolview based on the container height.
31,809,602
I have a viewController in which I have a scrollView in which I have 3 views. This is a scheme : * ScrollView (UIScrollView) + Header (UIView) + TabBar (UIView) + Container (UIView in which I load a ViewController) The main problem is that, in my container (in which there is a view controller), I have a collection...
2015/08/04
[ "https://Stackoverflow.com/questions/31809602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3369214/" ]
I just solved this problem for my own project. Assuming you are using storyboards, I made the UIView a child of UITableView and made the UITableView extend the full viewport of the device. Since UITableView implements UIScrollView you get full screen scrolling of your content. **General Rule** your parent view has t...
**A scrollview will scroll only if its contents are bigger than its frame.** This applies to the parent scrollview as well as the child scrollview. Here in your case, for the parent scrollview to scroll its contents (Header, Tabbar & container) together must have greater height than its parent. The child scrollview (c...
1,114,284
Is there a way I can prove that $O(3^{2n})$ does NOT equal $10^n$? How would that be done? Also, is it okay to simplify $O(3^{2n})$ to $O(9^n)$ to do so?
2015/01/21
[ "https://math.stackexchange.com/questions/1114284", "https://math.stackexchange.com", "https://math.stackexchange.com/users/209622/" ]
To answer your second question first: yes, it is allowable to simplify $3^{2n}$ to $9^n$. Recall that $f\in \mathcal O(g)$ iff: $$\limsup\_{x\to\infty}\frac{f(x)}{g(x)} = c,\quad 0\leq c < \infty$$ Letting $f(x) = 10^x$ and $g(x) = 9^x$, and taking the limit: \begin{align} \limsup\_{x\to\infty}\frac{f(x)}{g(x)} &= \l...
It seems that you want to show that $10^n\notin O(3^{2n})$. To prove that $10^n$ is not $O(3^{2n})$ it is enough to show that for any $M$ there is $n$ such that $10^n > M\cdot3^{2n}$, in particular \begin{align} 10^n &> M\cdot 9^n\\ \frac{10^n}{9^n} &> M \\ n &> \log\_{\frac{10}{9}} M \end{align} so $n = \left\lfloo...
1,114,284
Is there a way I can prove that $O(3^{2n})$ does NOT equal $10^n$? How would that be done? Also, is it okay to simplify $O(3^{2n})$ to $O(9^n)$ to do so?
2015/01/21
[ "https://math.stackexchange.com/questions/1114284", "https://math.stackexchange.com", "https://math.stackexchange.com/users/209622/" ]
In this answer, whenever I say "function," I mean a positive real-valued function on the natural numbers $\{1, 2, 3, \ldots\}$. Big-O notation is a way to compare the growth rates of functions as their arguments go to infinity. Let's define a relation $\preccurlyeq$ between functions by saying that $f \preccurlyeq g$ ...
To answer your second question first: yes, it is allowable to simplify $3^{2n}$ to $9^n$. Recall that $f\in \mathcal O(g)$ iff: $$\limsup\_{x\to\infty}\frac{f(x)}{g(x)} = c,\quad 0\leq c < \infty$$ Letting $f(x) = 10^x$ and $g(x) = 9^x$, and taking the limit: \begin{align} \limsup\_{x\to\infty}\frac{f(x)}{g(x)} &= \l...
1,114,284
Is there a way I can prove that $O(3^{2n})$ does NOT equal $10^n$? How would that be done? Also, is it okay to simplify $O(3^{2n})$ to $O(9^n)$ to do so?
2015/01/21
[ "https://math.stackexchange.com/questions/1114284", "https://math.stackexchange.com", "https://math.stackexchange.com/users/209622/" ]
In this answer, whenever I say "function," I mean a positive real-valued function on the natural numbers $\{1, 2, 3, \ldots\}$. Big-O notation is a way to compare the growth rates of functions as their arguments go to infinity. Let's define a relation $\preccurlyeq$ between functions by saying that $f \preccurlyeq g$ ...
It seems that you want to show that $10^n\notin O(3^{2n})$. To prove that $10^n$ is not $O(3^{2n})$ it is enough to show that for any $M$ there is $n$ such that $10^n > M\cdot3^{2n}$, in particular \begin{align} 10^n &> M\cdot 9^n\\ \frac{10^n}{9^n} &> M \\ n &> \log\_{\frac{10}{9}} M \end{align} so $n = \left\lfloo...
4,474,228
My model is correctly validated. If I take a peak in the validation results during debug, I will see that everything is correct. However, *all* my validation results will show, even if only one is invalid. Again, during debug, only one field is correctly showing up in the validation results, but when my view is rendere...
2010/12/17
[ "https://Stackoverflow.com/questions/4474228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500038/" ]
Try: ``` preg_match_all("/\d{10}/", $article, $tags); ```
``` preg_match('/[0-9]{10}/', $article, $tags); ``` Try that. Or if you have multiple IDs, you can use `preg_match_all`. ``` preg_match_all('/[0-9]{10}/', $article, $tags); ```
49,392
I have a custom Site page that contains some javascript code (using jquery and `SPServices`), that calls `Lists.asmx` Web service to perform CRUD operations on the list. At the init, my js code needs all list items. Recently I notided, that the latest added list items are not returned. Using Fiddler, I investigated tha...
2012/10/18
[ "https://sharepoint.stackexchange.com/questions/49392", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/5118/" ]
Like @Ben said, Chrome and SharePoint 2007 do not play nicely together. There is an extension for Chrome called IE Tab [Chrome Extension for using IE](https://chrome.google.com/webstore/detail/ie-tab/hehijbfgiekmjfkfjpbkbammjbdenadd) It will render the page using the IE engine while still in Chrome. You can configur...
SharePoint and Chrome really don't play nice. FF is better but still has oddities. Leave your soul at the door and use the latest version of IE. I feel dirty saying that.
14,904,398
I have two select statement like ``` Select author_id, count(text) from posts group by author_id select author_id, count(text) from posts where postcounter =1 group by author_id ``` Is there a way to combine in a single query the two statements? Results differ in length, so it is needed to insert some 0s in the sec...
2013/02/15
[ "https://Stackoverflow.com/questions/14904398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299791/" ]
You should be able to get this in a single query using: ``` Select author_id, count(text) TextCount, count(case when postcounter=1 then text end) PostCount from posts group by author_id ```
Is this what you're looking for? ``` select author_id, sum(case when postcounter = 1 then 1 else 0 end) count1, sum(case when postcounter <> 1 then 1 else 0 end) count2, count(text) allcount from posts group by author_id ```
14,904,398
I have two select statement like ``` Select author_id, count(text) from posts group by author_id select author_id, count(text) from posts where postcounter =1 group by author_id ``` Is there a way to combine in a single query the two statements? Results differ in length, so it is needed to insert some 0s in the sec...
2013/02/15
[ "https://Stackoverflow.com/questions/14904398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299791/" ]
Is this what you're looking for? ``` select author_id, sum(case when postcounter = 1 then 1 else 0 end) count1, sum(case when postcounter <> 1 then 1 else 0 end) count2, count(text) allcount from posts group by author_id ```
You can try a union all statement? ``` SELECT `id`,sum(`count`) FROM ( Select author_id as `id`, count(text) as `count` from posts group by author_id UNION ALL select author_id as `id`, count(text) as `count` from posts where postcounter =1 group by author_id ) ```
14,904,398
I have two select statement like ``` Select author_id, count(text) from posts group by author_id select author_id, count(text) from posts where postcounter =1 group by author_id ``` Is there a way to combine in a single query the two statements? Results differ in length, so it is needed to insert some 0s in the sec...
2013/02/15
[ "https://Stackoverflow.com/questions/14904398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299791/" ]
You should be able to get this in a single query using: ``` Select author_id, count(text) TextCount, count(case when postcounter=1 then text end) PostCount from posts group by author_id ```
You can try a union all statement? ``` SELECT `id`,sum(`count`) FROM ( Select author_id as `id`, count(text) as `count` from posts group by author_id UNION ALL select author_id as `id`, count(text) as `count` from posts where postcounter =1 group by author_id ) ```
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
There is no need to create your own class with media queries. Bootstrap 3 already has float ordering for media breakpoints under [Column Ordering](http://getbootstrap.com/css/#grid-column-ordering). The syntax for the class is `col-<#grid-size>-(push|pull)-<#cols>` where `<#grid-size>` is `xs`, `sm`, `md` or `lg` and ...
LESS version of @Alex's answer ``` @media (max-width: @screen-xs-max) { .pull-xs-left { .pull-left(); } .pull-xs-right { .pull-right(); } } @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { .pull-sm-left { .pull-left(); } .pull-sm-right { ...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
You can use [CSS Media Queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) basic usage will be like this; if you want to float left below devices of width 500px, then ``` @media (max-width: 500px) { .your_class { float: left; } } @media (min-width: 501px) { .your_class { float...
Yes. Create your own style. I don’t know what element you’re trying to float left/right, but create an **application.css** file and create a CSS class for it: ``` /* default, mobile-first styles */ .logo { float: left; } /* tablets and upwards */ @media (min-width: 768px) { .logo { float: right; }...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
There is no need to create your own class with media queries. Bootstrap 3 already has float ordering for media breakpoints under [Column Ordering](http://getbootstrap.com/css/#grid-column-ordering). The syntax for the class is `col-<#grid-size>-(push|pull)-<#cols>` where `<#grid-size>` is `xs`, `sm`, `md` or `lg` and ...
This is what i am using . change @screen-xs-max for other sizes ``` /* Pull left in mobile resolutions */ @media (max-width: @screen-xs-max) { .pull-xs-right { float: right !important; } .pull-xs-left { float: left !important; } .radio-inline.pull-xs-left + .radio-inline.pull-xs-l...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
You can use [CSS Media Queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) basic usage will be like this; if you want to float left below devices of width 500px, then ``` @media (max-width: 500px) { .your_class { float: left; } } @media (min-width: 501px) { .your_class { float...
This is what i am using . change @screen-xs-max for other sizes ``` /* Pull left in mobile resolutions */ @media (max-width: @screen-xs-max) { .pull-xs-right { float: right !important; } .pull-xs-left { float: left !important; } .radio-inline.pull-xs-left + .radio-inline.pull-xs-l...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
Just add this to your SASS file: ``` @media (max-width: $screen-xs-max) { .pull-xs-left { float: left; } .pull-xs-right { float: right; } } @media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { .pull-sm-left { float: left; } .pull-sm-right { ...
Yes. Create your own style. I don’t know what element you’re trying to float left/right, but create an **application.css** file and create a CSS class for it: ``` /* default, mobile-first styles */ .logo { float: left; } /* tablets and upwards */ @media (min-width: 768px) { .logo { float: right; }...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
You can use [CSS Media Queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) basic usage will be like this; if you want to float left below devices of width 500px, then ``` @media (max-width: 500px) { .your_class { float: left; } } @media (min-width: 501px) { .your_class { float...
There is no need to create your own class with media queries. Bootstrap 3 already has float ordering for media breakpoints under [Column Ordering](http://getbootstrap.com/css/#grid-column-ordering). The syntax for the class is `col-<#grid-size>-(push|pull)-<#cols>` where `<#grid-size>` is `xs`, `sm`, `md` or `lg` and ...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
Possibly you can use [column ordering](https://getbootstrap.com/docs/3.3/css/#grid-column-ordering). ``` <div class="row"> <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div> <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div> </div> ``` Looks like floating columns will be getting ...
LESS version of @Alex's answer ``` @media (max-width: @screen-xs-max) { .pull-xs-left { .pull-left(); } .pull-xs-right { .pull-right(); } } @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { .pull-sm-left { .pull-left(); } .pull-sm-right { ...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
Just add this to your SASS file: ``` @media (max-width: $screen-xs-max) { .pull-xs-left { float: left; } .pull-xs-right { float: right; } } @media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { .pull-sm-left { float: left; } .pull-sm-right { ...
There is no need to create your own class with media queries. Bootstrap 3 already has float ordering for media breakpoints under [Column Ordering](http://getbootstrap.com/css/#grid-column-ordering). The syntax for the class is `col-<#grid-size>-(push|pull)-<#cols>` where `<#grid-size>` is `xs`, `sm`, `md` or `lg` and ...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
You can use [CSS Media Queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) basic usage will be like this; if you want to float left below devices of width 500px, then ``` @media (max-width: 500px) { .your_class { float: left; } } @media (min-width: 501px) { .your_class { float...
LESS version of @Alex's answer ``` @media (max-width: @screen-xs-max) { .pull-xs-left { .pull-left(); } .pull-xs-right { .pull-right(); } } @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { .pull-sm-left { .pull-left(); } .pull-sm-right { ...
18,329,564
I'm building a site in Bootstrap 3. Is there anyway to make a element use the class pull-left on smaller devices and use pull-right on larger ones? Something like: *pull-left-sm pull-right-lg.* I've managed to do it with jquery, catching the resize of the window. Is there any other way? Pref without duplicating the c...
2013/08/20
[ "https://Stackoverflow.com/questions/18329564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676860/" ]
There is no need to create your own class with media queries. Bootstrap 3 already has float ordering for media breakpoints under [Column Ordering](http://getbootstrap.com/css/#grid-column-ordering). The syntax for the class is `col-<#grid-size>-(push|pull)-<#cols>` where `<#grid-size>` is `xs`, `sm`, `md` or `lg` and ...
Yes. Create your own style. I don’t know what element you’re trying to float left/right, but create an **application.css** file and create a CSS class for it: ``` /* default, mobile-first styles */ .logo { float: left; } /* tablets and upwards */ @media (min-width: 768px) { .logo { float: right; }...
69,448,661
I am new to Snakemake, and I'm wondering if I'm able to put optional output files in a snakemake rule while using `expand()`. I'm using `bowtie2-build` to create an indexing of my reference genome, but depending on the genome size, bowtie2 creates indexing files with different extensions: `.bt2` for small genomes, and...
2021/10/05
[ "https://Stackoverflow.com/questions/69448661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17078546/" ]
Perhaps you are making things more complicated than necessary. Bowtie2 (the aligner) takes in input the prefix of the index files and it will find the actual index files by itself. So I wouldn't list the index files as output of any rule. Just use a flag file to indicate that indexing has been completed. For example: ...
This approach is to rename the files with a different extension. It will print an error if such file does not exist, but you might consider this a feature...: ```py rule bowtie2_build: input: "reference/"+config["reference_genome"]+".fa" output: expand("reference/"+config["reference_genome"]+"{...
69,448,661
I am new to Snakemake, and I'm wondering if I'm able to put optional output files in a snakemake rule while using `expand()`. I'm using `bowtie2-build` to create an indexing of my reference genome, but depending on the genome size, bowtie2 creates indexing files with different extensions: `.bt2` for small genomes, and...
2021/10/05
[ "https://Stackoverflow.com/questions/69448661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17078546/" ]
Perhaps you are making things more complicated than necessary. Bowtie2 (the aligner) takes in input the prefix of the index files and it will find the actual index files by itself. So I wouldn't list the index files as output of any rule. Just use a flag file to indicate that indexing has been completed. For example: ...
Seems like a use for [checkpoints](https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#data-dependent-conditional-execution). With checkpoints, the DAG will be reevaluated after the checkpoint's execution. You could do something like this: ``` from glob import glob def get_ref_index(wildcards): """Re...
59,892,408
I have a GUI application created with PyQt and I would like to be able to control it also from the python terminal through a kind of internal API. Ideas : * Using the main terminal : impossible since that it is blocked by the QApplication (by app.exec\_()) * Starting the GUI in another thread to free the main one : ...
2020/01/24
[ "https://Stackoverflow.com/questions/59892408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4958910/" ]
You have to set the `data` and `columns` value. So try it like this: ```js import React, { useState, useEffect } from "react"; import MaterialTable, { MTableToolbar } from "material-table"; const fakeFetch = () => { return new Promise(resolve => { resolve({ data: [ { brand: "brand 1", price: 1, mo...
As per the material-table approach, you have to put your whole fetched data on the `data` prop inside the `MaterialTable` component. So as far as I can understand, there is no looping made in this case by using the material-table library. Assuming the attributes in your data object match the field names specified in y...
20,275,988
Without spending nights of digging through the source code, I was hoping someone could shed some light on how Node is able to communicate with the operating system and do such things as writing files to the file system? I've even seen a package which allows bidirectional communication with the .NET runtime. My very si...
2013/11/28
[ "https://Stackoverflow.com/questions/20275988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17211/" ]
V8 in Chrome isn't sandboxed because V8 is sandboxed. It's sandboxed because Chrome sandboxes it.
Only way to use the operating system functionality is to make system call. For example to create a new file Windows exports systemcall CreateFile(). The V8 engine interprets the javascript code and makes call to NODEJS core library NodeJs itslef is written in c/C++ . calls are made through V8 engine to NODEJS core lib...
51,609,471
I'm new to this and I'm getting an error that I was hoping someone could help me with and explain my error. Error: > > line 178, in applyThrust > > shipPos = self.Fighter.getPos(self.origin) > > AttributeError: 'Fighter' object has no attribute 'Fighter' > > > ``` class Fighter(SphereCollideObj, ob...
2018/07/31
[ "https://Stackoverflow.com/questions/51609471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9949630/" ]
From my point of view, the .htaccess file should look like this: ``` <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /pes/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> ``` The access to dashboard must be checked in ...
I Have done by removing this line from my dashboard controller. ``` public fucntion index() { if (!$this->session->userdata('is_logged')) { //function code } } ```
176,591
Has anyone developed an approach to teaching mechanics based on Lagrangian/Hamiltonian mechanics from the ground up. I mean from high school on up. This is akin to explicitly not talking about components of vectors or developing pre-calculus in a coordinate-free (coordinate agnostic). Perhaps I'm missing the point of ...
2015/04/17
[ "https://physics.stackexchange.com/questions/176591", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75644/" ]
The most fundamental parts of Lagrangian mechanics involve calculus. The action principle involves an integral and the Euler-Lagrange equation is a partial differential equation. Unless the students are pretty good with calculus it will be quite hard to teach.
Maybe you can give a rough idea about what the subject is about. You can introduce first for example the Fermat's principle of least time and maybe kind of make an analogy like. "There is a similar principle of minimization in mechanics where you minimize another quantity called action". Maybe if an student is inter...
176,591
Has anyone developed an approach to teaching mechanics based on Lagrangian/Hamiltonian mechanics from the ground up. I mean from high school on up. This is akin to explicitly not talking about components of vectors or developing pre-calculus in a coordinate-free (coordinate agnostic). Perhaps I'm missing the point of ...
2015/04/17
[ "https://physics.stackexchange.com/questions/176591", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75644/" ]
The most fundamental parts of Lagrangian mechanics involve calculus. The action principle involves an integral and the Euler-Lagrange equation is a partial differential equation. Unless the students are pretty good with calculus it will be quite hard to teach.
If all you are looking for is a basic introduction without the calculus of variations, then the following article (which, however, assumes knowledge of elementary calculus as a prerequisite) may be of help: Hanc, Jozef, Edwin F. Taylor, and Slavomir Tuleja. "Deriving Lagrange’s equations using elementary calculus." Am...
176,591
Has anyone developed an approach to teaching mechanics based on Lagrangian/Hamiltonian mechanics from the ground up. I mean from high school on up. This is akin to explicitly not talking about components of vectors or developing pre-calculus in a coordinate-free (coordinate agnostic). Perhaps I'm missing the point of ...
2015/04/17
[ "https://physics.stackexchange.com/questions/176591", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75644/" ]
If all you are looking for is a basic introduction without the calculus of variations, then the following article (which, however, assumes knowledge of elementary calculus as a prerequisite) may be of help: Hanc, Jozef, Edwin F. Taylor, and Slavomir Tuleja. "Deriving Lagrange’s equations using elementary calculus." Am...
Maybe you can give a rough idea about what the subject is about. You can introduce first for example the Fermat's principle of least time and maybe kind of make an analogy like. "There is a similar principle of minimization in mechanics where you minimize another quantity called action". Maybe if an student is inter...
19,041,165
I'm having some confusion with the reasoning behind what seems to me to be an inconsistency. For example ``` public class Test { static int a; public static void main(String[] args) { System.out.println(a); } } ``` So that will print out 0, as expected. But say we had this instead, ``` pu...
2013/09/27
[ "https://Stackoverflow.com/questions/19041165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The Java Language Specification explains the default [Initial values of Variables](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.5) > > Each class variable, instance variable, or array component is > initialized with a default value when it is created (§15.9, §15.10): > > > For type byte, th...
> > 1) Why don't function scoped variables have default values? > > > It is the rule defined by [JLS](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.5) that method variables are not initialized to thier default values. You need to initialize them beforeusing > > 2) Could the static keyword ...
19,041,165
I'm having some confusion with the reasoning behind what seems to me to be an inconsistency. For example ``` public class Test { static int a; public static void main(String[] args) { System.out.println(a); } } ``` So that will print out 0, as expected. But say we had this instead, ``` pu...
2013/09/27
[ "https://Stackoverflow.com/questions/19041165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The Java Language Specification explains the default [Initial values of Variables](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.5) > > Each class variable, instance variable, or array component is > initialized with a default value when it is created (§15.9, §15.10): > > > For type byte, th...
Java compiler never assigns default values to Local variables as mentioned in the link <http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html> You have to explicitly initialize them.
72,269,969
i want to write a game Lobby for a card game. Using React.js, Node.js and Websocket.io for achieving this. As so far all went fine. Players are connected in the same Lobby. But i want to print in the Lobby sth Like (Player 1: Steven, Player 2: Frank, ...). I ended up in an infinite loop, i am trying to solve since hour...
2022/05/17
[ "https://Stackoverflow.com/questions/72269969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15966001/" ]
This is set by the shortcut key. Open the **Default Keyboard Shortcuts** (**File** > **Preferences** > **Keyboard Shortcuts**) and search for "acceptSelectedSuggestion". You will see that there are only two settings by default, the `Tab` and `Enter` keys. [![enter image description here](https://i.stack.imgur.com/AWts...
I think you don't need to use the python autocomplete extension. You can just use the `Python` extension.
72,269,969
i want to write a game Lobby for a card game. Using React.js, Node.js and Websocket.io for achieving this. As so far all went fine. Players are connected in the same Lobby. But i want to print in the Lobby sth Like (Player 1: Steven, Player 2: Frank, ...). I ended up in an infinite loop, i am trying to solve since hour...
2022/05/17
[ "https://Stackoverflow.com/questions/72269969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15966001/" ]
This is set by the shortcut key. Open the **Default Keyboard Shortcuts** (**File** > **Preferences** > **Keyboard Shortcuts**) and search for "acceptSelectedSuggestion". You will see that there are only two settings by default, the `Tab` and `Enter` keys. [![enter image description here](https://i.stack.imgur.com/AWts...
Tab or enter is required to actually *make a selection*. Otherwise, you could have custom function `printStuff`, and typing `pr(` would not necessarily pick the right one. From what I can tell, PyCharm works the exact same way, so unclear what "acts normal" means in this context.
2,437,316
I'm wondering if I should use OpenId for my website. My first exposure to OpenId was StackOverflow, and I found it confusing that they only had a login link, yet no register link. Now that I've learned about OpenId though I prefer it over the regular way of registration. I have a feeling that only a small percentage o...
2010/03/13
[ "https://Stackoverflow.com/questions/2437316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243494/" ]
I think these days a lot of sites have facebook login and a lot more people know how to use facebook than openid. If I were you I'd go with facebook. e.g. dailymile.com
You should have it only as option, not requirement. People just don't understand this concept and often don't trust it. Many stackexchange.com clients (hosted stackoverflow) have learned this hard way. There have been so many complaints that stackexchange.com developers had to implement traditional username/password a...
2,437,316
I'm wondering if I should use OpenId for my website. My first exposure to OpenId was StackOverflow, and I found it confusing that they only had a login link, yet no register link. Now that I've learned about OpenId though I prefer it over the regular way of registration. I have a feeling that only a small percentage o...
2010/03/13
[ "https://Stackoverflow.com/questions/2437316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243494/" ]
You should have it only as option, not requirement. People just don't understand this concept and often don't trust it. Many stackexchange.com clients (hosted stackoverflow) have learned this hard way. There have been so many complaints that stackexchange.com developers had to implement traditional username/password a...
Several members of the [OpenID Foundation](http://openid.net/foundation/sponsoring-members/) have done that sort of user experience testing. I don't know, however, which (if any) of them have published that research. It's certainly the sort of thing that the Foundation *should* make available, as they [make some claims...
2,437,316
I'm wondering if I should use OpenId for my website. My first exposure to OpenId was StackOverflow, and I found it confusing that they only had a login link, yet no register link. Now that I've learned about OpenId though I prefer it over the regular way of registration. I have a feeling that only a small percentage o...
2010/03/13
[ "https://Stackoverflow.com/questions/2437316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243494/" ]
I think these days a lot of sites have facebook login and a lot more people know how to use facebook than openid. If I were you I'd go with facebook. e.g. dailymile.com
Several members of the [OpenID Foundation](http://openid.net/foundation/sponsoring-members/) have done that sort of user experience testing. I don't know, however, which (if any) of them have published that research. It's certainly the sort of thing that the Foundation *should* make available, as they [make some claims...
2,166,581
I'm creating a console application in which I'd like to record key presses (like the UP ARROW). I've created a Low Level Keyboard Hook that is supposed to capture all Key Presses in any thread and invoke my callback function, but it isn't working. The program stalls for a bit when I hit a key, but never invokes the cal...
2010/01/30
[ "https://Stackoverflow.com/questions/2166581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/262293/" ]
You can't block on a syscall (the getchar), you have to be running a window loop and processing messages before your hook gets called.
On Windows XP, you need, you need to pass `hInstance` (from `WinMain`) as the third argument to `SetWindowsHookEx`. For example: ``` int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow ) { hookHandle = SetWindowsHookEx ( WH_KEYBOARD_LL, keyHandler, hInstance, 0 ); //...
2,166,581
I'm creating a console application in which I'd like to record key presses (like the UP ARROW). I've created a Low Level Keyboard Hook that is supposed to capture all Key Presses in any thread and invoke my callback function, but it isn't working. The program stalls for a bit when I hit a key, but never invokes the cal...
2010/01/30
[ "https://Stackoverflow.com/questions/2166581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/262293/" ]
You can't block on a syscall (the getchar), you have to be running a window loop and processing messages before your hook gets called.
I suggest simle first; // VB: Retrieve the applications instance HINSTANCE appInstance = GetModuleHandle(NULL); and then: hookHandle = SetWindowsHookEx(WH\_KEYBOARD\_LL, keyHandler, appInstance, 0); // ..., but there are another errors later, too
58,859
Pat Cloud's "Key to Five-String Banjo" is a book of scale exercises. Before the first exercise, Mr. Cloud writes (emphasis mine): > > Always start slowly and increase speed on each exercise only when you are absolutely sure you are using the correct fingers. **There should be "daylight" between each note.** > > > ...
2017/07/02
[ "https://music.stackexchange.com/questions/58859", "https://music.stackexchange.com", "https://music.stackexchange.com/users/20675/" ]
Daylight should be between the notes like gaps in blinds: a bright streak of silence separating each note rather than an uninterrupted wall of notes. Staccato make the notes stand out as brief interruptions of the silence. What you want is a fine leggiero making the separations stand out as brief interruptions of the ...
Probably a mixture of both. Separated, as in not bleeding into each other, but not short either, as in proper staccato. The gap should be not long enough to sound like you're searching for the next note, but just short enough that it separates the last from the next. Something like when you explain in an exasperated ma...
8,801,213
What is the best and most effective way to extract a string from a string? I will need this operation to be preforms thousands of times. I have this string and I'd like to extract the URL. The URL is always after the "url=" substring until the end of the string. For example: ``` http://foo.com/fooimage.php?d=AQA4Gxx...
2012/01/10
[ "https://Stackoverflow.com/questions/8801213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
If you absolutely need the results as a string, you'll have to measure, but I doubt that anything will be significantly faster than the most intuitive: ``` std::string getTrailer( std::string const& original, std::string const& key ) { std::string::const_iterator pivot = std::search( original.begin(), ori...
you can use `std::string::find()` : if its a char\* than just move the pointer to the position right after "url=" ``` yourstring = (yourstring + yourstring.find("url=")+4 ); ``` I cant think of anything faster..
8,801,213
What is the best and most effective way to extract a string from a string? I will need this operation to be preforms thousands of times. I have this string and I'd like to extract the URL. The URL is always after the "url=" substring until the end of the string. For example: ``` http://foo.com/fooimage.php?d=AQA4Gxx...
2012/01/10
[ "https://Stackoverflow.com/questions/8801213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
If you absolutely need the results as a string, you'll have to measure, but I doubt that anything will be significantly faster than the most intuitive: ``` std::string getTrailer( std::string const& original, std::string const& key ) { std::string::const_iterator pivot = std::search( original.begin(), ori...
You could also look into the boost libraries. For example [boost::split()](http://www.boost.org/doc/libs/1_41_0/doc/html/boost/algorithm/split_id1113872.html) I don't know how they actually perform in terms of speed, but it's definitely worth a try.
8,801,213
What is the best and most effective way to extract a string from a string? I will need this operation to be preforms thousands of times. I have this string and I'd like to extract the URL. The URL is always after the "url=" substring until the end of the string. For example: ``` http://foo.com/fooimage.php?d=AQA4Gxx...
2012/01/10
[ "https://Stackoverflow.com/questions/8801213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
``` std::string inStr; //this step is necessary size_t pos = inStr.find("url="); if(pos != std::string::npos){ char const * url = &inStr[pos + 4]; // it is fine to do any read only operations with url // if you would apply some modifications to url, please make a copy string } ```
you can use `std::string::find()` : if its a char\* than just move the pointer to the position right after "url=" ``` yourstring = (yourstring + yourstring.find("url=")+4 ); ``` I cant think of anything faster..
8,801,213
What is the best and most effective way to extract a string from a string? I will need this operation to be preforms thousands of times. I have this string and I'd like to extract the URL. The URL is always after the "url=" substring until the end of the string. For example: ``` http://foo.com/fooimage.php?d=AQA4Gxx...
2012/01/10
[ "https://Stackoverflow.com/questions/8801213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63898/" ]
``` std::string inStr; //this step is necessary size_t pos = inStr.find("url="); if(pos != std::string::npos){ char const * url = &inStr[pos + 4]; // it is fine to do any read only operations with url // if you would apply some modifications to url, please make a copy string } ```
You could also look into the boost libraries. For example [boost::split()](http://www.boost.org/doc/libs/1_41_0/doc/html/boost/algorithm/split_id1113872.html) I don't know how they actually perform in terms of speed, but it's definitely worth a try.
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
It really depends what you are doing exactly. In general, I would say it's not good as a CAD tool for mechanical engineering. It's good for modeling good looking things (teaspot, tree, people etc.), but if you want to for example handle strength calculations, you are basically out of luck (unless you do everything ma...
A project has been started to achieve blender be a useful as CAD tool, without losing it's current capabilities. <http://www.mechanicalblender.org> <https://blenderartists.org/forum/showthread.php?395814-Mechanical-Blender>
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
Blender is an artistic tool (read "not intended for precision").
Tools like Blender work differently than most engineering CAD software. Blender-like apps are focused on manipulating the textures, colors, and other attributes of surfaces. However, those apps lack the ability to easily specify specific dimensions that you need to manufacture a part, as well as the ability to generate...
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
It really depends what you are doing exactly. In general, I would say it's not good as a CAD tool for mechanical engineering. It's good for modeling good looking things (teaspot, tree, people etc.), but if you want to for example handle strength calculations, you are basically out of luck (unless you do everything ma...
There exists project BlenderCAD, but I didn't tried it yet. <http://sourceforge.net/projects/blendercad/>
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
There exists project BlenderCAD, but I didn't tried it yet. <http://sourceforge.net/projects/blendercad/>
A project has been started to achieve blender be a useful as CAD tool, without losing it's current capabilities. <http://www.mechanicalblender.org> <https://blenderartists.org/forum/showthread.php?395814-Mechanical-Blender>
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
Blender is an artistic tool (read "not intended for precision").
A project has been started to achieve blender be a useful as CAD tool, without losing it's current capabilities. <http://www.mechanicalblender.org> <https://blenderartists.org/forum/showthread.php?395814-Mechanical-Blender>
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
It really depends what you are doing exactly. In general, I would say it's not good as a CAD tool for mechanical engineering. It's good for modeling good looking things (teaspot, tree, people etc.), but if you want to for example handle strength calculations, you are basically out of luck (unless you do everything ma...
Blender is an artistic tool (read "not intended for precision").
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
It really depends what you are doing exactly. In general, I would say it's not good as a CAD tool for mechanical engineering. It's good for modeling good looking things (teaspot, tree, people etc.), but if you want to for example handle strength calculations, you are basically out of luck (unless you do everything ma...
Tools like Blender work differently than most engineering CAD software. Blender-like apps are focused on manipulating the textures, colors, and other attributes of surfaces. However, those apps lack the ability to easily specify specific dimensions that you need to manufacture a part, as well as the ability to generate...
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
A project has been started to achieve blender be a useful as CAD tool, without losing it's current capabilities. <http://www.mechanicalblender.org> <https://blenderartists.org/forum/showthread.php?395814-Mechanical-Blender>
Honest answer: NO, not at all. Blender is NOT CAD, it's an artistic tool, it blends artistic ideas and visions. CAD is quite the opposite, it kills artistic ideas, it's about maths, physics and precision. There are many questions and solutions about CAD on this forum, but it's up to you to establish your specific re...
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
There exists project BlenderCAD, but I didn't tried it yet. <http://sourceforge.net/projects/blendercad/>
Honest answer: NO, not at all. Blender is NOT CAD, it's an artistic tool, it blends artistic ideas and visions. CAD is quite the opposite, it kills artistic ideas, it's about maths, physics and precision. There are many questions and solutions about CAD on this forum, but it's up to you to establish your specific re...
28,523
For instance for mechanical engineering; from what I've seen, Blender is quite flexible and powerful so maybe it serves well for this also?
2011/03/01
[ "https://askubuntu.com/questions/28523", "https://askubuntu.com", "https://askubuntu.com/users/8673/" ]
Blender is an artistic tool (read "not intended for precision").
There exists project BlenderCAD, but I didn't tried it yet. <http://sourceforge.net/projects/blendercad/>
100,428
I'm managing a Google Suite environment, for example, for company example.com. At the moment I'm managing it via the owner@example.com email address. But what I want, if possible, is to manage it via my own Google account, for example me@gmail.com. When I try to add my own email address as administrator I receive the ...
2016/11/16
[ "https://webapps.stackexchange.com/questions/100428", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/139968/" ]
Unfortunately it is not possible. You must create a new email address within the same domain as administration account.
In the simple way you describe, it is not possible; i.e., one may not add `user@other-domain.com` to `domain.com` as an administrator. If you only want an unpaid (no email, storage, etc.) account with `superadmin` privileges to manage the domain, you can use the "Cloud Identity" service. You could also use a sub-domai...
36,801,850
I can't seem to get this form to work properly. My web scripting knowledge is pretty limited as I'm still a student. I searched and found this [Post Self Form Validation and Submission in PHP](https://stackoverflow.com/questions/23933991/post-self-form-validation-and-submission-in-php) which is the same assignment but ...
2016/04/22
[ "https://Stackoverflow.com/questions/36801850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6152284/" ]
If you have php anywhere in the code, it can't be saved as an `.html` file. Save it as a `.php` file and then Apache will call the PHP interpreter.
since you're saving the page as an `.html` extension, it's very likely that your php is not being processed. Try saving the page as an `.php`
58,005,073
I am setting up profile section. > > I want to show empty fields to a new user. > > > First I tried this, but it didn't work because new user's profile table is empty. ``` <li>Name :<br> <p> {{ Auth::user()->profile->name }} </p> </li> ``` So next I tried this one. ``` <p>@if(!empty(Auth::user...
2019/09/19
[ "https://Stackoverflow.com/questions/58005073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11527337/" ]
In UserController, ``` public function index() { $profiles=Profile::all() return view('your_view_file_path', compact('profiles')); } ``` In Blade ``` @foreach($profiles as $profile) <li>Name :<br> <p> {{profile->name}} </p> </li><br> @enforeach ``...
Try to change : ``` return redirect()->route('profile.index'); ``` To : ``` return redirect()->route('profile.index', [$profile]); ```
58,005,073
I am setting up profile section. > > I want to show empty fields to a new user. > > > First I tried this, but it didn't work because new user's profile table is empty. ``` <li>Name :<br> <p> {{ Auth::user()->profile->name }} </p> </li> ``` So next I tried this one. ``` <p>@if(!empty(Auth::user...
2019/09/19
[ "https://Stackoverflow.com/questions/58005073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11527337/" ]
In UserController, ``` public function index() { $profiles=Profile::all() return view('your_view_file_path', compact('profiles')); } ``` In Blade ``` @foreach($profiles as $profile) <li>Name :<br> <p> {{profile->name}} </p> </li><br> @enforeach ``...
How about simply keeping name values to input tag so you can pass all values. maybe that can be issue? ``` @if($profile->count() > 0) <ul class="information"> <li>Name :<br> <input type="text" name="name1" value=" {{ Auth::user()->profile->name }}" /> </li><br> @endif ``` ...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Lots of similar questions and answers: <https://wordpress.stackexchange.com/search?q=mysql+optimize> It comes down to using tools - like mysqltuner - to investigate the bottlenecks, checking logs for errors and memory usage, php opcode-caching, clearing post/page revisons to get the DB down to size, etc.
You weren't kidding, just tried going to your site and got a 500 internal error. Perhaps you can lower the number of plugins you are using and make sure all images are optimized, etc. to make page sizes smaller so they consume less bandwidth to load hence less errors. You may also want to look into [HIP HOP for PHP](h...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
### Hi Matthew Paulson, I see your using W3 Total Cache but your database and object cache is set to disk. Caching objects and your database to disk can actually have a negative performance effect especially if your getting that much traffic. You can read more about the effects on caching database and objects to disk...
Hi **@Matthew Paulson:** You may be asking the wrong question. With your traffic you *may* want to look at at front-end cache using [**nginx**](http://nginx.org/en/). Here are Q&As for nginx here on the site, lots of relevant articles in a Google search, and plugin that can interface WordPress to nginx at wordpress....
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
### Hi Matthew Paulson, I see your using W3 Total Cache but your database and object cache is set to disk. Caching objects and your database to disk can actually have a negative performance effect especially if your getting that much traffic. You can read more about the effects on caching database and objects to disk...
i dont know what programs you installed but maybe its APC - Zend problem: <http://www.ivankristianto.com/web-development/server/alternative-php-cache-apc-not-compatible-with-zend-optimizer/1726/> > > This problem happen in my VPS after i > install Alternative PHP cache (APC). > And also i already have Zend optimiz...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Lots of similar questions and answers: <https://wordpress.stackexchange.com/search?q=mysql+optimize> It comes down to using tools - like mysqltuner - to investigate the bottlenecks, checking logs for errors and memory usage, php opcode-caching, clearing post/page revisons to get the DB down to size, etc.
Hi **@Matthew Paulson:** You may be asking the wrong question. With your traffic you *may* want to look at at front-end cache using [**nginx**](http://nginx.org/en/). Here are Q&As for nginx here on the site, lots of relevant articles in a Google search, and plugin that can interface WordPress to nginx at wordpress....
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Hi **@Matthew Paulson:** You may be asking the wrong question. With your traffic you *may* want to look at at front-end cache using [**nginx**](http://nginx.org/en/). Here are Q&As for nginx here on the site, lots of relevant articles in a Google search, and plugin that can interface WordPress to nginx at wordpress....
The hardware you have should easily cope with the stated traffic (as a benchmark, a site I run peaks at ~40k daily page views on a 2GB Slicehost VPS) - so that suggests something grossly wrong. So, as other people have said, the first thing you need to do is understand where the problem(s) is/are. 1. What information...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
### Hi Matthew Paulson, I see your using W3 Total Cache but your database and object cache is set to disk. Caching objects and your database to disk can actually have a negative performance effect especially if your getting that much traffic. You can read more about the effects on caching database and objects to disk...
Lots of similar questions and answers: <https://wordpress.stackexchange.com/search?q=mysql+optimize> It comes down to using tools - like mysqltuner - to investigate the bottlenecks, checking logs for errors and memory usage, php opcode-caching, clearing post/page revisons to get the DB down to size, etc.
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Hi **@Matthew Paulson:** You may be asking the wrong question. With your traffic you *may* want to look at at front-end cache using [**nginx**](http://nginx.org/en/). Here are Q&As for nginx here on the site, lots of relevant articles in a Google search, and plugin that can interface WordPress to nginx at wordpress....
You weren't kidding, just tried going to your site and got a 500 internal error. Perhaps you can lower the number of plugins you are using and make sure all images are optimized, etc. to make page sizes smaller so they consume less bandwidth to load hence less errors. You may also want to look into [HIP HOP for PHP](h...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Lots of similar questions and answers: <https://wordpress.stackexchange.com/search?q=mysql+optimize> It comes down to using tools - like mysqltuner - to investigate the bottlenecks, checking logs for errors and memory usage, php opcode-caching, clearing post/page revisons to get the DB down to size, etc.
i dont know what programs you installed but maybe its APC - Zend problem: <http://www.ivankristianto.com/web-development/server/alternative-php-cache-apc-not-compatible-with-zend-optimizer/1726/> > > This problem happen in my VPS after i > install Alternative PHP cache (APC). > And also i already have Zend optimiz...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Hi **@Matthew Paulson:** You may be asking the wrong question. With your traffic you *may* want to look at at front-end cache using [**nginx**](http://nginx.org/en/). Here are Q&As for nginx here on the site, lots of relevant articles in a Google search, and plugin that can interface WordPress to nginx at wordpress....
i dont know what programs you installed but maybe its APC - Zend problem: <http://www.ivankristianto.com/web-development/server/alternative-php-cache-apc-not-compatible-with-zend-optimizer/1726/> > > This problem happen in my VPS after i > install Alternative PHP cache (APC). > And also i already have Zend optimiz...
14,187
have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunat...
2011/04/07
[ "https://wordpress.stackexchange.com/questions/14187", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/4510/" ]
Hi **@Matthew Paulson:** You may be asking the wrong question. With your traffic you *may* want to look at at front-end cache using [**nginx**](http://nginx.org/en/). Here are Q&As for nginx here on the site, lots of relevant articles in a Google search, and plugin that can interface WordPress to nginx at wordpress....
Do you have insight in what exactly is becoming a bottleneck under high load? It could be different type of resource (CPU load, sustaining network conenctions, running out of memory, etc). General things: * **opcode cache** (keeping compiled PHP code in memory) is a must; * you seem to have memory to burn, so it's wo...
57,905,279
I'll preface this question with the fact I am a newbie, and I just want a clear answer as I'm confused when I go to the internet for help. That said, here is my question: If someone submits a pull request, how do I pull those changes to my local machine to review before merging with master? Say the branch is named **...
2019/09/12
[ "https://Stackoverflow.com/questions/57905279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10381908/" ]
A pull request is a special ref in the format of `refs/pull/<number>/head`. Suppose there is a pull request `#29`. You can fetch it and create a local branch `p29` for it in the local repository by: ``` git fetch origin pull/29/head:p29 ``` and then compare it with `master` by: ``` git diff master p29 ``` If you ...
Normaly, it's best to use the following steps, considering you have a master branch and a feature branch that needs to be merged to master: 1. In your feature branch, make sure you comitted all your local changes. 2. Pull the feature branch from your remote. This will make sure that if other people worked on that feat...
57,905,279
I'll preface this question with the fact I am a newbie, and I just want a clear answer as I'm confused when I go to the internet for help. That said, here is my question: If someone submits a pull request, how do I pull those changes to my local machine to review before merging with master? Say the branch is named **...
2019/09/12
[ "https://Stackoverflow.com/questions/57905279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10381908/" ]
Sometimes pull request comes from forks, in order to get them you have to give url of of fork like you do this ``` git checkout master git checkout -b feature1 git pull 'https://github.com/user/username/fork.git' feature1 ``` if everything goes successfully, your 'feature1' branch has all the changes so now you can ...
Normaly, it's best to use the following steps, considering you have a master branch and a feature branch that needs to be merged to master: 1. In your feature branch, make sure you comitted all your local changes. 2. Pull the feature branch from your remote. This will make sure that if other people worked on that feat...
1,511,025
I have a silverlight app that allows the user to draw on it and save the drawing. The strokecollection in the canvas is converted to xml attributes and stored in the database. the only problem i have now is converting the xml back into a stroke collection. my strokes are stored as such: ``` <Strokes> <Stroke>...
2009/10/02
[ "https://Stackoverflow.com/questions/1511025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/166658/" ]
For Moonlight 2.0 we'll be using mono's 2.6 branch from here: <http://anonsvn.mono-project.com/source/branches/mono-2-6/> mono trunk is going through a lot of unstable changes right now, which is why we decided to use the stable 2.6 branch instead.
I think Moonlight currently uses a branch of mono and mcs, so it might be best to use that - or it might just be a makfile bug in mcs trunk. You'd be best asking on the moonlight mailing list or IRC.
1,511,025
I have a silverlight app that allows the user to draw on it and save the drawing. The strokecollection in the canvas is converted to xml attributes and stored in the database. the only problem i have now is converting the xml back into a stroke collection. my strokes are stored as such: ``` <Strokes> <Stroke>...
2009/10/02
[ "https://Stackoverflow.com/questions/1511025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/166658/" ]
I think Moonlight currently uses a branch of mono and mcs, so it might be best to use that - or it might just be a makfile bug in mcs trunk. You'd be best asking on the moonlight mailing list or IRC.
For such specific questions about building moonlight, please join us on irc.gnom.org/#moonlight or our mailing list moonlight-list @ lists.ximian.com. We can better help you that way.
1,511,025
I have a silverlight app that allows the user to draw on it and save the drawing. The strokecollection in the canvas is converted to xml attributes and stored in the database. the only problem i have now is converting the xml back into a stroke collection. my strokes are stored as such: ``` <Strokes> <Stroke>...
2009/10/02
[ "https://Stackoverflow.com/questions/1511025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/166658/" ]
For Moonlight 2.0 we'll be using mono's 2.6 branch from here: <http://anonsvn.mono-project.com/source/branches/mono-2-6/> mono trunk is going through a lot of unstable changes right now, which is why we decided to use the stable 2.6 branch instead.
For such specific questions about building moonlight, please join us on irc.gnom.org/#moonlight or our mailing list moonlight-list @ lists.ximian.com. We can better help you that way.
44,643,443
I've spent a lot of time researching the keyring package trying to get a simple example to work. I'm using python 2.7 on a windows 7-x64 machine. I've installed the package and confirmed that the files are within my Lib/site-packages folder. In this code snippet from the installation docs what is supposed to go in "sy...
2017/06/20
[ "https://Stackoverflow.com/questions/44643443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8186108/" ]
You may have to install the `pywin32` package. Doing so solved the problem for me. Using `conda`: `conda install -e environment_name_here pywin32` Using `pip`: `pip install pywin32` On a tangent: For some reason, the code swallows an exception that the windows credential manager class would have otherwise thro...
i don't know if you can do that but instead you can ask the user to give it's credentials using this following commands ``` import admin if not admin.isUserAdmin(): admin.runAsAdmin() ```
44,643,443
I've spent a lot of time researching the keyring package trying to get a simple example to work. I'm using python 2.7 on a windows 7-x64 machine. I've installed the package and confirmed that the files are within my Lib/site-packages folder. In this code snippet from the installation docs what is supposed to go in "sy...
2017/06/20
[ "https://Stackoverflow.com/questions/44643443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8186108/" ]
Finally got this working. The information from Shaun pointed me in the right direction with installing `pywin32`. From there I did trial and error with creating test credentials in Windows Credential Manager and testing the Python keyring function. I only got it working with Generic Credentials which is fine for my p...
i don't know if you can do that but instead you can ask the user to give it's credentials using this following commands ``` import admin if not admin.isUserAdmin(): admin.runAsAdmin() ```
44,643,443
I've spent a lot of time researching the keyring package trying to get a simple example to work. I'm using python 2.7 on a windows 7-x64 machine. I've installed the package and confirmed that the files are within my Lib/site-packages folder. In this code snippet from the installation docs what is supposed to go in "sy...
2017/06/20
[ "https://Stackoverflow.com/questions/44643443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8186108/" ]
Finally got this working. The information from Shaun pointed me in the right direction with installing `pywin32`. From there I did trial and error with creating test credentials in Windows Credential Manager and testing the Python keyring function. I only got it working with Generic Credentials which is fine for my p...
You may have to install the `pywin32` package. Doing so solved the problem for me. Using `conda`: `conda install -e environment_name_here pywin32` Using `pip`: `pip install pywin32` On a tangent: For some reason, the code swallows an exception that the windows credential manager class would have otherwise thro...
6,855
I'm trying out a new type of review, which includes a score card at the top *in addition to the rest of the review* to summarize how the code shapes up. I would like to standardize the scores within the card and improve it. Here's what it currently looks like: > > Code Score > ========== > > > 1. **Design**: n/a >...
2016/06/23
[ "https://codereview.meta.stackexchange.com/questions/6855", "https://codereview.meta.stackexchange.com", "https://codereview.meta.stackexchange.com/users/27623/" ]
How does a score card actually help the OP? ------------------------------------------- Telling them their code sucks, without explaining how to improve it, is no benefit to anybody. Telling them how to improve it, by definition, involves explaining why it's not so good at the moment. So why have the score if you're ...
I also think that this is a very bad idea. We are already subject to users that are giving code only reviews, which are not reviews at all and don't belong on Code Review, if we start doing this score card type of deal I am afraid that new users will start posting just the score cards and not posting an actual review....
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
You need to call srand just once, at the beginning of your program. `srand` initializes the pseudo random number generator using time in seconds. If you initialize it with a particular number, you will always get the same sequence of numbers. That's why you usually want to initialize it at the beginning using the time...
I rather suggest also using gettimeofday() system call to retrieve the seed to be used to feed srand(). Something like ``` struct timeval tv; ... gettimeofday(&tv, NULL); srand(tv.tv_usec); ... ``` This approach can add more entropy in your pseudo number generation code. IMHO of course Ciao ciao
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
You need to call srand just once, at the beginning of your program. `srand` initializes the pseudo random number generator using time in seconds. If you initialize it with a particular number, you will always get the same sequence of numbers. That's why you usually want to initialize it at the beginning using the time...
You need to do `srand((unsigned int)time(NULL))` only once before the loop.
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
You're seeding *inside* the loop (with the same value because of how quickly the loop will be executed), which causes the random number generated to be the same each time. You need to move your seed function *outside* the loop: ``` /* Initialize random number */ srand((unsigned int)time(NULL)); for(i = 0; i < 3; i++...
Seed to the pseudo Random number generator should be called only once outside the loop. Using time as a seed is good thing. However there is still a possiblity of getting the same random number.
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
You're seeding *inside* the loop (with the same value because of how quickly the loop will be executed), which causes the random number generated to be the same each time. You need to move your seed function *outside* the loop: ``` /* Initialize random number */ srand((unsigned int)time(NULL)); for(i = 0; i < 3; i++...
I rather suggest also using gettimeofday() system call to retrieve the seed to be used to feed srand(). Something like ``` struct timeval tv; ... gettimeofday(&tv, NULL); srand(tv.tv_usec); ... ``` This approach can add more entropy in your pseudo number generation code. IMHO of course Ciao ciao
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
It is completely possible that the 3 times 17 are still completely random. There is an about 1 in 10 chance of getting two numbers the same when using a range of 1-30 and three picks. (this is due to the [birthday problem](http://en.wikipedia.org/wiki/Birthday_problem) ) Now, getting three the same results has still ...
Seed to the pseudo Random number generator should be called only once outside the loop. Using time as a seed is good thing. However there is still a possiblity of getting the same random number.
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
It is completely possible that the 3 times 17 are still completely random. There is an about 1 in 10 chance of getting two numbers the same when using a range of 1-30 and three picks. (this is due to the [birthday problem](http://en.wikipedia.org/wiki/Birthday_problem) ) Now, getting three the same results has still ...
I rather suggest also using gettimeofday() system call to retrieve the seed to be used to feed srand(). Something like ``` struct timeval tv; ... gettimeofday(&tv, NULL); srand(tv.tv_usec); ... ``` This approach can add more entropy in your pseudo number generation code. IMHO of course Ciao ciao
3,159,644
gcc 4.4.4 c89 I am using the code below. However, I keep getting the same number: ``` size_t i = 0; for(i = 0; i < 3; i++) { /* Initialize random number */ srand((unsigned int)time(NULL)); /* Added random number (simulate seconds) */ add((rand() % 30) + 1); } ``` I would...
2010/07/01
[ "https://Stackoverflow.com/questions/3159644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70942/" ]
You need to do `srand((unsigned int)time(NULL))` only once before the loop.
Seed to the pseudo Random number generator should be called only once outside the loop. Using time as a seed is good thing. However there is still a possiblity of getting the same random number.