qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
13,226,463
I have music contents for more than 500GB in external HDD. I need to access it from my android application, How can I do this. 1.Can I connect the USB HDD directly to the tablet? and access? OR 2.If I share the content in my local network, can I access it from Wifi like accessing shared folder in windows? OR a...
2012/11/05
[ "https://Stackoverflow.com/questions/13226463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/515616/" ]
You should be able to connect it directly to the tablet (with a USB OTG adapter if necessary). It should mount automatically under `/sdcard/usbStorage`.
If your tablet lacks a USB host port and OTG adapters won't work due to some tablet-specific limitation (I've had this happen), the free ES File Explorer app will allow you to [access network shares](http://www.techrepublic.com/blog/tablets/connect-android-to-windows-and-samba-shared-directories/1262).
58,186,238
So I have a general question, but since I'm writing in Python it is the tag. Assume I have `df` which is a pandas dataframe - I would normally do: ``` df=pd.DataFrame(data = cosine_similarity(df.T)) ``` instead of ``` df=df.T df = pd.DataFrame(data = cosine_similarity(df)) ``` but then I thought: if *memory* is...
2019/10/01
[ "https://Stackoverflow.com/questions/58186238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6224975/" ]
``` from awsglue.dynamicframe import DynamicFrame ``` Import DynamicFrame
You need to import the `DynamicFrame` class from `awsglue.dynamicframe` module: ``` from awsglue.dynamicframe import DynamicFrame ``` There are lot of things missing in the examples provided with the AWS Glue ETL documentation. However, you can refer to the following GitHub repository which contains lots of example...
21,544,624
Why is `PagerAdapter.setPrimaryItem()` called more than once (with the same values) after I select a new page with `ViewPager.setCurrentItem(index)` ?
2014/02/04
[ "https://Stackoverflow.com/questions/21544624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/913867/" ]
Yes, for me it even kept calling infinitely. However, if you need something to be called once, here is a simple solution ``` public class MyPagerAdapter extends PagerAdapter { private int lastPosition = -1; @Override public void setPrimaryItem(ViewGroup container, int position, Object object) { super.se...
I think the reason why `PagerAdapter.setPrimaryItem()` gets called more than once is because of `ViewPager.setOffscreenPageLimit(int)` See official docs for more info: *<https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager#setOffscreenPageLimit(kotlin.Int)>*
38,251
Within our team we would like to do load tests in a CI process. For this we want to use either Jmeter or just a comparable tool. Jmeter offers u.a. the possibility that one can plan and execute a test pipeline for a load test via plugin. The question we ask ourselves, how often should we perform this load test but in ...
2019/03/13
[ "https://sqa.stackexchange.com/questions/38251", "https://sqa.stackexchange.com", "https://sqa.stackexchange.com/users/37123/" ]
IMO, for every major code change, you need to execute load test. You can decide either you can execute a load test as part of sprint closing/feature closing.
Make the load testing part of your performance suite so it runs automatically when you push branch commits to your CI system and fails when user experience deteriorates. The level at which that happens, e.g. slow slow responses is something you will need to define. I also recommend you consider creating functional tes...
42,358,588
Distinct is not giving distinct row for table ``` ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); return Context.p_Countries_List(userName, statusCode, statusMessage) .Select(c => new Cou...
2017/02/21
[ "https://Stackoverflow.com/questions/42358588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6313778/" ]
You have to override `Equals` so `Distinct` knows how to tell one instance from another. ``` public class Countries_List_ResultModel { public override bool Equals(object obj) { var item = obj as Countries_List_ResultModel; if (item == null) { return false; } ...
There are two overloads of `Distinct` method: ``` Distinct<TSource>(this IEnumerable<TSource> source); Distinct<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource> comparer); ``` Apparently, you are using the first one which use a default equality comparer to compare values. Default equality compar...
42,358,588
Distinct is not giving distinct row for table ``` ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); return Context.p_Countries_List(userName, statusCode, statusMessage) .Select(c => new Cou...
2017/02/21
[ "https://Stackoverflow.com/questions/42358588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6313778/" ]
You have to override `Equals` so `Distinct` knows how to tell one instance from another. ``` public class Countries_List_ResultModel { public override bool Equals(object obj) { var item = obj as Countries_List_ResultModel; if (item == null) { return false; } ...
I found the answer and this is working. ``` ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); return Context.p_Currencies_List(userName, statusCode, statusMessage).Distinct().Select(...
42,358,588
Distinct is not giving distinct row for table ``` ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); return Context.p_Countries_List(userName, statusCode, statusMessage) .Select(c => new Cou...
2017/02/21
[ "https://Stackoverflow.com/questions/42358588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6313778/" ]
There are two overloads of `Distinct` method: ``` Distinct<TSource>(this IEnumerable<TSource> source); Distinct<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource> comparer); ``` Apparently, you are using the first one which use a default equality comparer to compare values. Default equality compar...
I found the answer and this is working. ``` ObjectParameter statusCode = new ObjectParameter("StatusCode", typeof(int)); ObjectParameter statusMessage = new ObjectParameter("StatusMessage", typeof(string)); return Context.p_Currencies_List(userName, statusCode, statusMessage).Distinct().Select(...
5,768,136
I am computing a similarity matrix based on Euclidean distance in MATLAB. My code is as follows: ``` for i=1:N % M,N is the size of the matrix x for whose elements I am computing similarity matrix for j=1:N D(i,j) = sqrt(sum(x(:,i)-x(:,j)).^2)); % D is the similarity matrix end end ``` Can any help with optimizi...
2011/04/24
[ "https://Stackoverflow.com/questions/5768136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722271/" ]
There's probably a better way to do it, but the first thing I noticed was that you could cut the runtime in half by exploiting the symmetry `D(i,j)==D(i,j)` You can also use the function `norm(x(:,i)-x(:,j),2)`
To start with, you are computing twice as much as you need to here, because D will be symmetric. You don't need to calculate the (i,j) entry and the (j,i) entry separately. Change your inner loop to `for j=1:i`, and add in the body of that loop `D(j,i)=D(i,j);` After that, there's really not much redundancy left in wh...
5,768,136
I am computing a similarity matrix based on Euclidean distance in MATLAB. My code is as follows: ``` for i=1:N % M,N is the size of the matrix x for whose elements I am computing similarity matrix for j=1:N D(i,j) = sqrt(sum(x(:,i)-x(:,j)).^2)); % D is the similarity matrix end end ``` Can any help with optimizi...
2011/04/24
[ "https://Stackoverflow.com/questions/5768136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722271/" ]
The function to do so in matlab is called pdist. Unfortunately it is painfully slow and doesnt take Matlabs vectorization abilities into account. The following is code I wrote for a project. Let me know what kind of speed up you get. ``` Qx=repmat(dot(x,x,2),1,size(x,1)); D=sqrt(Qx+Qx'-2*x*x'); ``` Note thoug...
There's probably a better way to do it, but the first thing I noticed was that you could cut the runtime in half by exploiting the symmetry `D(i,j)==D(i,j)` You can also use the function `norm(x(:,i)-x(:,j),2)`
5,768,136
I am computing a similarity matrix based on Euclidean distance in MATLAB. My code is as follows: ``` for i=1:N % M,N is the size of the matrix x for whose elements I am computing similarity matrix for j=1:N D(i,j) = sqrt(sum(x(:,i)-x(:,j)).^2)); % D is the similarity matrix end end ``` Can any help with optimizi...
2011/04/24
[ "https://Stackoverflow.com/questions/5768136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722271/" ]
I think this is what you're looking for. ``` D=zeros(N); jIndx=repmat(1:N,N,1);iIndx=jIndx'; %'# fix SO's syntax highlighting D(:)=sqrt(sum((x(iIndx(:),:)-x(jIndx(:),:)).^2,2)); ``` Here, I have assumed that the distance vector, `x` is initalized as an `NxM` array, where `M` is the number of dimensions of the s...
To start with, you are computing twice as much as you need to here, because D will be symmetric. You don't need to calculate the (i,j) entry and the (j,i) entry separately. Change your inner loop to `for j=1:i`, and add in the body of that loop `D(j,i)=D(i,j);` After that, there's really not much redundancy left in wh...
5,768,136
I am computing a similarity matrix based on Euclidean distance in MATLAB. My code is as follows: ``` for i=1:N % M,N is the size of the matrix x for whose elements I am computing similarity matrix for j=1:N D(i,j) = sqrt(sum(x(:,i)-x(:,j)).^2)); % D is the similarity matrix end end ``` Can any help with optimizi...
2011/04/24
[ "https://Stackoverflow.com/questions/5768136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722271/" ]
The function to do so in matlab is called pdist. Unfortunately it is painfully slow and doesnt take Matlabs vectorization abilities into account. The following is code I wrote for a project. Let me know what kind of speed up you get. ``` Qx=repmat(dot(x,x,2),1,size(x,1)); D=sqrt(Qx+Qx'-2*x*x'); ``` Note thoug...
To start with, you are computing twice as much as you need to here, because D will be symmetric. You don't need to calculate the (i,j) entry and the (j,i) entry separately. Change your inner loop to `for j=1:i`, and add in the body of that loop `D(j,i)=D(i,j);` After that, there's really not much redundancy left in wh...
5,768,136
I am computing a similarity matrix based on Euclidean distance in MATLAB. My code is as follows: ``` for i=1:N % M,N is the size of the matrix x for whose elements I am computing similarity matrix for j=1:N D(i,j) = sqrt(sum(x(:,i)-x(:,j)).^2)); % D is the similarity matrix end end ``` Can any help with optimizi...
2011/04/24
[ "https://Stackoverflow.com/questions/5768136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/722271/" ]
The function to do so in matlab is called pdist. Unfortunately it is painfully slow and doesnt take Matlabs vectorization abilities into account. The following is code I wrote for a project. Let me know what kind of speed up you get. ``` Qx=repmat(dot(x,x,2),1,size(x,1)); D=sqrt(Qx+Qx'-2*x*x'); ``` Note thoug...
I think this is what you're looking for. ``` D=zeros(N); jIndx=repmat(1:N,N,1);iIndx=jIndx'; %'# fix SO's syntax highlighting D(:)=sqrt(sum((x(iIndx(:),:)-x(jIndx(:),:)).^2,2)); ``` Here, I have assumed that the distance vector, `x` is initalized as an `NxM` array, where `M` is the number of dimensions of the s...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
I created a vanilla javascript solution to using VH units. Using VH pretty much anywhere is effected by address bars minimizing on scroll. To fix the jank that shows when the page redraws, I've got this js here that will grab all your elements using VH units (if you give them the class `.vh-fix`), and give them inlined...
I am using this workaround: Fix bg1's height on page load by: ``` var BG = document.getElementById('bg1'); BG.style.height = BG.parentElement.clientHeight; ``` Then attach a resize event listener to Window which does this: if difference in height after resizing is less than 60px (anything more than url bar height) ...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
All of the answers here are using `window` height, which is affected by the URL bar. Has everyone forgotten about `screen` height? Here's my jQuery solution: ``` $(function(){ var $w = $(window), $background = $('#background'); // Fix background image jump on mobile if ((/Android|iPhone|iPad|iPod|BlackB...
My answer is for everyone who comes here (like I did) to find an answer for a bug caused by the hiding address bare / browser interface. The hiding address bar causes the resize-event to trigger. But different than other resize-events, like switching to landscape mode, this doesn't change the width of the window. So m...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
All of the answers here are using `window` height, which is affected by the URL bar. Has everyone forgotten about `screen` height? Here's my jQuery solution: ``` $(function(){ var $w = $(window), $background = $('#background'); // Fix background image jump on mobile if ((/Android|iPhone|iPad|iPod|BlackB...
I am using this workaround: Fix bg1's height on page load by: ``` var BG = document.getElementById('bg1'); BG.style.height = BG.parentElement.clientHeight; ``` Then attach a resize event listener to Window which does this: if difference in height after resizing is less than 60px (anything more than url bar height) ...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
The solution I'm currently using is to check the `userAgent` on `$(document).ready` to see if it's one of the offending browsers. If it is, follow these steps: 1. Set the relevant heights to the current viewport height rather than '100%' 2. Store the current viewport horizontal value 3. Then, on `$(window).resize`, o...
My answer is for everyone who comes here (like I did) to find an answer for a bug caused by the hiding address bare / browser interface. The hiding address bar causes the resize-event to trigger. But different than other resize-events, like switching to landscape mode, this doesn't change the width of the window. So m...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
This issue is caused by the URL bars shrinking/sliding out of the way and changing the size of the #bg1 and #bg2 divs since they are 100% height and "fixed". Since the background image is set to "cover" it will adjust the image size/position as the containing area is larger. Based on the responsive nature of the site,...
I found that Jason's answer wasn't quite working for me and I was still getting a jump. The Javascript ensured there was no gap at the top of the page but the background was still jumping whenever the address bar disappeared/reappeared. So as well as the Javascript fix, I applied `transition: height 999999s` to the div...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
I found that Jason's answer wasn't quite working for me and I was still getting a jump. The Javascript ensured there was no gap at the top of the page but the background was still jumping whenever the address bar disappeared/reappeared. So as well as the Javascript fix, I applied `transition: height 999999s` to the div...
I found a really easy solution without the use of Javascript: ``` transition: height 1000000s ease; -webkit-transition: height 1000000s ease; -moz-transition: height 1000000s ease; -o-transition: height 1000000s ease; ``` All this does is delay the movement so that it's incredibly slow that it's not noticeable.
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
I created a vanilla javascript solution to using VH units. Using VH pretty much anywhere is effected by address bars minimizing on scroll. To fix the jank that shows when the page redraws, I've got this js here that will grab all your elements using VH units (if you give them the class `.vh-fix`), and give them inlined...
I set my width element, with javascript. After I set the de vh. **html** ``` <div id="gifimage"><img src="back_phone_back.png" style="width: 100%"></div> ``` **css** ``` #gifimage { position: absolute; height: 70vh; } ``` **javascript** ``` imageHeight = document.getElementById('gifimage').clientHeight...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
This is the best solution (simplest) above everything I have tried. **...And this does not keep the native experience of the address bar**! You could set the height with CSS to 100% for example, and then set the height to 0.9 \* of the window height in px with javascript, when the document is loaded. For example wit...
For those who would like to listen to the actual inner height and vertical scroll of the window while the Chrome mobile browser is transition the URL bar from shown to hidden and vice versa, the only solution that I found is to set an interval function, and measure the discrepancy of the `window.innerHeight` with its p...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
this is my solution to resolve this issue, i have added comments directly on code. I've tested this solution and works fine. Hope we will be useful for everyone has the same problem. ``` //remove height property from file css because we will set it to first run of page //insert this snippet in a script after declarati...
Simple answer if your background allows, why not set background-size: to something just covering device width with media queries and use alongside the :after position: fixed; hack [here](https://stackoverflow.com/questions/23571578/chrome-issue-with-background-attachment-fixed-and-position-fixed-elements). IE: backgro...
24,944,925
I'm currently developing a responsive site using Twitter Bootstrap. The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs. It's nearly perfect, except one issue. Using iOS Safari, Android Browser or Chrome on Android the background jumps sl...
2014/07/24
[ "https://Stackoverflow.com/questions/24944925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1236799/" ]
this is my solution to resolve this issue, i have added comments directly on code. I've tested this solution and works fine. Hope we will be useful for everyone has the same problem. ``` //remove height property from file css because we will set it to first run of page //insert this snippet in a script after declarati...
I am using this workaround: Fix bg1's height on page load by: ``` var BG = document.getElementById('bg1'); BG.style.height = BG.parentElement.clientHeight; ``` Then attach a resize event listener to Window which does this: if difference in height after resizing is less than 60px (anything more than url bar height) ...
56,768
Let's say I wrote the following in an essay. > > Hello, Anna. I love you > > > Now I want to write something like this: This line I've written was supposedly said by Anna's boyfriend, but Anna's boyfriend didn't actually say it himself. It's a creative work of mine pretending to be Anna's boyfriend. Note that th...
2015/05/14
[ "https://ell.stackexchange.com/questions/56768", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/19552/" ]
You simply need to change "*by* himself" to "himself" or even leave himself out entirely. **But Anna's boyfriend didn't say it himself. I said it, pretending to be him. But Anna's boyfriend didn't say it. I said it, pretending to be him.** *did not say this by himself* means that *someone helped him* to say this. ...
* I imagine he said, "Anna, ... I love you". * If I were in his shoes, I would come-right-out and say, "Anna, ... I love you". * "Anna, ... I love you", would have been the right thing for him to have said. * He should have said, "Anna, ... I love you", but he didn't. * If, for example, he had said, "Anna, ... I love y...
14,740
I'm trying to plan the pieces I'll need for a castle door. I know I need 2 of [these doors](https://www.bricklink.com/v2/catalog/catalogitem.page?P=2554&idColor=11#T=C&C=11). Based on the part list for [Adventurers Tomb set](https://www.bricklink.com/v2/catalog/catalogitem.page?S=2996-1#T=S&O=%7B%22st%22:%224%22,%22ss%...
2020/05/11
[ "https://bricks.stackexchange.com/questions/14740", "https://bricks.stackexchange.com", "https://bricks.stackexchange.com/users/13805/" ]
The [Adventures Tomb 2996](https://brickset.com/sets/2996-1/Adventurers-Tomb) set you mentioned uses [shutter holders](https://rebrickable.com/parts/3581/brick-special-1-x-1-x-2-with-shutter-holder/) to mount the door and a [1x6x1 arch](https://rebrickable.com/parts/3455/brick-arch-1-x-6/) to cover the space behind the...
I have those doors, and you're right about the shutter holder bricks, which are pretty fragile. The doors each cover half the space under a 1x6x2 arch. Besides the shutter snaps, the only connection point is the stud/doorknob.
49,544,408
I am printing the data from `ViewModel` into `DataTable` in the following way, but how to obtain a `space` between `@item.FirstName` and `@item.LastName` so that the output can be of the form `FirstName LastName`? At present, I am getting the `Name` as `FirstNameLastName`. Ex: `MarkStevens`. I want to print it as `Mark...
2018/03/28
[ "https://Stackoverflow.com/questions/49544408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use prettyPrint method of Response class. Status you will have to print.
(Response to comment) If your API call return JSON responses, you can use a JSON validator module. What it does is: you provide a JSON *schema*, and it compares it with the response. The JSON schema syntax is defined over there: <http://json-schema.org/latest/json-schema-validation.html> (it looks more complex than i...
43,637,184
There is no vendor folder in laravel project. I download the laravel using composer create-project laravel/laravel. What problem?
2017/04/26
[ "https://Stackoverflow.com/questions/43637184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5204922/" ]
Your `SELECT` statement is neither needed nor stored. This can all be done by using a `WHERE` clause within the `UPDATE` statement. I have written this based on SQL Server syntax and have parameterized the query to avoid SQL Injection. With neither your C# code nor db schema I went with a generic Sql Connection & Comm...
You have a few problems here. First, ``` SELECT Money FROM [User] >= '"+ customPayTextBox.Text+"' ``` the `SELECT Money FROM [User]` may return more than one row. Secondly, ``` '"+ customPayTextBox.Text+"' ``` You shouldn't build a query with unverified user input like that; for one thing, you don't know if `cus...
634,401
If $f(x)= x^3 + 3x^2 + 12x - 2\sin x$ where $f:\mathbb R \to \mathbb R$, then prove that $f(x)$ is one-one and onto.
2014/01/11
[ "https://math.stackexchange.com/questions/634401", "https://math.stackexchange.com", "https://math.stackexchange.com/users/120548/" ]
$$ 4.5\leq 2x+1<5.5 \implies 1.75\leq x < 2.25 $$ Since it's uniform, the desired probability is the derived interval compared to the total sample space. $$ P(1.75\leq x < 2.25) = \frac{2.25-1.75}{10} =\frac{0.5}{10} = \boxed{0.05}. $$
You are right Dividing by $2$ you get $$2.25 \le x <2.75$$ This is intreval of length 0.5 and random number can be in an interval of length 10. So probability is $$ p = 0.5/10 = 0.05$$
34,846,545
I'd like to log (and ideally correlate) incoming and outgoing messages with at minimum the following properties: Date/Time Client Address (IP, name optional) Method I can get this working for incoming messages using the following but for the outgoing message (back to the client), it returns null. ``` get-property('ax...
2016/01/18
[ "https://Stackoverflow.com/questions/34846545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70614/" ]
AFAIK, you need set a custom property on the inSequence. I tested this localy and for the below proxy I was able to get REMOTE\_ADDR: = 172.xx.xx.xx for both Incoming and outgoing messages. ``` <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="test" transports=...
Yes, you need to add a custom property mediator to the inSequence to get and save the value of IP address of the incoming request. Then by adding log mediators to both inSequence and outSequence, you will be able to see that the IP address is preserved in outgoing message as well. ``` <?xml version="1.0" encoding="UTF...
3,726,878
In [this](https://www.cambridge.org/core/books/introduction-to-communication-systems/0ADB3DB43CAD06A46CBDC494BF8B5905) textbook, I found the following remark: > > An $(n,k)$ linear code $\mathcal{C}$ is a unique subspace consisting of a set of $2^k$ codewords. > > > The statement surprised me because in vector sp...
2020/06/19
[ "https://math.stackexchange.com/questions/3726878", "https://math.stackexchange.com", "https://math.stackexchange.com/users/786682/" ]
A $(n,k)$ linear code $\mathcal{C}$ is a subspace living in the vector space $(\mathbb{F}^n,\mathbb{F}\_2,+\_2,.)$ which has $2^k$ distinct code words, is the right way to read it. Let $G$ be the generator matrix for $\mathcal{C}$. Since $\mathcal{C}$ is a $k$ dimensional subspace in $\mathbb{F}^n\_2$, $G$ is a $k \ti...
To go directly from what you have written, if $[u|uP\_{1}]=[v|vP\_{2}]$, you can see right away that $u=v$. Therefore $uP\_{1}=vP\_{2}=uP\_{2}$. You should be able to finish from here. The word "unique" in the definition you have been given is without meaning and so does not belong since it only adds confusion. It rea...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
Your array may contain the same content as the array in `expected`, but it is not the same object.
I'm guessing the issue is because the method compares objects, and not contents. Basically, even though both have the same content, they are not the same object. [See here in the docs](http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html#matches(java.lang.Object)) Do this instead: `String[] actual =...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
Your array may contain the same content as the array in `expected`, but it is not the same object.
The problem with collection.IsIn in your context, is that your elements of your list is an array and it will use the Array#equals to compare each element. More specifically ``` // It will print false, because Array.equals check the reference // of objects, not the content System.out.println(actual.equals(new String[...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
The issue is that `Object.equals()` doesn't do what you might expect when the objects are arrays. As you probably already know, you have to use `Arrays.equals()` -- but Hamcrest `isIn()` does not allow for this. Probably the simplest solution is to convert to `List` even if only for the test -- because `List.equals()`...
Your array may contain the same content as the array in `expected`, but it is not the same object.
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
First of all, you would be better off using `List<>` instead of arrays. Secondly, yes, if you insist on using arrays, you will need to write your own 'array-contains-element' function. You can implement this function using a loop over the major dimension of the array, invoking the `Arrays.equals()` method to compare t...
I'm guessing the issue is because the method compares objects, and not contents. Basically, even though both have the same content, they are not the same object. [See here in the docs](http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html#matches(java.lang.Object)) Do this instead: `String[] actual =...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
The issue is that `Object.equals()` doesn't do what you might expect when the objects are arrays. As you probably already know, you have to use `Arrays.equals()` -- but Hamcrest `isIn()` does not allow for this. Probably the simplest solution is to convert to `List` even if only for the test -- because `List.equals()`...
I'm guessing the issue is because the method compares objects, and not contents. Basically, even though both have the same content, they are not the same object. [See here in the docs](http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html#matches(java.lang.Object)) Do this instead: `String[] actual =...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
First of all, you would be better off using `List<>` instead of arrays. Secondly, yes, if you insist on using arrays, you will need to write your own 'array-contains-element' function. You can implement this function using a loop over the major dimension of the array, invoking the `Arrays.equals()` method to compare t...
The problem with collection.IsIn in your context, is that your elements of your list is an array and it will use the Array#equals to compare each element. More specifically ``` // It will print false, because Array.equals check the reference // of objects, not the content System.out.println(actual.equals(new String[...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
The issue is that `Object.equals()` doesn't do what you might expect when the objects are arrays. As you probably already know, you have to use `Arrays.equals()` -- but Hamcrest `isIn()` does not allow for this. Probably the simplest solution is to convert to `List` even if only for the test -- because `List.equals()`...
First of all, you would be better off using `List<>` instead of arrays. Secondly, yes, if you insist on using arrays, you will need to write your own 'array-contains-element' function. You can implement this function using a loop over the major dimension of the array, invoking the `Arrays.equals()` method to compare t...
45,354,657
I am trying to assert that an array of string elements is one of the elements of a 2-dimensional array using the standard **Collection.isIn** matcher provided with Hamcrest library. Unfortunately receiving the following assertion exception: ``` java.lang.AssertionError: Expected: one of {["A", "B", "C"], ["A", "B", ...
2017/07/27
[ "https://Stackoverflow.com/questions/45354657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141666/" ]
The issue is that `Object.equals()` doesn't do what you might expect when the objects are arrays. As you probably already know, you have to use `Arrays.equals()` -- but Hamcrest `isIn()` does not allow for this. Probably the simplest solution is to convert to `List` even if only for the test -- because `List.equals()`...
The problem with collection.IsIn in your context, is that your elements of your list is an array and it will use the Array#equals to compare each element. More specifically ``` // It will print false, because Array.equals check the reference // of objects, not the content System.out.println(actual.equals(new String[...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
Well. There are many ways to do so and all have their pros and cons. So here's yet another solution, hope it will be helpful to someone. ``` public static IEnumerable<TSource[]> ToRanges<TSource>( this IEnumerable<TSource> source, Func<TSource, TSource, TSource, bool> isNear) { List<TSource[]> resu...
Try this: ``` private static List<int[]> GetGroups(List<int> numberList) { List<List<int>> groups = new List<List<int>>(); numberList.Zip(numberList.Skip(1), (a, b) => { if ((b - a) == 30) { if (groups.Count == 0) groups.Add(new List<int>()); groups[g...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
Well. There are many ways to do so and all have their pros and cons. So here's yet another solution, hope it will be helpful to someone. ``` public static IEnumerable<TSource[]> ToRanges<TSource>( this IEnumerable<TSource> source, Func<TSource, TSource, TSource, bool> isNear) { List<TSource[]> resu...
You must use LINQ? If not, what about: ``` List<int> numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; Dictionary<int, int> result = new Dictionary<int, int>(); int lastStart = numberList.First(); for(int i=1; i < numberList.Count; i++) { if(numberList[i] >= lastStart + 30) { result....
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You could write a method to handle the split: ``` IEnumerable<IList<int>> SplitValues(IList<int> input, int difference = 30) { List<int> results = new List<int>(); int last = input.First(); foreach(var value in input) { if (value - last > difference) { yield return new[] {re...
You must use LINQ? If not, what about: ``` List<int> numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; Dictionary<int, int> result = new Dictionary<int, int>(); int lastStart = numberList.First(); for(int i=1; i < numberList.Count; i++) { if(numberList[i] >= lastStart + 30) { result....
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You can do this in one linq statement: ``` var numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; var section = 0; var result = numberList .Select( (x, i) => new {value = x, section = (i == 0 ? 0 : ((x - numberList[i - 1]) > 30 ? ++section : section))}) .GroupBy(x => x.section) ...
You must use LINQ? If not, what about: ``` List<int> numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; Dictionary<int, int> result = new Dictionary<int, int>(); int lastStart = numberList.First(); for(int i=1; i < numberList.Count; i++) { if(numberList[i] >= lastStart + 30) { result....
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You could write a method to handle the split: ``` IEnumerable<IList<int>> SplitValues(IList<int> input, int difference = 30) { List<int> results = new List<int>(); int last = input.First(); foreach(var value in input) { if (value - last > difference) { yield return new[] {re...
Try this: ``` private static List<int[]> GetGroups(List<int> numberList) { List<List<int>> groups = new List<List<int>>(); numberList.Zip(numberList.Skip(1), (a, b) => { if ((b - a) == 30) { if (groups.Count == 0) groups.Add(new List<int>()); groups[g...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You could write a method to handle the split: ``` IEnumerable<IList<int>> SplitValues(IList<int> input, int difference = 30) { List<int> results = new List<int>(); int last = input.First(); foreach(var value in input) { if (value - last > difference) { yield return new[] {re...
You can use `TakeWhile` and add the result to another list ``` void SplitByRange() { List<int> numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; IEnumerable<int> aux = new List<int>(); int n = numberList.First(); int skip = 0; List<List<int>> output = new List<List<int>>(); w...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You could write a method to handle the split: ``` IEnumerable<IList<int>> SplitValues(IList<int> input, int difference = 30) { List<int> results = new List<int>(); int last = input.First(); foreach(var value in input) { if (value - last > difference) { yield return new[] {re...
Well. There are many ways to do so and all have their pros and cons. So here's yet another solution, hope it will be helpful to someone. ``` public static IEnumerable<TSource[]> ToRanges<TSource>( this IEnumerable<TSource> source, Func<TSource, TSource, TSource, bool> isNear) { List<TSource[]> resu...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You can do this in one linq statement: ``` var numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; var section = 0; var result = numberList .Select( (x, i) => new {value = x, section = (i == 0 ? 0 : ((x - numberList[i - 1]) > 30 ? ++section : section))}) .GroupBy(x => x.section) ...
Try this: ``` private static List<int[]> GetGroups(List<int> numberList) { List<List<int>> groups = new List<List<int>>(); numberList.Zip(numberList.Skip(1), (a, b) => { if ((b - a) == 30) { if (groups.Count == 0) groups.Add(new List<int>()); groups[g...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You could write a method to handle the split: ``` IEnumerable<IList<int>> SplitValues(IList<int> input, int difference = 30) { List<int> results = new List<int>(); int last = input.First(); foreach(var value in input) { if (value - last > difference) { yield return new[] {re...
You can do this in one linq statement: ``` var numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; var section = 0; var result = numberList .Select( (x, i) => new {value = x, section = (i == 0 ? 0 : ((x - numberList[i - 1]) > 30 ? ++section : section))}) .GroupBy(x => x.section) ...
16,928,581
I am looking to extract ranges from an list of integers using linq: for example I am looking to split the following list: ``` List<int> numberList = new List<int>() { 30, 60, 90, 120, 150, 180, 270, 300, 330 }; ``` into a list of integer ranges that will look like: ``` { 30, 180 } { 270, 330 } ``` ie: where t...
2013/06/04
[ "https://Stackoverflow.com/questions/16928581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2453617/" ]
You can do this in one linq statement: ``` var numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; var section = 0; var result = numberList .Select( (x, i) => new {value = x, section = (i == 0 ? 0 : ((x - numberList[i - 1]) > 30 ? ++section : section))}) .GroupBy(x => x.section) ...
You can use `TakeWhile` and add the result to another list ``` void SplitByRange() { List<int> numberList = new List<int>() { 30, 60, 120, 150, 270, 300, 330 }; IEnumerable<int> aux = new List<int>(); int n = numberList.First(); int skip = 0; List<List<int>> output = new List<List<int>>(); w...
466,553
How do the diodes protect the input of amplifier from excess voltage in the circuit below? [![enter image description here](https://i.stack.imgur.com/fO89q.jpg)](https://i.stack.imgur.com/fO89q.jpg)
2019/11/09
[ "https://electronics.stackexchange.com/questions/466553", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/207122/" ]
The LM386 looks internally similar to the LM380, which you can see more about [here on EESE](https://electronics.stackexchange.com/a/273901/38098). The difference voltage between the two inputs should never be allowed to exceed a certain amount because once it does, the inputs will sink/source a great deal of current a...
1N4148 diodes are made of silicon and conduct very little until the forward voltage reaches 0.6 V or so. * On positive half-cycles D1 will remain "open-circuit" unless the audio signal exceeds 0.5 to 0.6 V. If the signal exceeds the forward voltage of the diode then the signal will be clamped at the forward voltage. ...
466,553
How do the diodes protect the input of amplifier from excess voltage in the circuit below? [![enter image description here](https://i.stack.imgur.com/fO89q.jpg)](https://i.stack.imgur.com/fO89q.jpg)
2019/11/09
[ "https://electronics.stackexchange.com/questions/466553", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/207122/" ]
1N4148 diodes are made of silicon and conduct very little until the forward voltage reaches 0.6 V or so. * On positive half-cycles D1 will remain "open-circuit" unless the audio signal exceeds 0.5 to 0.6 V. If the signal exceeds the forward voltage of the diode then the signal will be clamped at the forward voltage. ...
The 1N4158 will have this behavior (assuming N=1 for doping profile, and 1mA at 0.6 volts) 10mA @ 0.658 volt; incremental R = 2.6 ohms 1mA @0.600 volt; incremental R = 26 ohms 0.1mA @0.542 volt; incremental R = 260 ohms 0.01mA @0.484 volt incremental R = 2,600 ohms 0.001mA @0.426 volt; incremental R = 26,000 ohms ...
466,553
How do the diodes protect the input of amplifier from excess voltage in the circuit below? [![enter image description here](https://i.stack.imgur.com/fO89q.jpg)](https://i.stack.imgur.com/fO89q.jpg)
2019/11/09
[ "https://electronics.stackexchange.com/questions/466553", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/207122/" ]
The LM386 looks internally similar to the LM380, which you can see more about [here on EESE](https://electronics.stackexchange.com/a/273901/38098). The difference voltage between the two inputs should never be allowed to exceed a certain amount because once it does, the inputs will sink/source a great deal of current a...
The 1N4158 will have this behavior (assuming N=1 for doping profile, and 1mA at 0.6 volts) 10mA @ 0.658 volt; incremental R = 2.6 ohms 1mA @0.600 volt; incremental R = 26 ohms 0.1mA @0.542 volt; incremental R = 260 ohms 0.01mA @0.484 volt incremental R = 2,600 ohms 0.001mA @0.426 volt; incremental R = 26,000 ohms ...
45,427,487
I am getting **following error** while doing a prod build for my angular 4 project in windows 10: ``` 92% chunk asset optimization <--- Last few GCs ---> [2608:000002518B1007B0] 578653 ms: Mark-sweep 1400.7 (1534.2) -> 1400.7 (1502.2) MB, 1409.9 / 0.0 ms last resort [2608:000002518B1007B0] 579952 ms: Mark-sweep ...
2017/08/01
[ "https://Stackoverflow.com/questions/45427487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/900947/" ]
I've changed `max_old_space_size` in `ng.cmd` file inside `%AppData%\npm` (Windows) and it did the trick. I no longer face any issue while launching `ng build --prod --env=prod --base-href .`
To actually increase the memory size you need to use the flag `max_old_space_size` with the file call. Change your code to: ``` @IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" --max_old_space_size=8048 "%~dp0\..\webpack\bin\webpack.js" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node ...
26,295,378
I can't fix an issue am having with centering a block of content in IE9. I tried various stuff from the web, didn't work. If possible, I'd appreciate if this could be hosted somewhere where I can see it working. I have defined doctype: ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <ti...
2014/10/10
[ "https://Stackoverflow.com/questions/26295378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1047283/" ]
Answer is to add this (see Hashem Qolami's comment): **-ms-transform:translate(-50%, -50%);**
Though I'm unable to reproduce the effect, my guess would be that you need to set a transform origin: ``` .zone-label { background-color: #666; color: white; font-size: 25px; font-weight: bold; padding: 0 5px; position: absolute; margin: 0 -50% 0 0; top: 50%; left: 50%; transfor...
50,408,319
I am stuck in the below scenario. I have added these in one script named : small\_script.sh ``` #!/bin/bash uname uname -r uname -a pwd ``` I need the timestamp in seconds for every line displaying in the terminal and needs to write to a file .. Hence I implemented as below : ``` ./small_script.sh | while read R;...
2018/05/18
[ "https://Stackoverflow.com/questions/50408319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7015074/" ]
You are ignoring the result of the recursive call to `sorted`. Just return it, and you should be fine: ``` boolean sorted(int[] a , int s , int n) { if(s+1==n) return true ; if(a[s]<=a[s+1]) return sorted(a,s+1,n); // Here! return false ; } ```
You don't use result of recursive call. Perhaps it may look like ``` if(a[s]<=a[s+1]) return sorted(a,s+1,n) else return false; ``` or (if Java uses fast evaluation of complex conditions): ``` return (a[s]<=a[s+1]) && (sorted(a,s+1,n)) ```
45,901,119
Hello I am a beginner at SQL, especially postgresql. I have a table that looks something like this: ``` ID | Entity | Startdate | enddate ------| ------ | ------ | ------ 1 | Hospital |2013-01-01 |2013-01-31 1 | Clinic |2013-02-01 |2013-04-30 1 | Hospital |2013-05-01 |2013-05-31 ``` What I ...
2017/08/27
[ "https://Stackoverflow.com/questions/45901119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8522121/" ]
> > Any idea why firefox changes the value of the attribute? > > > Because `middle` *is* the correct value as defined in [RFC 1866 (HTML 2.0)](https://www.rfc-editor.org/rfc/rfc1866#page-35), [HTML 3.2](https://www.w3.org/TR/REC-html32#img) and [HTML 4](https://www.w3.org/TR/html4/struct/objects.html#h-13.7.4), no...
the [html specification](https://www.w3.org/TR/html401/struct/objects.html#adef-align-IMG) does not know of a value *center* for the align attribute for img tags (but for other tags). however, firefox probably recognizes *center* as value (instead of other nonsense) and accepts it as *middle* since firefox and possible...
4,184,572
I'm using the `XMLStreamReader` interface from `javax.xml` to parse an XML file. The file contains huge data amounts and single text nodes of several KB. The validating and reading generally works very good, but I'm having trouble with text nodes that are larger than 15k characters. The problem occurs in this functio...
2010/11/15
[ "https://Stackoverflow.com/questions/4184572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/254033/" ]
> > Of course I could loop over the function and concatenate the strings, but somehow I don't think that's the idea... > > > Actually, that *is* the idea :) The parser is permitted to break up the event stream however it wishes, as long as it's consistent with the original document. That means it can, and often w...
Another option is the `javax.xml.stream.isCoalescing` option (documented in [XMLStreamReader.next()](http://docs.oracle.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html#next%28%29) or [Using StAX](http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/SJSXP4.html)), which automatic...
13,727,179
I have a list of objects which contain one XML String field. I have to execute an SQL like query for that field, and get a sub list that satisfies the values. I am trying to use XPath. Firstly, I can't figure out the XPath string to achieve this. Secondly, there might be a better way of doing this. I tried searching ...
2012/12/05
[ "https://Stackoverflow.com/questions/13727179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289918/" ]
We need book records ``` //book ``` with author "J K Rowling" ``` //book[author = "J K Rowling"] ``` and genre is "fantasy" ``` //book[author = "J K Rowling" and genre = "fantasy"] ``` and keyword is "wizard" or "hogwarts" ``` //book[author = "J K Rowling" and genre = "fantasy" and (keyword = "wizard" or keyw...
Assume the `Books` is the root ``` /Books/Book[(author = "J K Rowling") and (genre = "fantasy") and (keyword = "wizard" or keyword = "hogwarts")] ```
13,727,179
I have a list of objects which contain one XML String field. I have to execute an SQL like query for that field, and get a sub list that satisfies the values. I am trying to use XPath. Firstly, I can't figure out the XPath string to achieve this. Secondly, there might be a better way of doing this. I tried searching ...
2012/12/05
[ "https://Stackoverflow.com/questions/13727179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289918/" ]
We need book records ``` //book ``` with author "J K Rowling" ``` //book[author = "J K Rowling"] ``` and genre is "fantasy" ``` //book[author = "J K Rowling" and genre = "fantasy"] ``` and keyword is "wizard" or "hogwarts" ``` //book[author = "J K Rowling" and genre = "fantasy" and (keyword = "wizard" or keyw...
You need to build the XPath queries first. I recommend referring to a previous answer for those (hoaz has a good listing [here](https://stackoverflow.com/a/13727372/460638)). Then you need to write the code to compile the query and evaluate it. Example: ``` public List<Book> findBookInformation(List<Books> books) ...
13,727,179
I have a list of objects which contain one XML String field. I have to execute an SQL like query for that field, and get a sub list that satisfies the values. I am trying to use XPath. Firstly, I can't figure out the XPath string to achieve this. Secondly, there might be a better way of doing this. I tried searching ...
2012/12/05
[ "https://Stackoverflow.com/questions/13727179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289918/" ]
You need to build the XPath queries first. I recommend referring to a previous answer for those (hoaz has a good listing [here](https://stackoverflow.com/a/13727372/460638)). Then you need to write the code to compile the query and evaluate it. Example: ``` public List<Book> findBookInformation(List<Books> books) ...
Assume the `Books` is the root ``` /Books/Book[(author = "J K Rowling") and (genre = "fantasy") and (keyword = "wizard" or keyword = "hogwarts")] ```
10,258,808
I need to query parse.com to check if 2 specified values are present in an array. The documentation states that: "You can give multiple constraints, and objects will only be in the results if they match all of the constraints. In other words, it's like an AND of constraints." My experience says it is not. I am query...
2012/04/21
[ "https://Stackoverflow.com/questions/10258808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/685523/" ]
As detailed in PFQuery.h ------------------------ Use this available method. This is ensure that **EVERY** object in specified array must be present. ``` - (void)whereKey:(NSString *)key containsAllObjectsInArray:(NSArray *)array; ``` Example ======= ``` PFQuery *gameQuery = [PFQuery queryWithClassName:@"GameObjec...
From Parse header documentation: ``` /*! Add a constraint to the query that requires a particular key's object to be contained in the provided array. @param key The key to be constrained. @param array The possible values for the key's object. */ - (void)whereKey:(NSString *)key containedIn:(NSArray *)array; ``` ...
208,472
I add new link to customer account sidebar like in the image below. Customer account sidebar : [![sidebar](https://i.stack.imgur.com/mTmmO.png)](https://i.stack.imgur.com/mTmmO.png) And i create new page for `Reset Employee Password` link, and it's done like in the image below. Custom page : [![Custom page](https:/...
2018/01/08
[ "https://magento.stackexchange.com/questions/208472", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/58086/" ]
I found the answer myself, if maybe someone want to do the same with me, just set the layout at your xml file to `layout="2columns-left"` and you'll get the customer account page sidebar like in the image below. [![Done](https://i.stack.imgur.com/Q0wjC.png)](https://i.stack.imgur.com/Q0wjC.png) **Code :** ``` <page ...
It might not be the complete answer but I think you can generate the further idea looking at this. You can edit your layout `reset_emppass_index.xml` as: ``` <?xml version="1.0" ?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_conf...
4,110,146
Is there an easy, not using spring, way to have RESTeasy return a jsp or html page with a model? I want to do something similar to the spring ModelAndView where I have a request to say /contacts/loomer and have it return a mocked up object in a jsp template. All of the examples I see are for JSON/XML. I know in Jersey ...
2010/11/05
[ "https://Stackoverflow.com/questions/4110146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323358/" ]
Okay, I figured it out for anyone who is interested. It was actually fairly trivial once I found an example. ``` @GET @Path("{eventid}") @Produces("text/html") public void getEvent(@Context HttpServletResponse response, @Context HttpServletRequest request, @PathParam("eventid") Long eventid) throws Ser...
I have voted up the above answer but it seems to work OK with RestEasy up to 2.3.2.Final, latest is 2.3.5.Final (for today). It seems to work OK with Jersey bundled with Glassfish 3.1.2.2 too. This doesn't work with the RestEasy above 2.3.2.Final when I tried. I thought to share this observation as it took me a while ...
4,110,146
Is there an easy, not using spring, way to have RESTeasy return a jsp or html page with a model? I want to do something similar to the spring ModelAndView where I have a request to say /contacts/loomer and have it return a mocked up object in a jsp template. All of the examples I see are for JSON/XML. I know in Jersey ...
2010/11/05
[ "https://Stackoverflow.com/questions/4110146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323358/" ]
Okay, I figured it out for anyone who is interested. It was actually fairly trivial once I found an example. ``` @GET @Path("{eventid}") @Produces("text/html") public void getEvent(@Context HttpServletResponse response, @Context HttpServletRequest request, @PathParam("eventid") Long eventid) throws Ser...
Using `org.jboss.resteasy.resteasy-html` version `3.0.6.Final` you can directly access the `HttpServletRequest` and inject your own attributes before directing output to a RESTEasy `View`. ``` @GET @Path("{eventid}") @Produces("text/html") public View getEvent(@Context HttpServletResponse response, ...
4,110,146
Is there an easy, not using spring, way to have RESTeasy return a jsp or html page with a model? I want to do something similar to the spring ModelAndView where I have a request to say /contacts/loomer and have it return a mocked up object in a jsp template. All of the examples I see are for JSON/XML. I know in Jersey ...
2010/11/05
[ "https://Stackoverflow.com/questions/4110146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323358/" ]
Using `org.jboss.resteasy.resteasy-html` version `3.0.6.Final` you can directly access the `HttpServletRequest` and inject your own attributes before directing output to a RESTEasy `View`. ``` @GET @Path("{eventid}") @Produces("text/html") public View getEvent(@Context HttpServletResponse response, ...
I have voted up the above answer but it seems to work OK with RestEasy up to 2.3.2.Final, latest is 2.3.5.Final (for today). It seems to work OK with Jersey bundled with Glassfish 3.1.2.2 too. This doesn't work with the RestEasy above 2.3.2.Final when I tried. I thought to share this observation as it took me a while ...
7,728
How can I get a query-based treelist to return a list of items relative to the current item, that fits a template, instead of only the first result Search structure: ``` -Parent Item --Segments ---Item 1 (template = {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}) ---Item 2 (template = {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}) ...
2017/09/25
[ "https://sitecore.stackexchange.com/questions/7728", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/757/" ]
The reason only the first result is available for selection is because the treelist query sets the root item for selection, not the available list of items. Instead you should use enhanced syntax using Parameterized datasource, which allows you to add some additional restrictions as well as setting the root node. ```...
I managed to get a relative query selection to work out of the box, with a multilist using a hierarchy like this: ``` BASE-TEMPLATE-ID item -CHILD-CONTAINER-TEMPLATE-ID --Child --Child ``` With the template source query looking like this: ``` query:ancestor-or-self::*/.[@@templateid='{BASE-TEMPLATE-ID}']/*[@@templa...
3,588
Is there a source with records of the participants and/or casualties of the Russian army during the WWI period (1914-1918) and thereabouts? Preferably on-line and indexed/searchable by name(s), birthplace, place of residence and whatever else data the authorities gathered for the recruits.
2013/07/22
[ "https://genealogy.stackexchange.com/questions/3588", "https://genealogy.stackexchange.com", "https://genealogy.stackexchange.com/users/776/" ]
There are some sources but they are fragmented and most of them are not digitized yet. One online source about WWI casualties for 1914-1915 years is in the [Russian State Library](http://sigla.rsl.ru/table.jsp?f=1016&t=3&v0=%D0%98%D0%BC%D0%B5%D0%BD%D0%BD%D0%BE%D0%B9%20%D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA%20%D1%83%D0%B...
There is a Russian website that has a project going to provide the data within pdf format spreadsheets. These are also in Russian and provided according to Russian province. You can find these records at <http://svrt.ru/1914/1914-1.htm> .
3,588
Is there a source with records of the participants and/or casualties of the Russian army during the WWI period (1914-1918) and thereabouts? Preferably on-line and indexed/searchable by name(s), birthplace, place of residence and whatever else data the authorities gathered for the recruits.
2013/07/22
[ "https://genealogy.stackexchange.com/questions/3588", "https://genealogy.stackexchange.com", "https://genealogy.stackexchange.com/users/776/" ]
There are some sources but they are fragmented and most of them are not digitized yet. One online source about WWI casualties for 1914-1915 years is in the [Russian State Library](http://sigla.rsl.ru/table.jsp?f=1016&t=3&v0=%D0%98%D0%BC%D0%B5%D0%BD%D0%BD%D0%BE%D0%B9%20%D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA%20%D1%83%D0%B...
I've had simliar questions about those records (and those of WWII). For WWI I was directed to try <https://gwar.mil.ru/>
3,588
Is there a source with records of the participants and/or casualties of the Russian army during the WWI period (1914-1918) and thereabouts? Preferably on-line and indexed/searchable by name(s), birthplace, place of residence and whatever else data the authorities gathered for the recruits.
2013/07/22
[ "https://genealogy.stackexchange.com/questions/3588", "https://genealogy.stackexchange.com", "https://genealogy.stackexchange.com/users/776/" ]
There is a Russian website that has a project going to provide the data within pdf format spreadsheets. These are also in Russian and provided according to Russian province. You can find these records at <http://svrt.ru/1914/1914-1.htm> .
I've had simliar questions about those records (and those of WWII). For WWI I was directed to try <https://gwar.mil.ru/>
61,629,246
I tried to write this formula excel vba what is my wrong ``` For i = 1 To (N - 1) H = H + N- (i / (N) ^ P) Next ``` [![enter image description here](https://i.stack.imgur.com/WYgWl.jpg)](https://i.stack.imgur.com/WYgWl.jpg)
2020/05/06
[ "https://Stackoverflow.com/questions/61629246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10752924/" ]
The loop is only for what is behind the sum sign `Σ` and the `N - Σ` must be calculated **after** the loop. Also you need to place the perenthesis correctly: ``` Public Function H(ByVal N As Long, ByVal P As Double) As Double 'Calculate the sum Σ Dim S As Double 'result of the sum Σ Dim i As Long For i...
For caulations, VBA follows operator precedence, so we should carefully use parentheses around the calculations in order to change the predence of operators. Absence of parentheses at the right place in the above caluclations could be the reason of unexpected result. Please refer to the link below to see the operator p...
61,629,246
I tried to write this formula excel vba what is my wrong ``` For i = 1 To (N - 1) H = H + N- (i / (N) ^ P) Next ``` [![enter image description here](https://i.stack.imgur.com/WYgWl.jpg)](https://i.stack.imgur.com/WYgWl.jpg)
2020/05/06
[ "https://Stackoverflow.com/questions/61629246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10752924/" ]
If you want a formula to do it: ``` =B1 -SUMPRODUCT((ROW($ZZ1:INDEX($ZZ:$ZZ,B1-1))/B1)^B2) ``` [![enter image description here](https://i.stack.imgur.com/qiS8E.png)](https://i.stack.imgur.com/qiS8E.png)
For caulations, VBA follows operator precedence, so we should carefully use parentheses around the calculations in order to change the predence of operators. Absence of parentheses at the right place in the above caluclations could be the reason of unexpected result. Please refer to the link below to see the operator p...
61,629,246
I tried to write this formula excel vba what is my wrong ``` For i = 1 To (N - 1) H = H + N- (i / (N) ^ P) Next ``` [![enter image description here](https://i.stack.imgur.com/WYgWl.jpg)](https://i.stack.imgur.com/WYgWl.jpg)
2020/05/06
[ "https://Stackoverflow.com/questions/61629246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10752924/" ]
The loop is only for what is behind the sum sign `Σ` and the `N - Σ` must be calculated **after** the loop. Also you need to place the perenthesis correctly: ``` Public Function H(ByVal N As Long, ByVal P As Double) As Double 'Calculate the sum Σ Dim S As Double 'result of the sum Σ Dim i As Long For i...
If you want a formula to do it: ``` =B1 -SUMPRODUCT((ROW($ZZ1:INDEX($ZZ:$ZZ,B1-1))/B1)^B2) ``` [![enter image description here](https://i.stack.imgur.com/qiS8E.png)](https://i.stack.imgur.com/qiS8E.png)
34,703,803
(Rails 4.2.1, Sqlite3) I have three models - M1, M2, M3. M1 belongs\_to M2 M1 also belongs\_to M3 M1 has a :name (string) field. I have the following constraints that must be validated: 1) An M1 record can have an M2 or M3 associated, but not both. 2) M1 name must be unique under whichever of M2 or M3 is specif...
2016/01/10
[ "https://Stackoverflow.com/questions/34703803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/456735/" ]
So `m3_id` is `NULL` in both cases ? In Sqlite3, a null value is considered distinct to another null value in the context of a unique index. > > For the purposes of unique indices, all NULL values are considered to > different from all other NULL values and are thus unique > > > See <https://sqlite.org/lang_cre...
You can express this with two indices. ```rb add_index :m1s, [:name, :m2_id], unique: true add_index :m1s, [:name, :m3_id], unique: true ``` Since nulls are considered distinct for uniqueness purposes, the first index will not constrain rows where only `m3_id` is set, and vice versa for the second index. (You might...
70,724,640
I have created a website for desktop and mobile, and it has to be responsive. My problem is that when I resize the browser all the content gets zoomed out instead of adapting. I also have an issue with the HTML. why is it only taking up 1/3 of the page according to dev tools and when I add `width:1100px` to my sections...
2022/01/15
[ "https://Stackoverflow.com/questions/70724640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17941738/" ]
Some issues I noticed: * The horizontal scrollbar opens when the screen width is reduced after the web page is loaded; This situation is not suitable for responsive design. To avoid this situation, add `overflow-x: hidden` to the `<body>` I used the style. * You should use media queries to make a mobile responsive web...
For making your website responsive you need to use [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries). It's like you tell the browser how to style your website in different sizes. I think your problem with your sections might also get solved if you try to make your websi...
55,079,296
I have the following trait: ``` trait Storage[C <: Config] { def get(name: String, version: Int): Option[C] def list: List[(String, String)] def register(config: C): Boolean } ``` and I want to create the following class: ``` class MultiStorage[C <: Config](storages: List[Storage[_ <: C]]) extends Storage[C] ...
2019/03/09
[ "https://Stackoverflow.com/questions/55079296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3737163/" ]
The runtime class needs to be made available, for example: ``` class Config class FooConfig extends Config class BarConfig extends Config trait Storage[C <: Config] { val ctag: ClassTag[C] def get(name: String, version: Int): Option[C] def list: List[(String, String)] def register(config: C): Boolean...
Possible approach with Shapeless is ``` import shapeless.{::, HList, HNil} object App { trait Config object config1 extends Config object config2 extends Config trait Storage[C <: Config] { def get(name: String, version: Int): Option[C] def list: List[(String, String)] def register(config: C): Bo...
544,786
I would like to know how it is possible to manually change the style of a mark in a data set. In the MWE below, I have commented on a simple but unsatisfactory solution (Put `triangle` instead of `triangle*`, for example). [![enter image description here](https://i.stack.imgur.com/QhFqH.png)](https://i.stack.imgur.c...
2020/05/17
[ "https://tex.stackexchange.com/questions/544786", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/209693/" ]
Like this? [![enter image description here](https://i.stack.imgur.com/aTjwx.png)](https://i.stack.imgur.com/aTjwx.png) (red lines indicate text borders) ``` \documentclass[12pt, fleqn]{article} \usepackage[letterpaper, margin=1in]{geometry} \usepackage{newtxtext} \usepackage{mathtools,amssymb,amsthm} \s...
You can accomplish this with the `align*` environment, the `fleqn` and `alignedleftspaceno` options of `amsmath`, and a `\@mathmargin` of zero. To break a long equation, insert a `split`. If you just want equations flush left without alignment points, you can use the `lgather` environment from `mathtools`. The `fleqn...
41,814,008
I just had one question about "Event-Timestamp" AVP. I know that i should put the epoch time in there, but i mainly concerned about its format, it is what i found in RFC so far: ``` 8.21. Event-Timestamp AVP The Event-Timestamp (AVP Code 55) is of type Time, and MAY be included in an Accounting-Request and Accoun...
2017/01/23
[ "https://Stackoverflow.com/questions/41814008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1955220/" ]
Well, the RFC should be re-strictly followed :) Converting the epoch time to bytes (length = 4) did the trick. Update: It didnt really worked out :/ I mean now, the message is ok from AVP format point of view .. however the time is not correct .. I used below code to create the epoch time and convert to byte array: ...
"fd\_dictfct\_Time\_encode" function is the answer :)
41,814,008
I just had one question about "Event-Timestamp" AVP. I know that i should put the epoch time in there, but i mainly concerned about its format, it is what i found in RFC so far: ``` 8.21. Event-Timestamp AVP The Event-Timestamp (AVP Code 55) is of type Time, and MAY be included in an Accounting-Request and Accoun...
2017/01/23
[ "https://Stackoverflow.com/questions/41814008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1955220/" ]
Well, the problem here is that you have a reference in the RFC you are reading that links you to the NTP rfc for a definition of the NTP timestamp. The 4 first bytes of the NTP timestamp show you the integer part (in seconds) from the epoch to the time the timestamp was acquired. The `time(2)` function gives you a `t...
Well, the RFC should be re-strictly followed :) Converting the epoch time to bytes (length = 4) did the trick. Update: It didnt really worked out :/ I mean now, the message is ok from AVP format point of view .. however the time is not correct .. I used below code to create the epoch time and convert to byte array: ...
41,814,008
I just had one question about "Event-Timestamp" AVP. I know that i should put the epoch time in there, but i mainly concerned about its format, it is what i found in RFC so far: ``` 8.21. Event-Timestamp AVP The Event-Timestamp (AVP Code 55) is of type Time, and MAY be included in an Accounting-Request and Accoun...
2017/01/23
[ "https://Stackoverflow.com/questions/41814008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1955220/" ]
Well, the problem here is that you have a reference in the RFC you are reading that links you to the NTP rfc for a definition of the NTP timestamp. The 4 first bytes of the NTP timestamp show you the integer part (in seconds) from the epoch to the time the timestamp was acquired. The `time(2)` function gives you a `t...
"fd\_dictfct\_Time\_encode" function is the answer :)
53,859,193
I'm currently working on a Mule 3.9 app that handles both REST and SOAP requests. The REST side works fine, however I'm running into a bizarre issue with the SOAP functionality. Right now, the file is just the HTTP Listener, a SOAP Router, and two flows, each for a different process, each containing a single Logger. Ho...
2018/12/19
[ "https://Stackoverflow.com/questions/53859193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9962085/" ]
Here is one way. First, subtract one from each of your little numbers. For your example input that results in ``` 0 1 3 4 2 4 1 2 0 1 2 3 ``` Now treat that as the base-5 representation of an integer. (You can choose either most significant digit first or last.) Calculate the number in binary that means the same thi...
Its call : **polidatacompressor.js** but license will be cost you, you have to ask author about prices LOL <https://github.com/polidatacompressor/polidatacompressor> Ncomp(65535) will output: 255, 255 and when you store this in database as bytes you got 2 char another way is to use "Hexadecimal aka base16" in javasc...
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
As an alternative, you could: 1. Use the **Convert Lines to Points** tool from: *Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points* (Add points over small distances. E.g. add a point every 1m if the overall line is 100m) [![Convert lines to points](https://i.stack.imgur.com/izAtG.png)](https://i...
If you find the point over the line, the shortest point, with the coordinate 3D (X,Y,Z) you need an algorithm to calc the position over the shortest line. You can using this tool <https://github.com/rafaelduartenom/findpointonline>. You need postgres to execute this tool and shapefiles.
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
As an alternative, you could: 1. Use the **Convert Lines to Points** tool from: *Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points* (Add points over small distances. E.g. add a point every 1m if the overall line is 100m) [![Convert lines to points](https://i.stack.imgur.com/izAtG.png)](https://i...
[The ClosestPoint](https://plugins.qgis.org/plugins/ClosestPoint/) does what you are looking for, currently limited to selected features only. You can take a look at the code and modify it for your needs
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
As an alternative, you could: 1. Use the **Convert Lines to Points** tool from: *Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points* (Add points over small distances. E.g. add a point every 1m if the overall line is 100m) [![Convert lines to points](https://i.stack.imgur.com/izAtG.png)](https://i...
In QGIS I can suggest using a ["Virtual Layer"](https://docs.qgis.org/latest/en/docs/user_manual/managing_data_source/create_layers.html#creating-virtual-layers) through `Layer > Add Layer > Add/Edit Virtual Layer...`. Let's assume we have two layers *'points'* and *'river'* with their corresponding attribute tables, ...
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
As an alternative, you could: 1. Use the **Convert Lines to Points** tool from: *Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points* (Add points over small distances. E.g. add a point every 1m if the overall line is 100m) [![Convert lines to points](https://i.stack.imgur.com/izAtG.png)](https://i...
Meanwhile (since QGIS 3.16), there is the new [`overlay_nearest()`](https://docs.qgis.orglatest/en/docs/user_manual/working_with_vector/functions_list.html#overlay-nearest) function you can use for that with QGIS expressions. For each point, 1) get the nearest line with `overlay_nearest()`, 2) get the closest point on ...
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
[The ClosestPoint](https://plugins.qgis.org/plugins/ClosestPoint/) does what you are looking for, currently limited to selected features only. You can take a look at the code and modify it for your needs
If you find the point over the line, the shortest point, with the coordinate 3D (X,Y,Z) you need an algorithm to calc the position over the shortest line. You can using this tool <https://github.com/rafaelduartenom/findpointonline>. You need postgres to execute this tool and shapefiles.
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
In QGIS I can suggest using a ["Virtual Layer"](https://docs.qgis.org/latest/en/docs/user_manual/managing_data_source/create_layers.html#creating-virtual-layers) through `Layer > Add Layer > Add/Edit Virtual Layer...`. Let's assume we have two layers *'points'* and *'river'* with their corresponding attribute tables, ...
If you find the point over the line, the shortest point, with the coordinate 3D (X,Y,Z) you need an algorithm to calc the position over the shortest line. You can using this tool <https://github.com/rafaelduartenom/findpointonline>. You need postgres to execute this tool and shapefiles.
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
Meanwhile (since QGIS 3.16), there is the new [`overlay_nearest()`](https://docs.qgis.orglatest/en/docs/user_manual/working_with_vector/functions_list.html#overlay-nearest) function you can use for that with QGIS expressions. For each point, 1) get the nearest line with `overlay_nearest()`, 2) get the closest point on ...
If you find the point over the line, the shortest point, with the coordinate 3D (X,Y,Z) you need an algorithm to calc the position over the shortest line. You can using this tool <https://github.com/rafaelduartenom/findpointonline>. You need postgres to execute this tool and shapefiles.
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
In QGIS I can suggest using a ["Virtual Layer"](https://docs.qgis.org/latest/en/docs/user_manual/managing_data_source/create_layers.html#creating-virtual-layers) through `Layer > Add Layer > Add/Edit Virtual Layer...`. Let's assume we have two layers *'points'* and *'river'* with their corresponding attribute tables, ...
[The ClosestPoint](https://plugins.qgis.org/plugins/ClosestPoint/) does what you are looking for, currently limited to selected features only. You can take a look at the code and modify it for your needs
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
Meanwhile (since QGIS 3.16), there is the new [`overlay_nearest()`](https://docs.qgis.orglatest/en/docs/user_manual/working_with_vector/functions_list.html#overlay-nearest) function you can use for that with QGIS expressions. For each point, 1) get the nearest line with `overlay_nearest()`, 2) get the closest point on ...
[The ClosestPoint](https://plugins.qgis.org/plugins/ClosestPoint/) does what you are looking for, currently limited to selected features only. You can take a look at the code and modify it for your needs
181,636
I have two layers, a line and a point layer. I need to make a line layer which connects all the points to the nearest line feature. How can I do that? Is there a plugin available for QGIS? This is a very important tool which is missing in QGIS. ArcView has this tool: ["Nearest Features"](http://www.jennessent.com/ar...
2016/02/21
[ "https://gis.stackexchange.com/questions/181636", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/45512/" ]
In QGIS I can suggest using a ["Virtual Layer"](https://docs.qgis.org/latest/en/docs/user_manual/managing_data_source/create_layers.html#creating-virtual-layers) through `Layer > Add Layer > Add/Edit Virtual Layer...`. Let's assume we have two layers *'points'* and *'river'* with their corresponding attribute tables, ...
Meanwhile (since QGIS 3.16), there is the new [`overlay_nearest()`](https://docs.qgis.orglatest/en/docs/user_manual/working_with_vector/functions_list.html#overlay-nearest) function you can use for that with QGIS expressions. For each point, 1) get the nearest line with `overlay_nearest()`, 2) get the closest point on ...
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
Assuming your "date" column is not actually a date. ``` Select convert(varchar(8),cast('12/24/2016' as date),112) ``` or ``` Select format(cast('12/24/2016' as date),'yyyyMMdd') ``` Returns ``` 20161224 ```
You can do as follows: ``` Select Format(test.Time, 'yyyyMMdd') From TableTest test ```
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
Assuming your "date" column is not actually a date. ``` Select convert(varchar(8),cast('12/24/2016' as date),112) ``` or ``` Select format(cast('12/24/2016' as date),'yyyyMMdd') ``` Returns ``` 20161224 ```
``` Select CONVERT(VARCHAR(8), GETDATE(), 112) ``` Tested in SQL Server 2012 <https://www.w3schools.com/sql/func_sqlserver_convert.asp>
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
SELECT YEAR(getdate()) \* 10000 + MONTH(getdate()) \* 100 + DAY(getdate())
SELECT TO\_CHAR(created\_at, 'YYYY-MM-DD') FROM table; //converts any date format to YYYY-MM-DD
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
``` DECLARE @v DATE= '3/15/2013' SELECT CONVERT(VARCHAR(10), @v, 112) ``` you can convert any date format or date time format to YYYYMMDD with no delimiters
You can do as follows: ``` Select Format(test.Time, 'yyyyMMdd') From TableTest test ```
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
try this.... ``` SELECT FORMAT(CAST(DOB AS DATE),'yyyyMMdd') FROM Employees; ```
In SQL Server, you can do: ``` select coalesce(format(try_convert(date, col, 112), 'yyyyMMdd'), col) ``` This attempts the conversion, keeping the previous value if available. Note: I hope you learned a lesson about storing dates as dates and not strings.
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
try this.... ``` SELECT FORMAT(CAST(DOB AS DATE),'yyyyMMdd') FROM Employees; ```
mm/dd/yyyy corresponds to U.S. standard so if you convert to date using 101 value and then to varchar using 112 for ISO date get the expected result. ``` declare @table table (date_value varchar(10)) insert into @table values ('03/30/2022'),('20220330') select date_value --converted to varchar ,case ...
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
Assuming your "date" column is not actually a date. ``` Select convert(varchar(8),cast('12/24/2016' as date),112) ``` or ``` Select format(cast('12/24/2016' as date),'yyyyMMdd') ``` Returns ``` 20161224 ```
try this.... ``` SELECT FORMAT(CAST(DOB AS DATE),'yyyyMMdd') FROM Employees; ```
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
``` DECLARE @v DATE= '3/15/2013' SELECT CONVERT(VARCHAR(10), @v, 112) ``` you can convert any date format or date time format to YYYYMMDD with no delimiters
mm/dd/yyyy corresponds to U.S. standard so if you convert to date using 101 value and then to varchar using 112 for ISO date get the expected result. ``` declare @table table (date_value varchar(10)) insert into @table values ('03/30/2022'),('20220330') select date_value --converted to varchar ,case ...
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
You can do as follows: ``` Select Format(test.Time, 'yyyyMMdd') From TableTest test ```
SELECT YEAR(getdate()) \* 10000 + MONTH(getdate()) \* 100 + DAY(getdate())
41,353,285
I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do this? Thanks Table is `Employees` and column is `DOB`
2016/12/27
[ "https://Stackoverflow.com/questions/41353285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6055501/" ]
try this.... ``` SELECT FORMAT(CAST(DOB AS DATE),'yyyyMMdd') FROM Employees; ```
SELECT TO\_CHAR(created\_at, 'YYYY-MM-DD') FROM table; //converts any date format to YYYY-MM-DD
66,517,370
I can open this file directly from the net,and I want to add row numbers to each line based on rules. If you need header row number,then start from number 1, if no need, then start from next line. This is my code, I tried a lot but doesn't work. It looks like picture. Does anyone how to solve this problem? Thanks in ad...
2021/03/07
[ "https://Stackoverflow.com/questions/66517370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12507567/" ]
Have a look at the data you are downloading: ``` Name;Short name;Email;Country;Other spoken languages ABOUELHASSAN Shehab Ibrahim Adbelazin;?;dwedar909@gmail.com;?;? AGHAEI HOSSEIN ABADI Mohammad Mehdi;Matt;mahdiaghaei355@gmail.com;Iran;English ... ``` Now look at the results you are getting: ``` 1,N 2,a 3,m 4,e 5,...
Your absorbing the .txt content in one big string... if you use .readlines() instead of .read(), you can achieve what you want. You should modify this: ``` # Print all student information content = response.read().decode('utf-8') ``` To this: ``` # Print all student information content = response.readlines() ``...
10,312
DSLRs often have the ability to store both a JPEG and a raw file. Given that the [primary benefit of in-camera JPEG over raw](https://photo.stackexchange.com/questions/15/what-are-the-pros-and-cons-when-shooting-in-raw-vs-jpeg/115#115) is the smaller filesize, and that JPEG+raw is going to store even more data than ra...
2011/03/29
[ "https://photo.stackexchange.com/questions/10312", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/378/" ]
I am an amateur photographer going semi-pro and even though I still only use RAW I have come across a few occasions where RAW+JPEG was needed (or at least would be a great convenience): * **ready to email files** (like @rowland-shaw wrote) - some times you need to get your photos out there as fast as possible * ***lit...
I shoot JPEG + RAW because my camera produces *really good JPEG output*. It has flexible control over tone curves, color, and contrast. I'm not usually interested in producing HDR-compressed images — in fact, I often prefer a high contrast look which reduces dynamic range. If I get the exposure and other settings right...