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
35,293
In Elder Scrolls: Oblivion, the player had to concern themselves with what level they chose to start and complete quests due to the quality of the reward being based on their level. Is this Level:Reward ratio still a part of the Elder Scrolls series in Skyrim?
2011/11/12
[ "https://gaming.stackexchange.com/questions/35293", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/14050/" ]
It is, at least for the Main Quest. When you fight enemies (specifically the Thalmor in Act 2 of the Main quest), at level 50+ (I'm at 62 when I fought them) they dropped Elven and Glass Armor. Enemies that wore heavy armor were dropping Ebony armor and ebony weapons.
Yes. Here is [proof](http://www.uesp.net/wiki/Skyrim:Leveled_Items) You can see that the same item at different levels of power have a minimum level to spawn, and different Item IDs.
35,293
In Elder Scrolls: Oblivion, the player had to concern themselves with what level they chose to start and complete quests due to the quality of the reward being based on their level. Is this Level:Reward ratio still a part of the Elder Scrolls series in Skyrim?
2011/11/12
[ "https://gaming.stackexchange.com/questions/35293", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/14050/" ]
It is, at least for the Main Quest. When you fight enemies (specifically the Thalmor in Act 2 of the Main quest), at level 50+ (I'm at 62 when I fought them) they dropped Elven and Glass Armor. Enemies that wore heavy armor were dropping Ebony armor and ebony weapons.
When you're in high levels, you will find stronger armor when looting. Bandits will just wear normal leather, fur, and iron armor unlike oblivion if you're in a high level. Thalmor soldiers will start to wear glass armor instead of Elven. The best way of getting these strong armors are not just to be in a high level, b...
416
Different kinds of problems involve transporting an amount $x$ from A to B which results in a cost $c(x)$ in the objective function. Traditionally, often linearized costs are used to get an easy, linear model. This might lead to unrealistic solutions if transport volumes are small. What are more realistic ways to mod...
2019/06/12
[ "https://or.stackexchange.com/questions/416", "https://or.stackexchange.com", "https://or.stackexchange.com/users/50/" ]
In my experience, there are two types of logistics modeling questions that require truck transportation costs. In the first, a shipper will operate a fleet of its own vehicles and would like to estimate costs. In such cases, it is usually important to model both fixed costs of using additional vehicles and the variab...
One common $c(x)$ function is a "cost per distance unit (mile/km)" like $2/mile, which is just distance-dependent. My 2 cents for more realistic cost functions: **For distance-dependent costs:** * Use a different distance function. If you are using linear distance (Euclidean or Manhattan), replace it with a better ap...
59,115,504
Basically, I want to add a title and subtitle to a grid.arrange() plot. I have `plot_list` which is a list of 15 ggplots and ``` tg <- textGrob('Title', gp = gpar(fontsize = 13, fontface = 'bold')) sg <- textGrob('Subtitle', gp = gpar(fontsize = 10)) ``` But this doesn't work. I don't get any errors but `tg` and `s...
2019/11/30
[ "https://Stackoverflow.com/questions/59115504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11984052/" ]
Following [changing multiple line title in multiplot ggplot2 using grid.arrange](https://stackoverflow.com/questions/31630020/changing-multiple-line-title-in-multiplot-ggplot2-using-grid-arrange) I could do what you asked for by creating two grids, first with only the plots and second with title, subtitle and the first...
You need to combine tg, sg and your plots into a list. I would specify a layout matrix, which gives you a bit more control, and plot using grid.arrange: First, we have tg,sg and I make a plot\_list of 3 with mtcars. ``` library(ggplot2) library(gridExtra) library(grid) tg <- textGrob('Title', gp = gpar(fontsize = 13...
59,115,504
Basically, I want to add a title and subtitle to a grid.arrange() plot. I have `plot_list` which is a list of 15 ggplots and ``` tg <- textGrob('Title', gp = gpar(fontsize = 13, fontface = 'bold')) sg <- textGrob('Subtitle', gp = gpar(fontsize = 10)) ``` But this doesn't work. I don't get any errors but `tg` and `s...
2019/11/30
[ "https://Stackoverflow.com/questions/59115504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11984052/" ]
Following [changing multiple line title in multiplot ggplot2 using grid.arrange](https://stackoverflow.com/questions/31630020/changing-multiple-line-title-in-multiplot-ggplot2-using-grid-arrange) I could do what you asked for by creating two grids, first with only the plots and second with title, subtitle and the first...
the `top` argument can take any grob but it needs to know its height to be given the right space, ``` library(grid) library(gridExtra) lg <- replicate(12, ggplot2::ggplot(), simplify = FALSE) tg <- textGrob('Title', gp = gpar(fontsize = 50, fontface = 'bold')) sg <- textGrob('Subtitle', gp = gpar(fontsize = 10)) lt ...
59,115,504
Basically, I want to add a title and subtitle to a grid.arrange() plot. I have `plot_list` which is a list of 15 ggplots and ``` tg <- textGrob('Title', gp = gpar(fontsize = 13, fontface = 'bold')) sg <- textGrob('Subtitle', gp = gpar(fontsize = 10)) ``` But this doesn't work. I don't get any errors but `tg` and `s...
2019/11/30
[ "https://Stackoverflow.com/questions/59115504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11984052/" ]
You need to combine tg, sg and your plots into a list. I would specify a layout matrix, which gives you a bit more control, and plot using grid.arrange: First, we have tg,sg and I make a plot\_list of 3 with mtcars. ``` library(ggplot2) library(gridExtra) library(grid) tg <- textGrob('Title', gp = gpar(fontsize = 13...
the `top` argument can take any grob but it needs to know its height to be given the right space, ``` library(grid) library(gridExtra) lg <- replicate(12, ggplot2::ggplot(), simplify = FALSE) tg <- textGrob('Title', gp = gpar(fontsize = 50, fontface = 'bold')) sg <- textGrob('Subtitle', gp = gpar(fontsize = 10)) lt ...
26,016,105
I have a simple `KeyboardAdjuster` class that is a property of my form views. If one of the form fields is hidden by the keyboard, then entering that field will have an animation to move the whole frame's `origin.y` up, so that the field appears above the keyboard. A very common approach. It also has a few complexities...
2014/09/24
[ "https://Stackoverflow.com/questions/26016105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404201/" ]
I have a different solution for you which works on both iOS 7 & 8 and Auto Layout. In my example I have two UITextFields which I move and hide depending on their position and the position of the keyboard. In this particular case, I switch the UITextFields between them and hide the inactive one. In `viewDidLoad` you r...
Here's the solution, posting in case it helps someone. I mentioned above that I'm using UIView containment, so I have a root view controller that: * Contains a UINavigationController (the root view is replaceable). * Contains a Menu Controller (dealloc'd when not in use) * Presents an overlay with custom animation ...
55,383,665
So I have this big messy component, I will try to slim it down, however keep most of it since I am unsure at this point what could be cause. The issue is, that the game works as expected. When it is time for the modal to render, it appears at the bottom left of the page, with no styling floating left. The functionalit...
2019/03/27
[ "https://Stackoverflow.com/questions/55383665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8766350/" ]
As I understand that current style you have doesn't like example of Antd. Missing is you didn't import styles of Antd like this. ``` import { Modal, Button } from "antd"; import "antd/dist/antd.css"; ``` Just need import style you will have what you need. You can check my example here <https://codesandbox.io/embed/8...
``` <Modal title="Basic Modal" centered="true" visible={this.state.visible} onOk={this.handleOk} onCancel={this.handleCancel}></Modal> ``` You do not need to wrap the `"true"` in brackets here as you are not calling a variable.
112,038
Is there a convention for the spelling of the name of the main page of a website? Should it be *home page*, with a space between the two words; or *homepage*, all one word?
2013/04/21
[ "https://english.stackexchange.com/questions/112038", "https://english.stackexchange.com", "https://english.stackexchange.com/users/41639/" ]
"Home page" was used first, but "homepage" followed soon after, is also acceptable and I prefer. * *Homepage* was used to refer to the main page of a website as early as July 1993. * *Home page* was used to refer to the main page of a website as early as September 1992. + The first web browser was only written (by ...
*Home page* vs *homepage* falls into the same category as *website* and *Web site* as well as *motor home* and *motorhome*. Originally, the words *homepage*, *website*, and *motorhome* did not exist, but after so much usage over the years it has become acceptable to combine the two words into one. In other words, eith...
112,038
Is there a convention for the spelling of the name of the main page of a website? Should it be *home page*, with a space between the two words; or *homepage*, all one word?
2013/04/21
[ "https://english.stackexchange.com/questions/112038", "https://english.stackexchange.com", "https://english.stackexchange.com/users/41639/" ]
*Home page* vs *homepage* falls into the same category as *website* and *Web site* as well as *motor home* and *motorhome*. Originally, the words *homepage*, *website*, and *motorhome* did not exist, but after so much usage over the years it has become acceptable to combine the two words into one. In other words, eith...
The poster mentions Merriam-Webster's in a comment responding to Hugo's excellent answer: > > It's also interesting that none of the answers referred to Merriam-Webster's, which uses home page. I thought it's considered an authoritative source of English language, besides the OED. > > > I should note first that M...
112,038
Is there a convention for the spelling of the name of the main page of a website? Should it be *home page*, with a space between the two words; or *homepage*, all one word?
2013/04/21
[ "https://english.stackexchange.com/questions/112038", "https://english.stackexchange.com", "https://english.stackexchange.com/users/41639/" ]
"Home page" was used first, but "homepage" followed soon after, is also acceptable and I prefer. * *Homepage* was used to refer to the main page of a website as early as July 1993. * *Home page* was used to refer to the main page of a website as early as September 1992. + The first web browser was only written (by ...
The poster mentions Merriam-Webster's in a comment responding to Hugo's excellent answer: > > It's also interesting that none of the answers referred to Merriam-Webster's, which uses home page. I thought it's considered an authoritative source of English language, besides the OED. > > > I should note first that M...
29,251,589
I would like to change text to input text by clicking on it : Currently I've: ``` <div class="wrapper"> <span class="text-content">Double Click On Me!</span> </div> ``` And in javascript: ``` //plugin to make any element text editable $.fn.extend({ editable: function () { $(this).each(function () { ...
2015/03/25
[ "https://Stackoverflow.com/questions/29251589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4651311/" ]
When you just change `$el.dblclick` to `$el.click` it will also handled with `$(document).click(submitChanges);` event. So `$el.click` handler should return `false` to stop further event processing. ``` $el.click(function (e) { // <---------- click tempVal = $el.html(); $edittextbox.val(tempVal).insertBefore(this)...
You may use the [`contenteditable`](http://www.w3schools.com/tags/att_global_contenteditable.asp) attribute of html ```js var initialContent = $('.text-content').html(); $('.text-content') .on('blur', function(){ if(initialContent != $(this).html()) alert($(this).text()); if($(this).html() == ''){ ...
131,327
I would like to ask if is it possible to make an interactive 3d house interior in blender or will I need another program to pair with blender? Thank you.
2019/02/10
[ "https://blender.stackexchange.com/questions/131327", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/68925/" ]
If you're using Blender < 2.7x you could do it with Game Engine.
Its genuine to ask such type of question, because every one has the doubt on any free thing/software that if it has a capability to do complex work or not. > > I would like to ask if is it possible to make an interactive 3d house > interior in blender or will I need another program to pair with > blender? > > > ...
47,829,721
I need an regex to find `<Field ...name="document">` or `<FieldArray ...name="document">` to replace with an empty string. They can be defined across multiple lines. This is not html or xhtml, it's just a text string containing `<Field>` and `<FieldArray>` Example with Field: ``` <Field component={Form...
2017/12/15
[ "https://Stackoverflow.com/questions/47829721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8055073/" ]
It is not advisable to [parse [X]HTML with regex](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454). If you have a possibility to use a domparser, I would advise using that instead of regex. If there is no other way, you could this approach to find and ...
You can parse HTML tags with regex because parsing the *tags* themselves are nothing special and are the first thing parsed as an atomic operation. But, you can't use regex to go beyond the atomic tag. For example, you can't find the balanced tag closing to match the open as this would put a tremendous strain o...
47,829,721
I need an regex to find `<Field ...name="document">` or `<FieldArray ...name="document">` to replace with an empty string. They can be defined across multiple lines. This is not html or xhtml, it's just a text string containing `<Field>` and `<FieldArray>` Example with Field: ``` <Field component={Form...
2017/12/15
[ "https://Stackoverflow.com/questions/47829721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8055073/" ]
It is not advisable to [parse [X]HTML with regex](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454). If you have a possibility to use a domparser, I would advise using that instead of regex. If there is no other way, you could this approach to find and ...
Here's an answer with actual XML parsing and no regular expressions: ```js var xml = document.createElement("xml"); xml.innerHTML = ` <Field name="amount" component={FormField} label={t('form.amount')} /> <FieldDistractor component={FormField} name="do...
47,829,721
I need an regex to find `<Field ...name="document">` or `<FieldArray ...name="document">` to replace with an empty string. They can be defined across multiple lines. This is not html or xhtml, it's just a text string containing `<Field>` and `<FieldArray>` Example with Field: ``` <Field component={Form...
2017/12/15
[ "https://Stackoverflow.com/questions/47829721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8055073/" ]
Here's an answer with actual XML parsing and no regular expressions: ```js var xml = document.createElement("xml"); xml.innerHTML = ` <Field name="amount" component={FormField} label={t('form.amount')} /> <FieldDistractor component={FormField} name="do...
You can parse HTML tags with regex because parsing the *tags* themselves are nothing special and are the first thing parsed as an atomic operation. But, you can't use regex to go beyond the atomic tag. For example, you can't find the balanced tag closing to match the open as this would put a tremendous strain o...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Yes, it is possible to declare a method as `final`. That will mean that a method cannot be overridden by its subclasses. From [The Java Language Specifications, Third Edition](http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html), [Section 8.4.3.3](http://java.sun.com/docs/books/jls/third_edition/html/clas...
yes, final keyword can be used for a method. It will preserve the immutability. it prevents between methods from being broken. For example, suppose the implementation of some method of class X assumes that method M will behave in a certain way. Declaring X or M as final will prevent derived classes from redefining M in...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Yes. You can make a method final ``` public class A { public static final void f() { System.out.println("test"); } } ``` There are typically two reasons for making a method final 1. When a method is final, it "may" be inlined. 2. When a method is final, the method is impossible to override.
Sure, check out [The Final Word on the Final Keyword](http://renaud.waldura.com/doc/java/final-keyword.shtml) ``` public abstract class AbstractBase { public final void performOperation() // cannot be overridden { prepareForOperation(); doPerformOperation(); } protected abstract ...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Absolutely! The `final` keyword can be applied to just about anything, in each case meaning "you don't get to change this anymore." Here's what it means when applied to... **a variable**: You simply cannot assign the variable a new value (rendering it a *constant*, of course) **a method**: You cannot re-implement (...
Sure, check out [The Final Word on the Final Keyword](http://renaud.waldura.com/doc/java/final-keyword.shtml) ``` public abstract class AbstractBase { public final void performOperation() // cannot be overridden { prepareForOperation(); doPerformOperation(); } protected abstract ...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Absolutely! The `final` keyword can be applied to just about anything, in each case meaning "you don't get to change this anymore." Here's what it means when applied to... **a variable**: You simply cannot assign the variable a new value (rendering it a *constant*, of course) **a method**: You cannot re-implement (...
As a note to the other answers. You **can** use final. In practice I rarely see people using it and I'm not sure why. A lot of the code I write these days is intended for multi-threaded environments and I tend to make the class final an immutable (if its a value class) so that it is threadsafe. The problem with marki...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Sure can. Making it impossible to override.
As a note to the other answers. You **can** use final. In practice I rarely see people using it and I'm not sure why. A lot of the code I write these days is intended for multi-threaded environments and I tend to make the class final an immutable (if its a value class) so that it is threadsafe. The problem with marki...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Absolutely! The `final` keyword can be applied to just about anything, in each case meaning "you don't get to change this anymore." Here's what it means when applied to... **a variable**: You simply cannot assign the variable a new value (rendering it a *constant*, of course) **a method**: You cannot re-implement (...
Sure can. Making it impossible to override.
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Yes. You can make a method final ``` public class A { public static final void f() { System.out.println("test"); } } ``` There are typically two reasons for making a method final 1. When a method is final, it "may" be inlined. 2. When a method is final, the method is impossible to override.
yes, final keyword can be used for a method. It will preserve the immutability. it prevents between methods from being broken. For example, suppose the implementation of some method of class X assumes that method M will behave in a certain way. Declaring X or M as final will prevent derived classes from redefining M in...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Yes, it is possible to declare a method as `final`. That will mean that a method cannot be overridden by its subclasses. From [The Java Language Specifications, Third Edition](http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html), [Section 8.4.3.3](http://java.sun.com/docs/books/jls/third_edition/html/clas...
Sure, check out [The Final Word on the Final Keyword](http://renaud.waldura.com/doc/java/final-keyword.shtml) ``` public abstract class AbstractBase { public final void performOperation() // cannot be overridden { prepareForOperation(); doPerformOperation(); } protected abstract ...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Sure can. Making it impossible to override.
Sure, check out [The Final Word on the Final Keyword](http://renaud.waldura.com/doc/java/final-keyword.shtml) ``` public abstract class AbstractBase { public final void performOperation() // cannot be overridden { prepareForOperation(); doPerformOperation(); } protected abstract ...
1,351,568
Can final keyword be used for a method?
2009/08/29
[ "https://Stackoverflow.com/questions/1351568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165370/" ]
Yes, it is possible to declare a method as `final`. That will mean that a method cannot be overridden by its subclasses. From [The Java Language Specifications, Third Edition](http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html), [Section 8.4.3.3](http://java.sun.com/docs/books/jls/third_edition/html/clas...
As a note to the other answers. You **can** use final. In practice I rarely see people using it and I'm not sure why. A lot of the code I write these days is intended for multi-threaded environments and I tend to make the class final an immutable (if its a value class) so that it is threadsafe. The problem with marki...
4,747,397
I have two classes A and B and A is base class of B. I read that all methods in Python are virtual. So how do I call a method of the base because when I try to call it, the method of the derived class is called as expected? ``` >>> class A(object): def print_it(self): print 'A' >>> class B(A): def ...
2011/01/20
[ "https://Stackoverflow.com/questions/4747397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225312/" ]
Using [super](http://docs.python.org/library/functions.html#super): ``` >>> class A(object): ... def print_it(self): ... print 'A' ... >>> class B(A): ... def print_it(self): ... print 'B' ... >>> x = B() >>> x.print_it() # calls derived class method as expected B >>> s...
Two ways: ``` >>> A.print_it(x) 'A' >>> super(B, x).print_it() 'A' ```
4,747,397
I have two classes A and B and A is base class of B. I read that all methods in Python are virtual. So how do I call a method of the base because when I try to call it, the method of the derived class is called as expected? ``` >>> class A(object): def print_it(self): print 'A' >>> class B(A): def ...
2011/01/20
[ "https://Stackoverflow.com/questions/4747397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225312/" ]
Using [super](http://docs.python.org/library/functions.html#super): ``` >>> class A(object): ... def print_it(self): ... print 'A' ... >>> class B(A): ... def print_it(self): ... print 'B' ... >>> x = B() >>> x.print_it() # calls derived class method as expected B >>> s...
Simple answer: ``` super().print_it() ```
4,747,397
I have two classes A and B and A is base class of B. I read that all methods in Python are virtual. So how do I call a method of the base because when I try to call it, the method of the derived class is called as expected? ``` >>> class A(object): def print_it(self): print 'A' >>> class B(A): def ...
2011/01/20
[ "https://Stackoverflow.com/questions/4747397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225312/" ]
Two ways: ``` >>> A.print_it(x) 'A' >>> super(B, x).print_it() 'A' ```
Simple answer: ``` super().print_it() ```
48,241,903
I want to automatically determine length in bytes of a field (`addr`) that is `uint32`, based on it's contents. Compiler is GCC. I use this: ``` uint8 len; if(addr < 256) len = 1; else if (addr < 65536) len = 2; else if (addr < 16777216) len = 3; else len = 4; ``` Is there a more efficient way? This is inside a SP...
2018/01/13
[ "https://Stackoverflow.com/questions/48241903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1734108/" ]
You can do it using an approach similar to binary search: first compare to `65536`, then either to 256 or 16777216, depending on the outcome of the first comparison. This way you always finish in two comparisons, while your code sometimes would require three: ``` uint8 len = (addr < 65536) ? ((addr < 256) ? 1...
gcc has a `__builtin_ctz()` function which can be used like ``` if (addr == 0) len = 0; else len = (sizeof(int) * 8 - __builtin_ctz(addr) + 7) / 8; ``` Update: under ARM, this compiles to ``` cmp r0, #0 rbitne r0, r0 clzne r0, r0 rsbne r0, r0, #39 lsrne r0, r0, #3 bx ...
48,241,903
I want to automatically determine length in bytes of a field (`addr`) that is `uint32`, based on it's contents. Compiler is GCC. I use this: ``` uint8 len; if(addr < 256) len = 1; else if (addr < 65536) len = 2; else if (addr < 16777216) len = 3; else len = 4; ``` Is there a more efficient way? This is inside a SP...
2018/01/13
[ "https://Stackoverflow.com/questions/48241903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1734108/" ]
You can do it using an approach similar to binary search: first compare to `65536`, then either to 256 or 16777216, depending on the outcome of the first comparison. This way you always finish in two comparisons, while your code sometimes would require three: ``` uint8 len = (addr < 65536) ? ((addr < 256) ? 1...
Get the position of the highest bit – the only one that counts for your question (from <https://stackoverflow.com/a/14085901>). Divide by 8 to get the number of bytes. ``` addr = 0x20424; printf ("%d\n", (fls(addr)+7)>>3); ``` It returns `0` when `addr == 0`. `fls` is conforming to POSIX.1-2001, POSIX.1-2008, 4.3BS...
2,860
First question here (i'm usually on StackOverflow)...not sure if the right place (if not, please vote to move where it belongs). If we have a dev process using traditional [GitFlow](https://datasift.github.io/gitflow/IntroducingGitFlow.html) approach, what criteria should be met before a Pull Request (PR) is opened? S...
2017/12/11
[ "https://devops.stackexchange.com/questions/2860", "https://devops.stackexchange.com", "https://devops.stackexchange.com/users/5667/" ]
The guidance that we've always followed in my various scrum teams is developers should get what they've got into testing as soon as possible. It may mean a little rework later on down the line if there are issues found in code reviews or developers haven't completely finished coding, but the earlier developers get feed...
> > Open the PR, even if it's not ready. Basically, allow the QA testing & code reviews to operate in parallel. Pros: code review and testing can operate in parallel. Cons: if issues are found in testing, the code needs to change, even though it has already been reviewed. > > > When code review prompts changes, te...
18,843,525
I have added a test target for my project, now I want to separate parts of the code that will not be executed on the app target. Let's say the app called `TestMyApp` and I want it to be something like: ``` -(void)addDevice:(Account*)account{ NSURL *url = [NSURL URLWithString:K_THINKERBELL_SERVER_URL]; AFHTTPClient *ht...
2013/09/17
[ "https://Stackoverflow.com/questions/18843525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/923290/" ]
Go to Target, Preprocessing section. In "Preprocessor macros" you can add defines for any scheme. For example: ``` TESTING=1 ``` Then you can write ``` #ifdef TESTING ... #endif ``` or ``` #if TESTING ... #endif ```
Create two pch file and add these to each of the target created. Now define some const string and based on that handle the code changes.
47,130,531
I'm pretty new to ruby on rails . I need to pass data from the view to create method in controller. ``` *view* function setDeliveryDetails () { var all_del_rate= $('#all_dr').val(); var all_del_period= $('#all_dp').val(); var array=[all_del_rate,all_del_period] $.ajax({ type:"GET", url:"save...
2017/11/06
[ "https://Stackoverflow.com/questions/47130531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8794062/" ]
Here you go with a solution ```js $('input[type="checkbox"]').click(function(){ var getClass = $(this).attr('class'); var flag = 0; $('input[class="' + getClass + '"]').each(function(){ if($(this).is(':checked')) flag = 1; }); if(flag) { $('input[name="sub_' + getClass + '"]').removeAt...
Don't use duplicate `id` values. It is invalid in HTML. But you don't need them. Instead group your items with some wrapper element, e.g. a `span`. Then you can use the following jQuery click handler: ```js $('[name=name\\[\\]]').change(function () { $span = $(this).parent(); $('[type=submit]', $span).prop('...
47,130,531
I'm pretty new to ruby on rails . I need to pass data from the view to create method in controller. ``` *view* function setDeliveryDetails () { var all_del_rate= $('#all_dr').val(); var all_del_period= $('#all_dp').val(); var array=[all_del_rate,all_del_period] $.ajax({ type:"GET", url:"save...
2017/11/06
[ "https://Stackoverflow.com/questions/47130531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8794062/" ]
Don't use duplicate `id` values. It is invalid in HTML. But you don't need them. Instead group your items with some wrapper element, e.g. a `span`. Then you can use the following jQuery click handler: ```js $('[name=name\\[\\]]').change(function () { $span = $(this).parent(); $('[type=submit]', $span).prop('...
1. Use `data-attr` to select group 2. use that `data-attr` to name the button and disable accordingly ```js $(":checkbox").change(function() { var thisclass = $(this).attr('data-class'); $('.' + thisclass).prop('disabled', !$(':checkbox[data-class='+thisclass+']').is(':checked')) }) ``` ```html <script src="h...
47,130,531
I'm pretty new to ruby on rails . I need to pass data from the view to create method in controller. ``` *view* function setDeliveryDetails () { var all_del_rate= $('#all_dr').val(); var all_del_period= $('#all_dp').val(); var array=[all_del_rate,all_del_period] $.ajax({ type:"GET", url:"save...
2017/11/06
[ "https://Stackoverflow.com/questions/47130531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8794062/" ]
Don't use duplicate `id` values. It is invalid in HTML. But you don't need them. Instead group your items with some wrapper element, e.g. a `span`. Then you can use the following jQuery click handler: ```js $('[name=name\\[\\]]').change(function () { $span = $(this).parent(); $('[type=submit]', $span).prop('...
1. Add the attribute class="abc" to every checkbox 2. Add the attribute id="sub\_abc" to submit button > > > ``` > $('.abc').change(function(ev) { > var flag = 0; > if($('.abc').is(':checked')) > flag = 1; > > if(flag) { > $('#sub_abc').removeAttr('disabled'); > } else { > ...
47,130,531
I'm pretty new to ruby on rails . I need to pass data from the view to create method in controller. ``` *view* function setDeliveryDetails () { var all_del_rate= $('#all_dr').val(); var all_del_period= $('#all_dp').val(); var array=[all_del_rate,all_del_period] $.ajax({ type:"GET", url:"save...
2017/11/06
[ "https://Stackoverflow.com/questions/47130531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8794062/" ]
Here you go with a solution ```js $('input[type="checkbox"]').click(function(){ var getClass = $(this).attr('class'); var flag = 0; $('input[class="' + getClass + '"]').each(function(){ if($(this).is(':checked')) flag = 1; }); if(flag) { $('input[name="sub_' + getClass + '"]').removeAt...
1. Use `data-attr` to select group 2. use that `data-attr` to name the button and disable accordingly ```js $(":checkbox").change(function() { var thisclass = $(this).attr('data-class'); $('.' + thisclass).prop('disabled', !$(':checkbox[data-class='+thisclass+']').is(':checked')) }) ``` ```html <script src="h...
47,130,531
I'm pretty new to ruby on rails . I need to pass data from the view to create method in controller. ``` *view* function setDeliveryDetails () { var all_del_rate= $('#all_dr').val(); var all_del_period= $('#all_dp').val(); var array=[all_del_rate,all_del_period] $.ajax({ type:"GET", url:"save...
2017/11/06
[ "https://Stackoverflow.com/questions/47130531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8794062/" ]
Here you go with a solution ```js $('input[type="checkbox"]').click(function(){ var getClass = $(this).attr('class'); var flag = 0; $('input[class="' + getClass + '"]').each(function(){ if($(this).is(':checked')) flag = 1; }); if(flag) { $('input[name="sub_' + getClass + '"]').removeAt...
1. Add the attribute class="abc" to every checkbox 2. Add the attribute id="sub\_abc" to submit button > > > ``` > $('.abc').change(function(ev) { > var flag = 0; > if($('.abc').is(':checked')) > flag = 1; > > if(flag) { > $('#sub_abc').removeAttr('disabled'); > } else { > ...
14,950,820
I have a html page which looks like this: ``` <html> <head> <title></title> <script language="javascript"> fields = 0; function addInput() { if ( fields != 3) { document.getElementById('text').innerHTML += "<input type='text' name='clients_form[clients_name]' size='32' maxlength='32' v...
2013/02/19
[ "https://Stackoverflow.com/questions/14950820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1731237/" ]
Hope this helps: ``` <html> <head> <title></title> <script > fields = 0; function addInput() { if (fields != 3) { document.getElementById('text').innerHTML += "<input type='text' name='clients_form[clients_name]' size='32' maxlength='32' value='' id='clients_form_clients_name_"+fields+"' />"+ '<select id="client_categ...
Ok assuming you already have [JQuery](http://jquery.com/) library ``` $("#text").append("<input type='text' name='clients_form[clients_name]' size='32' maxlength='32' value='' id='clients_form_clients_name' />"); ``` same goes on the `select` and for readable code. you can put it first on a variable ``` var mySelec...
588,151
I am using ncat to execute a reverse "cmd" shell from one machine to another and without any issues using the commands: ``` In my machine: ncat -l 443 In the remote machine: ncat <my ip> 443 -e cmd ``` And all works flawlessly, however, I would very much prefer "powershell" to be executed instead of "cmd", f...
2014/04/10
[ "https://serverfault.com/questions/588151", "https://serverfault.com", "https://serverfault.com/users/215982/" ]
The reason that the Powershell hangs on the reverse shell of your attacking machine might be due to it not being fully interactive. Try to use PowerShell-based shells like [Nishang's Invoke-PowerShellTcp](https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1). Download the .ps1 script on yo...
This should get you started on the right path: <http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html>
28,881,590
`git` allows `CRLF`, `CR` and `LF` as line feeds/EOL. What is the recommended way to deal with them: * allow all contributors to use whatever EOL and ignore it in `git`'s `diff` (e.g. with `git config core.whitespace cr-at-eol` as suggested in [git-diff to ignore ^M](https://stackoverflow.com/questions/1889559/git-dif...
2015/03/05
[ "https://Stackoverflow.com/questions/28881590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1797006/" ]
This problem can happen when in your `.env` file you have the following ``` DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=test_db DB_USERNAME=root DB_PASSWORD= ``` Instead, you should have ``` RDS_CONNECTION=mysql RDS_HOSTNAME=localhost RDS_PORT=3306 RDS_DB_NAME=test_db RDS_USERNAME=root RDS_PASSWO...
My suggestion would be to use environment variables instead, and make sure the keys match between environments (I think that's your biggest issue). ``` // File: .env.development.php return [ 'database_mysql_host' => '', 'database_mysql_database' => '', 'database_mysql_username' => '', 'database_mysql_p...
42,602,736
I've read and watched a lot of *youtube* videos without any progress. I'm trying to learn from a site called *hackcenter* and they presented me with a question like this in assembly code. ``` testazza: //No idea what this is doing .LFB0: //No idea what this is doing either push ebp mov ebp, es...
2017/03/04
[ "https://Stackoverflow.com/questions/42602736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7524578/" ]
It will have both positive and negative sides. This answer is applicable for C [since you mentioned this is what you will use] **Positive sides** 1. Lets assume you have created an array as pool of objects that you will use for red-black tree. Deleting an element or initializing a new element when the position is fou...
Yes, you can represent red-black tree as an array, but it's not worth it. Maximum height of red-black tree is 2\*log2(n+1), where n is number of entries. Number of entries in array representation on each level is 2\*\*n, where n is level. So to store 1\_000 entries you'd have to allocate array of 1\_048\_576 entries. ...
42,602,736
I've read and watched a lot of *youtube* videos without any progress. I'm trying to learn from a site called *hackcenter* and they presented me with a question like this in assembly code. ``` testazza: //No idea what this is doing .LFB0: //No idea what this is doing either push ebp mov ebp, es...
2017/03/04
[ "https://Stackoverflow.com/questions/42602736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7524578/" ]
It will have both positive and negative sides. This answer is applicable for C [since you mentioned this is what you will use] **Positive sides** 1. Lets assume you have created an array as pool of objects that you will use for red-black tree. Deleting an element or initializing a new element when the position is fou...
Red-back tree (and most data structures, really) doesn't care about which storage facility is used, that means you can use array or even HashTable/Map to store the tree node, the array index or map key is your new "pointer". You can even put the tree on the disk as a file and use file offset as node index if you would ...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
No, there is no difference between them, they will execute exactly the same query, the `All` part is ignored by Spring Data when deriving the query from the method name. The only important bit is the `By` keyword, anything following it is treated as a field name (with the exception of other keywords like `OrderBy` whic...
findBy method is used if we want to find by name or some other criteria like `findByFirstName(String firstName);` findAll methods generally finds by providing specification ``` List<T> findAll(Specification<T> spec); ``` Please see docs below for more clarity: <http://docs.spring.io/spring-data/jpa/docs/1.4.3.REL...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
one difference is that with findAllBy Hibernate filters (@Filters from org.hibernate.annotations) are applied and so a different sql.
findBy method is used if we want to find by name or some other criteria like `findByFirstName(String firstName);` findAll methods generally finds by providing specification ``` List<T> findAll(Specification<T> spec); ``` Please see docs below for more clarity: <http://docs.spring.io/spring-data/jpa/docs/1.4.3.REL...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
To illustrate the difference lets look at the two functions: ``` 1. Set<Policy> findAllByRoleIn(Iterable<Role> role); 2. Set<Policy> findByRoleIn(Iterable<Role> role); ``` The query generated by 1st function: ``` 1. select policy.id, policy.role from policy where (policy.role in (? , ? , ? , ?)) ``` The query g...
findBy method is used if we want to find by name or some other criteria like `findByFirstName(String firstName);` findAll methods generally finds by providing specification ``` List<T> findAll(Specification<T> spec); ``` Please see docs below for more clarity: <http://docs.spring.io/spring-data/jpa/docs/1.4.3.REL...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
Actually, the difference between findallBy and findby, is that : findAllBy returns a Collection but findBy returns Optional. so it's preferable to write List findAllBy instead of writing List findBy (but it will work also :p). and to write Optional findBy instead of Optional findAllBy. check this doc <https://docs.sp...
findBy method is used if we want to find by name or some other criteria like `findByFirstName(String firstName);` findAll methods generally finds by providing specification ``` List<T> findAll(Specification<T> spec); ``` Please see docs below for more clarity: <http://docs.spring.io/spring-data/jpa/docs/1.4.3.REL...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
No, there is no difference between them, they will execute exactly the same query, the `All` part is ignored by Spring Data when deriving the query from the method name. The only important bit is the `By` keyword, anything following it is treated as a field name (with the exception of other keywords like `OrderBy` whic...
one difference is that with findAllBy Hibernate filters (@Filters from org.hibernate.annotations) are applied and so a different sql.
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
No, there is no difference between them, they will execute exactly the same query, the `All` part is ignored by Spring Data when deriving the query from the method name. The only important bit is the `By` keyword, anything following it is treated as a field name (with the exception of other keywords like `OrderBy` whic...
To illustrate the difference lets look at the two functions: ``` 1. Set<Policy> findAllByRoleIn(Iterable<Role> role); 2. Set<Policy> findByRoleIn(Iterable<Role> role); ``` The query generated by 1st function: ``` 1. select policy.id, policy.role from policy where (policy.role in (? , ? , ? , ?)) ``` The query g...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
No, there is no difference between them, they will execute exactly the same query, the `All` part is ignored by Spring Data when deriving the query from the method name. The only important bit is the `By` keyword, anything following it is treated as a field name (with the exception of other keywords like `OrderBy` whic...
Actually, the difference between findallBy and findby, is that : findAllBy returns a Collection but findBy returns Optional. so it's preferable to write List findAllBy instead of writing List findBy (but it will work also :p). and to write Optional findBy instead of Optional findAllBy. check this doc <https://docs.sp...
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
To illustrate the difference lets look at the two functions: ``` 1. Set<Policy> findAllByRoleIn(Iterable<Role> role); 2. Set<Policy> findByRoleIn(Iterable<Role> role); ``` The query generated by 1st function: ``` 1. select policy.id, policy.role from policy where (policy.role in (? , ? , ? , ?)) ``` The query g...
one difference is that with findAllBy Hibernate filters (@Filters from org.hibernate.annotations) are applied and so a different sql.
37,253,571
Is there any difference when using Spring Data JPA keywords between: ``` List<SomeEntity> findBySomeCondition(); ``` and ``` List<SomeEntity> findAllBySomeCondition(); ```
2016/05/16
[ "https://Stackoverflow.com/questions/37253571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6280755/" ]
To illustrate the difference lets look at the two functions: ``` 1. Set<Policy> findAllByRoleIn(Iterable<Role> role); 2. Set<Policy> findByRoleIn(Iterable<Role> role); ``` The query generated by 1st function: ``` 1. select policy.id, policy.role from policy where (policy.role in (? , ? , ? , ?)) ``` The query g...
Actually, the difference between findallBy and findby, is that : findAllBy returns a Collection but findBy returns Optional. so it's preferable to write List findAllBy instead of writing List findBy (but it will work also :p). and to write Optional findBy instead of Optional findAllBy. check this doc <https://docs.sp...
19,908,246
I'm trying to do something I thought would be very simple - dynamically add some options in a select tag using ASP.NET. I've written my code as: ``` <select id='cmbDuration'> <% Dim periods As Generic.List(Of Models.Duration) = DBSupport.getDurations For Each d As Models.Duration In periods Response.Writ...
2013/11/11
[ "https://Stackoverflow.com/questions/19908246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1741167/" ]
Why are you talking about processing data in your code-behind post, but writing in-line code to generate list items? You should be binding your dropdown list in the code-behind: **ASP.NET** ``` <asp:DropDown ID="cmbDuration" DataTextField="Name" DataValueField="ID" runat="server" /> ``` CODE-BEHIND (in Page\_Load) ...
The problem is you are writing to ASPNET's "Response Stream" by using the function Response.Write(), which will cause the output'd option tags to appear at the very very top of the page where the Response Stream is printed. This will appear even above the HTML declaration tag. (Examine your HTML source code to see) If ...
19,908,246
I'm trying to do something I thought would be very simple - dynamically add some options in a select tag using ASP.NET. I've written my code as: ``` <select id='cmbDuration'> <% Dim periods As Generic.List(Of Models.Duration) = DBSupport.getDurations For Each d As Models.Duration In periods Response.Writ...
2013/11/11
[ "https://Stackoverflow.com/questions/19908246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1741167/" ]
> > So, the way I understand this, is that adding the runat="Server" > attribute will result in my control being available for subsequent > process only in code-behind > > > No, adding `runat="server"` tells visual studio and the compiler that this control will be represented as a server control. It add's a serv...
The problem is you are writing to ASPNET's "Response Stream" by using the function Response.Write(), which will cause the output'd option tags to appear at the very very top of the page where the Response Stream is printed. This will appear even above the HTML declaration tag. (Examine your HTML source code to see) If ...
19,908,246
I'm trying to do something I thought would be very simple - dynamically add some options in a select tag using ASP.NET. I've written my code as: ``` <select id='cmbDuration'> <% Dim periods As Generic.List(Of Models.Duration) = DBSupport.getDurations For Each d As Models.Duration In periods Response.Writ...
2013/11/11
[ "https://Stackoverflow.com/questions/19908246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1741167/" ]
Why are you talking about processing data in your code-behind post, but writing in-line code to generate list items? You should be binding your dropdown list in the code-behind: **ASP.NET** ``` <asp:DropDown ID="cmbDuration" DataTextField="Name" DataValueField="ID" runat="server" /> ``` CODE-BEHIND (in Page\_Load) ...
> > So, the way I understand this, is that adding the runat="Server" > attribute will result in my control being available for subsequent > process only in code-behind > > > No, adding `runat="server"` tells visual studio and the compiler that this control will be represented as a server control. It add's a serv...
14,636,722
In my SQL database I have a table for every state in the USA. The user can create multiple pages in different states. Each table has a "UserID" column that will always match the logged in user. How do I search multiple tables for the "UserID"? ``` string sqlquery = "SELECT * FROM[all tables] WHERE @UserID ='" + userID...
2013/01/31
[ "https://Stackoverflow.com/questions/14636722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599813/" ]
I haven't seen your database schema, but I can already tell you need to refactor it. There's no need to have a table for each state, and the maintenance on that could be rough. What you should have is a table holding all of the states, and then another table with a reference to the State table that holds whatever infor...
If tables have the same columns I would go for something like. Using the sql `UNION`. ``` var statesTables = new[]{"NY, Texas, Oregano, Alabama}"; var qBuild = new StringBuilder(); qBuild.Append(string.Format("SELECT * FROM {0} WHERE UserId = @userId ", statesTables[0])); for(int i=1;i<stateTables.Length;i++){ ...
14,636,722
In my SQL database I have a table for every state in the USA. The user can create multiple pages in different states. Each table has a "UserID" column that will always match the logged in user. How do I search multiple tables for the "UserID"? ``` string sqlquery = "SELECT * FROM[all tables] WHERE @UserID ='" + userID...
2013/01/31
[ "https://Stackoverflow.com/questions/14636722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599813/" ]
The right answer is that you need to change your database so that all this information is held in a single table. The easy answer is to take a few minutes to create a view that unions all the tables together so that you can access them as if they were all in one table. The only difference in my answer from the others ...
If tables have the same columns I would go for something like. Using the sql `UNION`. ``` var statesTables = new[]{"NY, Texas, Oregano, Alabama}"; var qBuild = new StringBuilder(); qBuild.Append(string.Format("SELECT * FROM {0} WHERE UserId = @userId ", statesTables[0])); for(int i=1;i<stateTables.Length;i++){ ...
14,636,722
In my SQL database I have a table for every state in the USA. The user can create multiple pages in different states. Each table has a "UserID" column that will always match the logged in user. How do I search multiple tables for the "UserID"? ``` string sqlquery = "SELECT * FROM[all tables] WHERE @UserID ='" + userID...
2013/01/31
[ "https://Stackoverflow.com/questions/14636722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599813/" ]
I haven't seen your database schema, but I can already tell you need to refactor it. There's no need to have a table for each state, and the maintenance on that could be rough. What you should have is a table holding all of the states, and then another table with a reference to the State table that holds whatever infor...
The right answer is that you need to change your database so that all this information is held in a single table. The easy answer is to take a few minutes to create a view that unions all the tables together so that you can access them as if they were all in one table. The only difference in my answer from the others ...
134,419
I am confused about the way momentum vector transforms in the following case: $$q\_k \to q\_k'= q\_k + \epsilon f\_k(q)$$ The Jacobian is thus $\Lambda\_{ij} = \frac{\partial q'\_i}{\partial q\_j} \approx \delta\_{ij} + \epsilon \frac{\partial f\_i(q)} {\partial q\_j}$. Then it (Nakahara's "*Geometry, Topology, and ...
2014/09/07
[ "https://physics.stackexchange.com/questions/134419", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/57300/" ]
The objects that we call vectors in Euclidean space are, in more general situations, actually two possible different types of objects. If you change coordinates ($q\_i\to q\_i'$), the components change with different rules, according to how the Jacobian $\Lambda\_{ij} = \frac{\partial q'\_i}{\partial q\_j}$ (using your...
I) The (Lagrangian) canonical conjugate [momentum](http://en.wikipedia.org/wiki/Momentum) $$\tag{1} p\_i ~:=~\frac{\partial L(q,\dot{q},t)}{\partial \dot{q}^i} $$ transforms as a one-form/co-vector $$\tag{2} p\_i~=~ p^{\prime}\_j \frac{\partial f^j(q,t)}{\partial q^i} $$ under (possibly time-dependent) position c...
4,500,373
I'm writing a PHP library which generates Javascript code. The Javascript code has a number of components named `component001`, `component002`, etc. Pages are loaded dynamically via AJAX. I need to pass the name of the component via URL variable which is then evaled() by the script. The only way I am protecting wha...
2010/12/21
[ "https://Stackoverflow.com/questions/4500373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
There is almost zero reasons to use `eval` and I think that this is not one of them. Remember that all objects act like dictionaries so you can simply do something like this: ``` var components = { component001 : 'testing111', component002 : 'testing222', component003 : 'testing333' }; APP.safeEval = func...
Well, if all there is is a name, then ``` eval(component101) ``` won't do anything anyway, so it seems safe. Maybe you meant ``` return eval(nameOfComponent + '()'); ``` If so, then I don't see why you don't just put your components in a namespace object. Then you wouldn't need eval at all: ``` return comp...
4,500,373
I'm writing a PHP library which generates Javascript code. The Javascript code has a number of components named `component001`, `component002`, etc. Pages are loaded dynamically via AJAX. I need to pass the name of the component via URL variable which is then evaled() by the script. The only way I am protecting wha...
2010/12/21
[ "https://Stackoverflow.com/questions/4500373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
There is almost zero reasons to use `eval` and I think that this is not one of them. Remember that all objects act like dictionaries so you can simply do something like this: ``` var components = { component001 : 'testing111', component002 : 'testing222', component003 : 'testing333' }; APP.safeEval = func...
If the variables are defined in another javascript file and contain only numbers and letters, then they are part of the global namespace. As such, they can be accessed as properties of the `window` object (no need for `eval`!): ``` if (typeof window[nameOfComponent] !== 'undefined') return window[nameOfComponent] ...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
If you're going to get big (scaleable) then SQLite is probably not your best bet. A true RDBMS is far more efficient. That being said, if you're truely going to scale Cake may not be the most efficient option either. Those are decisions for you to make based on your business model. It's good to have aspirations, but it...
We are creating a similar structure application where people can sign up and create there own internal application. We are using MySQL and all the data is stored in the same database. We have structured the tables in such a way that with the login credentials all the data can be easily identified across the site and fe...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
There can be different approaches to the implementation and each depends on the nature of your application, like what functionality is provided to each user, what per-user data is involved and relationships those data hold, how much per-user data is involved etc. **Approach 1**: single application database; multiple t...
If you're going to get big (scaleable) then SQLite is probably not your best bet. A true RDBMS is far more efficient. That being said, if you're truely going to scale Cake may not be the most efficient option either. Those are decisions for you to make based on your business model. It's good to have aspirations, but it...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
If you're going to get big (scaleable) then SQLite is probably not your best bet. A true RDBMS is far more efficient. That being said, if you're truely going to scale Cake may not be the most efficient option either. Those are decisions for you to make based on your business model. It's good to have aspirations, but it...
I would recommend you take a look into some new innovative types of databases. For huge data sets normal SQL DBs start to fall short as the amount of data gets above a certain point. This is why Google created their BigTable project (<http://en.wikipedia.org/wiki/BigTable>). It is also what is behind the NoSQL movement...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
If you're going to get big (scaleable) then SQLite is probably not your best bet. A true RDBMS is far more efficient. That being said, if you're truely going to scale Cake may not be the most efficient option either. Those are decisions for you to make based on your business model. It's good to have aspirations, but it...
I strongly recommend you to use a NoSQL design. NonSQL means Scalable-Non-Relational data store without joins and with a lightweight semantic. A NonSQL approach will improve the way you develop applications by earning new models and point of views about the data. NoSQL DBs tend to use memory over disk as the first-cl...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
There can be different approaches to the implementation and each depends on the nature of your application, like what functionality is provided to each user, what per-user data is involved and relationships those data hold, how much per-user data is involved etc. **Approach 1**: single application database; multiple t...
We are creating a similar structure application where people can sign up and create there own internal application. We are using MySQL and all the data is stored in the same database. We have structured the tables in such a way that with the login credentials all the data can be easily identified across the site and fe...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
There can be different approaches to the implementation and each depends on the nature of your application, like what functionality is provided to each user, what per-user data is involved and relationships those data hold, how much per-user data is involved etc. **Approach 1**: single application database; multiple t...
I would recommend you take a look into some new innovative types of databases. For huge data sets normal SQL DBs start to fall short as the amount of data gets above a certain point. This is why Google created their BigTable project (<http://en.wikipedia.org/wiki/BigTable>). It is also what is behind the NoSQL movement...
6,474,338
I have a Java SAXparser that downloads and parses, using parse(new InputSource(conn.getInputStream())). Unfortunately, sometimes it gives error when downloading a site's xml: "XML or text declaration not at start of entity" Apparently this is bad xml, declaration has to be first: ``` <!DOCTYPE ... stuff here ...> <?xm...
2011/06/24
[ "https://Stackoverflow.com/questions/6474338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/778234/" ]
There can be different approaches to the implementation and each depends on the nature of your application, like what functionality is provided to each user, what per-user data is involved and relationships those data hold, how much per-user data is involved etc. **Approach 1**: single application database; multiple t...
I strongly recommend you to use a NoSQL design. NonSQL means Scalable-Non-Relational data store without joins and with a lightweight semantic. A NonSQL approach will improve the way you develop applications by earning new models and point of views about the data. NoSQL DBs tend to use memory over disk as the first-cl...
52,401,207
There is a window function without `ORDER BY` in `OVER ()` clause. Is there a guarantee that the rows will be processed in the order specified by the `ORDER BY` expression in SELECT itself? For example: ``` SELECT tt.* , row_number() OVER (PARTITION BY tt."group") AS npp --without ORDER BY FROM ( SELECT SUB...
2018/09/19
[ "https://Stackoverflow.com/questions/52401207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10384238/" ]
Good question! No, you cannot rely on that. Window functions are processed *before* the query's `ORDER BY` clause, and without an `ORDER BY` in the window definition, the rows will be processed in the order in which they happen to come from the subselect.
if you use an `order by` in your `over ()` `row_number() OVER (PARTITION BY tt."group" ORDER BY tt."group")` you should get the order you want.
7,400,834
I am having trouble finding out how to form a triangle (not sawtooth) wave from a sine wave. I understand how to create it for a Square wave: ``` if( sineValue >= 0 ) value = amp; else value = -amp; ``` But I am not sure how to change this to accommodate for a triangle wave.
2011/09/13
[ "https://Stackoverflow.com/questions/7400834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577834/" ]
A triangle wave is the integral of a square wave. So you need to integrate (sum) your square wave over time: ``` if (sineValue >= 0) { value += delta; } else { value -= delta; } ``` Note that this can be written more succinctly as: ``` value += (sineValue >= 0) ? delta : -delta; ```
You can use the sign of the derivative of your sine wave to generate a triangular wave like this: ``` if (sineValue - oldSineValue >= 0) { value += delta; } else { value -= delta; } oldSineValue = sineValue; ``` You will need to choose delta to give the required amplitude for your triangular wave, and this w...
7,400,834
I am having trouble finding out how to form a triangle (not sawtooth) wave from a sine wave. I understand how to create it for a Square wave: ``` if( sineValue >= 0 ) value = amp; else value = -amp; ``` But I am not sure how to change this to accommodate for a triangle wave.
2011/09/13
[ "https://Stackoverflow.com/questions/7400834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577834/" ]
A triangle wave is the integral of a square wave. So you need to integrate (sum) your square wave over time: ``` if (sineValue >= 0) { value += delta; } else { value -= delta; } ``` Note that this can be written more succinctly as: ``` value += (sineValue >= 0) ? delta : -delta; ```
I missed this question, here is a very cool maths trick: [asin(cos(x))/1.5708](http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiJhc2luKGNvcyh4KSkvMS41NzA4IiwiY29sb3IiOiIjMDAwMDAwIn0seyJ0eXBlIjoxMDAwLCJ3aW5kb3ciOlsiLTEyLjY5NTcyOTg4MTExMDk4OSIsIjEyLjY5NDg5NTExODg4ODk1NCIsIi02LjgxMjA0NDEyNDA4MDI4NSIsIjguODEyOTU1ODc1OTE5OCJdfV0-...
7,400,834
I am having trouble finding out how to form a triangle (not sawtooth) wave from a sine wave. I understand how to create it for a Square wave: ``` if( sineValue >= 0 ) value = amp; else value = -amp; ``` But I am not sure how to change this to accommodate for a triangle wave.
2011/09/13
[ "https://Stackoverflow.com/questions/7400834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577834/" ]
I missed this question, here is a very cool maths trick: [asin(cos(x))/1.5708](http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiJhc2luKGNvcyh4KSkvMS41NzA4IiwiY29sb3IiOiIjMDAwMDAwIn0seyJ0eXBlIjoxMDAwLCJ3aW5kb3ciOlsiLTEyLjY5NTcyOTg4MTExMDk4OSIsIjEyLjY5NDg5NTExODg4ODk1NCIsIi02LjgxMjA0NDEyNDA4MDI4NSIsIjguODEyOTU1ODc1OTE5OCJdfV0-...
You can use the sign of the derivative of your sine wave to generate a triangular wave like this: ``` if (sineValue - oldSineValue >= 0) { value += delta; } else { value -= delta; } oldSineValue = sineValue; ``` You will need to choose delta to give the required amplitude for your triangular wave, and this w...
45,867,063
I have a wordpress site and using Twenty Seventeen theme, I like the scrolling feature on the Front Page Sections, just like in this demo: <https://2017.wordpress.net/> Now I am trying to get that scrolling feature to work on mobile, however when I look at the CSS I found this ``` .background-fixed .panel-image {
 ...
2017/08/24
[ "https://Stackoverflow.com/questions/45867063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979331/" ]
You need to write above css in your style.css file. we have to set background image fixed not a scroll. ``` .panel-image { background-attachment: fixed; } ```
To make background scroll set the background attachment property to fixed ``` .background-fixed .panel-image { background-attachment: fixed; } ``` To make it work on mobile you have to place above CSS in media query or copy paste the below code in your style.css ``` @media screen and (max-width: 768px){ .backg...
45,867,063
I have a wordpress site and using Twenty Seventeen theme, I like the scrolling feature on the Front Page Sections, just like in this demo: <https://2017.wordpress.net/> Now I am trying to get that scrolling feature to work on mobile, however when I look at the CSS I found this ``` .background-fixed .panel-image {
 ...
2017/08/24
[ "https://Stackoverflow.com/questions/45867063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979331/" ]
You need to write above css in your style.css file. we have to set background image fixed not a scroll. ``` .panel-image { background-attachment: fixed; } ```
Is not working on mobile because the theme only enabled this on desktop. To work on mobile, add this custom css: ``` .background-fixed .panel-image { background-attachment: fixed; } ``` This way, on every breakpoint the effect will be applied
45,867,063
I have a wordpress site and using Twenty Seventeen theme, I like the scrolling feature on the Front Page Sections, just like in this demo: <https://2017.wordpress.net/> Now I am trying to get that scrolling feature to work on mobile, however when I look at the CSS I found this ``` .background-fixed .panel-image {
 ...
2017/08/24
[ "https://Stackoverflow.com/questions/45867063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979331/" ]
You need to write above css in your style.css file. we have to set background image fixed not a scroll. ``` .panel-image { background-attachment: fixed; } ```
Try to select only for one class ".panel-image" using media-query like this: ``` @media screen and (max-width: 768px) { .panel-image { background-attachment: fixed; } } ```
45,867,063
I have a wordpress site and using Twenty Seventeen theme, I like the scrolling feature on the Front Page Sections, just like in this demo: <https://2017.wordpress.net/> Now I am trying to get that scrolling feature to work on mobile, however when I look at the CSS I found this ``` .background-fixed .panel-image {
 ...
2017/08/24
[ "https://Stackoverflow.com/questions/45867063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979331/" ]
Try to select only for one class ".panel-image" using media-query like this: ``` @media screen and (max-width: 768px) { .panel-image { background-attachment: fixed; } } ```
To make background scroll set the background attachment property to fixed ``` .background-fixed .panel-image { background-attachment: fixed; } ``` To make it work on mobile you have to place above CSS in media query or copy paste the below code in your style.css ``` @media screen and (max-width: 768px){ .backg...
45,867,063
I have a wordpress site and using Twenty Seventeen theme, I like the scrolling feature on the Front Page Sections, just like in this demo: <https://2017.wordpress.net/> Now I am trying to get that scrolling feature to work on mobile, however when I look at the CSS I found this ``` .background-fixed .panel-image {
 ...
2017/08/24
[ "https://Stackoverflow.com/questions/45867063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979331/" ]
Try to select only for one class ".panel-image" using media-query like this: ``` @media screen and (max-width: 768px) { .panel-image { background-attachment: fixed; } } ```
Is not working on mobile because the theme only enabled this on desktop. To work on mobile, add this custom css: ``` .background-fixed .panel-image { background-attachment: fixed; } ``` This way, on every breakpoint the effect will be applied
42,037,725
I have URLs of the form ``` http://example.com/example/a/b/c.html https//www.example.com/ ``` How do I get the path from the server root, without protocol or domain name? With the examples above, the function should return: ``` /example/a/b/c.html / ``` (I am using Django: answers relying on this framework are ac...
2017/02/04
[ "https://Stackoverflow.com/questions/42037725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/388835/" ]
[`urlparse`](https://docs.python.org/2/library/urlparse.html) module can solve this: ``` from urlparse import urlparse # for python 2 from urllib.parse import urlparse # for python 3 parsed_url = urlparse('http://example.com/abc/cde') assert parsed_url.path == '/abc/cde' ```
You could use the `path` attribute of django `HttpRequest` object, in other words: ``` request.path ``` see the [docs](https://docs.djangoproject.com/en/1.10/ref/request-response/#django.http.HttpRequest.path) for more
108,830
I am looking at a 2 Nucleon potential of the form $$V(r)=V\_0(r)[a+bI\_1\cdot I\_2]$$ Where a and b are constants. $I\_1,I\_2$ are isospins. $V\_0(r)$ is of the square well form. My goal is to find an equality for a and b, given that deuteron exists, and that diproton and dineutrons do not. My approach has been the f...
2014/04/17
[ "https://physics.stackexchange.com/questions/108830", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/25664/" ]
You're almost there. I'm assuming your square well $V\_0(r)$ is nonzero and negative only on some interval $-r\_0 < r < +r\_0$ about the origin. In that case, for positive $a,b$ you already have that the isosinglet well is deeper than the isotriplet well. Remember that the finite square well has a finite number of bou...
In my search for the Hagen Boson, I came across a very similar problem. It would be my honor to assist a young mind like yours through such treacherous waters. In my experience, it is beneficial to consider why the $I=0$ deuteron can exist, while the diproton and dineutron do not. Since the only thing holding these pa...
3,664,859
If my cursor is in a function call in a perl file , is there any shortcut in eclipse that would take me to the definition of the function( in the same file) like `gd` in vim?
2010/09/08
[ "https://Stackoverflow.com/questions/3664859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409263/" ]
Hold `Ctrl` and hover over function name, which should turn to a hyperlink pointing to its definition.
@others who could have been looking for this feature: Once you jump to the function definition (or any other place) in Eclipse, you can go back to the previous location by using `Alt` + `←` for Navigate->back.
3,664,859
If my cursor is in a function call in a perl file , is there any shortcut in eclipse that would take me to the definition of the function( in the same file) like `gd` in vim?
2010/09/08
[ "https://Stackoverflow.com/questions/3664859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409263/" ]
Hold `Ctrl` and hover over function name, which should turn to a hyperlink pointing to its definition.
If you want to use only the keyboard, press `F3`.
3,664,859
If my cursor is in a function call in a perl file , is there any shortcut in eclipse that would take me to the definition of the function( in the same file) like `gd` in vim?
2010/09/08
[ "https://Stackoverflow.com/questions/3664859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409263/" ]
@others who could have been looking for this feature: Once you jump to the function definition (or any other place) in Eclipse, you can go back to the previous location by using `Alt` + `←` for Navigate->back.
If you want to use only the keyboard, press `F3`.
7,804,745
in input XML I have a tag ``` <name>Sample " '</name> ``` in XSL I transform this tag with: ``` <xsl:variable name="productName" select="substring($elemXPath/name,1,50)"/> <someTag someAttr="{$productName}"/> ``` When I run XSLT the output is: ``` <someTag someAttr="Sample &quot; '"/> ``` but I'd like to get ...
2011/10/18
[ "https://Stackoverflow.com/questions/7804745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1000712/" ]
**There isn't a way to control serialization to this level in XSLT 1.0**. **In XSLT 2.0 use `<xsl:character-map>` as in the following example**: ``` <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" use-character-maps="myChars" omit-xml-declarat...
In general, you shouldn't care which of two equivalent serialisations of your data the XSLT processor chooses. Any sane consumer of the data will treat them the same way; if it doesn't you should fix the consumer. However, for pragmatic reasons XSLT 1.0 provides disable-output-escaping and XSLT 2.0 provides character ...
60,889,248
I have an Applescript that enters strings using `keystroke` but that is a slow solution, it is almost possible to write faster manually and my strings are long. Is there a faster way to enter text using Applescript?
2020/03/27
[ "https://Stackoverflow.com/questions/60889248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1802826/" ]
Here is A solution which will copy the string to the clipboard, then it will paste the string from the clipboard rather than key stroking the string. On my system, this solution was lightning fast in four different applications I tested it with. ``` set textToEnter to "This Is Text This Is More Text This Is More Text"...
The efficient way to do this is to use, if possible, the most natively script-able solution on both sides of the task list. One side of course is where you get the text from; The other side is where the text goes. I'm giving fairly basic concepts here because no code examples were given. So if I have lines of text to c...
33,919,301
I am trying to migrate a huge table from postgres into Redshift. 1. The size of the table is about 5,697,213,832 2. tool: pentaho Kettle Table input(from postgres) -> Table output(Redshift) 3. Connecting with Redshift JDBC4 By observation I found the inserting into Redshift is the bottleneck. only about 500 rows/sec...
2015/11/25
[ "https://Stackoverflow.com/questions/33919301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999675/" ]
Have you consider using S3 as mid-layer? Dump your data to csv files and apply gzip compression. Upload files to the S3 and then use `copy` command to load the data. <http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html>
Better to export data to S3, then use COPY command to import data into Redshift. In this way, the import process is fast while you don't need to vacuum it.
33,919,301
I am trying to migrate a huge table from postgres into Redshift. 1. The size of the table is about 5,697,213,832 2. tool: pentaho Kettle Table input(from postgres) -> Table output(Redshift) 3. Connecting with Redshift JDBC4 By observation I found the inserting into Redshift is the bottleneck. only about 500 rows/sec...
2015/11/25
[ "https://Stackoverflow.com/questions/33919301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999675/" ]
Have you consider using S3 as mid-layer? Dump your data to csv files and apply gzip compression. Upload files to the S3 and then use `copy` command to load the data. <http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html>
Export your data to S3 bucket and use the COPY command in Redshift . COPY command is the fastest way to insert data in Redshift .
33,919,301
I am trying to migrate a huge table from postgres into Redshift. 1. The size of the table is about 5,697,213,832 2. tool: pentaho Kettle Table input(from postgres) -> Table output(Redshift) 3. Connecting with Redshift JDBC4 By observation I found the inserting into Redshift is the bottleneck. only about 500 rows/sec...
2015/11/25
[ "https://Stackoverflow.com/questions/33919301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999675/" ]
The main reason for bottleneck of redshift performance, which i considered is that Redshift treats each and every hit to the cluster as one single query. It executes each query on its cluster and then proceeds to the next stage. Now when i am sending across multiple rows (in this case 10), each row of data is treated a...
Better to export data to S3, then use COPY command to import data into Redshift. In this way, the import process is fast while you don't need to vacuum it.
33,919,301
I am trying to migrate a huge table from postgres into Redshift. 1. The size of the table is about 5,697,213,832 2. tool: pentaho Kettle Table input(from postgres) -> Table output(Redshift) 3. Connecting with Redshift JDBC4 By observation I found the inserting into Redshift is the bottleneck. only about 500 rows/sec...
2015/11/25
[ "https://Stackoverflow.com/questions/33919301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2999675/" ]
The main reason for bottleneck of redshift performance, which i considered is that Redshift treats each and every hit to the cluster as one single query. It executes each query on its cluster and then proceeds to the next stage. Now when i am sending across multiple rows (in this case 10), each row of data is treated a...
Export your data to S3 bucket and use the COPY command in Redshift . COPY command is the fastest way to insert data in Redshift .
42,628,665
i have the topic of my computer science thesis. I have to develope an algorithm that after an upload of an excel file for example attributes and values mapps. I mean, this algorithm should recognize the excel attributes and its values and deliver them as suggestions. Does anybody know how can i begin with this? I mean ...
2017/03/06
[ "https://Stackoverflow.com/questions/42628665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7533608/" ]
[`terraform refresh`](https://www.terraform.io/docs/commands/refresh.html) attempts to find any resources held in the state file and update with any drift that has happened in the provider outside of Terraform since it was last ran. For example, lets say your state file contains 3 EC2 instances with instance ids of `i...
I know this is a little late to the party but in my recent dealings with terraform I read it still keeps a local state file tfstate.backup in case the remote state file is corrupted. Apparently, I haven't tried this, you can then do `terraform state push` and it will push the backup to the remote. Cheers
42,628,665
i have the topic of my computer science thesis. I have to develope an algorithm that after an upload of an excel file for example attributes and values mapps. I mean, this algorithm should recognize the excel attributes and its values and deliver them as suggestions. Does anybody know how can i begin with this? I mean ...
2017/03/06
[ "https://Stackoverflow.com/questions/42628665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7533608/" ]
[`terraform refresh`](https://www.terraform.io/docs/commands/refresh.html) attempts to find any resources held in the state file and update with any drift that has happened in the provider outside of Terraform since it was last ran. For example, lets say your state file contains 3 EC2 instances with instance ids of `i...
Plan-> In the aforementioned scenario when the 2nd EC2 instance is deleted and when you try again with `terraform plan` it does refresh the terraform state but in-memory prior to plan. The refreshed state will be used to calculate this plan, but will not be persisted in local or remote state storage. Refresh-> But if...
42,628,665
i have the topic of my computer science thesis. I have to develope an algorithm that after an upload of an excel file for example attributes and values mapps. I mean, this algorithm should recognize the excel attributes and its values and deliver them as suggestions. Does anybody know how can i begin with this? I mean ...
2017/03/06
[ "https://Stackoverflow.com/questions/42628665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7533608/" ]
[`terraform refresh`](https://www.terraform.io/docs/commands/refresh.html) attempts to find any resources held in the state file and update with any drift that has happened in the provider outside of Terraform since it was last ran. For example, lets say your state file contains 3 EC2 instances with instance ids of `i...
@Philip Seems I am the last here, going ahead with your answer. Since till you are here, you already know that Terraform refresh will update local state for any real world drifts and compare with the actual infra in your terraform templates. And then Terraform will just lay things off which are not part of your desir...
42,628,665
i have the topic of my computer science thesis. I have to develope an algorithm that after an upload of an excel file for example attributes and values mapps. I mean, this algorithm should recognize the excel attributes and its values and deliver them as suggestions. Does anybody know how can i begin with this? I mean ...
2017/03/06
[ "https://Stackoverflow.com/questions/42628665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7533608/" ]
Plan-> In the aforementioned scenario when the 2nd EC2 instance is deleted and when you try again with `terraform plan` it does refresh the terraform state but in-memory prior to plan. The refreshed state will be used to calculate this plan, but will not be persisted in local or remote state storage. Refresh-> But if...
I know this is a little late to the party but in my recent dealings with terraform I read it still keeps a local state file tfstate.backup in case the remote state file is corrupted. Apparently, I haven't tried this, you can then do `terraform state push` and it will push the backup to the remote. Cheers
42,628,665
i have the topic of my computer science thesis. I have to develope an algorithm that after an upload of an excel file for example attributes and values mapps. I mean, this algorithm should recognize the excel attributes and its values and deliver them as suggestions. Does anybody know how can i begin with this? I mean ...
2017/03/06
[ "https://Stackoverflow.com/questions/42628665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7533608/" ]
@Philip Seems I am the last here, going ahead with your answer. Since till you are here, you already know that Terraform refresh will update local state for any real world drifts and compare with the actual infra in your terraform templates. And then Terraform will just lay things off which are not part of your desir...
I know this is a little late to the party but in my recent dealings with terraform I read it still keeps a local state file tfstate.backup in case the remote state file is corrupted. Apparently, I haven't tried this, you can then do `terraform state push` and it will push the backup to the remote. Cheers
269,782
Let $G$ be a (not necessarily finite) group and $N\lhd G$. Show that if $N$ is finite then $C\_G(N)$ has finite index in $G$. Further show that if $N$ is finite and $G/N$ is cyclic then the center $Z(G)$ has finite index. These two are driving me crazy, and I simply cannot figure them out... Any help is appreciated
2013/01/03
[ "https://math.stackexchange.com/questions/269782", "https://math.stackexchange.com", "https://math.stackexchange.com/users/2313/" ]
Since $N$ is normal, $G$ acts on $N$ by conjugation, giving a homomorphism from $G$ to $\rm{Aut}(N)$. The kernel of this map is exactly $C\_G(N)$ so since $N$ only has a finite number of automorphisms, the index must be finite. For the second one, we have $G = N\left< g \right>$ for some $g\in G$ (just take a generato...
For your first question, use $N/C$ theorem: > > $(N/C)$ Theorem: If $G$ is a group and $N\subset G$, then $N\_G(N)/C\_G(N)$ is isomorphic to a subgroup of $\text{Aut}(N)$. > > > So since $N$ is normal in the group so the normalizer of it is $G$ and we have $G/C\_G(N)\cong S\leq Aut(N)$ which is finite.
40,064,129
Okay so I want to separate my html and javascript for my project. I want to define a template in a file called template.htm and then use javascript/jQuery to get the file and add the JSON data etc to it then to render/compile it. Script: ``` (function(){ //this is our JSON (data) var data = { "cities...
2016/10/15
[ "https://Stackoverflow.com/questions/40064129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6815928/" ]
Here's a 2018 version using fetch to retrieve both the data and the template in parallel: ``` // Get external data with fetch const data = fetch('data.json').then(response => response.json()); // Get external template with fetch const template = fetch('template.mst').then(response => response.text()); // wait for al...
From this article <http://jonnyreeves.co.uk/2012/using-external-templates-with-mustachejs-and-jquery/> With JQuery you can `.get()` a file and then apply the Mustache rendering to it once it's arrived. ``` $.get('greetings.htm', function(templates) { // Fetch the <script /> block from the loaded external // t...
261,670
Let $\{a\_i\}, i=1, 2, \cdots$ be a nonincreasing sequence of positive numbers, and suppose $\sum\_{k=1}^{\infty}\frac{a\_k}{\sqrt{k}}<\infty~$, show that $\sum\_{k=1}^{\infty}a\_k^2<\infty.$ **Could you give a direct proof by finding an inequality of the type $\sum\_{k=1}^{\infty}a\_k^2\leq f<\infty$, where $f$ is so...
2012/12/18
[ "https://math.stackexchange.com/questions/261670", "https://math.stackexchange.com", "https://math.stackexchange.com/users/17731/" ]
Set $b\_n=\frac{a\_n}{\sqrt n}$, then the result desired is equivalent to $$ \begin{align} \sum\_{n=1}^\infty nb\_n^2 &=\sum\_{n=1}^\infty\sum\_{k=1}^n b\_n^2\tag{1}\\ &=\sum\_{k=1}^\infty\sum\_{n=k}^\infty b\_n^2\tag{2}\\ &\le\sum\_{k=1}^\infty b\_k\sum\_{n=k}^\infty b\_n\tag{3}\\ &\le\left(\sum\_{n=1}^\infty b\_n\rig...
**Hint:** [Cauchy condensation test](http://en.wikipedia.org/wiki/Cauchy_condensation_test). As the sequence $\{a\_k^2\}$ still is non-increasing, we have to check whether the series $\sum\_n 2^na\_{2^n}^2$ is convergent. As $\frac{a\_k}{\sqrt k}$ is non-increasing, we have by condensation that the series $\sum\_n2^n\...
261,670
Let $\{a\_i\}, i=1, 2, \cdots$ be a nonincreasing sequence of positive numbers, and suppose $\sum\_{k=1}^{\infty}\frac{a\_k}{\sqrt{k}}<\infty~$, show that $\sum\_{k=1}^{\infty}a\_k^2<\infty.$ **Could you give a direct proof by finding an inequality of the type $\sum\_{k=1}^{\infty}a\_k^2\leq f<\infty$, where $f$ is so...
2012/12/18
[ "https://math.stackexchange.com/questions/261670", "https://math.stackexchange.com", "https://math.stackexchange.com/users/17731/" ]
Set $b\_n=\frac{a\_n}{\sqrt n}$, then the result desired is equivalent to $$ \begin{align} \sum\_{n=1}^\infty nb\_n^2 &=\sum\_{n=1}^\infty\sum\_{k=1}^n b\_n^2\tag{1}\\ &=\sum\_{k=1}^\infty\sum\_{n=k}^\infty b\_n^2\tag{2}\\ &\le\sum\_{k=1}^\infty b\_k\sum\_{n=k}^\infty b\_n\tag{3}\\ &\le\left(\sum\_{n=1}^\infty b\_n\rig...
For positive integers $n$, let $u(n) \in \ell^2$ such that $u(n)\_j = 1$ for $j \le n$ and $0$ otherwise. Then we can write $a = \sum\_{j=1}^\infty b\_j u(j)$ where $b\_j = a\_j - a\_{j+1}$. Now let $f(a) = \sum\_{j=1}^\infty a\_j/\sqrt{j}$. We have $$f(u(n)) = \sum\_{j=1}^n \frac{1}{\sqrt{j}} \ge \int\_1^{n+1} \frac{...
39,178,235
Our app is similar with this,[just like it](http://i.stack.imgur.com/SkrNp.png) after launching, without any other operation, if I right mouse click, [NSApplication sharedApplication].mainWindow = (null); but if I did click somewhere or do any operation, the mainWindow is right; I need the mainWindow to call ***make...
2016/08/27
[ "https://Stackoverflow.com/questions/39178235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6763841/" ]
I have obtained a solution. Since I just need a window not MainWindow, so try this ``` NSWindow *mainWindow = self.view.window; if (self.view.window == nil) { mainWindow = [[NSApplication sharedApplication].windows lastObject]; } ``` then the mainWindow can't be nil any more.
Swift solution ``` NSApp.windows.first ``` If you're using this at launch be sure that there are no other windows as the only limitation of this is that it displays all windows in an unpredictable order
9,476,799
Trying to understand Jquery's On() and off() a little better. Not understanding why this is not working. I want to activate and inactivate id TurnON and TurnOff Js. **Javascript** ``` $(document).ready(function(){ $(document).on("click.turnon","#TurnOn",function() { $(document).off('click.turnon'); ...
2012/02/28
[ "https://Stackoverflow.com/questions/9476799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1211946/" ]
If you want an event handler to only fire once then take a look at `.one()`: <http://api.jquery.com/one> As of jQuery 1.7 it does event delegation. ``` $(function(){ $(document).one("click.turnon","#TurnOn",function() { alert("Turn Off is now turned off"); }); $(document).one("click.turnoff","...
Your logic is right, but may I suggest better implementation? Please read this page as well: <http://api.jquery.com/off/> Here is what I suggest: ``` // first put a .click event with a separate "ID" to enable another div "ID". $('#ButtonForTurnOn').click(function () { //while body is .on(), the ID, when clicked app...
65,405,747
I try to convert this String to only the link: `{"link":"https://i.imgur.com/zfxsqlk.png"}` I'm trying to create a discord bot, which sends random pictures from the API `https://some-random-api.ml/img/red_panda`. With `imageURL = json.loads(requests.get(redpandaurl).content)` I get the json String, but what do I have...
2020/12/22
[ "https://Stackoverflow.com/questions/65405747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13121462/" ]
You can simply do this: ``` image_url = requests.get(your_api_url).json()["link"] ``` Directly use `requests.json()`, no need to load the string with `json.loads` and other manual stuff.
What you get from json.loads() is a Python dict. You can access values in the dict by specifying their keys. In your case, there is only one key-value pair in the dict: "link" is the key and "https://i.imgur.com/zfxsqlk.png" is the value. You can get the link and store it in the value by appending ["link"] to your line...