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
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
There are two main academic tracks I'm aware of that care about craft bookbinding, in a way that is beyond hobby: fine arts, and "library and archives". In schools of fine arts it is not uncommon to have "3D design" classes that can include craft binding concepts and techniques as an option. Other classes can focus o...
I was taught craft bookbinding in a university town - by the bookbinder to the university library. But he did not award degrees. Do you want to learn the craft or do you want a degree certificate? The two wishes may not be compatible.
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
There are two main academic tracks I'm aware of that care about craft bookbinding, in a way that is beyond hobby: fine arts, and "library and archives". In schools of fine arts it is not uncommon to have "3D design" classes that can include craft binding concepts and techniques as an option. Other classes can focus o...
My spouse worked in a small bookbinding shop in her university library as an undergrad as a work study assignment. The shop was there to rebind and do other preservation work on the library's older books. It was very much a matter of learning under the supervision of one of the full-time employees.
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
I was taught craft bookbinding in a university town - by the bookbinder to the university library. But he did not award degrees. Do you want to learn the craft or do you want a degree certificate? The two wishes may not be compatible.
The closest program would probably be a Library Science degree (e.g. MLS, MLIS). The actual percentage of the program that would directly deal with physical book construction and repair is almost certainly quite low, but what you will likely encounter in these programs are *fellow enthusiasts* who share your love of bo...
124,773
A (master) thesis about the development and assessment of an algorithm has some limitations. The method chapter is organized as follows: * Algorithm Description * Simulated Scenarios * Evaluation method The algorithm itself is not optimal and potential flaws exist in some modules. The simulated scenarios were selecte...
2019/02/11
[ "https://academia.stackexchange.com/questions/124773", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/104321/" ]
My spouse worked in a small bookbinding shop in her university library as an undergrad as a work study assignment. The shop was there to rebind and do other preservation work on the library's older books. It was very much a matter of learning under the supervision of one of the full-time employees.
The closest program would probably be a Library Science degree (e.g. MLS, MLIS). The actual percentage of the program that would directly deal with physical book construction and repair is almost certainly quite low, but what you will likely encounter in these programs are *fellow enthusiasts* who share your love of bo...
34,055,750
I decided to build a page around a responsive menu I found (I think in an answer here), when I got ready to work on the rest of the page I realized that all the CSS for the menu had been set to select and style all `ul, li, a` elements for the entire page. I tried adding selectors to each of the styled elements multipl...
2015/12/03
[ "https://Stackoverflow.com/questions/34055750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1401661/" ]
Add `.menuContainer` in front of everything you want to be styled specifically in that menu. And before that, style your ul / li for general use.
in order to dont mess up with your ongoing coding you have to "wrap-secure" your elements and specially your vulnerable tags (li,ul,a etc because u gona use them multiple times) so any change you do inside will affect only the "childs" of your "father" element. so here are some you can do on your given code: 1. your ...
34,055,750
I decided to build a page around a responsive menu I found (I think in an answer here), when I got ready to work on the rest of the page I realized that all the CSS for the menu had been set to select and style all `ul, li, a` elements for the entire page. I tried adding selectors to each of the styled elements multipl...
2015/12/03
[ "https://Stackoverflow.com/questions/34055750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1401661/" ]
Add `.menuContainer` in front of everything you want to be styled specifically in that menu. And before that, style your ul / li for general use.
I don't think you've messed up by adding lots of classes. You might check out Denise Jacobs' excellent series on [CSS Architecture](http://www.sitepoint.com/css-architectures-scalable-and-modular-approaches/), specifically the sections on OOCSS and SMACSS. If you take the OOCSS approach, you'd scope your module with a...
34,055,750
I decided to build a page around a responsive menu I found (I think in an answer here), when I got ready to work on the rest of the page I realized that all the CSS for the menu had been set to select and style all `ul, li, a` elements for the entire page. I tried adding selectors to each of the styled elements multipl...
2015/12/03
[ "https://Stackoverflow.com/questions/34055750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1401661/" ]
in order to dont mess up with your ongoing coding you have to "wrap-secure" your elements and specially your vulnerable tags (li,ul,a etc because u gona use them multiple times) so any change you do inside will affect only the "childs" of your "father" element. so here are some you can do on your given code: 1. your ...
I don't think you've messed up by adding lots of classes. You might check out Denise Jacobs' excellent series on [CSS Architecture](http://www.sitepoint.com/css-architectures-scalable-and-modular-approaches/), specifically the sections on OOCSS and SMACSS. If you take the OOCSS approach, you'd scope your module with a...
32,889,618
I created special metaclass so I can have nice wrapper for programs/commands with first 'action' argument ( without dash(es) ). Especially svn, git etc. I don't want to use external tools for that purpose. ``` import subprocess class CmdWrap(type): def __new__(mcs, name, bases=(object,), dict={}): ...
2015/10/01
[ "https://Stackoverflow.com/questions/32889618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3806595/" ]
**Ratios in Common Lisp** Note that *fractions* (which itself is not a numeric type in Common Lisp) are converted to *rationals* in Lisp. `rational`, `ratio` and `integer` (and others) are actual numeric types in Common Lisp. If you enter a fraction, it is normalized to a rational (an integer or a ratio number). ``` ...
The [specification](http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm#EQ) about `=` says: > > The value of `=` is true if all numbers are the same in value; otherwise it is false. > > > While the [specification](http://www.lispworks.com/documentation/HyperSpec/Body/t_real.htm#real) on `real` says...
47,569,461
I have a big numpy array `my_array` that I copy into another temporary array `temp_my_array` in order to use it in calculations inside a loop, as following: ``` my_array = [10.1, 20.3, ..., 11.2] # a large numpy array temp_my_array = np.copy(my_array) for i in range(200000): for item in np.where(my_array> 5): ...
2017/11/30
[ "https://Stackoverflow.com/questions/47569461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7912237/" ]
I suggest you only copy the values that actually changed. With your code this is only a slight change: ``` my_array = [10.1, 20.3, ..., 11.2] # a large numpy array temp_my_array = np.copy(my_array) for i in range(200000): inds = np.where(my_array > 5) for item in inds: temp_my_array[item] = f(my_arra...
Does this sound reasonable? Mass assign to original array without making copies ``` my_array = [10.1, 20.3, ..., 11.2] # a large numpy array for i in range(200000): my_array[np.where(my_array>5)] = f(my_array[some other items]) # Mass assign instead of for-loop ``` You'll need to make sure `f()` returns an arr...
70,299,060
I am currently working on a discord bot with Pycord. I am working on adding support for GIF images on the currently existing image commands, and I need the color of the pixels. When I try to get the color of an exact point in PIL/Pillow, I get a number representing the color of the pixel in the GIF color table, which i...
2021/12/10
[ "https://Stackoverflow.com/questions/70299060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13778713/" ]
Try ```py r, g, b, a = img.getpixel((x, y)) ``` I tested this and it works for me. Based on [this post]. ([Get pixel's RGB using PIL](https://stackoverflow.com/questions/11064786/get-pixels-rgb-using-pil)) Edit: another approach that has worked for me in the past is to use `pixels = img.load()` and index a pixel li...
This worked for me ```py from PIL import Image red_image = Image.open("red.png") red_image_rgb = red_image.convert("RGB") rgb_pixel_value = red_image_rgb.getpixel((10,15)) print(rgb_pixel_value) #Prints (255, 0, 0) ```
22,239,166
Experiment:'X is a binomial of five trials and p = 0.5, where X is the number of heads. Ysample is a binomial of X trials and p=0.5, where Ysample is the number of heads.' T is the number of times the experiment is repeated until the value of Ysample>=3. This is the code: ``` while (Ysample[i]<3){ length(X)=n leng...
2014/03/07
[ "https://Stackoverflow.com/questions/22239166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3356728/" ]
This is the code for `WithApplication`: ``` abstract class WithApplication(val app: FakeApplication = FakeApplication()) extends Around with Scope { implicit def implicitApp = app override def around[T: AsResult](t: => T): Result = { Helpers.running(app)(AsResult.effectively(t)) } } ``` It's actually quite...
If your `after` method doesn't need anything from the `WithApplication` trait you can mix in your specification the `AfterExample` trait and define the `after` behaviour for the whole spec: ``` import org.specs2.specification._ class Specs2Play extends org.specs2.mutable.Specification with AfterExample { "this is t...
20,739,041
I have a text file in which I have certain numbers of the type- ``` a.bcdef0000000000000e+05 ``` where a,b,c,d,e,f can take any values in 0-9. I want to find all of them and replace their value with abcdef i.e. 6 digits without the decimal point. How can I do it using regex in Linux or an editor like Sublime Text?
2013/12/23
[ "https://Stackoverflow.com/questions/20739041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
cheack for the regex ([\d]).([\d]{5})0\*e+\d\* or make changes in grouping of your regex and replace it with $1$2
Try this: ``` ([0-9]\.[0-9]{5}[0]{13}[e]\+05) ``` Demo: <http://regex101.com/r/jM9tQ6>
20,739,041
I have a text file in which I have certain numbers of the type- ``` a.bcdef0000000000000e+05 ``` where a,b,c,d,e,f can take any values in 0-9. I want to find all of them and replace their value with abcdef i.e. 6 digits without the decimal point. How can I do it using regex in Linux or an editor like Sublime Text?
2013/12/23
[ "https://Stackoverflow.com/questions/20739041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
cheack for the regex ([\d]).([\d]{5})0\*e+\d\* or make changes in grouping of your regex and replace it with $1$2
Try this `sed` command: ``` sed -i 's/\([0-9]\)\.\([0-9]\{5\}\)0000000000000e+05/\1\2/g' <filename> ``` Explanation of the individual parts of the command: * `sed`: program name * `-i`: use in-place substitution (make sure to create a backup of your files before you start!) * `'s/.../.../g'`: sed command: will sear...
20,739,041
I have a text file in which I have certain numbers of the type- ``` a.bcdef0000000000000e+05 ``` where a,b,c,d,e,f can take any values in 0-9. I want to find all of them and replace their value with abcdef i.e. 6 digits without the decimal point. How can I do it using regex in Linux or an editor like Sublime Text?
2013/12/23
[ "https://Stackoverflow.com/questions/20739041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
cheack for the regex ([\d]).([\d]{5})0\*e+\d\* or make changes in grouping of your regex and replace it with $1$2
Sublime Text solution. Go to Find->Replace... (Ctrl+H), change to Regular expression search (Alt+R), then: "Find What:" `([\d]).([\d]{5})0*e\+\d*` "Replace With:" `$1$2$3$4$5$6`
29,157,190
In a Grails relationship when an `Owner` domain class owns an `Owned` domain class, I've seen this declared two different ways in the `Owned` domain class: ``` static belongsTo [ owner : Owner ] ``` and sometimes as ``` static belongsTo [ Owner ] ``` what is the difference between these two other than the syntax?
2015/03/20
[ "https://Stackoverflow.com/questions/29157190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3192657/" ]
The difference is being able to indicate the name of the owned by property. In the second case it's going to assume the bean name convention of the class `owner` where as the first you are being explicit about the name of the property. It's about flexibility. The first option is there if the second doesn't do what you...
it's as simple as that: if you define the ``` static belongsTo = [ owner : Owner ] ``` then you can can access the `owner` as a variable: `obj.owner`. If you write: ``` static belongsTo = [ Owner ] ``` then you can't (you will get NoSuchPropException I guess). In both cases the foreign-key relation is created
29,157,190
In a Grails relationship when an `Owner` domain class owns an `Owned` domain class, I've seen this declared two different ways in the `Owned` domain class: ``` static belongsTo [ owner : Owner ] ``` and sometimes as ``` static belongsTo [ Owner ] ``` what is the difference between these two other than the syntax?
2015/03/20
[ "https://Stackoverflow.com/questions/29157190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3192657/" ]
The difference is being able to indicate the name of the owned by property. In the second case it's going to assume the bean name convention of the class `owner` where as the first you are being explicit about the name of the property. It's about flexibility. The first option is there if the second doesn't do what you...
The first is bidirectional, since you have an instance of `Owner` defined in your class. The key of that map is typically the lowercase name of the domain class, but it can be any legal variable name. An AST transformation adds a property to your domain class (you can see this by decompiling the .class file), basically...
16,060,734
I have on click jquery that submits ajax request. There are no forms. I'd like keyboard ENTER to be used also to submit ajax request. I've allot of these buttons, this confuses me as I cannot simply do: ``` $('#myForm input:text').keypress(function (e) { if (e.which == 13) { $("#button1").click() } }); ```...
2013/04/17
[ "https://Stackoverflow.com/questions/16060734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can make the ajax function external and then call it on click and keypress (enter) events like this: ``` $(document).on("click", ".unlocked figcaption .check", ajaxFunction); $(document).on("keypress", "#myForm input:text", function (e) { if (e.keyCode == 13){ e.preventDefault(); ajaxFunction(); } ...
// Try this!! :) ``` $(document).ready(function(){ $(this).on('keypress click','.unlocked figcaption .check',function(e){ if((e.type === 'keypress' && e.keyCode === 13) || e.type === 'click') { // All your code inside the .on() } }); }); ```
403,612
Let $a, b , c, d$ be reals. Define the sequence $(x\_n)$ as: $$x\_0 = a,\,\, x\_1 = b$$ $$x\_n = \left(1 - \frac{b^2}{n^2}\right)x\_{n-1} + \frac{1}{n-1}\sum\_{k=0}^{n-2}\binom{2n+1}{2k+1}^{-1} (x\_{k+1}-x\_k)(c\, x\_{n-k-1}- d\, x\_{n-k-2}),\,\,\, n \geq2.$$ I'm actually studying the asymptotic series of a solution ...
2021/09/10
[ "https://mathoverflow.net/questions/403612", "https://mathoverflow.net", "https://mathoverflow.net/users/365812/" ]
That is, indeed, more bark than bite, but the bark is somewhat louder than mlk presented it. First of all, let us define $X\_k=\max(|x\_k|,|x\_{k-1}|)$ and notice that ${2n+1\choose 2k+1}\ge 2^{\min(k,n-k)}n$ for $1\le k\le n-1$, provided that $n$ is not too small. With all this, we have the recursive inequality \begi...
This looks like one of these examples that is more bark than bite. If we separate the first term of the sum and do a bit of reordering we get $$x\_n-x\_{n-1} = \frac{b^2}{n^2} x\_{n-1} + \frac{b-a}{(n-1)(2n+1)} (c x\_{n-1}-d x\_{n-2}) + \frac{1}{n-1}\sum\_{k=1}^{n-2}\binom{2n+1}{2k+1}^{-1} (x\_{k+1}-x\_k)(c\, x\_{n-k-1...
35,239,930
Bootstrap `container` has `row`s with `col-lg-3` class. Over 100 articles are returned from a SQL query with different length of text. Each article (numbers as 1, 2, 3 etc) put on `<div>` tag individually. But my output as follows: [![](https://i.stack.imgur.com/8Zyvc.jpg)](https://i.stack.imgur.com/8Zyvc.jpg) but I...
2016/02/06
[ "https://Stackoverflow.com/questions/35239930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5891365/" ]
You need to change the structure of the data - something like this will work: ``` <?php $articleContainer = array('', '', '', ''); $count = 0; foreach($value as $add) { //this is called the Modulus operator if you have not seen it before switch ($count % 4) { case 0: $articleConta...
Two possible ways to fix it 1. You need to close every`<div class="row">`after 4 `col-lg-3 or col-md-3`inside the container, because col-lg-3/col-md-3 has dynamic heights and 5th column will stack to the tallest column of the above row as it can't clear: left because of the height of the tallest column. 2. use jQuery ...
35,239,930
Bootstrap `container` has `row`s with `col-lg-3` class. Over 100 articles are returned from a SQL query with different length of text. Each article (numbers as 1, 2, 3 etc) put on `<div>` tag individually. But my output as follows: [![](https://i.stack.imgur.com/8Zyvc.jpg)](https://i.stack.imgur.com/8Zyvc.jpg) but I...
2016/02/06
[ "https://Stackoverflow.com/questions/35239930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5891365/" ]
You need to change the structure of the data - something like this will work: ``` <?php $articleContainer = array('', '', '', ''); $count = 0; foreach($value as $add) { //this is called the Modulus operator if you have not seen it before switch ($count % 4) { case 0: $articleConta...
You will have 4 col-md-3 containing as many col-md-12 as you want (articles 1,5,9.. in the first, articles 2, 6, 10... in the second, etc.) ``` <div class="col-md-3"> # $i % 4 === 1 <div class="col-md-12"><p>Article 1</p></div> <div class="col-md-12"><p>Article 5</p></div> ... </div> <div class="col-md-3"> # $i % 4...
35,239,930
Bootstrap `container` has `row`s with `col-lg-3` class. Over 100 articles are returned from a SQL query with different length of text. Each article (numbers as 1, 2, 3 etc) put on `<div>` tag individually. But my output as follows: [![](https://i.stack.imgur.com/8Zyvc.jpg)](https://i.stack.imgur.com/8Zyvc.jpg) but I...
2016/02/06
[ "https://Stackoverflow.com/questions/35239930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5891365/" ]
You need to change the structure of the data - something like this will work: ``` <?php $articleContainer = array('', '', '', ''); $count = 0; foreach($value as $add) { //this is called the Modulus operator if you have not seen it before switch ($count % 4) { case 0: $articleConta...
Please replace this code on above code ```html <div class="row"> <?php for($i=0;$i<count($value);$i++) { if($i%4==0 && $i!=0) { echo "</div><div class='row'>"; } echo "<div class='col-md-3'><p>"; echo $value[$i]; // column name is article_item echo "</p></div>"; }...
65,928,345
Trying to split strings with a known starting segment and optional additional segments until a common endpoint. ``` eg. https://example.com/folder/upload/v1/subfolder/asset.doc https://example.com/folder/upload/temp_cache_folder_id/v1/subfolder/asset.doc ``` Basically need to remove anything between /upload/ and /...
2021/01/27
[ "https://Stackoverflow.com/questions/65928345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/542838/" ]
Use ```js /^(.*?)\/upload\/.*?(v1.*)/ ``` See [regex proof](https://regex101.com/r/DXgXUI/1). **Explanation** ```js -------------------------------------------------------------------------------- ^ the beginning of the string ---------------------------------------------------------------...
Using split, you could match `/upload/` followed by at least as possible chars until to can assert `v1` to the right. ``` \/upload\/.*?\b(?=v1) ``` See a [regex demo](https://regex101.com/r/JyrYeI/1). **Explanation** * `\/upload\/` Match `/upload/` * `.*?` Match 0+ occurrences of any char except a newline, as leas...
50,254,146
So, I've been developing an App for 2 months with prism, and just now I've realized that the method OnNavigatedTo is been calling twice when I select an Item from a MasterDetailPage. I have no clue why it is happening, I'm sure I'm missing something but I'm about two days trying to solve it. I'll put some code here, ...
2018/05/09
[ "https://Stackoverflow.com/questions/50254146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9558802/" ]
I don't know if anybody is still interested in this but I ran into the same issue and figured out what is going on. All code samples I found register a NavigationPage like this: ``` containerRegistry.RegisterForNavigation<NavigationPage>("Navigation"); ``` In order to be able to do something like this on app launc...
I've noticed some inconsistent results with Prism as well from a previous project. If you are only seeing it now and it worked previously I would try and backtrack to see if the version you used was different. <https://github.com/PrismLibrary/Prism/issues>
4,201,158
I'm writing the code for a form, and submitting it to a php file using $.get(). On submitting the form, Firebug responds with the error : `Failed to load source for: <http://localhost/llm/llm.php?name=afaf>` If I only write `http://localhost/llm/llm.php?name=afaf` in the address bar then it works properly! Here's m...
2010/11/17
[ "https://Stackoverflow.com/questions/4201158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331609/" ]
<http://www.java2s.com/Code/CSharp/GUI-Windows-Form/Adialogbyuserdefinedproperty.htm> the above link shows the complete code for a similar application. It is the first link that popped up from googling "C sharp diablogbox". Remember 'Google is your friend'.
I am assuming you are using Visual Studio Express. Create a new Winforms C# application...That will give you what you need. It will even start you off with a new form. You won't need a reference to Visual Basic.
4,201,158
I'm writing the code for a form, and submitting it to a php file using $.get(). On submitting the form, Firebug responds with the error : `Failed to load source for: <http://localhost/llm/llm.php?name=afaf>` If I only write `http://localhost/llm/llm.php?name=afaf` in the address bar then it works properly! Here's m...
2010/11/17
[ "https://Stackoverflow.com/questions/4201158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331609/" ]
Create a Windows Form with all the required input fields, you have a choice of using MaskedTextBox controls to validate or creating normal TextBox controls with ErrorProvider control (see below for links). Launch the form as a modal dialog box. <http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbo...
I am assuming you are using Visual Studio Express. Create a new Winforms C# application...That will give you what you need. It will even start you off with a new form. You won't need a reference to Visual Basic.
4,201,158
I'm writing the code for a form, and submitting it to a php file using $.get(). On submitting the form, Firebug responds with the error : `Failed to load source for: <http://localhost/llm/llm.php?name=afaf>` If I only write `http://localhost/llm/llm.php?name=afaf` in the address bar then it works properly! Here's m...
2010/11/17
[ "https://Stackoverflow.com/questions/4201158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331609/" ]
<http://www.java2s.com/Code/CSharp/GUI-Windows-Form/Adialogbyuserdefinedproperty.htm> the above link shows the complete code for a similar application. It is the first link that popped up from googling "C sharp diablogbox". Remember 'Google is your friend'.
You can solve this problem quite elegantly with Windows Presentation Foundation. The textbox in this example will only allow future dates ``` <TextBox Name="StartDateEntryForm" Grid.Row="3" Grid.Column="1" Validation.ErrorTemplate="{StaticResource validationTemplate}" Style="{StaticResource textStyleTextBox}" Margi...
4,201,158
I'm writing the code for a form, and submitting it to a php file using $.get(). On submitting the form, Firebug responds with the error : `Failed to load source for: <http://localhost/llm/llm.php?name=afaf>` If I only write `http://localhost/llm/llm.php?name=afaf` in the address bar then it works properly! Here's m...
2010/11/17
[ "https://Stackoverflow.com/questions/4201158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331609/" ]
Create a Windows Form with all the required input fields, you have a choice of using MaskedTextBox controls to validate or creating normal TextBox controls with ErrorProvider control (see below for links). Launch the form as a modal dialog box. <http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbo...
You can solve this problem quite elegantly with Windows Presentation Foundation. The textbox in this example will only allow future dates ``` <TextBox Name="StartDateEntryForm" Grid.Row="3" Grid.Column="1" Validation.ErrorTemplate="{StaticResource validationTemplate}" Style="{StaticResource textStyleTextBox}" Margi...
152,485
With the clock change ahead in Europe - how does SQL Server deal with the clock change? Are there known issues related to a clock change?
2016/10/17
[ "https://dba.stackexchange.com/questions/152485", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/92505/" ]
SQL Server just uses the operating system's time. However, if your application code relies on functions like GETDATE(), then your code needs to be able to handle jumps forward (or backward) in time. For example, if your have code that does something like this: ``` SET @StartDate = GETDATE() (Do some work) IF DATEDIFF...
Your code has to be insulated for that - as Brent says, SQL Server just relies on whatever the operating system says, so it inherits its DST changes, explicit time zone changes, and drift. To avoid issues involving everything (except drift of course), I always put all of my servers - where practical - to UTC. No time z...
100,366
Suppose I want to use the phrase "many, many" to compound the "maniness" of the thing I'm describing. > > There are **many, many** people. > > > The people (of which there are **many, many**) > > > The first one is standard, but the second one is contended. *Can* it be used in that way? An example of one that ...
2013/01/17
[ "https://english.stackexchange.com/questions/100366", "https://english.stackexchange.com", "https://english.stackexchange.com/users/33012/" ]
One issue is that you are using *many, many* to compound the number. It doesn't do that: it simply emphasises *many*. Where an adjective is simply repeated for emphasis, you can't repeat it in the style of your second sentence. > > My love is like a red, red rose > > \*My love is like a rose which is red, red. > ...
This is best reserved for the spoken word I think. Use one "many" to convey the meaning, or revise the sentence using a different word, like "multitude," for example.
51,972
I want to know if this same circuit can be used for 220 or 230 volt input, and if there are any components that need to be modified. C3 has 600V capacity and C1 and C2 have 250 volt. ![Schematic](https://i.stack.imgur.com/w1y7B.jpg) [Link to original circuit diagram.](http://www.circuitstoday.com/temperature-controll...
2012/12/22
[ "https://electronics.stackexchange.com/questions/51972", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/17158/" ]
Richman's advice is good regarding the capacitor rating. However at twice the input voltage, the caps will charge up to the trigger voltage faster. So you will need to increase - probably double - the values of C1 and C2 to maintain the same control law. It is also unclear that the thermistors will operate correctly o...
What are the new motor's ratings? The new motor's voltage rating should be 220-230. If your new motor is larger than the original motor's power / current rating, you may need to adjust the inductor/thyristor and fuse ratings. Most likely, your motor will be the same power and so it will draw less current and so you can...
27,357,428
Can someone tell me how can i read csv file by each row and column wise in java without using external jars. I have tried the below code but here i am able to read only one column at a time. ``` public class ParseCSVs{ public static void main(String[] args) throws Exception { File file = new File("./input//SIMNum...
2014/12/08
[ "https://Stackoverflow.com/questions/27357428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1097774/" ]
Assuming you are using Java 8 you can use streams. For this there is a `lines` method on the `Files` class. Next you need to `map` from a `String` to a `String[]` which you can then process. ``` public class ParseCSVs{ public static void main(String[] args) throws Exception { File file = new File("./inpu...
You can use a Scanner class: <https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html> Here is example from some page from google search: <http://www.journaldev.com/2335/how-to-read-csv-file-using-java-scanner-class>
6,789,643
I have to get the (shortest)/(an optimal) distance between two points in 2D. I have to avoid shapes that are lines, that may be connected together. Any suggestion on how to represent the nodes I can travel on? I have thought of making a grid, but this doesn't sound very accurate or elegant. I would consider a node as u...
2011/07/22
[ "https://Stackoverflow.com/questions/6789643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234167/" ]
I think this is essentially Larsmans' answer made a bit more algorithmic: Nodes of the graph are the obstacle vertices. Each internal vertex actually represents two nodes: the concave and the convex side. 1. Push the start node onto the priority queue with a Euclidean heuristic distance. 2. Pop the top node from the ...
A grid, and A\* running through it is the way to go. All games i am aware of use A\* or an adaptation of it for the global route and complement it with **steering behaviour** for local accuracy. Maybe you were not aware that using steering behaviour will resolve all your concerns about accuracy (search-engine it). EDI...
6,789,643
I have to get the (shortest)/(an optimal) distance between two points in 2D. I have to avoid shapes that are lines, that may be connected together. Any suggestion on how to represent the nodes I can travel on? I have thought of making a grid, but this doesn't sound very accurate or elegant. I would consider a node as u...
2011/07/22
[ "https://Stackoverflow.com/questions/6789643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/234167/" ]
I think this is essentially Larsmans' answer made a bit more algorithmic: Nodes of the graph are the obstacle vertices. Each internal vertex actually represents two nodes: the concave and the convex side. 1. Push the start node onto the priority queue with a Euclidean heuristic distance. 2. Pop the top node from the ...
I think you can solve this by an A\* search on a graph defined as: * Vertices: origin, destination and all endpoints of obstacle edges. * Edges (successor function): any pair of the previous where the corresponding line does not cross any obstacle's edges. A naive implementation would just check for intersection betwe...
16,916
I have a 5 speed freewheel that I need to take of from hub, but the standard freewheel tool that I do have does not fit. On the freewheel following text is engraved: UC SHIMANO SIS MF Z015 China It seems to me that tool would need to have 12 splines. ![enter image description here](https://i.stack.imgur.com/YyMqE.j...
2013/08/01
[ "https://bicycles.stackexchange.com/questions/16916", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/5563/" ]
I found a bunch of forum posts from people with similar problems. Shimano freewheels made prior to about 1985 have smaller diameters, about 20mm instead of 22-23mm that they have today. A search for "Shimano freewheel remover 20mm" brings up some useful results. It looks like Bicycle Research Tools makes a remover cal...
To answer your question Sir. The tool you need is a "Pin Tool" There are various brands that make them. My choice is Park Tool SPA-2 for the Shimano & Campagnolo free-wheel sprocket cassettes. RJ-The Bike Guy on YouTube has an excellent video on the disassembly & service of this type of hub. Be sure to see this before ...
16,916
I have a 5 speed freewheel that I need to take of from hub, but the standard freewheel tool that I do have does not fit. On the freewheel following text is engraved: UC SHIMANO SIS MF Z015 China It seems to me that tool would need to have 12 splines. ![enter image description here](https://i.stack.imgur.com/YyMqE.j...
2013/08/01
[ "https://bicycles.stackexchange.com/questions/16916", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/5563/" ]
I found a bunch of forum posts from people with similar problems. Shimano freewheels made prior to about 1985 have smaller diameters, about 20mm instead of 22-23mm that they have today. A search for "Shimano freewheel remover 20mm" brings up some useful results. It looks like Bicycle Research Tools makes a remover cal...
Kengine FR-04 Old Style Shimano Freewheel Remover Bike Tool fits FFS TL-FW20 This is what you need. It has 12 splines and is 20mm diameter. it is being sold on Ebay by the\_bikesmiths. I hope this helps. it took me awhile to find it.
16,916
I have a 5 speed freewheel that I need to take of from hub, but the standard freewheel tool that I do have does not fit. On the freewheel following text is engraved: UC SHIMANO SIS MF Z015 China It seems to me that tool would need to have 12 splines. ![enter image description here](https://i.stack.imgur.com/YyMqE.j...
2013/08/01
[ "https://bicycles.stackexchange.com/questions/16916", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/5563/" ]
Kengine FR-04 Old Style Shimano Freewheel Remover Bike Tool fits FFS TL-FW20 This is what you need. It has 12 splines and is 20mm diameter. it is being sold on Ebay by the\_bikesmiths. I hope this helps. it took me awhile to find it.
To answer your question Sir. The tool you need is a "Pin Tool" There are various brands that make them. My choice is Park Tool SPA-2 for the Shimano & Campagnolo free-wheel sprocket cassettes. RJ-The Bike Guy on YouTube has an excellent video on the disassembly & service of this type of hub. Be sure to see this before ...
16,249,211
ScreenShot: ![enter image description here](https://i.stack.imgur.com/pkX5M.png) I am adding uipangesture to an array of uimageviews like in the following code, but I want to add uipangesture to brown, green color and pink color image views only. How to do this in a loop? Ultimately I want to pan only three imagevi...
2013/04/27
[ "https://Stackoverflow.com/questions/16249211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385393/" ]
You could always use [TranslatePoint](http://msdn.microsoft.com/en-us/library/system.windows.uielement.translatepoint.aspx) to translate coordinates relative to one UIElement to coordinates relative to another UIElement: ``` var toggleButtonPosition = toggleButton.TranslatePoint(new Point(0, 0), stackPanel); var textB...
Basically, the position of a control is determined by the control which holds it, the margin property, the alignement and such. You could use this to determine the position of the child control.
18,569,757
I need to have a conditional statement added on a .jsp page that identifies all authenticated pages in order to insert a specific tracking code in place. I am not accustomed writing any jstl but I have this so far ``` <c:if test='${not empty authenticatedUser}'> my tagging code </c:if> ``` I would like to an ...
2013/09/02
[ "https://Stackoverflow.com/questions/18569757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400854/" ]
Use this - ``` <c:if test="${not empty authenticatedUser && url ne 'someUrl.html'}"> my tagging code </c:if> ``` Single quotes is coming two times. That might be creating an issue.
EL expressions (the `${not empty authenticatedUser}`) can contain logical expressions like: ``` <c:if test='${not empty authenticatedUser and url ne "someUrl.html"}'> my tagging code </c:if> ```
41,100,303
I'd like to convert the API call into a `pandas` `data frame`. At the moment, the [API](http://api.football-data.org/v1/competitions/398/teams) is very unorganised and I'd like to incorporate `pandas` to make it easier to read/edit/manipulate. I have attempted the following: ``` r = requests.get('http://api.football...
2016/12/12
[ "https://Stackoverflow.com/questions/41100303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4847912/" ]
`pd.read_json` expects a string. However, `r.json()` returns a dict object. In your case, you should explore the structure of the returned JSON object by looking at `x.keys()`. This will yield `['count', '_links', 'teams']`. You are probably interested in the 'teams' field. As such, you should do the following: ``` ...
`read_json` function [expects](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_json.html) a string. You are providing a JSON object (parsed using `requests` library's `json` method). What you need to do is to convert the object back to a string using `json.dumps` method: ``` import json r = request...
41,100,303
I'd like to convert the API call into a `pandas` `data frame`. At the moment, the [API](http://api.football-data.org/v1/competitions/398/teams) is very unorganised and I'd like to incorporate `pandas` to make it easier to read/edit/manipulate. I have attempted the following: ``` r = requests.get('http://api.football...
2016/12/12
[ "https://Stackoverflow.com/questions/41100303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4847912/" ]
`read_json` function [expects](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_json.html) a string. You are providing a JSON object (parsed using `requests` library's `json` method). What you need to do is to convert the object back to a string using `json.dumps` method: ``` import json r = request...
This simple solution worked for me (the api link in question is not accessible by me) ``` df=pd.read_json('https://api.coinmarketcap.com/v1/ticker/?limit=10') df.head() 24h_volume_usd available_supply id last_updated \ 0 12465900000 16812425 bitcoin 1516379664 1 48276700...
41,100,303
I'd like to convert the API call into a `pandas` `data frame`. At the moment, the [API](http://api.football-data.org/v1/competitions/398/teams) is very unorganised and I'd like to incorporate `pandas` to make it easier to read/edit/manipulate. I have attempted the following: ``` r = requests.get('http://api.football...
2016/12/12
[ "https://Stackoverflow.com/questions/41100303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4847912/" ]
`pd.read_json` expects a string. However, `r.json()` returns a dict object. In your case, you should explore the structure of the returned JSON object by looking at `x.keys()`. This will yield `['count', '_links', 'teams']`. You are probably interested in the 'teams' field. As such, you should do the following: ``` ...
This simple solution worked for me (the api link in question is not accessible by me) ``` df=pd.read_json('https://api.coinmarketcap.com/v1/ticker/?limit=10') df.head() 24h_volume_usd available_supply id last_updated \ 0 12465900000 16812425 bitcoin 1516379664 1 48276700...
26,539,837
I currently have a `varchar` column with 400 entries. Each row is formatted like this: ``` 'Thu, 18 Sep 2014 23:59:06 ' ``` Is it possible to change this `varchar` column to `datetime`? I have tried this... ``` ALTER TABLE BE ALTER COLUMN pubDate datetime ``` But I get the error > > Msg 241, Level 16, State ...
2014/10/24
[ "https://Stackoverflow.com/questions/26539837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3945848/" ]
I would create a new datetime column, then write an update statement to insert the correct values, then drop the old column (if desired). The update statement would look something like this: ``` update be set be.dt=convert(datetime, be.pubDate) ``` edit: just about to say the same as okaram in the comments. You pr...
the correct format for datetime is: ``` YYYY-MM-DD hh:mm:ss ``` Change your entries and it should work.
24,503,716
I have this json ``` $x = {"response":{},"status":{"detail":{"operation":"internal","errormessage":"Login session for token xxx is expired.","error":"Login session for token is expired or invalid.","errorcode":"500"},"success":false}} ``` when I try $x->success it tells me `Trying to get property of non-object` ...
2014/07/01
[ "https://Stackoverflow.com/questions/24503716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295189/" ]
Try this, it will serve your purpose ``` webView.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN) { WebView webView = (WebView) v; switch(keyCode) { case KeyEvent.KEYCO...
Use this method. As your target Webview declared: ``` WebView myWebView; ``` follow with below: ``` @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN){ switch(keyCode) { case KeyEvent.KEYCODE_BACK: if(myWebView...
24,503,716
I have this json ``` $x = {"response":{},"status":{"detail":{"operation":"internal","errormessage":"Login session for token xxx is expired.","error":"Login session for token is expired or invalid.","errorcode":"500"},"success":false}} ``` when I try $x->success it tells me `Trying to get property of non-object` ...
2014/07/01
[ "https://Stackoverflow.com/questions/24503716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295189/" ]
Try this, it will serve your purpose ``` webView.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN) { WebView webView = (WebView) v; switch(keyCode) { case KeyEvent.KEYCO...
The link is being opened into a new webview intent. That is why when you click the back button, the default event of back button which is "to go back one intent" is being called. Overriding it like how Badrul does is the best way i beleive.
24,503,716
I have this json ``` $x = {"response":{},"status":{"detail":{"operation":"internal","errormessage":"Login session for token xxx is expired.","error":"Login session for token is expired or invalid.","errorcode":"500"},"success":false}} ``` when I try $x->success it tells me `Trying to get property of non-object` ...
2014/07/01
[ "https://Stackoverflow.com/questions/24503716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295189/" ]
Use this method. As your target Webview declared: ``` WebView myWebView; ``` follow with below: ``` @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN){ switch(keyCode) { case KeyEvent.KEYCODE_BACK: if(myWebView...
The link is being opened into a new webview intent. That is why when you click the back button, the default event of back button which is "to go back one intent" is being called. Overriding it like how Badrul does is the best way i beleive.
35,287,170
My 1 file is city.html which contains the following code ``` <script language="javascript">alert("Page Called"); </script> 'Bhubaneshwar', 'Orissa', 'India' ``` My another file index.php contains the following code ``` $x=file_get_contents("city.html"); $x=array($x); echo $x[0]; ``` It shows the following output ...
2016/02/09
[ "https://Stackoverflow.com/questions/35287170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3257170/" ]
You are trying to separate DAO/Service/WEB layers into standalone JARs. Do you expect to distribute DAO artifact or Service artifact as standalone library into artifact repository (e.g. Maven Central, Internal Nexus or Internal Artifactory)? In such case you would need to very carefully treat API of each standalone JA...
Eclipse does not use maven when building but only reads the pom(s) to figure how it should configure its internal builder. This can easily lead to that kind of problems where *it works* when you run the application directly inside Eclipse, and *it fails* when you do a maven build (or the opposite). You should control ...
10,357,192
Can someone explain this behavior? I am well aware of machine-level representation of floating point numbers. This seems to be related to printf and its formats. Both numbers are represented exactly by floating-point notation (check: multiplying by 64 gives an integer). ``` #include <stdio.h> #include <iostream> using...
2012/04/27
[ "https://Stackoverflow.com/questions/10357192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/443854/" ]
It's "round half to even" or "Banker's rounding". The last digit of the rounded representation is chosen to be even if the number is exactly half way between the two. <http://linuxgazette.net/144/misc/lg/a_question_of_rounding_in_issue_143.html>: "For the GNU C library, the rounding rule used by printf() is "banker...
The `%9.5f` output gives the number with 5 digits after the decimal dot which is the nearest of the source number.
16,975,393
I would like to walk the page table, so I have accessed the current->mm, but it gives NULL value. I'm working on linux kernel 3.9 and I don't understand how could current->mm is zero. Is there something I miss here?
2013/06/07
[ "https://Stackoverflow.com/questions/16975393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1023045/" ]
It means you are in a kernel thread. In Linux, kernel threads have no mm struct. A kernel thread borrows the mm from the previous user thread and records it in active\_mm. So **you should use active\_mm instead**. --- **More details:** in `/kernel/sched/core.c` you can find the following code: ``` static inline v...
Need for active\_mm assignment : The call to `switch_mm()`, which results in a TLB flush, is avoided by “borrowing” the `mm_struct` used by the previous task and placing it in task\_`struct→active_mm`. This technique has made large improvements to context switches times.
6,760,273
Given the following query: ``` SELECT M.year, COUNT(C.eid) FROM Card AS C, Month AS M WHERE EXISTS(SELECT 1 FROM Charge AS CH WHERE CH.usingcard=C.eid AND CH.year=M.year) GROUP BY M.year ``` where EXISTS is used to avoid the number of 'Charge' matching the given year/card changing the count. The...
2011/07/20
[ "https://Stackoverflow.com/questions/6760273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853679/" ]
This avoids the the problem of multiple Charge records: ``` SELECT M.year, COUNT(distinct CH.usingcard) FROM Card AS C CROSS JOIN Month AS M LEFT JOIN Charge CH on CH.usingcard=C.eid AND CH.year=M.year GROUP BY M.year ``` This counts how may *different* cards were charged in the year. Non-joining rows will have `CH....
If all arguments are NULL, COALESCE returns NULL. ``` COALESCE(expression1,...n) is equivalent to the following CASE expression: CASE WHEN (expression1 IS NOT NULL) THEN expression1 WHEN (expression2 IS NOT NULL) THEN expression2 ... ELSE expressionN END ``` The following example shows how COALES...
6,760,273
Given the following query: ``` SELECT M.year, COUNT(C.eid) FROM Card AS C, Month AS M WHERE EXISTS(SELECT 1 FROM Charge AS CH WHERE CH.usingcard=C.eid AND CH.year=M.year) GROUP BY M.year ``` where EXISTS is used to avoid the number of 'Charge' matching the given year/card changing the count. The...
2011/07/20
[ "https://Stackoverflow.com/questions/6760273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853679/" ]
The NOT EXISTS is excluding zero counts: as expected If you want zero counts, then you need the OUTER JOIN. However, your FROM clause is a CROSS JOIN so you'd get wrong counts. And you can ignore the Card table because usingcard has the same data (otherwise you wouldn't use it in your EXISTS) It is this simple... ``...
If all arguments are NULL, COALESCE returns NULL. ``` COALESCE(expression1,...n) is equivalent to the following CASE expression: CASE WHEN (expression1 IS NOT NULL) THEN expression1 WHEN (expression2 IS NOT NULL) THEN expression2 ... ELSE expressionN END ``` The following example shows how COALES...
6,760,273
Given the following query: ``` SELECT M.year, COUNT(C.eid) FROM Card AS C, Month AS M WHERE EXISTS(SELECT 1 FROM Charge AS CH WHERE CH.usingcard=C.eid AND CH.year=M.year) GROUP BY M.year ``` where EXISTS is used to avoid the number of 'Charge' matching the given year/card changing the count. The...
2011/07/20
[ "https://Stackoverflow.com/questions/6760273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853679/" ]
This avoids the the problem of multiple Charge records: ``` SELECT M.year, COUNT(distinct CH.usingcard) FROM Card AS C CROSS JOIN Month AS M LEFT JOIN Charge CH on CH.usingcard=C.eid AND CH.year=M.year GROUP BY M.year ``` This counts how may *different* cards were charged in the year. Non-joining rows will have `CH....
The NOT EXISTS is excluding zero counts: as expected If you want zero counts, then you need the OUTER JOIN. However, your FROM clause is a CROSS JOIN so you'd get wrong counts. And you can ignore the Card table because usingcard has the same data (otherwise you wouldn't use it in your EXISTS) It is this simple... ``...
6,760,273
Given the following query: ``` SELECT M.year, COUNT(C.eid) FROM Card AS C, Month AS M WHERE EXISTS(SELECT 1 FROM Charge AS CH WHERE CH.usingcard=C.eid AND CH.year=M.year) GROUP BY M.year ``` where EXISTS is used to avoid the number of 'Charge' matching the given year/card changing the count. The...
2011/07/20
[ "https://Stackoverflow.com/questions/6760273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853679/" ]
This avoids the the problem of multiple Charge records: ``` SELECT M.year, COUNT(distinct CH.usingcard) FROM Card AS C CROSS JOIN Month AS M LEFT JOIN Charge CH on CH.usingcard=C.eid AND CH.year=M.year GROUP BY M.year ``` This counts how may *different* cards were charged in the year. Non-joining rows will have `CH....
You could the NULLIF function which can be used inside the count function. This function takes two parameters: if the parameters are equal, then it returns null, else it returns the value of the first parameter. ``` SELECT M.year, COUNT (NULLIF (CH.usingcard, NULL)) FROM Month as M left join Charge as CH ON CH.Year =...
6,760,273
Given the following query: ``` SELECT M.year, COUNT(C.eid) FROM Card AS C, Month AS M WHERE EXISTS(SELECT 1 FROM Charge AS CH WHERE CH.usingcard=C.eid AND CH.year=M.year) GROUP BY M.year ``` where EXISTS is used to avoid the number of 'Charge' matching the given year/card changing the count. The...
2011/07/20
[ "https://Stackoverflow.com/questions/6760273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853679/" ]
The NOT EXISTS is excluding zero counts: as expected If you want zero counts, then you need the OUTER JOIN. However, your FROM clause is a CROSS JOIN so you'd get wrong counts. And you can ignore the Card table because usingcard has the same data (otherwise you wouldn't use it in your EXISTS) It is this simple... ``...
You could the NULLIF function which can be used inside the count function. This function takes two parameters: if the parameters are equal, then it returns null, else it returns the value of the first parameter. ``` SELECT M.year, COUNT (NULLIF (CH.usingcard, NULL)) FROM Month as M left join Charge as CH ON CH.Year =...
608,271
I am looking to return a table of results from an Oracle function. Using a cursor would be easiest, but the application I have to work this into will not accept a cursor as a return value. The alternative is to create a type (likely wrapped in a package) to go along with this function. However, it seems somewhat superf...
2009/03/03
[ "https://Stackoverflow.com/questions/608271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**UPDATE:** See the first comment for TABLE solution withou limit of size. Return an **VARRAY** or use a **PIPELINED** function to query from them. * For **VARRAY** look in [this](http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html) article for a detail. Code example from there: ...
You could always return XML from your function if that suits the application developers. XML can be generated a number of ways in Oracle, depending on what you have installed and what version you're using. XMLTYPE is very useful in certain contexts, and can be generated from SQL using the XMLElement, XMLAttributes, X...
111,480
It seems Kylo has an obsession of Darth Vader and has an interest in the dark side because of it. Does he not realize that Darth Vader turned good and helped destroy the Empire (Spoilers?)? I feel like Kylo would've seen how much better the Light Side was as it was able to turn Vader from the Dark Side if he had know...
2015/12/21
[ "https://scifi.stackexchange.com/questions/111480", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/57682/" ]
Kylo Ren knows about Vader's fate, after all, > > he trained under the person who was responsible for Vader's return to the Light Side of the force. > > > Snoke and Ren discuss it in the movie. From the novelization: > > “Yes. Such a simple thing. Such a foolish error of judgment. A momentary lapse in an othe...
Kylo Ren knows that Anakin had turned back to the Light. What he knows about Anakin's earlier fall to the Dark Side is unknown as of this time. =============================================================================================================================================== Kylo Ren is aware, at the time ...
111,480
It seems Kylo has an obsession of Darth Vader and has an interest in the dark side because of it. Does he not realize that Darth Vader turned good and helped destroy the Empire (Spoilers?)? I feel like Kylo would've seen how much better the Light Side was as it was able to turn Vader from the Dark Side if he had know...
2015/12/21
[ "https://scifi.stackexchange.com/questions/111480", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/57682/" ]
Kylo Ren knows about Vader's fate, after all, > > he trained under the person who was responsible for Vader's return to the Light Side of the force. > > > Snoke and Ren discuss it in the movie. From the novelization: > > “Yes. Such a simple thing. Such a foolish error of judgment. A momentary lapse in an othe...
To complement Praxis's answer: There is a **plausible** way that Ben/Kylo Ren may have found out details about Anakin's **fall** to the Dark Side (Praxis's answer covered his un-falling). * Bail Organa was with Yoda and Obi-Wan; he took them to Coruscant to find the beacon in Jedi temple and reverse it - where they l...
111,480
It seems Kylo has an obsession of Darth Vader and has an interest in the dark side because of it. Does he not realize that Darth Vader turned good and helped destroy the Empire (Spoilers?)? I feel like Kylo would've seen how much better the Light Side was as it was able to turn Vader from the Dark Side if he had know...
2015/12/21
[ "https://scifi.stackexchange.com/questions/111480", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/57682/" ]
Kylo Ren knows that Anakin had turned back to the Light. What he knows about Anakin's earlier fall to the Dark Side is unknown as of this time. =============================================================================================================================================== Kylo Ren is aware, at the time ...
To complement Praxis's answer: There is a **plausible** way that Ben/Kylo Ren may have found out details about Anakin's **fall** to the Dark Side (Praxis's answer covered his un-falling). * Bail Organa was with Yoda and Obi-Wan; he took them to Coruscant to find the beacon in Jedi temple and reverse it - where they l...
37,188,563
I've following array: ``` Array ( [0] => class="amount">€39,00 [2] => class="subscription-details"> [4] => für [5] => 1 [6] => month ) ``` I want to check if the sixth element of the value is "month". I use this code: ``` print_r($test[6]); //Output month if($test[6] == 'month'){ echo 'A...
2016/05/12
[ "https://Stackoverflow.com/questions/37188563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1581406/" ]
It does output Alex. Here is the simplest test case which almost repeats your code as I understand it. ``` <?php $test = [ 0 => 'class="amount">€39,00', 2 => 'class="subscription-details">', 4 => 'für', 5 => 1, 6 => 'month</span>', ]; var_dump($test[6]); var_export($test[6]); if (trim(strip_tags(...
Well, this seems to be a problem... ``` var_dump($test[6]) outputs = string(12) ``` `month` is not 12 characters long. You probably have some non-printable characters in that string apart from `month`
43,219,218
I have a batch command that will move certain files from one folder to another folder, as follows: ``` move /-y "U:\REVIT\REVIT FAMILES\*.00*.rfa" "U:\REVIT\Revit Backup Files" pause ``` This moves the backup files that are created and have extensions of `.001.rfa`, `.002.rfa` etc. to another folder, but it only mo...
2017/04/04
[ "https://Stackoverflow.com/questions/43219218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7817186/" ]
In the Python documentation there is a small excerpt on this. > > On Windows, the standard Python installer already associates the .py extension with a file type (Python.File) and gives that file type an open command that runs the interpreter (`D:\Program Files\Python\python.exe "%1" %*`). This is enough to make scri...
You don't have shell scripts on Windows, you have batch or powershell. If your reading is teaching Unix things, get a virtual machine running (insert popular Linux distribution here). Regarding python, you just execute `python script.py`
6,435,520
The following query is working successfully. ``` var tabs = ( from r in db.TabMasters orderby r.colID select new { r.colID, r.FirstName, r.LastName }) .Skip(rows * (page - 1)).Take(rows); ``` Now I want to return JsonResult as like ``` var jsonData = n...
2011/06/22
[ "https://Stackoverflow.com/questions/6435520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735598/" ]
I suspect that it's as simple as pushing the last part into an in-process query using `AsEnumerable()`: ``` var jsonData = new { total = (int)Math.Ceiling((float)totalRecords / (float)rows), page = page, records = totalRecords, rows = (from r in tabs.AsEnumerable() select new { id = r.colID...
It's because it's adding to the LINQ query that is your `tabs` IQueryable. That is then trying to turn the LINQ expression into a SQL query and the provider doesn't support projecting arrays. You can either change the assignment of the tabs variable's LINQ expression to use ToList to materialize the DB results right t...
28,392,702
I want a background (color) to be displayed by default for each article. I thougt of doing this in a css file, but I don't know where to place the statement. Btw I can't find the definition of the article tag in any css file. The following code shows 2 articles: ``` <div class="items-row cols-3 row-0 row"> <div c...
2015/02/08
[ "https://Stackoverflow.com/questions/28392702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2355146/" ]
I found an answer to my own question. The mark\_boundaries in the skimage.segmentation package does exactly what I needed. Usage: ``` processed = mark_boundaries(frame, segments==some_segment) ``` Here frame is he current image frame and segments is the label array. some\_segment is the label integer index whose bo...
You can make use of the find\_contours function available in skimage.measure module to find the co-ordinates of the pixels along the boundary. An example is available at [find\_contours.](http://scikit-image.org/docs/dev/auto_examples/plot_polygon.html/%22Link%22). Next, you can change for change in both directions as ...
73,202,559
I am trying to implement a function returning different type of value based on its parameter. I could do it with just using javascript, but I want Typescript to correctly infer return type of this function too. So I used Generic to extract return type, but TS(2322) error is reported for every return statement. Is the...
2022/08/02
[ "https://Stackoverflow.com/questions/73202559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17413375/" ]
The `getDate` method of `Date` returns the day of the date (in both cases you gave as an exampel, this is `01`). To compare between dates, you can use the `getTime` method (returns the number of milliseconds passed since Jan 1st, 1970) [getDate documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Ref...
> > you can use momentjs like this > > > ```js var bool2 = moment('2019-10-20').isSame('2019-10-20'); //true console.log(bool2); ``` ```html <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script> ```
60,831,429
I am running blender with a python file via shell like this `./blender visualizer.blend -P Visualizer.py` in my python file I have a socket server, that receives a list and loops over the list to create meshes accordingly. Now the problem is I have to use `threading` so that blender doesn't freeze because otherwise ble...
2020/03/24
[ "https://Stackoverflow.com/questions/60831429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3540131/" ]
On blender API docs it clearly warns you not to use threading at all. You can Create Operator and run it with timer event. with timer event you can poll network messages from socket and perform any action.
I came to realize that blender needs time to finish drawing an object before asking it to draw another one. so all I had to do was to put `time.sleep(1)` in my loop for creating objects.
54,627,893
My question basically is: How can I tell my database to do a seq scan and STOP after the first match to my WHERE condition? Assuming I want to find the first event of a certain type, I could write the following query: ``` select * from installs where country = 'China' order by install_date limit 1 ``` The problem ...
2019/02/11
[ "https://Stackoverflow.com/questions/54627893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10719566/" ]
Redshift's general strategy is to do a lot of scanning, but parallelize it. Any case that involves getting a single row is not going to be ideal. That said, you can do four things: **1. Reduce scanning, to a point** If country will always be the field filtered on, set the sortkey for the table to a compound sortkey o...
If you remove the `ORDER BY`, then it can work efficiently. The requirement to sort the results means it needs to examine all rows where the country is China, which is not efficient for returning one item. The `where country = 'China'` clause is efficient if `SORTKEY = country` since it can skip over any storage bloc...
48,425,851
I have a few errors during installation of Sonata Media Bundle on Symfony 4 application which had no place with Symfony 2.8. The first error: ``` sensio/generator-bundle v3.1.6 requires symfony/framework-bundle ~2.7|~3.0 ``` Next one, after solving the previous: ``` - php-amqplib/php-amqplib v2.7.0 requires ext-b...
2018/01/24
[ "https://Stackoverflow.com/questions/48425851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6316792/" ]
I found the solutions for all of them, but it took some time, so I want to post it here for everyone who encounter this problem. The first error with `sensio/generator-bundle` is solved by requiring dev version of `sonata-media-bundle`: ``` composer require sonata-project/media-bundle:3.x-dev ``` Solution for the n...
For the > > Unrecognized options "naming\_strategy, auto\_mapping, mappings" under > "doctrine.orm" > > > error, try to add the configurations in orm.entity\_managers instead of in orm in your config/packages/doctrine.yaml, something like this: ``` doctrine: dbal: url: '%env(resolve:DATABASE_URL)%' ...
61,405
Created a class in an external script which is dependent on the Wordpress environment. Since it's a class I intend to use on various projects, I decided to dynamically create a path to wp-blog-header.php and here's what I came up with. It currently works for me, but I need to ensure that its foolproof. ``` $docRoot = ...
2012/08/09
[ "https://wordpress.stackexchange.com/questions/61405", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13176/" ]
In the generic case, there is no performant solution other than to check every file and folder that is publicly accessible, and then all the parent folders. Since this is not a feasible or excusable operation to perform on every page load or request, you're left with two other options: * Define the location manually,...
As per the Codex, <http://codex.wordpress.org/Integrating_WordPress_with_Your_Website> ``` <?php require('/the/path/to/your/wp-blog-header.php'); ?> ``` Whether or not your means and method is foolproof is entirely dependent upon your setup and the locations in which you are placing your scripts, relative to your W...
61,405
Created a class in an external script which is dependent on the Wordpress environment. Since it's a class I intend to use on various projects, I decided to dynamically create a path to wp-blog-header.php and here's what I came up with. It currently works for me, but I need to ensure that its foolproof. ``` $docRoot = ...
2012/08/09
[ "https://wordpress.stackexchange.com/questions/61405", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13176/" ]
As per the Codex, <http://codex.wordpress.org/Integrating_WordPress_with_Your_Website> ``` <?php require('/the/path/to/your/wp-blog-header.php'); ?> ``` Whether or not your means and method is foolproof is entirely dependent upon your setup and the locations in which you are placing your scripts, relative to your W...
You just need the followingcode to apply to get real path for the `wp-blog-header.php` ``` $scriptPath = dirname(__FILE__); $path = realpath($scriptPath . '/./'); $filepath = split("wp-content", $path); // print_r($filepath); define('WP_USE_THEMES', false); require(''.$filepath[0].'/wp-blog-header.php'); ```
61,405
Created a class in an external script which is dependent on the Wordpress environment. Since it's a class I intend to use on various projects, I decided to dynamically create a path to wp-blog-header.php and here's what I came up with. It currently works for me, but I need to ensure that its foolproof. ``` $docRoot = ...
2012/08/09
[ "https://wordpress.stackexchange.com/questions/61405", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13176/" ]
As per the Codex, <http://codex.wordpress.org/Integrating_WordPress_with_Your_Website> ``` <?php require('/the/path/to/your/wp-blog-header.php'); ?> ``` Whether or not your means and method is foolproof is entirely dependent upon your setup and the locations in which you are placing your scripts, relative to your W...
BTW, if you want to include worpdress core (+theme functions), its better to user: ``` require('/wp-load.php'); ``` and NOT ``` require('/wp-blog-header.php'); ```
61,405
Created a class in an external script which is dependent on the Wordpress environment. Since it's a class I intend to use on various projects, I decided to dynamically create a path to wp-blog-header.php and here's what I came up with. It currently works for me, but I need to ensure that its foolproof. ``` $docRoot = ...
2012/08/09
[ "https://wordpress.stackexchange.com/questions/61405", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13176/" ]
In the generic case, there is no performant solution other than to check every file and folder that is publicly accessible, and then all the parent folders. Since this is not a feasible or excusable operation to perform on every page load or request, you're left with two other options: * Define the location manually,...
You just need the followingcode to apply to get real path for the `wp-blog-header.php` ``` $scriptPath = dirname(__FILE__); $path = realpath($scriptPath . '/./'); $filepath = split("wp-content", $path); // print_r($filepath); define('WP_USE_THEMES', false); require(''.$filepath[0].'/wp-blog-header.php'); ```
61,405
Created a class in an external script which is dependent on the Wordpress environment. Since it's a class I intend to use on various projects, I decided to dynamically create a path to wp-blog-header.php and here's what I came up with. It currently works for me, but I need to ensure that its foolproof. ``` $docRoot = ...
2012/08/09
[ "https://wordpress.stackexchange.com/questions/61405", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/13176/" ]
In the generic case, there is no performant solution other than to check every file and folder that is publicly accessible, and then all the parent folders. Since this is not a feasible or excusable operation to perform on every page load or request, you're left with two other options: * Define the location manually,...
BTW, if you want to include worpdress core (+theme functions), its better to user: ``` require('/wp-load.php'); ``` and NOT ``` require('/wp-blog-header.php'); ```
10,368,308
I am struggling to find a good way to run running totals with a group by in it, or the equivalent. The below cursor based running total works on a complete table, but I would like to expand this to add a "Client" dimension. So I would get running totals as the below creates but for each company (ie Company A, Company B...
2012/04/28
[ "https://Stackoverflow.com/questions/10368308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1363498/" ]
This is finally simple to do in SQL Server 2012, where SUM and COUNT support OVER clauses that contain ORDER BY. Using Cris's #Checks table definition: ``` SELECT CompanyID, count(*) over ( partition by CompanyID order by Cleared, ID ) as cnt, str(100.0*sum(Amount) over ( partition by CompanyID ...
I didn't exactly understand the schema you were pulling from, but here is a quick query using a temp table that shows how to do a running total in a set based operation. ``` CREATE TABLE #Checks ( ID int IDENTITY(1,1) PRIMARY KEY ,CompanyID int NOT NULL ,Amount float NOT NULL ,Cleared datetime NOT NUL...
10,368,308
I am struggling to find a good way to run running totals with a group by in it, or the equivalent. The below cursor based running total works on a complete table, but I would like to expand this to add a "Client" dimension. So I would get running totals as the below creates but for each company (ie Company A, Company B...
2012/04/28
[ "https://Stackoverflow.com/questions/10368308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1363498/" ]
I originally started posting the SQL Server 2012 equivalent (since you didn't mention what version you were using). Steve has done a great job of showing the simplicity of this calculation in the newest version of SQL Server, so I'll focus on a few methods that work on earlier versions of SQL Server (back to 2005). I'...
I didn't exactly understand the schema you were pulling from, but here is a quick query using a temp table that shows how to do a running total in a set based operation. ``` CREATE TABLE #Checks ( ID int IDENTITY(1,1) PRIMARY KEY ,CompanyID int NOT NULL ,Amount float NOT NULL ,Cleared datetime NOT NUL...
62,375,204
[![T](https://i.stack.imgur.com/4ZEOH.png)](https://i.stack.imgur.com/4ZEOH.png) This is my discord.py bot. When I type `m!rate (person)` It sends me a text like this. However, I don't want the `('` and `',)` at the beginning and end of the message. This is my code: ``` @client.command() async def rate(ctx, *membe...
2020/06/14
[ "https://Stackoverflow.com/questions/62375204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12920146/" ]
Using `*` in a parameter makes the function pass positional arguments into a tuple, hence the brackets. This is usually for when you want to unpack an arbitrary amount of arguments. To fix it, just remove `*`, and also add a type for the parameter if you want: ```py @client.command() async def rate(ctx, member: disco...
If you want your bot to mention one person per command : ```py @client.command() async def rate(ctx, *member): if member: "".join(member) value = random.randint(1,10) for user in ctx.guild.members: if user.name.lower() == member.lower() or user.nick.lower() == member.lower(): ...
71,241,408
I'm writing quite some Powershell modules to be used with different kind of (rest) api's. The first thing that you need to do when connecting to an API is creating a session with authentication credentials. Now my question is: is it possible to store this session variable somewhere in memory, so it can be used with lat...
2022/02/23
[ "https://Stackoverflow.com/questions/71241408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17167219/" ]
You could assign the result of the call to `New-GitlabSession` to the `$PSDefaultParameterValues` automatic variable: ``` $PSDefaultParameterValues['Get-Project:Session'] = New-GitlabSession -GitlabToken 'your token' ``` Now PowerShell will automatically provide the session object as the argument to `-Session` unles...
Thanks to the feedback of Mathias R. Jessen, I have transformed my code into this working example: I have the following Functions: ``` function Set-DefaultParameters { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [pscustomobject]$Session ) $PSDefaultParameterValues['Get...
65,932,762
I was trying to log the data flow activity information by using the data flow activity's output object which has a key named 'metrics' which contains 'RowsRead' and 'RowsWritten' but sometimes when data flow activity insert data into database, the metrics show 'NULL' value although records were read and written into da...
2021/01/28
[ "https://Stackoverflow.com/questions/65932762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15096986/" ]
Add this line of code in your first activity where you set your text to your button: To change background color: ``` placeHolder.setBackgroundColor(Color.parseColor("#FF0000")); ``` To change text color: ``` placeHolder.setTextColor(Color.parseColor("#FF0000")); ``` **Usage:** **MainActivity.java** ``` pack...
You can use GreenRobot. Then you can do anything from other activities. Here is the link [Event Bus](https://github.com/greenrobot/EventBus)
65,932,762
I was trying to log the data flow activity information by using the data flow activity's output object which has a key named 'metrics' which contains 'RowsRead' and 'RowsWritten' but sometimes when data flow activity insert data into database, the metrics show 'NULL' value although records were read and written into da...
2021/01/28
[ "https://Stackoverflow.com/questions/65932762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15096986/" ]
you can use startActivityforResult() insted of startActivity() and then when you come back from second class to the first class then set red color tor your button onActivityResult() function thanks
You can use GreenRobot. Then you can do anything from other activities. Here is the link [Event Bus](https://github.com/greenrobot/EventBus)
65,932,762
I was trying to log the data flow activity information by using the data flow activity's output object which has a key named 'metrics' which contains 'RowsRead' and 'RowsWritten' but sometimes when data flow activity insert data into database, the metrics show 'NULL' value although records were read and written into da...
2021/01/28
[ "https://Stackoverflow.com/questions/65932762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15096986/" ]
Add this line of code in your first activity where you set your text to your button: To change background color: ``` placeHolder.setBackgroundColor(Color.parseColor("#FF0000")); ``` To change text color: ``` placeHolder.setTextColor(Color.parseColor("#FF0000")); ``` **Usage:** **MainActivity.java** ``` pack...
you can use startActivityforResult() insted of startActivity() and then when you come back from second class to the first class then set red color tor your button onActivityResult() function thanks
65,932,762
I was trying to log the data flow activity information by using the data flow activity's output object which has a key named 'metrics' which contains 'RowsRead' and 'RowsWritten' but sometimes when data flow activity insert data into database, the metrics show 'NULL' value although records were read and written into da...
2021/01/28
[ "https://Stackoverflow.com/questions/65932762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15096986/" ]
Add this line of code in your first activity where you set your text to your button: To change background color: ``` placeHolder.setBackgroundColor(Color.parseColor("#FF0000")); ``` To change text color: ``` placeHolder.setTextColor(Color.parseColor("#FF0000")); ``` **Usage:** **MainActivity.java** ``` pack...
**Second Activity:** ``` Intent intent=new Intent(MainActivity2.this, MainActivity.class); intent.putExtra("message", "Hello"); intent.putExtra("color", -65536); //-65536 is color RED int value startActivity(intent); ``` **First Activity** ``` placeHolder.setText(getIntent().getStringExtra("message")); ...
65,932,762
I was trying to log the data flow activity information by using the data flow activity's output object which has a key named 'metrics' which contains 'RowsRead' and 'RowsWritten' but sometimes when data flow activity insert data into database, the metrics show 'NULL' value although records were read and written into da...
2021/01/28
[ "https://Stackoverflow.com/questions/65932762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15096986/" ]
you can use startActivityforResult() insted of startActivity() and then when you come back from second class to the first class then set red color tor your button onActivityResult() function thanks
**Second Activity:** ``` Intent intent=new Intent(MainActivity2.this, MainActivity.class); intent.putExtra("message", "Hello"); intent.putExtra("color", -65536); //-65536 is color RED int value startActivity(intent); ``` **First Activity** ``` placeHolder.setText(getIntent().getStringExtra("message")); ...
31,796,427
I have one simple question. How to achieve this format of date `1438117140000+0300`. First part `1438117140000` its the time in millisec , that i convert with no problem, second part with timezone info is my headache , how to get it ??
2015/08/03
[ "https://Stackoverflow.com/questions/31796427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5127419/" ]
One way to do it is as Jef says. In LibClass.h inside the interface: ``` @property (strong, readonly) id aProperty; ``` In a new file LibClassPrivate.h: ``` @interface LibClass () @property (strong, readwrite) id aPropertyWritable; @end ``` In LibClass.m: ``` @implementation LibClass{ id _aProperty; } - (i...
What about...? **.h file** ``` @property (strong, nonatomic, readonly) id lib; ``` **.m file** ``` @interface LibManager () @property (strong, nonatomic, readwrite) id lib; @end @implementation LibManager @synthesize lib = _lib; // ... - (id)lib { return [_lib copy]; } - (id)_internal_get_mutable_lib { ...
3,510,226
What is wrong with this argument that differentiation using the First Principle leads to division by $0$: $$ f'(x)=\lim\_\limits{h \to 0} \frac{f(x+h)-f(x)}{h} \\ $$ Using the quotient limit law: $$ \lim\_\limits{h \to 0} \frac{f(x+h)-f(x)}{h}=\frac{\lim\_\limits{h \to 0}f(x+h)-f(x)}{\lim\_\limits{h \to 0}h} $$ $$ ...
2020/01/15
[ "https://math.stackexchange.com/questions/3510226", "https://math.stackexchange.com", "https://math.stackexchange.com/users/623665/" ]
Find the SDE for $X\_t$ by differentiating the given integral, $$dX\_t =(\sqrt t)'\sqrt{2t}\; dB\_t = dB\_t$$ which yields $X\_t = B\_t$.
**HINT** You are adding a bunch of zero-mean normals to each other, so the result must be a zero-mean normal. can you find the variance?
25,069,925
We are fairly new to docker but have been able to install docker on CentOS 6.4, created images, generated containers, and even created a private local registry. Our question is in regards to the local registry. Well... actually... regarding a remote registry. We want to be able to create the registry on a separate ser...
2014/07/31
[ "https://Stackoverflow.com/questions/25069925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3897489/" ]
You need to initialize the ViewController. As a test, initialize it in your appdelegate like this: ``` func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { Parse.setApplicationId("YOUR_APP_ID", clientKey:"YOUR_CLIENT_KEY") var controller:PF...
This is sorta lame advice. But just make the class in ObjC and include it in your Bridging Header
51,117,146
I am putting together a userform, where a user would be able to get real-time count of resolved queries from SQL Server. Currently, I use ADODB connection to connect to SQL table and execute a Count command. I then take the value and copy it into an Admin sheet, where it is then presented in a userform. I wonder if ...
2018/06/30
[ "https://Stackoverflow.com/questions/51117146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8981066/" ]
You don't need `CopyFromRecordset` for one value Just assign your count to an alias and use the alias fieldname from your recordset ``` strSQL = "SELECT COUNT(TempStatus) AS CountRecs FROM [DB] WHERE [TempStatus] = 'pinged'" Set objmyrecordset.ActiveConnection = objmyconn objmyrecordset.Open strSQL test = objmyrecord...
You may try something like this... ``` Dim x x = objmyrecordset.GetRows Me.Label1 = x(0, 0) ```
51,117,146
I am putting together a userform, where a user would be able to get real-time count of resolved queries from SQL Server. Currently, I use ADODB connection to connect to SQL table and execute a Count command. I then take the value and copy it into an Admin sheet, where it is then presented in a userform. I wonder if ...
2018/06/30
[ "https://Stackoverflow.com/questions/51117146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8981066/" ]
The result of `"SELECT COUNT(TempStatus) FROM [DB] WHERE [TempStatus] = 'pinged'"` is still a recordset. So you have to get the value of the field of the recordset like this `objmyrecordset.fields(0).value`. This should give you the result of `COUNT`.
You may try something like this... ``` Dim x x = objmyrecordset.GetRows Me.Label1 = x(0, 0) ```
51,117,146
I am putting together a userform, where a user would be able to get real-time count of resolved queries from SQL Server. Currently, I use ADODB connection to connect to SQL table and execute a Count command. I then take the value and copy it into an Admin sheet, where it is then presented in a userform. I wonder if ...
2018/06/30
[ "https://Stackoverflow.com/questions/51117146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8981066/" ]
The result of `"SELECT COUNT(TempStatus) FROM [DB] WHERE [TempStatus] = 'pinged'"` is still a recordset. So you have to get the value of the field of the recordset like this `objmyrecordset.fields(0).value`. This should give you the result of `COUNT`.
You don't need `CopyFromRecordset` for one value Just assign your count to an alias and use the alias fieldname from your recordset ``` strSQL = "SELECT COUNT(TempStatus) AS CountRecs FROM [DB] WHERE [TempStatus] = 'pinged'" Set objmyrecordset.ActiveConnection = objmyconn objmyrecordset.Open strSQL test = objmyrecord...
24,036,627
I have name,surname,city,address,mobile fields in mysql table. I want a select statement that select all the records if any of the above fields data matches; For eg: If i put name: yusuf. then select statement should look data :yusuf in all column mentioned above and if any of the record matches then it should show th...
2014/06/04
[ "https://Stackoverflow.com/questions/24036627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3133175/" ]
So the only difference between the two is the extensions property? There was an issue with extensions in an older version of the toolkit, I think updating to the latest version will solve your issue. If you have the latest version already then I'll need more information on this problem. I have tried what you suggeste...
I have updated the SDK, all the extensions properties can be seen extensions: {    commenting: true,    saving: true,    refreshButton: true,    deleteButton: true }, refresh works, but saving, commenting, delete do not work error from commenting, it asks me to log in again ![enter image description here](https://i.s...
24,109,794
When trying to use Cython on Windows (Anaconda-based install, using TDM-GCC as I need support for OpenMP), I ran into an error when using typed memoryviews. ``` test1.pyx def test(int x): pass test2.pyx def test(int[:] x): pass ``` Both modules can be compiled with a basic setup.py (using cythonize), but while test...
2014/06/08
[ "https://Stackoverflow.com/questions/24109794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/378080/" ]
I am using Windows 7 64-bit, Python 2.7.5 64 bit and Cython 0.20.1 and your code works for me. I tested your original code and this: ``` def test(int[:] x): s = np.shape(x)[0] for i in range(s): print x[i] ``` without problems. I will describe here how I compiled by Cython and how I configured my C ...
As it turns out, the simplest solution was just to switch everything to 32bit, as TDM-GCC 32bit works fine and I don't have any hard dependencies on 64bit-Python.
10,586,401
I am trying to post the contents of a form field into a MySql database. The title and contents of a blog should post into a mysql table but I keep getting this error: Notice: Undefined index: titleblog in /home/ooze/public\_html/main2/uploadblog.php on line 10 Notice: Undefined index: blogcontent in /home/ooze/public\...
2012/05/14
[ "https://Stackoverflow.com/questions/10586401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202252/" ]
simply change your current remove method: ``` @Override public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException { fb.insertString(offset, "", null); } ``` for this one: ``` @Override public void remove(DocumentFilter.FilterBypass fb, int offset, int...
You should make your own class that checks whether you gave more input than the maximum allowed length: See an example on <http://www.java2s.com/Tutorial/Java/0240__Swing/LimitJTextFieldinputtoamaximumlength.htm>.
2,460,308
i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have searched all the properties but none of them help me out to solve this pbm.. this is possible in gridview but how will it be possible in listview....
2010/03/17
[ "https://Stackoverflow.com/questions/2460308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261578/" ]
The easiest way is to use `ColumnWidthChanging` event: ``` private void listView_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e) { e.Cancel = true; e.NewWidth = listView.Columns[e.ColumnIndex].Width; } ```
Use [ObjectListView](http://www.codeproject.com/KB/list/ObjectListView.aspx). That not only allows individual columns to be fixed width, but to have minimum and maximum widths as well. It does the hard work of catching *all* cases, including Ctrl-Numpad-+, so that they cannot be circumvented.
2,460,308
i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have searched all the properties but none of them help me out to solve this pbm.. this is possible in gridview but how will it be possible in listview....
2010/03/17
[ "https://Stackoverflow.com/questions/2460308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261578/" ]
The easiest way is to use `ColumnWidthChanging` event: ``` private void listView_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e) { e.Cancel = true; e.NewWidth = listView.Columns[e.ColumnIndex].Width; } ```
Thanks a lot I've used it in vb.net as ``` Private Sub ListView1_ColumnWidthChanging(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangingEventArgs) Handles ListView1.ColumnWidthChanging e.Cancel = True e.NewWidth = ListView1.Columns(e.ColumnIndex).Width End Sub ```
2,460,308
i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have searched all the properties but none of them help me out to solve this pbm.. this is possible in gridview but how will it be possible in listview....
2010/03/17
[ "https://Stackoverflow.com/questions/2460308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261578/" ]
The easiest way is to use `ColumnWidthChanging` event: ``` private void listView_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e) { e.Cancel = true; e.NewWidth = listView.Columns[e.ColumnIndex].Width; } ```
One way of achieving this is by setting the Selector.IsEnabled to false. I'll put a code which I used in one of my applications that I was working on, it is simple you'll get it easily. ListView code (Focus on GridView's ColumnHeaderContainerStyle property) - ``` <ListView Grid.Row="1" BorderBrush="{StaticResource M...
2,460,308
i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have searched all the properties but none of them help me out to solve this pbm.. this is possible in gridview but how will it be possible in listview....
2010/03/17
[ "https://Stackoverflow.com/questions/2460308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261578/" ]
Use [ObjectListView](http://www.codeproject.com/KB/list/ObjectListView.aspx). That not only allows individual columns to be fixed width, but to have minimum and maximum widths as well. It does the hard work of catching *all* cases, including Ctrl-Numpad-+, so that they cannot be circumvented.
Thanks a lot I've used it in vb.net as ``` Private Sub ListView1_ColumnWidthChanging(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangingEventArgs) Handles ListView1.ColumnWidthChanging e.Cancel = True e.NewWidth = ListView1.Columns(e.ColumnIndex).Width End Sub ```
2,460,308
i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have searched all the properties but none of them help me out to solve this pbm.. this is possible in gridview but how will it be possible in listview....
2010/03/17
[ "https://Stackoverflow.com/questions/2460308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261578/" ]
Use [ObjectListView](http://www.codeproject.com/KB/list/ObjectListView.aspx). That not only allows individual columns to be fixed width, but to have minimum and maximum widths as well. It does the hard work of catching *all* cases, including Ctrl-Numpad-+, so that they cannot be circumvented.
One way of achieving this is by setting the Selector.IsEnabled to false. I'll put a code which I used in one of my applications that I was working on, it is simple you'll get it easily. ListView code (Focus on GridView's ColumnHeaderContainerStyle property) - ``` <ListView Grid.Row="1" BorderBrush="{StaticResource M...
20,298,254
I work with somewhat large SVN repositories that are located very far from me. Doing SVN history related commands is very painful. Rather, just using any of SVN is pretty painful. I only need to push my changes maybe once a week but I still like to commit often instead of doing large commits. Since SVN repos can only ...
2013/11/30
[ "https://Stackoverflow.com/questions/20298254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17675/" ]
This is an excellent use case for [`git-svn`](https://www.kernel.org/pub/software/scm/git/docs/git-svn.html) — it allows you to work locally and efficiently with `git`, including querying the entire history without ever contacting the svn server, all the while keeping the repository synchronized with the remote SVN. T...
There is in fact a way to mirror a Subversion repository. But first you'll need the ability to install hook scripts on the "master" repository. Then use `svnsync` to sync each commit to your local mirror. See <http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.replication> for how to set ...
20,298,254
I work with somewhat large SVN repositories that are located very far from me. Doing SVN history related commands is very painful. Rather, just using any of SVN is pretty painful. I only need to push my changes maybe once a week but I still like to commit often instead of doing large commits. Since SVN repos can only ...
2013/11/30
[ "https://Stackoverflow.com/questions/20298254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17675/" ]
This is an excellent use case for [`git-svn`](https://www.kernel.org/pub/software/scm/git/docs/git-svn.html) — it allows you to work locally and efficiently with `git`, including querying the entire history without ever contacting the svn server, all the while keeping the repository synchronized with the remote SVN. T...
Using [the write-through proxy solution](http://svnbook.red-bean.com/en/1.8/svn.serverconfig.httpd.html#svn.serverconfig.httpd.extra.writethruproxy) will help you to reduce read times only. Commits are still proxied through the slave, so you won't see any gain when doing imports, commits, etc. To achieve a real master...
20,298,254
I work with somewhat large SVN repositories that are located very far from me. Doing SVN history related commands is very painful. Rather, just using any of SVN is pretty painful. I only need to push my changes maybe once a week but I still like to commit often instead of doing large commits. Since SVN repos can only ...
2013/11/30
[ "https://Stackoverflow.com/questions/20298254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17675/" ]
There is in fact a way to mirror a Subversion repository. But first you'll need the ability to install hook scripts on the "master" repository. Then use `svnsync` to sync each commit to your local mirror. See <http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.replication> for how to set ...
Using [the write-through proxy solution](http://svnbook.red-bean.com/en/1.8/svn.serverconfig.httpd.html#svn.serverconfig.httpd.extra.writethruproxy) will help you to reduce read times only. Commits are still proxied through the slave, so you won't see any gain when doing imports, commits, etc. To achieve a real master...
12,164,483
Here's the code for my ItemAdapter which I use as an adapter for list in this way. ``` list.setAdapter(new ItemAdapter(thisContext,imageUrl)); ``` I'm trying to implement an onclick listener for the button that will add an item to a ListFragment. When I compile, it says "cannot resolve symbol getSupportFragmentMana...
2012/08/28
[ "https://Stackoverflow.com/questions/12164483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1309431/" ]
It's been a while since I played around with fragments. but I believe you can only access getSupportedFragmentManager from an FragmentActivity class. try this ``` public ItemAdapter(Context c,FragmentActivity activity, String[] imageUrl) { super(); itemPageContext = c; this.activity = activity; imagesUrl ...
You may have imported the class, but you aren't in a `FragmentActivity`, you are in a `BaseAdapter` so that method doesn't exist on the class you are in. If you wanted to call that method on your Activity, you would need to pass the Activity in (as a `FragmentActivity` rather than a `Context`) or make this adapter a pr...
12,164,483
Here's the code for my ItemAdapter which I use as an adapter for list in this way. ``` list.setAdapter(new ItemAdapter(thisContext,imageUrl)); ``` I'm trying to implement an onclick listener for the button that will add an item to a ListFragment. When I compile, it says "cannot resolve symbol getSupportFragmentMana...
2012/08/28
[ "https://Stackoverflow.com/questions/12164483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1309431/" ]
You may have imported the class, but you aren't in a `FragmentActivity`, you are in a `BaseAdapter` so that method doesn't exist on the class you are in. If you wanted to call that method on your Activity, you would need to pass the Activity in (as a `FragmentActivity` rather than a `Context`) or make this adapter a pr...
Surely you've found the answer by now, but this may help others. I was in a situation perhaps similar to yours with no precise answers for how to work around having an `Adapter` class separate from the `FragmentActivity` class, while needing to access the `getSupportFragmentManager`() within the Adapter. Passing the c...
12,164,483
Here's the code for my ItemAdapter which I use as an adapter for list in this way. ``` list.setAdapter(new ItemAdapter(thisContext,imageUrl)); ``` I'm trying to implement an onclick listener for the button that will add an item to a ListFragment. When I compile, it says "cannot resolve symbol getSupportFragmentMana...
2012/08/28
[ "https://Stackoverflow.com/questions/12164483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1309431/" ]
It's been a while since I played around with fragments. but I believe you can only access getSupportedFragmentManager from an FragmentActivity class. try this ``` public ItemAdapter(Context c,FragmentActivity activity, String[] imageUrl) { super(); itemPageContext = c; this.activity = activity; imagesUrl ...
Surely you've found the answer by now, but this may help others. I was in a situation perhaps similar to yours with no precise answers for how to work around having an `Adapter` class separate from the `FragmentActivity` class, while needing to access the `getSupportFragmentManager`() within the Adapter. Passing the c...
34,743,389
I have the following table: ``` OrderID | OldOrderID | Action | EntryDate | Source 1 | NULL | Insert | 2016-01-12| A 1 | NULL | Remove | 2016-01-13| A 2 | NULL | Insert | 2016-01-12| B 3 | NULL | Insert | 2016-01-12| C 4 | ...
2016/01/12
[ "https://Stackoverflow.com/questions/34743389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/555967/" ]
The error is pretty simple the key name is invalid. You use keyname `data` but you get `text` which does not exists. change ``` $.post('textify.php', {data: textify}, function(txt){ ``` to ``` $.post('textify.php', {text: textify}, function(txt){ ``` or better use [serialize()](https://api.jquery.com/serializ...
Just make some changes `{text: textify}` instead of `{data: textify}` like below: ``` $(document).ready(function(){ $('form').submit(function(){ var textify = $('input[name="textify"]').val(); $.post('textify.php', {text: textify}, function(txt){ $('pre').show(); $('p...