qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
24,190,065
Using Selenium / C# I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it. I have the below to try and select this: ``` public static void Userloggedin() { var us...
2014/06/12
[ "https://Stackoverflow.com/questions/24190065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3451887/" ]
To resolve this problem I changed $JAVA\_HOME environment variable to the path I found it from: ``` System Preferences -> Java -> java (tab in Java Control Panel) -> View -> Path ``` I had two version of java and the default one was the old version of java.
This is caused by a bug in Cassandra: <https://issues.apache.org/jira/browse/CASSANDRA-11661>
24,190,065
Using Selenium / C# I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it. I have the below to try and select this: ``` public static void Userloggedin() { var us...
2014/06/12
[ "https://Stackoverflow.com/questions/24190065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3451887/" ]
See this [CASSANDRA-11716](https://issues.apache.org/jira/browse/CASSANDRA-11716) issue. The solution posted there worked for me.
There appears to be a newer issue now that Java 7 update 101 has been released. I installed this version which broke Cassandra: ``` yum install java-1.7.0-oracle-1.7.0.101-1jpp.1.el7.x86_64 ``` Installing a previous version (update 99) fixed the issue: ``` yum install java-1.7.0-oracle-1.7.0.99-1jpp.1.el7.x86_64 `...
24,190,065
Using Selenium / C# I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it. I have the below to try and select this: ``` public static void Userloggedin() { var us...
2014/06/12
[ "https://Stackoverflow.com/questions/24190065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3451887/" ]
Per documentation: <http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation> > > **Set JAVA\_HOME** > > > Make sure JAVA\_HOME is set: echo $JAVA\_HOME > > > So make sure `JAVA_HOME` is pointing to `/path/to/jdk7`
To resolve this problem I changed $JAVA\_HOME environment variable to the path I found it from: ``` System Preferences -> Java -> java (tab in Java Control Panel) -> View -> Path ``` I had two version of java and the default one was the old version of java.
24,190,065
Using Selenium / C# I have an automated test case where a user logs in (jonpark2), once the user has done so their username is stored in the text of a span class, I need to select this element and then verify an assert on it. I have the below to try and select this: ``` public static void Userloggedin() { var us...
2014/06/12
[ "https://Stackoverflow.com/questions/24190065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3451887/" ]
Per documentation: <http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation> > > **Set JAVA\_HOME** > > > Make sure JAVA\_HOME is set: echo $JAVA\_HOME > > > So make sure `JAVA_HOME` is pointing to `/path/to/jdk7`
There appears to be a newer issue now that Java 7 update 101 has been released. I installed this version which broke Cassandra: ``` yum install java-1.7.0-oracle-1.7.0.101-1jpp.1.el7.x86_64 ``` Installing a previous version (update 99) fixed the issue: ``` yum install java-1.7.0-oracle-1.7.0.99-1jpp.1.el7.x86_64 `...
74,619,432
The following script is working fine. But need to add one more item in array without built-in function. Is it possible to do without `Resize()` ? ``` string[] data = {"item-1", "item-2"}; Array.Resize(ref data, 3); data[2] = "item-3"; foreach(string i in data) { Console.WriteLine(i); } ```
2022/11/29
[ "https://Stackoverflow.com/questions/74619432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7186739/" ]
Assuming you're trying to increase the size of an array without any built-in libraries or data structures, you just need to create a new larger array, copy the old elements, then add your new element. ``` string[] data = {"item-1", "item-2"}; string[] newData = new string[data.Length + 1]; int i; for (i = 0; i < data...
No. Arrays are fixed size, so the only way to add more stuff to them is to resize them. If you have a scenario where you need to add a dynamic number of elements, use `List<T>` instead.
74,619,432
The following script is working fine. But need to add one more item in array without built-in function. Is it possible to do without `Resize()` ? ``` string[] data = {"item-1", "item-2"}; Array.Resize(ref data, 3); data[2] = "item-3"; foreach(string i in data) { Console.WriteLine(i); } ```
2022/11/29
[ "https://Stackoverflow.com/questions/74619432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7186739/" ]
Assuming you're trying to increase the size of an array without any built-in libraries or data structures, you just need to create a new larger array, copy the old elements, then add your new element. ``` string[] data = {"item-1", "item-2"}; string[] newData = new string[data.Length + 1]; int i; for (i = 0; i < data...
The short answer is no. But if you want you can always implement a logic that does the resizing. You could do something like this implementation of a List: ``` public class List<T> : IAbstractList<T> { private const int DEFAULT_CAPACITY = 4; private T[] _items; public List() : this(DEFAULT_CAPACIT...
178,027
I read about turbulence a few days back.I saw a video showing the physics behind van gogh's starry night and physics.But I could not really understand the link between starry night and physics of turbulence.Please explain.
2015/04/23
[ "https://physics.stackexchange.com/questions/178027", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/78126/" ]
I find the explanation given in [the first paragraph of Wikipedia article](http://en.wikipedia.org/wiki/Megaphone) is pretty good. Let me just elaborate some aspects to make it more clear. Megaphone is simply an extension of your vocal tract. Therefore the [acoustic impedance](http://en.wikipedia.org/wiki/Acoustic_imp...
When one shouts , the sound waves disperse in a semicircle , the power of the voice cords distributed to 180 degrees. A simple [megaphone](http://en.wikipedia.org/wiki/Megaphone) channels the sound in a small angle and thus is directional and stronger. Electric megaphones amplify the sound and still send it in a narrow...
185,521
I run into similar codes like this all the time in aspx pages: ``` <asp:CheckBox Runat="server" ID="myid" Checked='<%# DataBinder.Eval(Container.DataItem, "column").Equals(1) %>'> ``` I was wondering what other objects I have access to inside of that <%# %> tag. How come DataBinder.Eval() and Container.DataItem are ...
2008/10/09
[ "https://Stackoverflow.com/questions/185521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
Within <%# %> tags you have access to 1. Anything that is visible in your code-behind class (including protected methods and properties). 2. Anything declared on the aspx page using <@import @>. 3. Anything passed in as the event arguments when the ItemDataBound event is fired (e.g. RepeaterItemEventArgs, DataListIte...
I believe you have access to anything within scope of the page class, though the results of the expression are converted to a string, so you can't embed conditional expressions the way you can with "<%" expression holes. [Here](http://www.odetocode.com/Articles/278.aspx) is a nice blog post which dives under the cover...
185,521
I run into similar codes like this all the time in aspx pages: ``` <asp:CheckBox Runat="server" ID="myid" Checked='<%# DataBinder.Eval(Container.DataItem, "column").Equals(1) %>'> ``` I was wondering what other objects I have access to inside of that <%# %> tag. How come DataBinder.Eval() and Container.DataItem are ...
2008/10/09
[ "https://Stackoverflow.com/questions/185521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
Within <%# %> tags you have access to 1. Anything that is visible in your code-behind class (including protected methods and properties). 2. Anything declared on the aspx page using <@import @>. 3. Anything passed in as the event arguments when the ItemDataBound event is fired (e.g. RepeaterItemEventArgs, DataListIte...
<%# is specific to inline ASPX databinding like the link ckramer posted suggests. > > How come DataBinder.Eval() and Container.DataItem are not visible anywhere inside .CS code? > > > To access the binding item in codebehind you would need to set up an [ItemDataBound](http://msdn.microsoft.com/en-us/library/syste...
185,521
I run into similar codes like this all the time in aspx pages: ``` <asp:CheckBox Runat="server" ID="myid" Checked='<%# DataBinder.Eval(Container.DataItem, "column").Equals(1) %>'> ``` I was wondering what other objects I have access to inside of that <%# %> tag. How come DataBinder.Eval() and Container.DataItem are ...
2008/10/09
[ "https://Stackoverflow.com/questions/185521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
Within <%# %> tags you have access to 1. Anything that is visible in your code-behind class (including protected methods and properties). 2. Anything declared on the aspx page using <@import @>. 3. Anything passed in as the event arguments when the ItemDataBound event is fired (e.g. RepeaterItemEventArgs, DataListIte...
ASP.NET generates a subclass of [TemplateControl](http://msdn.microsoft.com/en-us/library/system.web.ui.templatecontrol.aspx) for each occurence of a template. Databinding statements are expressions used in a method inside that class. Thus, you can call any public/protected instance method on TemplateControl. See [any ...
185,521
I run into similar codes like this all the time in aspx pages: ``` <asp:CheckBox Runat="server" ID="myid" Checked='<%# DataBinder.Eval(Container.DataItem, "column").Equals(1) %>'> ``` I was wondering what other objects I have access to inside of that <%# %> tag. How come DataBinder.Eval() and Container.DataItem are ...
2008/10/09
[ "https://Stackoverflow.com/questions/185521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
Within <%# %> tags you have access to 1. Anything that is visible in your code-behind class (including protected methods and properties). 2. Anything declared on the aspx page using <@import @>. 3. Anything passed in as the event arguments when the ItemDataBound event is fired (e.g. RepeaterItemEventArgs, DataListIte...
Great example ``` <%#((System.Data.DataRow)Container.DataItem)["ColumnName"].ToString()%> ```
185,521
I run into similar codes like this all the time in aspx pages: ``` <asp:CheckBox Runat="server" ID="myid" Checked='<%# DataBinder.Eval(Container.DataItem, "column").Equals(1) %>'> ``` I was wondering what other objects I have access to inside of that <%# %> tag. How come DataBinder.Eval() and Container.DataItem are ...
2008/10/09
[ "https://Stackoverflow.com/questions/185521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088/" ]
Within <%# %> tags you have access to 1. Anything that is visible in your code-behind class (including protected methods and properties). 2. Anything declared on the aspx page using <@import @>. 3. Anything passed in as the event arguments when the ItemDataBound event is fired (e.g. RepeaterItemEventArgs, DataListIte...
using `<%# %>` actually means that code inside this block will execute when `page.DataBind()` method is being executed. Thus you can access anything at that point accessible as protected/public to that particular page/control.
27,701,178
When I need to update a table through a stored procedure I use something like the following for this which usually works for me (using SQL Server 2012): ``` UPDATE LogTable SET title = @title, summary = @summary, post = @post, departmentID = @departmentID WHERE postID = @postID ``` Ho...
2014/12/30
[ "https://Stackoverflow.com/questions/27701178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2571510/" ]
``` UPDATE A SET title = b.title, summary = b.summary, post = b.post, departmentID = b.departmentID FROM LogTable A JOIN (SELECT title=[Xml_Tab].[Cols].value('(title)[1]', 'nvarchar(100)'), summary=[Xml_Tab].[Cols].value('(summary)[1]', 'nvarchar(500)'), ...
If you have no performance issues you can use your initial code to update your log but simply fill your variables from new source like you wrote in your question: ``` SELECT @title = [Xml_Tab].[Cols].value('(title)[1]', 'nvarchar(100)'), @summary = [Xml_Tab].[Cols].value('(summary)[1]', 'nvarchar(500)'), ...
27,701,178
When I need to update a table through a stored procedure I use something like the following for this which usually works for me (using SQL Server 2012): ``` UPDATE LogTable SET title = @title, summary = @summary, post = @post, departmentID = @departmentID WHERE postID = @postID ``` Ho...
2014/12/30
[ "https://Stackoverflow.com/questions/27701178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2571510/" ]
``` UPDATE A SET title = b.title, summary = b.summary, post = b.post, departmentID = b.departmentID FROM LogTable A JOIN (SELECT title=[Xml_Tab].[Cols].value('(title)[1]', 'nvarchar(100)'), summary=[Xml_Tab].[Cols].value('(summary)[1]', 'nvarchar(500)'), ...
Try following query and check whether it is working or not: ``` UPDATE LogTable SET title = Temp.Cols.value('@title','nvarchar(100)'), summary = Temp.Cols.value('@summary', 'nvarchar(500)'), post = Temp.Cols.value('@post', 'nvarchar(max)'), departmentID = Temp.Cols.value('@departmentID', 'int') F...
27,701,178
When I need to update a table through a stored procedure I use something like the following for this which usually works for me (using SQL Server 2012): ``` UPDATE LogTable SET title = @title, summary = @summary, post = @post, departmentID = @departmentID WHERE postID = @postID ``` Ho...
2014/12/30
[ "https://Stackoverflow.com/questions/27701178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2571510/" ]
Try following query and check whether it is working or not: ``` UPDATE LogTable SET title = Temp.Cols.value('@title','nvarchar(100)'), summary = Temp.Cols.value('@summary', 'nvarchar(500)'), post = Temp.Cols.value('@post', 'nvarchar(max)'), departmentID = Temp.Cols.value('@departmentID', 'int') F...
If you have no performance issues you can use your initial code to update your log but simply fill your variables from new source like you wrote in your question: ``` SELECT @title = [Xml_Tab].[Cols].value('(title)[1]', 'nvarchar(100)'), @summary = [Xml_Tab].[Cols].value('(summary)[1]', 'nvarchar(500)'), ...
191,395
I was wondering if there is a bijection between unit quaternions and other rotation representations such as vector of rotation, Euler angles or rotation matrices. It seems to me this is not the case but I cannot find a theoretical arguments to prove this point. Thanks.
2012/09/05
[ "https://math.stackexchange.com/questions/191395", "https://math.stackexchange.com", "https://math.stackexchange.com/users/39425/" ]
No there isn't, since the unit quaternions $1$ and $-1$ both give the identity rotation.
In any method of representation, if you have chosen unique representations in terms of quaternions (or Euler angles, or rotation matrices,) then they correspond in a one-to-one way with rotations, and hence with each other. That is the meaning of "uniquely represented". Of couse in some of these systems, there is more...
3,545,384
I have developed an iPhone application which needs to access MySQL database on the server. It builds very well on 'iPhone simulator',but when I want to build 'Device' version, it fails with error messages bolow: ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file was built for i386 which is not the archite...
2010/08/23
[ "https://Stackoverflow.com/questions/3545384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/424714/" ]
``` using (SaveFileDialog dialog = new SaveFileDialog()) { dialog.Filter = "Text files|*.txt"; while(dialog.ShowDialog() == DialogResult.OK) if (System.IO.Path.GetExtension(dialog.FileName).ToLowerInvariant() != ".txt") MessageBox.Show("You must select a.txt file"); else // file is o...
I would suggest the following: ``` using (SaveFileDialog dialog = new SaveFileDialog()) { dialog.Filter = "Text files|*.txt"; while (true) { if (dialog.ShowDialog() == DialogResult.OK) { if (!System.IO.Path.GetExtension(dialog.FileName).Equals(".txt", StringComparison.InvariantCultureIgnor...
102,003
I have two question for the following sentence: "the attached document has 6 files ,if none of them suited what you are looking for let me know. " Q1: should i say the attached has 6 files or the attached have 6 files ? Q2: is it right to say "if none of them suited what you are looking for"?
2013/01/28
[ "https://english.stackexchange.com/questions/102003", "https://english.stackexchange.com", "https://english.stackexchange.com/users/36651/" ]
The attached....has is correct, because it is a singular item. And it's fine to say the second line that if none suit, to let you know.
"Has files" is correct. "The attached" is singular, not plural. It's irrelevant that the files are plural. "If none of them **are** suited to what you are looking for..."
21,936,196
I have hard time understanding how this callback is called: ``` $(function () { function getData(callback) { var now = Date.now(); var hour = 60 * 60 * 1000; var temperatures = []; for (var k = 24; k > 0; --k) { temperatures.push([now - k * hour,...
2014/02/21
[ "https://Stackoverflow.com/questions/21936196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385917/" ]
You are creating an object which has one property called `data` the value of which is an array (your temperature). This object is passed as the first parameter of callback. ``` getData(function (data) { $.plot("#chart", new Array(data)); }); ``` Here the object is being passed in as an argument called `data`. As w...
A callback is a way to say, "When you're done with what you're doing, call this method." JavaScript is single threaded, but it is asynchronous, so you may have some calls that finish before others. In these cases your code runs out of order. Callbacks are a way to ensure that a method calls another method when it's fi...
21,936,196
I have hard time understanding how this callback is called: ``` $(function () { function getData(callback) { var now = Date.now(); var hour = 60 * 60 * 1000; var temperatures = []; for (var k = 24; k > 0; --k) { temperatures.push([now - k * hour,...
2014/02/21
[ "https://Stackoverflow.com/questions/21936196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385917/" ]
You are creating an object which has one property called `data` the value of which is an array (your temperature). This object is passed as the first parameter of callback. ``` getData(function (data) { $.plot("#chart", new Array(data)); }); ``` Here the object is being passed in as an argument called `data`. As w...
> > So, the callback is just a another function and in it we are creating > a method? And assigning a tempretures array to it? > > > Kinda, the callback is a function, but you're not creating a method. You're calling a method and assigning the array to it. > > This part really confuses me. If "data" in the call...
417,536
What is the explicit formula for $A\_{n+1} = 0.90 \space A\_n$ where $A(5) = 1000$? I have no idea how to find the solution to this.
2013/06/11
[ "https://math.stackexchange.com/questions/417536", "https://math.stackexchange.com", "https://math.stackexchange.com/users/81958/" ]
Each time $n$ increases, you multiply by $0.9$ So $A\_n=1000\cdot 0.9^{n-5}$ You could change this to an exponent of $n$ if you want by changing the $1000$. Can you solve that?
$$A\_{n}=0.9A\_{n-1}=0.9^{2}A\_{n-2}=\cdots=0.9^{n-5}A\_{5}=0.9^{n-5}\cdot1000$$
50,508,192
I have a vector of sets which contain integers as given below: ``` std::vector<std::set<int> > vec = {{2,4},{1,3,8},{7,5}}; ``` Diagram illustration of the above vector of set ``` | 2 | 4 | | 1 | 3 | 8 | | 7 | 5 | ``` I need to traverse through each set elements of vector such that each set element in vect...
2018/05/24
[ "https://Stackoverflow.com/questions/50508192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9840407/" ]
As of October 2018, it seems like `UILabel` is the only class that has dynamic updation behaviors for accessibility built-in, in the form of the `adjustsFontForContentSizeCategory` boolean flag. If you set this flag to `true` on a `UILabel`, and set a dynamic type font for the label, the label will dynamically resize i...
In UIKit 14 the only ones components which support "Dynamic type" feature are * UILabel * UITextField * UITextview Also UILabels which are a part of the UINavigationBar, UIBarButtonItem and UITableViewCell use the Dynamic type out of the box. UIKit Components which still lacks the feature are: * UIButton * UISegeme...
17,570,463
I'm calling Shell.BrowseForFolder in VB.NET because I need to pass an arbitrary path in the rootFolder argument. So I instanciate an objet like this: ``` Dim shellType As Type = Type.GetTypeFromProgID("Shell.Application") Dim shell = Activator.CreateInstance(shellType) ``` Then I call: ``` Dim folder = shell.Browse...
2013/07/10
[ "https://Stackoverflow.com/questions/17570463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200443/" ]
only way for me to reproduce this issue under windows 7 64bits with vs 2012 is to have an invalid `rootFolder` like an empty string or crap data in that variable. can you do a breakpoint on that line: ``` Dim folder = shell.BrowseForFolder(0, message, &H241, rootFolder) ``` and check what is `rootFolder` ? foun...
You could always use folderBrowserDialog directly: ``` Dim f As New FolderBrowserDialog f.SelectedPath = "f:" f.ShowDialog() ``` Though I can't see how to get it to *only* show F:
70,315,215
``` SELECT (SELECT SUM(`m_amount`) FROM `tr10_project_payment` WHERE `m_project_id`=`plan_booking`.`plan_book_id`) AS Total_deposit, (CASE WHEN (`plan_booking`.`plan_type`=2 || `plan_booking`.`plan_type`=4) THEN (CASE WHEN DATE_ADD((SELECT GetMaturityDate(`plan_booking`.`plan_book_date`,`plan_booking`.`total_paid...
2021/12/11
[ "https://Stackoverflow.com/questions/70315215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8744309/" ]
try the query below ```sql SELECT SUM(`m_amount`) AS Total_deposit, (CASE WHEN (`plan_booking`.`plan_type`=2 || `plan_booking`.`plan_type`=4) THEN ( CASE WHEN DATE_ADD(( SELECT GetMaturityDate(`plan_booking`.`plan_book_date`,`plan_booking`.`total_paid_ins`,`plan_booking...
Some rewrites: ``` SELECT ( SELECT SUM(tpp.`m_amount`) FROM `tr10_project_payment` AS tpp WHERE tpp.`m_project_id` = pb.`plan_book_id` ) AS Total_deposit, IF ( pb.`plan_type` IN (2, 4), IF ( GetMaturityDate(pb.`plan_book_date`, ...
63,479,353
How to convert string list to 2d array The string is ``` ['43.417', '42.953', '43.417', '43.290', '43.105', '43.000', '43.105', '43.290', '42.426', '42.953', '42.837', '42.720'] -> [43.417, 42.953], [42.417, 43.105], [43.105, 43.000], ,,,, [42.837, 42.720] ```
2020/08/19
[ "https://Stackoverflow.com/questions/63479353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3329944/" ]
Another option is use range and slice (no need to import any module): ``` >>> list_ = ['a', 'b', 'c', 'd', 'e'] >>> [list_[i:i+2] for i in range(0, len(list_), 2)] [['a', 'b'], ['c', 'd'], ['e']] ```
So you want to group every 2 elements into a list and collect them all into a big list? If the number of elements in the list is even: ``` newList = [oldList[k * 2 : (k + 1) * 2] for k in range(len(oldList) // 2)] ``` ``` [1, 2, 3, 4] -> [[1, 2], [3, 4]] ``` If the number of elements is odd and you want to includ...
63,479,353
How to convert string list to 2d array The string is ``` ['43.417', '42.953', '43.417', '43.290', '43.105', '43.000', '43.105', '43.290', '42.426', '42.953', '42.837', '42.720'] -> [43.417, 42.953], [42.417, 43.105], [43.105, 43.000], ,,,, [42.837, 42.720] ```
2020/08/19
[ "https://Stackoverflow.com/questions/63479353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3329944/" ]
Another option is use range and slice (no need to import any module): ``` >>> list_ = ['a', 'b', 'c', 'd', 'e'] >>> [list_[i:i+2] for i in range(0, len(list_), 2)] [['a', 'b'], ['c', 'd'], ['e']] ```
If you have a list of strings, we can copy-n-paste, and make an array: ``` In [149]: alist = ['43.417', '42.953', '43.417', '43.290', '43.105', '43.000', '43.105', '43.290', '4 ...: 2.426', '42.953','42.837', '42.720'] In [150]: len(alist) ...
4,036,125
Is it possible to show the limit $\lim\limits\_{x\to0}x\ln(x)=0$ by expanding the corresponding Taylor series? --- **My approach:** I know that the Taylor series of $\ln(x)$ converges uniformly on a closed interval $(1-\delta,1+\delta)$ where $\delta>0$ is sufficiently small. So let be $$S\_n(x):=\sum\limits\_{k=1}...
2021/02/22
[ "https://math.stackexchange.com/questions/4036125", "https://math.stackexchange.com", "https://math.stackexchange.com/users/579544/" ]
It helps to keep in mind the geometric series $$\sum\_{k=0}^\infty (1-x)^k = \frac 1{1-(1-x)} = \frac 1x$$ which is valid for $x \in (0,2)$. You have that the Taylor expansion $$\ln x = \sum\_{k=1}^\infty \frac{(-1)^{k+1}}k(x-1)^k$$ is valid on the interval $(0,2)$ but is **not** uniform on any interval of the form $(0...
I'm surprised this question still didn't produce the answer the OP is missing (badly). First off: the Taylor series of $x\,\ln x$ around $x=1$ is indeed (correcting a typo from above) $$x-1+\sum^\infty\_{k=2}\frac{(-1)^k}{k\,(k-1)}\,(x-1)^k.\tag{1}$$ That can be done (as the OP did) by multiplying the known series for ...
62,091,445
I have a python script that has a line `with open('gg.csv') as csv_file:`, and I have a csv file called gg.csv in the exact same directory as the python file, but when I run the script I am getting `FileNotFoundError: [Errno 2] No such file or directory: 'gg.csv'` - does anyone know of the solution?
2020/05/29
[ "https://Stackoverflow.com/questions/62091445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11508332/" ]
This is probably beacuse you run the script from different directoy. For instance, if I have the following script at my Desktop: ``` import os print(os.getcwd()) ``` running the script from the Desktop I get: ``` ~/Desktop » py3 SO.py Sriker@Sriker-MBP /Users/Sriker/Desktop ...
Which os are you using?. Try with providing full url to your file and see if it works If you are using Windows, try renaming ``` open('gg.csv') ``` to ``` open('\gg.csv') ```
62,091,445
I have a python script that has a line `with open('gg.csv') as csv_file:`, and I have a csv file called gg.csv in the exact same directory as the python file, but when I run the script I am getting `FileNotFoundError: [Errno 2] No such file or directory: 'gg.csv'` - does anyone know of the solution?
2020/05/29
[ "https://Stackoverflow.com/questions/62091445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11508332/" ]
This is probably beacuse you run the script from different directoy. For instance, if I have the following script at my Desktop: ``` import os print(os.getcwd()) ``` running the script from the Desktop I get: ``` ~/Desktop » py3 SO.py Sriker@Sriker-MBP /Users/Sriker/Desktop ...
``` with open(r'gg.csv') as csv_file: ``` this may work otherwise use ``` df=pd.read_csv("gg.csv") ``` if the csv is in row and column format.
62,091,445
I have a python script that has a line `with open('gg.csv') as csv_file:`, and I have a csv file called gg.csv in the exact same directory as the python file, but when I run the script I am getting `FileNotFoundError: [Errno 2] No such file or directory: 'gg.csv'` - does anyone know of the solution?
2020/05/29
[ "https://Stackoverflow.com/questions/62091445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11508332/" ]
This is probably beacuse you run the script from different directoy. For instance, if I have the following script at my Desktop: ``` import os print(os.getcwd()) ``` running the script from the Desktop I get: ``` ~/Desktop » py3 SO.py Sriker@Sriker-MBP /Users/Sriker/Desktop ...
**tl;dr**: You are running your script in another directory. You are running it in another directory other than the main one. Basically, `"gg.csv"` in python has a relative path. For example, if I am in my home directory, (in Linux) this should correspond to the path of: ``` /home/<whatever username>/gg.csv ``` But...
42,973,984
I have an array that looks like this. I have a countries array containing objects with `name` and `code`. Given the country name I want to return the country code. ``` var countries = [ { name: 'United States', code: 'US' }, { name: 'Spain', code: 'ES' } ]; ``` I know I can do somethin...
2017/03/23
[ "https://Stackoverflow.com/questions/42973984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You should hide your website content while your blue div is showing ```js document.onreadystatechange = function() { var state = document.readyState if (state == 'complete') { setTimeout(function() { document.getElementById('interactive'); document.getElementById('load').style.visibility = "hi...
You can use as following. Hide the `overflow` property relates to `<body>` tag onload and re-enable it after page render. ```js document.onreadystatechange = function() { var state = document.readyState if (state == 'complete') { setTimeout(function() { document.getElementById('interactive'); ...
42,973,984
I have an array that looks like this. I have a countries array containing objects with `name` and `code`. Given the country name I want to return the country code. ``` var countries = [ { name: 'United States', code: 'US' }, { name: 'Spain', code: 'ES' } ]; ``` I know I can do somethin...
2017/03/23
[ "https://Stackoverflow.com/questions/42973984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You should hide your website content while your blue div is showing ```js document.onreadystatechange = function() { var state = document.readyState if (state == 'complete') { setTimeout(function() { document.getElementById('interactive'); document.getElementById('load').style.visibility = "hi...
You can achieve this effect through CSS alone, by using two `@keyframe` animations. **Working example:** ```css body { position: relative; height: 400vh; margin: 0; padding: 6px; animation: noScrollBar 3s linear; } .loading { position: absolute; display: block; top: 0; left: 0; z-index: 12; width: 0; h...
42,973,984
I have an array that looks like this. I have a countries array containing objects with `name` and `code`. Given the country name I want to return the country code. ``` var countries = [ { name: 'United States', code: 'US' }, { name: 'Spain', code: 'ES' } ]; ``` I know I can do somethin...
2017/03/23
[ "https://Stackoverflow.com/questions/42973984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You should hide your website content while your blue div is showing ```js document.onreadystatechange = function() { var state = document.readyState if (state == 'complete') { setTimeout(function() { document.getElementById('interactive'); document.getElementById('load').style.visibility = "hi...
You can use this Script ``` document.onreadystatechange = function() { var state = document.readyState if (state == 'complete') { setTimeout(function() { document.getElementById('interactive'); document.getElementById('load').style.visibility = "hidden"; document.getElementById('inner-content').st...
17,619,171
I cant seem to get the last right hand corners on the slideshow to round. <http://www.petrowestcorp.com/home/> ``` .squarespace-slideshow-wrapper { -webkit-border-top-right-radius: 5px!important; -moz-border-radius-topright: 5px!important; border-top-right-radius: 5px!important; } ```
2013/07/12
[ "https://Stackoverflow.com/questions/17619171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1850658/" ]
seems like it needs to be added to the `sf` selector ``` .squarespace-slideshow-animated-frame.type-fade .sf { border-top-right-radius:5px along with webkit and -moz obviously } ```
You should use a new `<div>` that wraps your `pageHeaderWrapper` and `pageBodyWrapper` and then put a `border-radius` on that div instead of specifying `border-radius` for 2 different divs, and specifying which corners should have `border-radius`. Like this: ``` <div id="content"> <div id="pageHeaderWrapper"> </d...
17,619,171
I cant seem to get the last right hand corners on the slideshow to round. <http://www.petrowestcorp.com/home/> ``` .squarespace-slideshow-wrapper { -webkit-border-top-right-radius: 5px!important; -moz-border-radius-topright: 5px!important; border-top-right-radius: 5px!important; } ```
2013/07/12
[ "https://Stackoverflow.com/questions/17619171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1850658/" ]
Your divs `header-slideshow` and `.squarespace-slideshow-wrapper` are both 980px wide but your page is only 960px thus you don't see the round corner up right. Set width to 960px on both divs and you will be fine.
You should use a new `<div>` that wraps your `pageHeaderWrapper` and `pageBodyWrapper` and then put a `border-radius` on that div instead of specifying `border-radius` for 2 different divs, and specifying which corners should have `border-radius`. Like this: ``` <div id="content"> <div id="pageHeaderWrapper"> </d...
418,646
The question is: > > Show or disprove that a graph with 7 vertices and 17 edges can have an isolated vertex. > > > I know what is an isolated vertex, but don't know how to connect it with the concrete question. Any hints?
2013/06/12
[ "https://math.stackexchange.com/questions/418646", "https://math.stackexchange.com", "https://math.stackexchange.com/users/82163/" ]
If you allow loops and/or multiple edges between vertices, then such a graph exists. Take $1$ vertex with $17$ loops, or two vertices with $17$ edges between them, and let the other vertices be isolated. Now assuming we are working with a simple graph (no loops, and no multiple edges), then no such graph exists. This ...
The following graph is a simple 7-vertex graph with an isolated vertex. It contains every possible edge subject to the constraint that it has an isolated vertex. ![A 7 vertex graph with an isolated vertex](https://i.stack.imgur.com/V2tk0.png) Any other 7-vertex graph with an isolated vertex would consequently be a su...
418,646
The question is: > > Show or disprove that a graph with 7 vertices and 17 edges can have an isolated vertex. > > > I know what is an isolated vertex, but don't know how to connect it with the concrete question. Any hints?
2013/06/12
[ "https://math.stackexchange.com/questions/418646", "https://math.stackexchange.com", "https://math.stackexchange.com/users/82163/" ]
I assume your graph can't have parallel edges or loops, otherwise statement is true since you can connect two arbitrary vertices with all the 17 edges and 5 vertices left are isolated. So in this case the maximum number of edges in undirected graph of n vertices is ${n \choose 2}$ (number of pairs of vertices). For $n...
The following graph is a simple 7-vertex graph with an isolated vertex. It contains every possible edge subject to the constraint that it has an isolated vertex. ![A 7 vertex graph with an isolated vertex](https://i.stack.imgur.com/V2tk0.png) Any other 7-vertex graph with an isolated vertex would consequently be a su...
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
the command '<<' you use, puts zeros for remaining bits. you can do like the following code: imagine you have 4 bit variable (like your example) called A. ``` A = 4'b0000; A = {A[2:0], 1'b1}; ``` with concatenation you can put one's instead of zeros. or you can use 'or' function for this issue: ``` A = (A << 1) ...
Would you be able to do something like: `(x << 1) + 1` or `(x << 1) | 1`
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
the command '<<' you use, puts zeros for remaining bits. you can do like the following code: imagine you have 4 bit variable (like your example) called A. ``` A = 4'b0000; A = {A[2:0], 1'b1}; ``` with concatenation you can put one's instead of zeros. or you can use 'or' function for this issue: ``` A = (A << 1) ...
x |= x<<1; // assumes x starts as 1
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
the command '<<' you use, puts zeros for remaining bits. you can do like the following code: imagine you have 4 bit variable (like your example) called A. ``` A = 4'b0000; A = {A[2:0], 1'b1}; ``` with concatenation you can put one's instead of zeros. or you can use 'or' function for this issue: ``` A = (A << 1) ...
We can use this, a = (1'b1 << count) - 1; Assign count to a value equal to the no.of 1's to be filled from LSB.
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
the command '<<' you use, puts zeros for remaining bits. you can do like the following code: imagine you have 4 bit variable (like your example) called A. ``` A = 4'b0000; A = {A[2:0], 1'b1}; ``` with concatenation you can put one's instead of zeros. or you can use 'or' function for this issue: ``` A = (A << 1) ...
To have the shift work with up to the number of bits the following example pre pads the input with 1's shifts then selects the MSBs: ``` localparam WIDTH = 4; // Create temp with 1's as padding wire [WIDTH*2 -1 :0] pad = {A, {4{1'b1}}}; wire [WIDTH*2 -1 :0] shift = pad << 1; // Select MSB with 1's shifted in wire [...
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
You could do this: ``` module ones_shift #(log2_width=2) (input [(2**log2_width)-1:0] A, input [log2_width:0] SHIFT, output [(2**log2_width)-1:0] As); wire [(2**log2_width)-1:0] Ai, Ais; assign Ai = ~A; assign Ais = Ai << SHIFT; assign As = ~Ais; endmodule ``` ie BITWISE INVERT -> LOGICAL SHIFT LEFT -> B...
``` function bit[31:0] cal_mask_value (int size); bit [31:0] mask_value; mask_value = 32'hFFFFFFFF << size; mask_value = ~mask_value; return mask_value; endfunction ```
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
You could do this: ``` module ones_shift #(log2_width=2) (input [(2**log2_width)-1:0] A, input [log2_width:0] SHIFT, output [(2**log2_width)-1:0] As); wire [(2**log2_width)-1:0] Ai, Ais; assign Ai = ~A; assign Ais = Ai << SHIFT; assign As = ~Ais; endmodule ``` ie BITWISE INVERT -> LOGICAL SHIFT LEFT -> B...
Would you be able to do something like: `(x << 1) + 1` or `(x << 1) | 1`
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
You could do this: ``` module ones_shift #(log2_width=2) (input [(2**log2_width)-1:0] A, input [log2_width:0] SHIFT, output [(2**log2_width)-1:0] As); wire [(2**log2_width)-1:0] Ai, Ais; assign Ai = ~A; assign Ais = Ai << SHIFT; assign As = ~Ais; endmodule ``` ie BITWISE INVERT -> LOGICAL SHIFT LEFT -> B...
We can use this, a = (1'b1 << count) - 1; Assign count to a value equal to the no.of 1's to be filled from LSB.
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
You could do this: ``` module ones_shift #(log2_width=2) (input [(2**log2_width)-1:0] A, input [log2_width:0] SHIFT, output [(2**log2_width)-1:0] As); wire [(2**log2_width)-1:0] Ai, Ais; assign Ai = ~A; assign Ais = Ai << SHIFT; assign As = ~Ais; endmodule ``` ie BITWISE INVERT -> LOGICAL SHIFT LEFT -> B...
To have the shift work with up to the number of bits the following example pre pads the input with 1's shifts then selects the MSBs: ``` localparam WIDTH = 4; // Create temp with 1's as padding wire [WIDTH*2 -1 :0] pad = {A, {4{1'b1}}}; wire [WIDTH*2 -1 :0] shift = pad << 1; // Select MSB with 1's shifted in wire [...
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
You could do this: ``` module ones_shift #(log2_width=2) (input [(2**log2_width)-1:0] A, input [log2_width:0] SHIFT, output [(2**log2_width)-1:0] As); wire [(2**log2_width)-1:0] Ai, Ais; assign Ai = ~A; assign Ais = Ai << SHIFT; assign As = ~Ais; endmodule ``` ie BITWISE INVERT -> LOGICAL SHIFT LEFT -> B...
x |= x<<1; // assumes x starts as 1
36,069,409
I'm trying to bit shift a value in verilog such that the replaced bits are 1's instead of 0's. i.e. I want to do `0001 << 1` such that it gives `0011` instead of `0010`
2016/03/17
[ "https://Stackoverflow.com/questions/36069409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3159146/" ]
the command '<<' you use, puts zeros for remaining bits. you can do like the following code: imagine you have 4 bit variable (like your example) called A. ``` A = 4'b0000; A = {A[2:0], 1'b1}; ``` with concatenation you can put one's instead of zeros. or you can use 'or' function for this issue: ``` A = (A << 1) ...
``` function bit[31:0] cal_mask_value (int size); bit [31:0] mask_value; mask_value = 32'hFFFFFFFF << size; mask_value = ~mask_value; return mask_value; endfunction ```
16,449,743
When you enable RavenDB's ['Period Backups' bundle](http://ravendb.net/docs/2.0/server/extending/bundles/periodic-backups), RavenDB does the following: 1. Backs up the entire database. 2. At every interval (or 'n' minutes), RavenDB makes an incremental backup (or delta backup) of all the changes that occurred since th...
2013/05/08
[ "https://Stackoverflow.com/questions/16449743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109941/" ]
From the [Raven.Backup utility documentation](http://ravendb.net/docs/server/administration/backup-restore): > > * incremental - Optional. When specified, the backup process will be incremental when done to a folder where a previous backup lies. **If dest is an empty folder, or it does not exist, a full backup will b...
I don't believe this is a supported scenario. RavenDB's Periodic Backup bundle is [intended to work with incremental updates](https://groups.google.com/forum/?fromgroups=#!topic/ravendb/sOdsTT9Q-TI), and AFAIK there's nothing to force a full update or make the bundle believe it's starting from a clean slate. If you ...
19,936,650
I'm trying to parse PayPal HTML emails to pick up the different items. For instance, there is a in which all the bought items are displayed, with their price, units and total. This is the `<table>` I'm trying to parse: ```html <table align="center" border="0" cellpadding="0" cellspacing="0" style="clear:both;color:#3...
2013/11/12
[ "https://Stackoverflow.com/questions/19936650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1334109/" ]
Use [**Nokogiri**](http://nokogiri.org/). I would do as below : ``` require 'nokogiri' doc = Nokogiri::HTML.parse <<-eot <table align="center" border="0" cellpadding="0" cellspacing="0" style="clear:both;color:#333!important;font-size:12px;font-family:arial,helvetica,sans-serif" width="598px"> <tbody> <tr> ...
Instead of using `match` You need to use `exec` method and repeat it with `while` loop. Use only short regex like this: ``` /item=(\d*?)\".*?€([\d\,]+) EUR/g ``` Hope it helps, but not in criminal activity.
10,296,118
I have several local html files and I want to show them in a table with static(for now) cells. Each UIWebView would have a different height (I dont want to have any scrolls in the UIWebView) so obviously each cell has a different height. Most of the comments i read discourage the usage of UIWebView in table cells. What...
2012/04/24
[ "https://Stackoverflow.com/questions/10296118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344237/" ]
UIWebview in tableview cells will affect the performance for sure. To display Html content in tableview cells you can use [NSAttributedString](https://stackoverflow.com/questions/4217820/convert-html-to-nsattributedstring-in-ios).
I used a `UIWebView` in an app to display content coming from the web as rows in a table view. I know that doing that is discouraged, due to the high memory use of `UIWebView`, but in my case it was not only a matter of displaying rich text: I had to display HTML loaded from the web, so I give that option a try. In sh...
31,862,748
I am running into issues working with a very large table from C# .Net 4.0. For reference the table has ~120 Million rows. I can't do even a simple query like ``` SELECT TOP(50) * FROM TableName WHERE CreatedOn < '2015-06-01'; ``` From code it will timeout (Default setting - 15 seconds I believe), but in SSMS ...
2015/08/06
[ "https://Stackoverflow.com/questions/31862748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5199267/" ]
`where_query` is *constructed* wrong. ``` >>> where_query = 'field_name' <= "{0}.format(year_range)" >>> where_query True >>> year_range = 2010 >>> where_query = "'field_name' <= {0}".format(year_range) >>> where_query "'field_name' <= 2010" >>> ``` I'm not familiar with `arcpy` if the single quotes around `field_n...
[Someone in the GIS StackExchange](https://gis.stackexchange.com/questions/157337/executeerror-error-000358-using-a-variable-within-arcpy-select-analysis?noredirect=1#157340) was able to help me using the below solution. ``` import os import arcpy in_feature = arcpy.GetParameterAsText(0) out_features = arcpy.GetPar...
1,237,324
> > **Possible Duplicate:** > > [What Should I Learn After PHP?](https://stackoverflow.com/questions/1148027/what-should-i-learn-after-php) > > > Ive been doing PHP for the past 2 years and I'm quite comfortable with it, I can do most things and I'm finding it harder to find challenges. Which is good I suppose...
2009/08/06
[ "https://Stackoverflow.com/questions/1237324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111669/" ]
It depends on what you want to do, you choose the right tool for the job. PHP is a fine choice for rapid web development. However, even if your day job requires you to stick with PHP, learning another language by doing some toy projects will actually improve the way you write PHP. Pick a language, try it out for a few...
What about participating in some kind of Open Source project ? Now that you have some experience, you would probably be able to help doing nice stuff ;-) It would also be a rewarding / interesting experience : * not working alone is often better -- you learn more stuff, and you are more motivated * working on a big O...
1,237,324
> > **Possible Duplicate:** > > [What Should I Learn After PHP?](https://stackoverflow.com/questions/1148027/what-should-i-learn-after-php) > > > Ive been doing PHP for the past 2 years and I'm quite comfortable with it, I can do most things and I'm finding it harder to find challenges. Which is good I suppose...
2009/08/06
[ "https://Stackoverflow.com/questions/1237324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111669/" ]
Take anything you hear about PHP with a pinch of salt. Whilst it can be used as a simple scripting language, you can write entire object-oriented web applications with it (PHP5 adds massively to this). PHP is my language of choice for many web projects - and not just because it's the one I know best, I've been using C...
What about participating in some kind of Open Source project ? Now that you have some experience, you would probably be able to help doing nice stuff ;-) It would also be a rewarding / interesting experience : * not working alone is often better -- you learn more stuff, and you are more motivated * working on a big O...
1,237,324
> > **Possible Duplicate:** > > [What Should I Learn After PHP?](https://stackoverflow.com/questions/1148027/what-should-i-learn-after-php) > > > Ive been doing PHP for the past 2 years and I'm quite comfortable with it, I can do most things and I'm finding it harder to find challenges. Which is good I suppose...
2009/08/06
[ "https://Stackoverflow.com/questions/1237324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111669/" ]
What about participating in some kind of Open Source project ? Now that you have some experience, you would probably be able to help doing nice stuff ;-) It would also be a rewarding / interesting experience : * not working alone is often better -- you learn more stuff, and you are more motivated * working on a big O...
It depends on why you want to move really. Are you looking to get past PHPs alleged flaws and produce better webapps, are you wanting to improve your programming ability/style/technique or do you want to learn a different style of programming? You probably only want to learn C if you intend to move away from web-devel...
1,237,324
> > **Possible Duplicate:** > > [What Should I Learn After PHP?](https://stackoverflow.com/questions/1148027/what-should-i-learn-after-php) > > > Ive been doing PHP for the past 2 years and I'm quite comfortable with it, I can do most things and I'm finding it harder to find challenges. Which is good I suppose...
2009/08/06
[ "https://Stackoverflow.com/questions/1237324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111669/" ]
It depends on what you want to do, you choose the right tool for the job. PHP is a fine choice for rapid web development. However, even if your day job requires you to stick with PHP, learning another language by doing some toy projects will actually improve the way you write PHP. Pick a language, try it out for a few...
It depends on why you want to move really. Are you looking to get past PHPs alleged flaws and produce better webapps, are you wanting to improve your programming ability/style/technique or do you want to learn a different style of programming? You probably only want to learn C if you intend to move away from web-devel...
1,237,324
> > **Possible Duplicate:** > > [What Should I Learn After PHP?](https://stackoverflow.com/questions/1148027/what-should-i-learn-after-php) > > > Ive been doing PHP for the past 2 years and I'm quite comfortable with it, I can do most things and I'm finding it harder to find challenges. Which is good I suppose...
2009/08/06
[ "https://Stackoverflow.com/questions/1237324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111669/" ]
Take anything you hear about PHP with a pinch of salt. Whilst it can be used as a simple scripting language, you can write entire object-oriented web applications with it (PHP5 adds massively to this). PHP is my language of choice for many web projects - and not just because it's the one I know best, I've been using C...
It depends on why you want to move really. Are you looking to get past PHPs alleged flaws and produce better webapps, are you wanting to improve your programming ability/style/technique or do you want to learn a different style of programming? You probably only want to learn C if you intend to move away from web-devel...
27,040
I'm currently putting together a mobile version of an existing site (Django-based) and there seems to be two ways of doing this. I can do one of two things: 1. Detect a mobile useragent and redirect the user from `http://www.example.com/page/awesome/` to `http://m.example.com/page/awesome/`, which serves up mobile-spe...
2012/03/09
[ "https://webmasters.stackexchange.com/questions/27040", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/13921/" ]
With the current trend towards [responsive design](http://en.wikipedia.org/wiki/Responsive_Web_Design) I think you'd be correct in your assumption that (2) is the best approach. The dividing line would be how you intend to manage the content. If you were placing different or modified content/resources on the mobile s...
With Google dragging their heels and sending mixed messages on this topic, Bing has come out in favour of the **1 URL to Rule Them All approach**: <http://www.bing.com/community/site_blogs/b/webmaster/archive/2012/03/07/building-websites-optimized-for-all-platforms-desktop-mobile-etc.aspx>
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
Hibernate cannot work without transaction. Preferred way to use a transaction manager. Easy way to just call ``` session.beginTransaction(); Criteria crit = session.createCriteria(); crit.list(); session.getTransaction().commit(); ```
If you missed out this line in your code please add before writing criteria query ``` Transaction tx = session.beginTransaction(); ``` finally ``` tx.commit(); ```
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
Hibernate cannot work without transaction. Preferred way to use a transaction manager. Easy way to just call ``` session.beginTransaction(); Criteria crit = session.createCriteria(); crit.list(); session.getTransaction().commit(); ```
DAO implementation beans are usually annotated with `@Repository`. In your case you are used a `@Component`. This stereotype doesn't have a transaction support. Communication with the database using Hibernate is made in the scope of transaction. An open current transaction is required to perform database operations. ...
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
Hibernate cannot work without transaction. Preferred way to use a transaction manager. Easy way to just call ``` session.beginTransaction(); Criteria crit = session.createCriteria(); crit.list(); session.getTransaction().commit(); ```
`getCurrentSession()` : Obtains the current session. Creates a new session, different from the contextual session `openSession()` : Returns: The created session.
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
Hibernate cannot work without transaction. Preferred way to use a transaction manager. Easy way to just call ``` session.beginTransaction(); Criteria crit = session.createCriteria(); crit.list(); session.getTransaction().commit(); ```
Steps needed : 1. Get session in this way : ``` Session session = HibernateUtil.getSessionFactory().getCurrentSession(); ``` 2. Intialize Transaction ``` Transaction tx = session.beginTransaction(); ``` 3. Write Criteria to fetch list from Database. 4. Close the initialized transaction. ``` tx.close(); ```
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
DAO implementation beans are usually annotated with `@Repository`. In your case you are used a `@Component`. This stereotype doesn't have a transaction support. Communication with the database using Hibernate is made in the scope of transaction. An open current transaction is required to perform database operations. ...
If you missed out this line in your code please add before writing criteria query ``` Transaction tx = session.beginTransaction(); ``` finally ``` tx.commit(); ```
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
DAO implementation beans are usually annotated with `@Repository`. In your case you are used a `@Component`. This stereotype doesn't have a transaction support. Communication with the database using Hibernate is made in the scope of transaction. An open current transaction is required to perform database operations. ...
`getCurrentSession()` : Obtains the current session. Creates a new session, different from the contextual session `openSession()` : Returns: The created session.
20,296,944
Anybody/Mentors/Guru can help me resolve this issue? I'm stuck for it more than 2 days Java code via annotation I got this error `createCriteria is not valid without active transaction` in Struts 2.3.15 & Spring 3.2.4 & Hibernate 4.2.5 Final Please see the detailed errors as following: ``` Struts Problem Report St...
2013/11/30
[ "https://Stackoverflow.com/questions/20296944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3051339/" ]
DAO implementation beans are usually annotated with `@Repository`. In your case you are used a `@Component`. This stereotype doesn't have a transaction support. Communication with the database using Hibernate is made in the scope of transaction. An open current transaction is required to perform database operations. ...
Steps needed : 1. Get session in this way : ``` Session session = HibernateUtil.getSessionFactory().getCurrentSession(); ``` 2. Intialize Transaction ``` Transaction tx = session.beginTransaction(); ``` 3. Write Criteria to fetch list from Database. 4. Close the initialized transaction. ``` tx.close(); ```
38,499,145
I'm trying to change the style of a `disabled input` using IE5 only. I tried the `[disabled]`, `:disabled` and `[disabled=disabled]` but not one is working. HTML INPUT: ``` <input type="submit" disabled="disabled" class="Button " id="ctl08_ctl02__wizard__btnPrevious" value="Back" onfocus="try{document.getElementById...
2016/07/21
[ "https://Stackoverflow.com/questions/38499145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6494361/" ]
Do you have a header file that is basically included by everything? Some kind of holder-of-all-fundamentals? If so, you can put this in there: ``` extern void NeverDefined(); inline int abs(int a) { NeverDefined(); return a; } // abs(int) ``` If you then get a linker error on `NeverDefined`, you'll know the...
Do you have the possibility to set mandatory Compiler flags at a central Location (common cmake includes or whatever other build system you use)? If so, you can create a header file as indicated by John and add a compile flag that will include the file at the beginning of any compilation unit: [MSVC](https://msdn.micr...
38,499,145
I'm trying to change the style of a `disabled input` using IE5 only. I tried the `[disabled]`, `:disabled` and `[disabled=disabled]` but not one is working. HTML INPUT: ``` <input type="submit" disabled="disabled" class="Button " id="ctl08_ctl02__wizard__btnPrevious" value="Back" onfocus="try{document.getElementById...
2016/07/21
[ "https://Stackoverflow.com/questions/38499145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6494361/" ]
Do you have a header file that is basically included by everything? Some kind of holder-of-all-fundamentals? If so, you can put this in there: ``` extern void NeverDefined(); inline int abs(int a) { NeverDefined(); return a; } // abs(int) ``` If you then get a linker error on `NeverDefined`, you'll know the...
As suggested in the same linked answer from your question: 1. `<math.h>` is responsible for `abs(int)` 2. `<cmath>` is responsible for `std::abs(double)` If you have a top-most header file then simply put below method: ``` template<typename T> void abs (T); ``` Hence, wherever there is an `abs` found, a **compiler...
38,499,145
I'm trying to change the style of a `disabled input` using IE5 only. I tried the `[disabled]`, `:disabled` and `[disabled=disabled]` but not one is working. HTML INPUT: ``` <input type="submit" disabled="disabled" class="Button " id="ctl08_ctl02__wizard__btnPrevious" value="Back" onfocus="try{document.getElementById...
2016/07/21
[ "https://Stackoverflow.com/questions/38499145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6494361/" ]
Do you have the possibility to set mandatory Compiler flags at a central Location (common cmake includes or whatever other build system you use)? If so, you can create a header file as indicated by John and add a compile flag that will include the file at the beginning of any compilation unit: [MSVC](https://msdn.micr...
As suggested in the same linked answer from your question: 1. `<math.h>` is responsible for `abs(int)` 2. `<cmath>` is responsible for `std::abs(double)` If you have a top-most header file then simply put below method: ``` template<typename T> void abs (T); ``` Hence, wherever there is an `abs` found, a **compiler...
431,010
I recently read [this article](http://www.foxnews.com/science/2018/09/26/if-extra-dimensions-do-exist-must-be-really-really-small.html) which claims that last year’s LIGO observation of gravitational waves is proof that, at least on massive scales, there cannot be more than three spatial dimensions. I don’t understan...
2018/09/26
[ "https://physics.stackexchange.com/questions/431010", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/143711/" ]
I’m the lead author of the paper. Thanks for being interested in the work! Your question is a good one. Really, our work can’t say anything about extra spatial dimensions if they’re not doing anything to gravity or light. As you correctly mention, we can only constrain higher dimensions where gravity is actually leakin...
I did not read the article and can not comment about it. But as a common sense, the inverse square law indicates there are only three spatial dimensions. If there were more, then we would have say inverse cube law of gravity as an example. Inverse square law applies to most spatial phenomena like EM forces, gravity,...
431,010
I recently read [this article](http://www.foxnews.com/science/2018/09/26/if-extra-dimensions-do-exist-must-be-really-really-small.html) which claims that last year’s LIGO observation of gravitational waves is proof that, at least on massive scales, there cannot be more than three spatial dimensions. I don’t understan...
2018/09/26
[ "https://physics.stackexchange.com/questions/431010", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/143711/" ]
I’m the lead author of the paper. Thanks for being interested in the work! Your question is a good one. Really, our work can’t say anything about extra spatial dimensions if they’re not doing anything to gravity or light. As you correctly mention, we can only constrain higher dimensions where gravity is actually leakin...
It doesn't disprove all possibilities for higher dimensions - technically, you can't really disprove something so broad because there's always another way to phrase it that will put it out of reach of existing experimental data. This is a common theme with science, and thus why that scientific claims and hypotheses hav...
431,010
I recently read [this article](http://www.foxnews.com/science/2018/09/26/if-extra-dimensions-do-exist-must-be-really-really-small.html) which claims that last year’s LIGO observation of gravitational waves is proof that, at least on massive scales, there cannot be more than three spatial dimensions. I don’t understan...
2018/09/26
[ "https://physics.stackexchange.com/questions/431010", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/143711/" ]
It doesn't disprove all possibilities for higher dimensions - technically, you can't really disprove something so broad because there's always another way to phrase it that will put it out of reach of existing experimental data. This is a common theme with science, and thus why that scientific claims and hypotheses hav...
I did not read the article and can not comment about it. But as a common sense, the inverse square law indicates there are only three spatial dimensions. If there were more, then we would have say inverse cube law of gravity as an example. Inverse square law applies to most spatial phenomena like EM forces, gravity,...
10,629
Yo nací en los años setenta y me casé en los noventa. > > Mis hijos nacieron en... > > > y ahora estamos en... > > > Sé que no hay una respuesta única, pero ¿qué forma cómoda y correcta recomiendan para denominar las dos primeras décadas de un siglo? ¿En algún país se solucionó este vacío? Y aprovecho de pregu...
2014/12/18
[ "https://spanish.stackexchange.com/questions/10629", "https://spanish.stackexchange.com", "https://spanish.stackexchange.com/users/6915/" ]
Pues supongo que "**en la primera/segunda década del siglo**" respectivamente. A partir de ahí ya puedes usar construcciones como "en los años veinte" o "en los (años) setenta". Tenemos el mismo problema para los años en las edades de las personas. Puedes decir que alguien tiene veintitantos o treinta y tantos años, p...
No hay problema, aunque sea menos común, llamar a los años en las primeras y segundas décadas de siglos como *los años cero* o *los años diez* Constan usos en [España](http://www.rtve.es/alacarta/audios/el-sotano/sotano-vivieron-murieron-decada-anos-cero-bandas-nacionales-primera-parte-06-01-10/661713/), [Colombia](ht...
22,611,372
I have 2 models: News and Uploadedfile ``` class News < ActiveRecord::Base has_many :uploadedfiles, as: :parent attr_accessible :title, :content, :author end class Uploadedfile < ActiveRecord::Base belongs_to :parent, polymorphic: true has_attached_file :url attr_accessible :url_file_name, :url_co...
2014/03/24
[ "https://Stackoverflow.com/questions/22611372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3260941/" ]
I think you have nested arribute `:uploadedfiles` ``` class News < ActiveRecord::Base has_many :uploadedfiles, as: :parent attr_accessible :title, :content, :author, :uploadedfiles_attributes accept_nested_attributes_for :uploadedfiles end ``` And in form : change: ``` <%= f.fields_for :uploadedfile, ...
I don't think you need polymorphic association here. Here is a more readable way of doing this: ``` class News < ActiveRecord::Base has_many :uploadedfiles attr_accessible :title, :content, :author accept_nested_attributes_for :uploadedfiles end class Uploadedfile < ActiveRecord::Base belongs_to :news...
17,098,807
I am trying to select multiple children when loading some data but I would like to put conditional statements around the includes. At the moment I have many different selects in different methods working with 1 specific grandparent object but would like to put them into one select in a ``` ShapeResults(this IQueryabl...
2013/06/13
[ "https://Stackoverflow.com/questions/17098807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234567/" ]
How about using [the conditional operator](http://msdn.microsoft.com/en-us/library/ty67wk28.aspx) like this? ``` var query = context.Grandparent.Select(i => new GrandparentObject { GrandparentProp1 = i.GrandparentProp1, Parents = includeParents ? i.Parents.Select(j => new ParentObject { ...
Adam, I've been working on something similar and would recommend something like this: ``` var query = context.Grandparent .Select(poco => new { poco = poco, parents = poco.Parents.Where(x => includeParents) ...
51,787,339
I was wondering when one would decide to resort to Reinforcement Learning to problems that have been previously tackled by mathematical optimisation methods - think the Traveling Salesman Problem or Job Scheduling or Taxi Sharing Problems. Since Reinforcement Learning aims at minimising/maximising a certain cost/rewar...
2018/08/10
[ "https://Stackoverflow.com/questions/51787339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2035894/" ]
In an attempt to get all the answers in one spot (and hopefully help a future searcher), you can connect to the SQL box that SQL Management Studio is installed on by changing the `Server name:` in the connection dialog [![enter image description here](https://i.stack.imgur.com/pUxFv.png)](https://i.stack.imgur.com/pUx...
May be this is familiar to many, but I believe new starters may find this helpful! As similar like above snapshot provided in the problem, I did not find MSSQLSERVER service is showing in SQL Server Configuration Manager. The reason is that I just installed the exe, but failed to do sql server setup actually! To make m...
51,787,339
I was wondering when one would decide to resort to Reinforcement Learning to problems that have been previously tackled by mathematical optimisation methods - think the Traveling Salesman Problem or Job Scheduling or Taxi Sharing Problems. Since Reinforcement Learning aims at minimising/maximising a certain cost/rewar...
2018/08/10
[ "https://Stackoverflow.com/questions/51787339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2035894/" ]
I could solve the same issue only with server name `(localdb)\MSSQLLocalDB`. Just FYI
May be this is familiar to many, but I believe new starters may find this helpful! As similar like above snapshot provided in the problem, I did not find MSSQLSERVER service is showing in SQL Server Configuration Manager. The reason is that I just installed the exe, but failed to do sql server setup actually! To make m...
68,743,491
It looks like Google Analytics 4 API doesn't offer reporting to the minutes. The closest I can see in the Query Explorer is Date + Hour. Is there a way to obtain data accurate to the minutes with GA4 reporting API?
2021/08/11
[ "https://Stackoverflow.com/questions/68743491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16641866/" ]
One workaround could be to capture the hit timestamp as a custom dimension. Here's an example: <https://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/#4-hit-timestamp> Note that link I shared sets up a custom dimension for Universal Analytics, not GA4. So for GA4 you would need to cap...
Not sure if there is a workaround but GA have said in April that they plan to add dateHourMinutes to GA4 API.
68,743,491
It looks like Google Analytics 4 API doesn't offer reporting to the minutes. The closest I can see in the Query Explorer is Date + Hour. Is there a way to obtain data accurate to the minutes with GA4 reporting API?
2021/08/11
[ "https://Stackoverflow.com/questions/68743491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16641866/" ]
Google Analytics 4 Data API added three new dimensions today: `dateHourMinute`, `minute`, and `nthMinute`. This [page](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) lists all dimensions and metrics available in the API. These dimensions are compatible with some but not all ...
Not sure if there is a workaround but GA have said in April that they plan to add dateHourMinutes to GA4 API.
65,257
Assuming I have a database column containing table names, how do I safely delete all of the tables it lists? The tables themselves are fairly simple - they may have indeces, but definitely don't contain other complex items (and don't have dependencies on other tables - ie, foreign keys into/out of them, etc...)
2014/05/16
[ "https://dba.stackexchange.com/questions/65257", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/37872/" ]
The error isn't caused by creating the index. The error is caused by `TRY_CAST` when the computed column values are evaluated at index creation. If I run this: ``` SELECT TRY_CAST(REPLICATE(CONVERT(nvarchar(MAX), N'a'), 4001) AS bigint) ``` I get the same error. The [documentation](http://technet.microsoft.com/en-...
If you have a string with a value that is too long, then the index create will fail. I tried a little test code using SQL Server 2012. ``` CREATE TABLE dbo.foo (ID bigint not null identity(1,1), SerializedValue nvarchar(max), LongValue as TRY_CAST(SerializedValue as bigint)); INSERT INTO dbo.foo (serializedvalue) VA...
59,772,934
My goal is to automate adding 10 rows to a Google Sheet used by a nonprofit organization's business and then replicate the formulas sequences needed in the newly created rows. I had all the code working to accomplish the task and prevent users from messing up the spreadsheet formulas when they manually insert rows. How...
2020/01/16
[ "https://Stackoverflow.com/questions/59772934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12725343/" ]
My answer is I have tenacity, I try to limit the variables one at a time to prove how things really work, moved the code that did work in the test script file to a production script file and it didn't work for copy of what I had in test, went back to the test script and it didn't work either, after it had... There are ...
Try this: ``` function getEOD() { var ss=SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var MyRange=ss.getRangeByName("EndData"); MyRange.activate(); } ```
46,444,758
I am a beginner in Python. I am using Python 2.7.3. I tried to read from Arabic text to do some processes on it for my program idea. but it prints unreadable output this is a script of my code: ``` >>> fname = open (r"C:\Python27\نجود.txt ", "rb") >>> text = fname.read() >>> print text ï»؟ط§ظ„ط³ظ„ط§ظ… ط¹ظ„ظٹظƒظ… ط£...
2017/09/27
[ "https://Stackoverflow.com/questions/46444758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4353150/" ]
Reading from a file will return a `str` which, in Python2, is an arbitrary byte string (which might be a UTF-8 encoded string of unicode characters, but it could also be binary data like the contents of a JPG file or similar). If you know that it is a UTF-8 encoded string of characters, you should *decode* it: ``` de...
First, you need to open the file in the right encoding. Arabic on Windows is usually `windows-1256` or sometimes it can be `utf-8`. For 2.7.3, make sure you are opening the file correctly: ``` import io with io.open(r"C:\Python27\نجود.txt ", "r", encoding="utf-8") as f: for line in f: print(line) ```
6,331,659
I need to create a history table for particular resource and am trying to decide how to design it. My current thought was to create a separate table for each instance of the resource and enter a new value whenever there is something to new add. Would that be quicker? Or should I try to put everything in one table and s...
2011/06/13
[ "https://Stackoverflow.com/questions/6331659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/705319/" ]
It seems like you are looking for [acts\_as\_audited](https://github.com/collectiveidea/acts_as_audited).
If the data logically belongs in one table, put it in one table. Don't prematurely vertically or horizontally partition your data unless you have a good reason.
6,331,659
I need to create a history table for particular resource and am trying to decide how to design it. My current thought was to create a separate table for each instance of the resource and enter a new value whenever there is something to new add. Would that be quicker? Or should I try to put everything in one table and s...
2011/06/13
[ "https://Stackoverflow.com/questions/6331659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/705319/" ]
It seems like you are looking for [acts\_as\_audited](https://github.com/collectiveidea/acts_as_audited).
If you have a history, it would be simple enough to have a table like... ``` history_id | resource_id | history_event 1 | 1 | created 2 | 1 | updated with silly info ``` With an index on `resource_id` it will be plenty fast. :)
70,289
So the packaging of Bio-Cultures Complex says that it contains a minimum of a billion viable organisms per capsule. How has such an estimate been drawn? Have they counted a smaller amount and then multiplied it?
2018/02/07
[ "https://biology.stackexchange.com/questions/70289", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/40559/" ]
It says a "a billion *viable* cells". The *viable* is important because it tells you that they employ a method that determines whether the cells are alive or dead. Most likely they did a simple colony count. The approach is simple, you take bacteria in suspension, serially dilute them in order to reduce the concentrat...
This more a question of Biology than Chemistry, but we have a similar problem when determining particle size distributions. The principle is always the same: the suspended particles or cells are passed through a capillary tube and than some measurement is done. This can be with light, an electrical field, etc. When a...
88,189
I am trying to understand the example game, cuboc. GitHub is <https://github.com/libgdx/libgdx-demo-cuboc>. I have generated my texture atlas but I do not understand the code that uses this texture atlas. Here's the code (you can see on github too [here](https://github.com/libgdx/libgdx-demo-cuboc/blob/master/core/src/...
2014/12/05
[ "https://gamedev.stackexchange.com/questions/88189", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/55165/" ]
From [the documentation](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/TextureRegion.html#split-int-int-): > > public TextureRegion[][] split(int tileWidth, > int tileHeight) > > > Helper function to create tiles out of this TextureRegion starting > from the top left corner goin...
this is easy way to create animations, you can add all animation images to one image and than use them separately , for example each image is 20x20 pixel and your animation contains 3 images so the big image will be 60x20 , and if you split it by 20 x20 pixel you can get all the images , and then put those images in an...
18,274,788
In the Following query where would I place `WITH(NOLOCK)`? ``` SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM dbo.VBsplit(@mnemonicList, ',')) a) b JOIN dct ...
2013/08/16
[ "https://Stackoverflow.com/questions/18274788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You should not put `NOLOCK` anywhere in that query. If you are trying to prevent readers from blocking writers, a much better alternative is `READ COMMITTED SNAPSHOT`. Of course, you should read about this, just like you should read about `NOLOCK` before blindly throwing it into your queries: * [Is the `NOLOCK` SQL Se...
Like this, to use the tidiest method. ``` SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM dbo.VBsplit(@mnemonicList,',')) a ) b JOIN dct ON dct.concept = b.concept WHERE b.geo = dct_variable.geo_rfa) c JOIN dct_rel z ON c.db_int = z.db_int) ...
18,274,788
In the Following query where would I place `WITH(NOLOCK)`? ``` SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM dbo.VBsplit(@mnemonicList, ',')) a) b JOIN dct ...
2013/08/16
[ "https://Stackoverflow.com/questions/18274788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You should not put `NOLOCK` anywhere in that query. If you are trying to prevent readers from blocking writers, a much better alternative is `READ COMMITTED SNAPSHOT`. Of course, you should read about this, just like you should read about `NOLOCK` before blindly throwing it into your queries: * [Is the `NOLOCK` SQL Se...
Since the question really is, "where should I put NOLOCK". I am not going do debate the use of OR reformat the query with better joins. I will just answer the question. **In no way am I intending to say this is the better way or to say that the other answers are bad. The other answer solve the actual problem. I'm just...
60,873,680
I am trying to use jQuery inside an Angular Elements web component with ShadowDom encapsulation and running into problems with internet explorer, specifically IE11. An error is triggered when resolving to the shadowRoot and then using the jQuery find method with a selector other than an ID. The error message is: ``` U...
2020/03/26
[ "https://Stackoverflow.com/questions/60873680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2120708/" ]
I found a workaround that works consistently on IE11 and Chrome. Putting the shadow DOM elements within a container div that has an ID allows for resolving to the container and finding the elements from that context. Here is the updated code: ``` <script> // Setup an element in the shadow dom var element = $('.par...
After using F12 developer tools to debug the javascript, we can see that the span is undefined. So, it will show the "Unable to get property 'length' of undefined or null reference" error. To solve this error, please try to find the span element from the "element" variable, instead of from the "shadowRoot". please che...
57,587,569
written case statements to get result again i need to compare the result column with Job\_Level column if Job\_Level contains any one value present in result then it should return true else false in new column (ExpectedOutput) ``` select Email, Job_Levels,Answer, case when answer = 'Assessor / Trainer' then 1 when ans...
2019/08/21
[ "https://Stackoverflow.com/questions/57587569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11026518/" ]
Edit: While this answer has been accepted, please note there are caveats to this solution. For a more fool-proof method please see @GuidoG's answer. I think you're looking for something like this: ``` SELECT Email , Job_Levels , Answer , result , CASE WHEN Job_Levels LIKE '%' + CO...
use this. note that if we dont use ',' before and after [co].[Job\_Levels] result may be incorrect. for example IDs 11,113 both appears true result in LIKE %11% Statement but 113 is not correct result. but my query using LIKE %,11,% and returns false for ,113, ``` SELECT co.* ,CASE WHEN Convert(varcha...
57,587,569
written case statements to get result again i need to compare the result column with Job\_Level column if Job\_Level contains any one value present in result then it should return true else false in new column (ExpectedOutput) ``` select Email, Job_Levels,Answer, case when answer = 'Assessor / Trainer' then 1 when ans...
2019/08/21
[ "https://Stackoverflow.com/questions/57587569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11026518/" ]
one option is to use the `CharIndex`function ``` declare @Job_Levels varchar(100) = '2,1,16' select case when charindex('16' + ',', @Job_Levels + ',') > 0 then 'true' else 'false' end ``` Note that I added an extra , just to make sure I dont get TRUE when looking for 1 and there is no 1 but there is 16. In other...
use this. note that if we dont use ',' before and after [co].[Job\_Levels] result may be incorrect. for example IDs 11,113 both appears true result in LIKE %11% Statement but 113 is not correct result. but my query using LIKE %,11,% and returns false for ,113, ``` SELECT co.* ,CASE WHEN Convert(varcha...
56,426
> > If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. > > > Find the sum of all the multiples of 3 or 5 below N. > > > ``` #include <stdio.h> int main(){ int i=0,j,k,l,sum=0; scanf("%d",&i); if(i<=100000&&i>0){ fo...
2014/07/08
[ "https://codereview.stackexchange.com/questions/56426", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/47849/" ]
Generally, try to think about the problem before brute-forcing it. Is there an easy way to sum all the multiples of 3 below \$N\$? Of course there is. First we note that the largest multiple of 3 is \$3 \* \lfloor\frac{N}{3}\rfloor\$ and the sum of all the multiples is then \$3 \* 1 + 3 \* 2 + ... 3 \* \lfloor\frac{...
You can solve it with one for loop. The % operator is predefined for numeric types to compute the remainder after division. So if the remainder after division is 0 then you can add "i" to "sum". ``` int sum = 0; for(int i = 1; i < 1000; i++) { int value1 = i%5 == 0?5:0; int value2 = i%3 == 0?3:0; sum += (valu...
56,426
> > If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. > > > Find the sum of all the multiples of 3 or 5 below N. > > > ``` #include <stdio.h> int main(){ int i=0,j,k,l,sum=0; scanf("%d",&i); if(i<=100000&&i>0){ fo...
2014/07/08
[ "https://codereview.stackexchange.com/questions/56426", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/47849/" ]
Generally, try to think about the problem before brute-forcing it. Is there an easy way to sum all the multiples of 3 below \$N\$? Of course there is. First we note that the largest multiple of 3 is \$3 \* \lfloor\frac{N}{3}\rfloor\$ and the sum of all the multiples is then \$3 \* 1 + 3 \* 2 + ... 3 \* \lfloor\frac{...
It's a very simple problem to get the answer. Just use the A.P and the answer will be: (sum of multiple of 3) + (sum of multiple of 5) - (sum of multiple of 15) Use this formula to calculate the sum = n(a + l) / 2, where n = number of terms. * a = first term * l = last term
56,426
> > If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. > > > Find the sum of all the multiples of 3 or 5 below N. > > > ``` #include <stdio.h> int main(){ int i=0,j,k,l,sum=0; scanf("%d",&i); if(i<=100000&&i>0){ fo...
2014/07/08
[ "https://codereview.stackexchange.com/questions/56426", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/47849/" ]
You can solve it with one for loop. The % operator is predefined for numeric types to compute the remainder after division. So if the remainder after division is 0 then you can add "i" to "sum". ``` int sum = 0; for(int i = 1; i < 1000; i++) { int value1 = i%5 == 0?5:0; int value2 = i%3 == 0?3:0; sum += (valu...
It's a very simple problem to get the answer. Just use the A.P and the answer will be: (sum of multiple of 3) + (sum of multiple of 5) - (sum of multiple of 15) Use this formula to calculate the sum = n(a + l) / 2, where n = number of terms. * a = first term * l = last term
1,106,699
I ran into a problem that I've never seen before and can't exactly explain. I was helping someone run a perl based install on a RedHad 4.6 zLinux and running under sudo seemed to grab the system perl rather than the fully qualified perl executable. Example: ``` /my/perl/bin> ./perl -v == 5.8.8 /my/perl/bin> /my/perl/...
2009/07/09
[ "https://Stackoverflow.com/questions/1106699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Our application is stateless (no session required), yet we had a situation where an app pool recycle caused invalidation of all machinekey-encrypted cookies on a server environment (above described issue). This was caused because the **machinekey changes with every recycle, which should not be the case**. > > The Aut...
Forms Authentication cookies have nothing to do with Session state.
1,106,699
I ran into a problem that I've never seen before and can't exactly explain. I was helping someone run a perl based install on a RedHad 4.6 zLinux and running under sudo seemed to grab the system perl rather than the fully qualified perl executable. Example: ``` /my/perl/bin> ./perl -v == 5.8.8 /my/perl/bin> /my/perl/...
2009/07/09
[ "https://Stackoverflow.com/questions/1106699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Internet Information Services (IIS) 7.0 (Windows Vista, Windows Server 2008) introduced application pool identity, a new isolation mechanism that helps provide increased security for servers that run ASP.NET applications. However, sites that are running under the application pool identity do not have access to the HKCU...
Forms Authentication cookies have nothing to do with Session state.
1,106,699
I ran into a problem that I've never seen before and can't exactly explain. I was helping someone run a perl based install on a RedHad 4.6 zLinux and running under sudo seemed to grab the system perl rather than the fully qualified perl executable. Example: ``` /my/perl/bin> ./perl -v == 5.8.8 /my/perl/bin> /my/perl/...
2009/07/09
[ "https://Stackoverflow.com/questions/1106699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Our application is stateless (no session required), yet we had a situation where an app pool recycle caused invalidation of all machinekey-encrypted cookies on a server environment (above described issue). This was caused because the **machinekey changes with every recycle, which should not be the case**. > > The Aut...
Internet Information Services (IIS) 7.0 (Windows Vista, Windows Server 2008) introduced application pool identity, a new isolation mechanism that helps provide increased security for servers that run ASP.NET applications. However, sites that are running under the application pool identity do not have access to the HKCU...
65,079,072
Using common crawl, is there a way I can download raw text from all pages of a particular domain (e.g., wisc.edu)? I am only interested in text for NLP purposes such as topic modeling.
2020/11/30
[ "https://Stackoverflow.com/questions/65079072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7426950/" ]
A nuance of ADO.NET is that if the value of a parameter is `null`, the parameter **is not added** (for input purposes, at least). As such, when adding - you should check for `null` and use `DbNull.Value` instead.
LasseV.Karlsen was correct in the comments; the parameters were not being passed to the ExecuteDataset(...) method. This is what worked for me: ``` using (SqlConnection batConnection = new SqlConnection(batConstr)) { string actualsQuery = "SELECT * FROM Budget WHERE CostCenter = @SelectedDepartment AND Ye...
70,969,937
playing around with Rails 7 and import maps. Trying to import a folder with some custom JS. ``` # config/importmap.rb pin_all_from "app/javascript/custom", under: "custom" # app/javascript/application.js import "custom" ``` Gives `Uncaught TypeError: Failed to resolve module specifier "custom"` on Chrome and `Uncau...
2022/02/03
[ "https://Stackoverflow.com/questions/70969937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10205462/" ]
I had this same problem and found the following solution: ``` # app/javascript/application.js import "custom/my_custom_code.js" ``` This means that `pin_all_from "app/javascript/custom", under: "custom"` is really just making each custom JS file available under the `custom` namespace. Therefore, you still need to im...
While this might still be a valid thing to do in some use cases, I think what I was trying to do was a bit of an anti-pattern in Rails 7. It is very easy to use Stimulus controllers instead. [Stimulus Handbook](https://stimulus.hotwired.dev/handbook/hello-stimulus) For reference For example, to dismiss an alert when...
59,128,771
I have 2 arrays. One is called x and has 30 image values. The other is a list of years that correspond to each of the image values in array x. I have 2 textboxes, in each I want to place a year. For example 1919 in one textbox and 1925 in the other box. What I want to happen is have all the images with the correspondin...
2019/12/01
[ "https://Stackoverflow.com/questions/59128771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464924/" ]
You can use [pandas.DataFrame.isnull](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.isnull.html#pandas.DataFrame.isnull) on the column with the missing values and remove the affected rows via [boolean indexing](https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html): ``` co...
> > to show just the rows that have data in that column > > > Just drop rows with missing values in particular subset of columns: ``` data = pd.read_csv(filenameAmexGold, names=colnames, header=None) data.dropna(subset=['AmexCategory']) ```
59,128,771
I have 2 arrays. One is called x and has 30 image values. The other is a list of years that correspond to each of the image values in array x. I have 2 textboxes, in each I want to place a year. For example 1919 in one textbox and 1925 in the other box. What I want to happen is have all the images with the correspondin...
2019/12/01
[ "https://Stackoverflow.com/questions/59128771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464924/" ]
> > to show just the rows that have data in that column > > > Just drop rows with missing values in particular subset of columns: ``` data = pd.read_csv(filenameAmexGold, names=colnames, header=None) data.dropna(subset=['AmexCategory']) ```
Not sure this is the best answer, but for now it gets me moving forward: data.fillna('', inplace=True) Pandas Doc: <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.fillna.html> StackOverflow: [Get pandas.read\_csv to read empty values as empty string instead of nan](https://stackoverflow...
59,128,771
I have 2 arrays. One is called x and has 30 image values. The other is a list of years that correspond to each of the image values in array x. I have 2 textboxes, in each I want to place a year. For example 1919 in one textbox and 1925 in the other box. What I want to happen is have all the images with the correspondin...
2019/12/01
[ "https://Stackoverflow.com/questions/59128771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464924/" ]
You can use [pandas.DataFrame.isnull](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.isnull.html#pandas.DataFrame.isnull) on the column with the missing values and remove the affected rows via [boolean indexing](https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html): ``` co...
Not sure this is the best answer, but for now it gets me moving forward: data.fillna('', inplace=True) Pandas Doc: <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.fillna.html> StackOverflow: [Get pandas.read\_csv to read empty values as empty string instead of nan](https://stackoverflow...