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
15,526,238
In my model, I have this enum that looks like this: ``` public enum m_ItemType { Unknown = 0, // Physical = 1, // Logical = 2, } ``` And I have this method which builds a list of items based on another list of item which has this enum value: ``` private static List<ItemType> BuildListItem(IEnume...
2013/03/20
[ "https://Stackoverflow.com/questions/15526238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2021863/" ]
If the data type of `item.m_ItemType` is `m_ItemType`, first I would rename that to something a bit more sensible (`ItemType` should work). Then you need to use that name in the case statements of your switch. Try this: ``` // your enum public enum ItemType {     Unknown = 0,     //     Physical = 1,     //     Logica...
In your first example the enum is named `m_ItemType`, but should rather be `AnotherEnumValue`. Therefore, in the line `switch (item.m_ItemType)` the value after the dot is interpreted as a type name, not a field.
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
Isn't there a way to describe with drawings that the derivative is the limit of the slopes of the secants, that the integral is the area under a curve, and that the derivative of the area is the height of the function at the point at which you compute derivative? Sure, she might not know what "slope" means, but certain...
Explain derivatives using the speedometer ! Ask her how one could find the speed of something , and if she goes saying the average speed , ask her how one could calculate the instantaneous speed. And boom , there comes your derivatives.
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
Isn't there a way to describe with drawings that the derivative is the limit of the slopes of the secants, that the integral is the area under a curve, and that the derivative of the area is the height of the function at the point at which you compute derivative? Sure, she might not know what "slope" means, but certain...
I remember the explanation I was always given.. "Do you know how to find the area of a circle" "Yes" "Well, do you know how to find an area of a random curved figure?" "No" "That is what we use calculus for".
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
Isn't there a way to describe with drawings that the derivative is the limit of the slopes of the secants, that the integral is the area under a curve, and that the derivative of the area is the height of the function at the point at which you compute derivative? Sure, she might not know what "slope" means, but certain...
I quote parts of [this Reddit answer](https://old.reddit.com/r/explainlikeimfive/comments/70copy/eli5what_is_calculus_how_does_it_work/dn2r32w/). --- The easiest way to understand a little calculus is to sit in the middle seat and look at the speedometer in the car. What speed does it say? Maybe it says 31 miles per ...
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
This is a question for a long car journey - both speed and distance travelled are available, and the relationship between the two can be explored and sampled, and later plotted and examined. And the questions as to why both speed and distance are important can be asked etc
Explain derivatives using the speedometer ! Ask her how one could find the speed of something , and if she goes saying the average speed , ask her how one could calculate the instantaneous speed. And boom , there comes your derivatives.
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
Explain derivatives using the speedometer ! Ask her how one could find the speed of something , and if she goes saying the average speed , ask her how one could calculate the instantaneous speed. And boom , there comes your derivatives.
I remember the explanation I was always given.. "Do you know how to find the area of a circle" "Yes" "Well, do you know how to find an area of a random curved figure?" "No" "That is what we use calculus for".
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
Explain derivatives using the speedometer ! Ask her how one could find the speed of something , and if she goes saying the average speed , ask her how one could calculate the instantaneous speed. And boom , there comes your derivatives.
I quote parts of [this Reddit answer](https://old.reddit.com/r/explainlikeimfive/comments/70copy/eli5what_is_calculus_how_does_it_work/dn2r32w/). --- The easiest way to understand a little calculus is to sit in the middle seat and look at the speedometer in the car. What speed does it say? Maybe it says 31 miles per ...
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
This is a question for a long car journey - both speed and distance travelled are available, and the relationship between the two can be explored and sampled, and later plotted and examined. And the questions as to why both speed and distance are important can be asked etc
I remember the explanation I was always given.. "Do you know how to find the area of a circle" "Yes" "Well, do you know how to find an area of a random curved figure?" "No" "That is what we use calculus for".
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
This is a question for a long car journey - both speed and distance travelled are available, and the relationship between the two can be explored and sampled, and later plotted and examined. And the questions as to why both speed and distance are important can be asked etc
I quote parts of [this Reddit answer](https://old.reddit.com/r/explainlikeimfive/comments/70copy/eli5what_is_calculus_how_does_it_work/dn2r32w/). --- The easiest way to understand a little calculus is to sit in the middle seat and look at the speedometer in the car. What speed does it say? Maybe it says 31 miles per ...
136,664
I have a sister that is interested in learning *"what I do"*. I'm a 17 years old math loving person, but I don't know how to explain integrals and derivatives with some type of analogies. I just want to explain it well so that in the future she could remember what I say to her.
2012/04/25
[ "https://math.stackexchange.com/questions/136664", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26711/" ]
I quote parts of [this Reddit answer](https://old.reddit.com/r/explainlikeimfive/comments/70copy/eli5what_is_calculus_how_does_it_work/dn2r32w/). --- The easiest way to understand a little calculus is to sit in the middle seat and look at the speedometer in the car. What speed does it say? Maybe it says 31 miles per ...
I remember the explanation I was always given.. "Do you know how to find the area of a circle" "Yes" "Well, do you know how to find an area of a random curved figure?" "No" "That is what we use calculus for".
62,764,582
I have a HttpGet endpoint that takes in an `id`. I have figured out how to get the controller and action names but I am also wanting to get the parameters used in the endpoint because I want to be able to distinguish them from a normal default GET. Here is the endpoint and example of what I am wanting: ``` // GET: ap...
2020/07/06
[ "https://Stackoverflow.com/questions/62764582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3681591/" ]
``` // GET: api/PatientSearch/5 [HttpGet("{id}", Name = "Get")] public string Get(int id) { var parameters = MethodBase.GetCurrentMethod().GetParameters(); var paramNames = String.Join(", ", parameters.Select(p => p.Name)); // myString, myInt return this.ControllerContext.RouteData....
``` var q = ControllerContext.RouteData.Values["id"]; ``` or ``` var q = id; ```
56,955,925
I need a way to automatically find out SSH username for an instance. It requires knowing whether AMI is Amazon Linux or Ubuntu (ec2-user@ for Amazon Linux vs ubuntu@ on Ubuntu images) Can someone see a way to get this info? I've been using `image.root_device_name` which seems to be `/dev/xvda` on Amazon Linux `/dev/s...
2019/07/09
[ "https://Stackoverflow.com/questions/56955925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/419116/" ]
In the same directory as `docker-compose.yml` add an environment file named `.env`, then specify your environment variable. [![enter image description here](https://i.stack.imgur.com/AAGRu.png)](https://i.stack.imgur.com/AAGRu.png) After that, add variable into your `docker-compose.yml` [![enter image description h...
Docker-compose used Interpolation Syntax `${variable}` for variables and you missed that in your file. ``` version: '2' services: db: image: example/db:${version} backend: image: example/server:${version} frontend: image: example/gui:${version} ``` So just pass the version to your `docker-compose...
12,436,243
I'm trying to create a new sheet in an existing excel workbook using apache POI for java but have been unsuccessful so far. Can anyone please tell me how it is done?
2012/09/15
[ "https://Stackoverflow.com/questions/12436243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1673176/" ]
It's very easy. It's just like adding a new sheet to a new workbook, only you start with the existing workbook rather than a new one ``` Workbook wb = WorkbookFactory.create(new File("/path/to/existing")); Sheet s = wb.createSheet(); // Do something with the new sheet FileOutputStream out = new FileOutputStream(...
``` //we can create any number of sheets for single workbook HSSFSheet sheet1= workBook.createSheet("sheet1"); HSSFSheet sheet2= workBook.createSheet("sheet2"); HSSFSheet sheet3= workBook.createSheet("sheet3"); ```
12,436,243
I'm trying to create a new sheet in an existing excel workbook using apache POI for java but have been unsuccessful so far. Can anyone please tell me how it is done?
2012/09/15
[ "https://Stackoverflow.com/questions/12436243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1673176/" ]
It's very easy. It's just like adding a new sheet to a new workbook, only you start with the existing workbook rather than a new one ``` Workbook wb = WorkbookFactory.create(new File("/path/to/existing")); Sheet s = wb.createSheet(); // Do something with the new sheet FileOutputStream out = new FileOutputStream(...
``` HSSFSheet sheet1= workBook.createSheet("sheet1"); HSSFSheet sheet2= workBook.createSheet("sheet2"); HSSFSheet sheet3= workBook.createSheet("sheet3"); ```
7,162,242
In my previous version, I used a Date Picker which could default as null as follows; ``` <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %> <%:Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datePicker" }) %> ``` Now I am using...
2011/08/23
[ "https://Stackoverflow.com/questions/7162242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125673/" ]
The following works for me: Inside `Views\Home\Index.cshtml`: ``` @model MvcApplication10.Models.FooBar <!DOCTYPE html> <html> <head> <title>Test DateTime?</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="ht...
I've had problems with the jQuery date picker when my input elements don't have an ID (which I see will happen to you here because you aren't specifying a name when calling Html.TextBox), maybe try assigning one? E.g. ``` @Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class...
7,162,242
In my previous version, I used a Date Picker which could default as null as follows; ``` <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %> <%:Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datePicker" }) %> ``` Now I am using...
2011/08/23
[ "https://Stackoverflow.com/questions/7162242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125673/" ]
The following works for me: Inside `Views\Home\Index.cshtml`: ``` @model MvcApplication10.Models.FooBar <!DOCTYPE html> <html> <head> <title>Test DateTime?</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="ht...
i'm using id instead of classes i also included date diff function you can remove it if you want ``` <script type="text/javascript"> $(document).ready(function () { $("#StartDate").datepicker(); $('#EndDate').datepicker({ onSelect: function () { var diff = dateDiff($('#StartDate').datepicke...
7,162,242
In my previous version, I used a Date Picker which could default as null as follows; ``` <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %> <%:Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datePicker" }) %> ``` Now I am using...
2011/08/23
[ "https://Stackoverflow.com/questions/7162242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125673/" ]
The following works for me: Inside `Views\Home\Index.cshtml`: ``` @model MvcApplication10.Models.FooBar <!DOCTYPE html> <html> <head> <title>Test DateTime?</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="ht...
I found the answer, although no clues in the question. The problem was that I was using a javascript library; jquery-ui-1.8.4.custom.min.js When I disabled it, it worked. I suspect there are some library name clashes that caused the problem. It worked with jquery-ui-1.8.4.min.js, but now I am using jquery-ui-1.8.10.m...
299,539
I have a working VM with ubuntu under virtual box. Everything works fine, but there's a detail that's getting on my nerves. Every time i receive a kernel update, i have to re-install virtual box's guest additions. Is there a way to automate this besides skipping the update ([i found information on that approach here](...
2013/05/24
[ "https://askubuntu.com/questions/299539", "https://askubuntu.com", "https://askubuntu.com/users/161451/" ]
Quoting the [VirtualBox User Manual](http://www.virtualbox.org/manual/ch04.html#idp11306688): > > Be sure to install DKMS before installing the Linux Guest Additions. > If DKMS is not available or not installed, the guest kernel modules > will need to be recreated manually whenever the guest kernel is > updated us...
If you are using [Vagrant](https://www.vagrantup.com/) to manage your Virtualbox VMs, you can install the [vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest/blob/master/Readme.md) plugin to automatically detect out-of-date guest additions and update them.
5,025,744
I have a table with three columns (ProdID,ProdName,Status). I m fetching that into a dataSet and binding that to my gridview. I have a very basic and simple rowdatabound event like this : ``` protected void gvProducts_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRo...
2011/02/17
[ "https://Stackoverflow.com/questions/5025744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/416941/" ]
you can try like... ``` if (((CheckBox)e.Row.Cells[3]).Checked == false) ``` OR, event better if you do like.. ``` if(((CheckBox)e.Row.FindControl("YourCheckboxID")).Checked == false) ``` **Edit:** since you are using RowDataBound Event, in which at that time row don't have what you are finding. you need to do t...
If the Status column is a bunch of checkboxes, then test whether the checkbox's `Checked` property is `true` or `false`.
5,025,744
I have a table with three columns (ProdID,ProdName,Status). I m fetching that into a dataSet and binding that to my gridview. I have a very basic and simple rowdatabound event like this : ``` protected void gvProducts_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRo...
2011/02/17
[ "https://Stackoverflow.com/questions/5025744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/416941/" ]
Check if you have a **CheckBox** control in: ``` e.Rows.Cells[3].Controls ``` Then you can get its **Checked** property: ``` ((CheckBox)e.Rows.Cells[3].Controls[0]).Checked ```
If the Status column is a bunch of checkboxes, then test whether the checkbox's `Checked` property is `true` or `false`.
5,025,744
I have a table with three columns (ProdID,ProdName,Status). I m fetching that into a dataSet and binding that to my gridview. I have a very basic and simple rowdatabound event like this : ``` protected void gvProducts_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRo...
2011/02/17
[ "https://Stackoverflow.com/questions/5025744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/416941/" ]
you can try like... ``` if (((CheckBox)e.Row.Cells[3]).Checked == false) ``` OR, event better if you do like.. ``` if(((CheckBox)e.Row.FindControl("YourCheckboxID")).Checked == false) ``` **Edit:** since you are using RowDataBound Event, in which at that time row don't have what you are finding. you need to do t...
Check if you have a **CheckBox** control in: ``` e.Rows.Cells[3].Controls ``` Then you can get its **Checked** property: ``` ((CheckBox)e.Rows.Cells[3].Controls[0]).Checked ```
14,801,786
I was wanting to get some tips on how to get my program to output a desired number of columns by the user. For example, if the user enters 2 for termsPerLine, then the program should print the values generated by the Juggler series in two columns, or if the user enters 3 for termsPerLine, 3 columns and so forth. The ou...
2013/02/10
[ "https://Stackoverflow.com/questions/14801786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1702085/" ]
Try this at the top of the loop: ``` if ((count % termsPerLine) == 0) { cout << "\n"; } ``` or this at the bottom of the loop: ``` if ((count % termsPerLine) == termsPerLine) { cout << "\n"; } ```
just Fix your loop as: ``` for (count = 1; count <= numOfTerm; count++) { if(firstTerm % 2 == 0) firstTerm = pow(firstTerm, 0.5); else firstTerm = pow(firstTerm, 1.5); if(count % termPerLine != 0) cout << setw(15) << firstTerm; else cout << setw(15) << firstTerm << endl; }; ...
1,056,317
I am using the AES methods here: <http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx> I want to have a string value that I will convert to byte array and pass it to the AES encrypt method. How many characters should the string be to produce the correct byte array size that the me...
2009/06/29
[ "https://Stackoverflow.com/questions/1056317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
The size of the plain text does not matter. Just make sure you use the exact same IV and Key along with the encrypted bytes in the decryptStringFromBytes\_AES(byte[] cipherText, byte[] Key, byte[] IV) method. That will return back to you the entered plain text. For example: ``` string plain_text = "Cool this works";...
You need padding for that. Actually, the page you linked have an example on padding (in C++). With paddings, you can encrypt non standard block sizes.
1,056,317
I am using the AES methods here: <http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx> I want to have a string value that I will convert to byte array and pass it to the AES encrypt method. How many characters should the string be to produce the correct byte array size that the me...
2009/06/29
[ "https://Stackoverflow.com/questions/1056317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
The size of the plain text does not matter. Just make sure you use the exact same IV and Key along with the encrypted bytes in the decryptStringFromBytes\_AES(byte[] cipherText, byte[] Key, byte[] IV) method. That will return back to you the entered plain text. For example: ``` string plain_text = "Cool this works";...
Do not convert a string into its Unicode byte representation. It will be too hard to check for the right length, and not provide enough randomization. You could do the following: use a [key derivation function](http://en.wikipedia.org/wiki/Key_derivation_function). You want a fixed length byte array for the input of t...
67,330,241
What I am trying to do: I want to make it so that when you click on a button with the mouse or with enter from the keyboard that you cannot click on it again afterwards. In other words, disable it after pressing the button one time. Clicking for the second time with the mouse worked, but I can't get it to work with en...
2021/04/30
[ "https://Stackoverflow.com/questions/67330241", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14697913/" ]
Just like the `onClick`, invoke `setDisabled` in `handleKeyPress`: ``` function handleKeyPress(e) { if (e.key === 'Enter') { if (disabled) { // do nothing if already disabled return; } foodData(); setDisabled(true); } } ```
Add a second disabled state, i.e. `inputDisabled` and toggle it on the same way. This allows each to disabled independently of the other. ``` function HomeFood() { const [food, setFood] = useState(null); const [calories, setCalories] = useState(''); const [disabled, setDisabled] = useState(false); const [input...
67,155,591
I want to create a Linux command which creates a file containing 10 random numbers. This is a solution to generate 10 random numbers; ``` RANDOM=$$ for i in `seq 10` do echo $RANDOM done ``` It is working to generate random numbers but how can I combine this with 'touch' command? Should I create a loop?
2021/04/19
[ "https://Stackoverflow.com/questions/67155591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10027996/" ]
Using touch? Like this? ``` touch file.txt && RANDOM=$$ for i in `seq 10` do echo $RANDOM done >> file.txt ``` Not sure why you need touch though, this will also work: ``` for i in `seq 10`; do echo $RANDOM; done > file.txt ```
Use >> to write to file, $1 is first argument of your .sh file ``` FILE=$1 RANDOM=$$ for i in `seq 10` do echo $RANDOM >> $FILE echo "\n" >> $FILE done ```
67,155,591
I want to create a Linux command which creates a file containing 10 random numbers. This is a solution to generate 10 random numbers; ``` RANDOM=$$ for i in `seq 10` do echo $RANDOM done ``` It is working to generate random numbers but how can I combine this with 'touch' command? Should I create a loop?
2021/04/19
[ "https://Stackoverflow.com/questions/67155591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10027996/" ]
Using touch? Like this? ``` touch file.txt && RANDOM=$$ for i in `seq 10` do echo $RANDOM done >> file.txt ``` Not sure why you need touch though, this will also work: ``` for i in `seq 10`; do echo $RANDOM; done > file.txt ```
You could use [head(1)](https://man7.org/linux/man-pages/man1/head.1.html) and [od(1)](https://man7.org/linux/man-pages/man1/od.1.html) or [GNU gawk](https://www.gnu.org/software/gawk/) with [random(4)](https://man7.org/linux/man-pages/man4/random.4.html). For example, perhaps ``` head -20c /dev/random | od -s > /tm...
67,155,591
I want to create a Linux command which creates a file containing 10 random numbers. This is a solution to generate 10 random numbers; ``` RANDOM=$$ for i in `seq 10` do echo $RANDOM done ``` It is working to generate random numbers but how can I combine this with 'touch' command? Should I create a loop?
2021/04/19
[ "https://Stackoverflow.com/questions/67155591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10027996/" ]
Use >> to write to file, $1 is first argument of your .sh file ``` FILE=$1 RANDOM=$$ for i in `seq 10` do echo $RANDOM >> $FILE echo "\n" >> $FILE done ```
You could use [head(1)](https://man7.org/linux/man-pages/man1/head.1.html) and [od(1)](https://man7.org/linux/man-pages/man1/od.1.html) or [GNU gawk](https://www.gnu.org/software/gawk/) with [random(4)](https://man7.org/linux/man-pages/man4/random.4.html). For example, perhaps ``` head -20c /dev/random | od -s > /tm...
10,805,214
I have a larger method, part of which I want to use to take array values and insert them into a link. I'm using the method to generate linked fields in the metadata of an app I'm customizing. The full method is below: ``` def get_facet_from_datastream(resource, datastream_name, field_key, opts={}) if opts.has_key?(:...
2012/05/29
[ "https://Stackoverflow.com/questions/10805214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/770248/" ]
Yes, it stops, because you have `return link.html_safe` in your `each` block. It returns first value of `values` array. Update your code part: ``` values.map do |v| searchv = v.to_s.gsub(/ /, "+") "<a href=\"http://development4/lcdl/catalog?f[#{facet}][]=#{searchv}\">#{v}</a>" end.join.html_safe ```
You have a `return` statement in your each loop. This will exit the method, returning on the first pass. You might want to do something like this instead: ``` values.map do |v| searchv = v.to_s.gsub(/ /, "+") link = "<a href=\"http://development4/lcdl/catalog?f[#{facet}][]=#{searchv}\">#{v}</a>" link.html_safe...
1,462,819
This is taken from Palis, Geometric Theory of Dynamical Systems, p.55: [![enter image description here](https://i.stack.imgur.com/u2uEn.png)](https://i.stack.imgur.com/u2uEn.png) Here $X$ is a $C^r$ vector field on $M$. What does the notation $DX\_p$ mean?
2015/10/03
[ "https://math.stackexchange.com/questions/1462819", "https://math.stackexchange.com", "https://math.stackexchange.com/users/194722/" ]
This is often called the *intrinsic* derivative. (This makes sense, more generally, for the section of any vector bundle at a zero.) It is well-defined at a zero of $X$. Think in local coordinates of $X$ as a map from $\Bbb R^n$ to $\Bbb R^n$, and compute its derivative at $0$ (corresponding to $P$). You can check that...
This is a fleshed out version of Ted's answer. Given coordinates $\phi = (x^1 ,\ldots,x^n)$ about $p$ such that $\phi(p) = 0$, write $X = a^i \frac{\partial}{\partial x^i}$ and define $DX\_p:T\_pM \to T\_pM$ by $$ DX\_p\left( \frac{\partial}{\partial x^j}\lvert\_p \right) = \frac{\partial \widehat{a^i}}{\partial x^j}(...
50,574,536
I have the following task: check that A do not divide A and B do not divide A The function must return true / false. In input put 2 integer positive numbers A and B. 1 <= A, B <= 10000 The sample: > > node task.js 5 3 > > > true > > > The first argument puts in process.argv [1] My code: ``` function not_divi...
2018/05/28
[ "https://Stackoverflow.com/questions/50574536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9645128/" ]
`console.log()` returns undefined...not the values passed to it. That means your function always returns `undefined` change ``` return console.log(true); ``` To ``` console.log(true); return true; ``` Same for the other return
I think You need `process.argv[2]` and `process.argv[3]` instead of `[1]` and `[2]`; `process.argv[0]` - path to `node.exe`; `process.argv[1]` - path to script; `process.argv[2... etc]` - params;
10,034,045
I am using a NSProgressIndicator in my main thread to update on progress as I run through my entire method. Now when I end up calling an object from a different class file, and wait for that object to return to a value to my main thread, I notice that the NSProgressIndicator will disappear. I understand that this is be...
2012/04/05
[ "https://Stackoverflow.com/questions/10034045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247629/" ]
Your above code is not the correct approach. Since `main` never returns, the progress indicator will never update. You must return quickly on the main thread. Instead, what you want to do is set up a background block that at various points updates the progress indicator on the main thread. So, for instance: ``` - (IB...
You can achieve what you are looking for with GCD ([Grand Central Dispatch](http://developer.apple.com/library/ios/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html)). Here is an example to get you started: ``` dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_...
10,034,045
I am using a NSProgressIndicator in my main thread to update on progress as I run through my entire method. Now when I end up calling an object from a different class file, and wait for that object to return to a value to my main thread, I notice that the NSProgressIndicator will disappear. I understand that this is be...
2012/04/05
[ "https://Stackoverflow.com/questions/10034045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247629/" ]
You can achieve what you are looking for with GCD ([Grand Central Dispatch](http://developer.apple.com/library/ios/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html)). Here is an example to get you started: ``` dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_...
It sounds like your operation should be run in a separate thread which can be done several ways but is probably most easily achieved using NSOperationQueue and either custom NSOperation classes (it's easier than it sounds to set these up) or use of the NSInvokeOperation class. Then you can send messages back to your c...
10,034,045
I am using a NSProgressIndicator in my main thread to update on progress as I run through my entire method. Now when I end up calling an object from a different class file, and wait for that object to return to a value to my main thread, I notice that the NSProgressIndicator will disappear. I understand that this is be...
2012/04/05
[ "https://Stackoverflow.com/questions/10034045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247629/" ]
Your above code is not the correct approach. Since `main` never returns, the progress indicator will never update. You must return quickly on the main thread. Instead, what you want to do is set up a background block that at various points updates the progress indicator on the main thread. So, for instance: ``` - (IB...
It sounds like your operation should be run in a separate thread which can be done several ways but is probably most easily achieved using NSOperationQueue and either custom NSOperation classes (it's easier than it sounds to set these up) or use of the NSInvokeOperation class. Then you can send messages back to your c...
30,599,884
I have test: ``` @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {TestRepositoryConfig.class}) @Transactional public class ServiceTest { @Autowired private UserRepository userRepository; @Autowired private Service service; static { initTestUser(); } public void setUp() { ...
2015/06/02
[ "https://Stackoverflow.com/questions/30599884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2104993/" ]
I believe the problem you are trying to solve should be done in a different way. As far as I see you want to fill your DB with some test data, and this is better to do in a global configuration for all tests. But if you want to stick to your initial idea you can try an approach with listeners described in [this blog p...
Use the [@BeforeClass](http://junit.sourceforge.net/javadoc/org/junit/BeforeClass.html) annotation ``` public class MyTest { @BeforeClass public static void setupClass() { /* Set up stuff once */ } @Test public void test1() { /* ... */ } } ``` Note however that the static method does not have access to in...
229,632
How can you have two-way synchronization of data between Excel and a SharePoint list? I've read the Office support [Manage large lists and libraries in SharePoint](https://support.office.com/en-us/article/Manage-large-lists-and-libraries-in-SharePoint-b8588dae-9387-48c2-9248-c24122f07c59) page and the limitation about...
2017/11/07
[ "https://sharepoint.stackexchange.com/questions/229632", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/54/" ]
There is no way to have two-way sync out of the box (OOTB) between Excel and a SharePoint List as Microsoft deprecated this feature 10 years ago. OOTB Options include creating a new SP list from an Excel file and exporting a list to an Excel file. To have bi-directional sync, you need a third party tool such as [Share...
As far as I know the two-way sync is no longer available, it used to be possible in SP 2010. 'Export to Excel' is still possible, so you can set up e.g. a linked Template for a report and even make graphs that will be refreshable with new data from a Sharepoint List. Something like 'Freeze Panes' could be achieved wi...
229,632
How can you have two-way synchronization of data between Excel and a SharePoint list? I've read the Office support [Manage large lists and libraries in SharePoint](https://support.office.com/en-us/article/Manage-large-lists-and-libraries-in-SharePoint-b8588dae-9387-48c2-9248-c24122f07c59) page and the limitation about...
2017/11/07
[ "https://sharepoint.stackexchange.com/questions/229632", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/54/" ]
There is no way to have two-way sync out of the box (OOTB) between Excel and a SharePoint List as Microsoft deprecated this feature 10 years ago. OOTB Options include creating a new SP list from an Excel file and exporting a list to an Excel file. To have bi-directional sync, you need a third party tool such as [Share...
I’m proposing a workaround to the suggested third party solution. It is a two-parter. **Part 1** addresses formatting and **Part 2** addresses speed. **Part 1:** Export the list to Excel and save the workbook back to SharePoint with a data connection. Format the workbook with all desired Excel features such as freeze...
229,632
How can you have two-way synchronization of data between Excel and a SharePoint list? I've read the Office support [Manage large lists and libraries in SharePoint](https://support.office.com/en-us/article/Manage-large-lists-and-libraries-in-SharePoint-b8588dae-9387-48c2-9248-c24122f07c59) page and the limitation about...
2017/11/07
[ "https://sharepoint.stackexchange.com/questions/229632", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/54/" ]
There is no way to have two-way sync out of the box (OOTB) between Excel and a SharePoint List as Microsoft deprecated this feature 10 years ago. OOTB Options include creating a new SP list from an Excel file and exporting a list to an Excel file. To have bi-directional sync, you need a third party tool such as [Share...
As a workaround, you can also use MS Flow to update a SharePoint List from an Excel file - <https://www.youtube.com/watch?v=qxuTVjQbECo>
24,828,298
I am using Moq framework to mock objects in my project. I want to save the user profile which is calling UserManager.SetPhoneNUmberAsync of AspNet.Identity. Here is my code: ``` public async Task<ActionResult> SaveProfile(DistributorViewModel distributorModel) { if (ModelState.IsValid) { ...
2014/07/18
[ "https://Stackoverflow.com/questions/24828298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3663543/" ]
Something similar to this should work: ``` var manager = new Mock<UserManager<ApplicationUser>(); manager.Setup(m => m.SetPhoneNumberAsync(userId, "phoneNumber").ReturnsAsync(IdentityResult.Succeeded()).Verifiable(); ```
You can also create class **IdentityResultMock** which inherited from **IdentityResult**. Than you can assign **Successed** property from **IdentityResultMock** because **IdentityResult** has protected constructor. Please refer to my answer [here](https://stackoverflow.com/questions/26269104/how-to-construct-identityr...
1,713,476
I have a C++ class which contains only static data members. I noticed the compiler is OK if I define the access methods as const, as static, or as "regular" - so all seem to work. My question is what is the correct/better practice in this case? Thanks!
2009/11/11
[ "https://Stackoverflow.com/questions/1713476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208456/" ]
Static accessors for static data members.
If your class contains only static members, you should probably be using the [singleton pattern](http://en.wikipedia.org/wiki/Singleton_pattern).
1,713,476
I have a C++ class which contains only static data members. I noticed the compiler is OK if I define the access methods as const, as static, or as "regular" - so all seem to work. My question is what is the correct/better practice in this case? Thanks!
2009/11/11
[ "https://Stackoverflow.com/questions/1713476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208456/" ]
Static accessors for static data members.
If all methods are static then there is no point in creating an instance of the class. So I suggest to make all methods static so that you can use those methods without creating the object of the class. Basically, you will be able to call the methods using the namespace syntax.
1,713,476
I have a C++ class which contains only static data members. I noticed the compiler is OK if I define the access methods as const, as static, or as "regular" - so all seem to work. My question is what is the correct/better practice in this case? Thanks!
2009/11/11
[ "https://Stackoverflow.com/questions/1713476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208456/" ]
Static accessors for static data members.
> > I have a C++ class which contains only static data members. > > > Then that probably shouldn't be a class, but either free functions in a namespace or a singleton.
1,713,476
I have a C++ class which contains only static data members. I noticed the compiler is OK if I define the access methods as const, as static, or as "regular" - so all seem to work. My question is what is the correct/better practice in this case? Thanks!
2009/11/11
[ "https://Stackoverflow.com/questions/1713476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208456/" ]
If your class contains only static members, you should probably be using the [singleton pattern](http://en.wikipedia.org/wiki/Singleton_pattern).
If all methods are static then there is no point in creating an instance of the class. So I suggest to make all methods static so that you can use those methods without creating the object of the class. Basically, you will be able to call the methods using the namespace syntax.
1,713,476
I have a C++ class which contains only static data members. I noticed the compiler is OK if I define the access methods as const, as static, or as "regular" - so all seem to work. My question is what is the correct/better practice in this case? Thanks!
2009/11/11
[ "https://Stackoverflow.com/questions/1713476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208456/" ]
> > I have a C++ class which contains only static data members. > > > Then that probably shouldn't be a class, but either free functions in a namespace or a singleton.
If all methods are static then there is no point in creating an instance of the class. So I suggest to make all methods static so that you can use those methods without creating the object of the class. Basically, you will be able to call the methods using the namespace syntax.
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
Go through this post . will help you to upload file in selenium RC <http://automationtricks.blogspot.com/2010/09/how-to-upload-file-in-selenium.html> Thanks Niraj
You might try using the \*iehta browser launcher instead of \*iexplore. \*iehta has heightened privileges. I use it to circumvent "Same Origin" restrictions, and comments in various forums I've read indicate that it might work for file upload as well.
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
Go through this post . will help you to upload file in selenium RC <http://automationtricks.blogspot.com/2010/09/how-to-upload-file-in-selenium.html> Thanks Niraj
I found that Autoit does the job but It failed for firefox so if else statement according to browser comes. ``` WinWaitActive("Choose File to Upload") Send("C:\Images\abc.jpg") Send("{ENTER}") ``` Type the above code in SciTE Script Editor of [Autoit](http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-...
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
Go through this post . will help you to upload file in selenium RC <http://automationtricks.blogspot.com/2010/09/how-to-upload-file-in-selenium.html> Thanks Niraj
In firefox and other browsers you can upload a file just using type command of selenium. See here <http://aboutselenium.blogspot.com/2011/02/handling-file-upload-using-selenium.html>
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
Go through this post . will help you to upload file in selenium RC <http://automationtricks.blogspot.com/2010/09/how-to-upload-file-in-selenium.html> Thanks Niraj
We can use Sikuli with selenium. If you are int interested in solution I can provide you better. Please explain your requirement in details.
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
The short answer is that in general [you can't](http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-Ican%27tseemtouseSeleniumCoretouploadafile%3BwhenItrytotypeinthefileuploadtextfield%2Cnothinghappens!), due to browser security restrictions. Think about it, if Javascript code could programmatically upl...
You might try using the \*iehta browser launcher instead of \*iexplore. \*iehta has heightened privileges. I use it to circumvent "Same Origin" restrictions, and comments in various forums I've read indicate that it might work for file upload as well.
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
The short answer is that in general [you can't](http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-Ican%27tseemtouseSeleniumCoretouploadafile%3BwhenItrytotypeinthefileuploadtextfield%2Cnothinghappens!), due to browser security restrictions. Think about it, if Javascript code could programmatically upl...
I found that Autoit does the job but It failed for firefox so if else statement according to browser comes. ``` WinWaitActive("Choose File to Upload") Send("C:\Images\abc.jpg") Send("{ENTER}") ``` Type the above code in SciTE Script Editor of [Autoit](http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-...
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
The short answer is that in general [you can't](http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-Ican%27tseemtouseSeleniumCoretouploadafile%3BwhenItrytotypeinthefileuploadtextfield%2Cnothinghappens!), due to browser security restrictions. Think about it, if Javascript code could programmatically upl...
In firefox and other browsers you can upload a file just using type command of selenium. See here <http://aboutselenium.blogspot.com/2011/02/handling-file-upload-using-selenium.html>
3,387,257
can I upload files using `selenium RC` in IE?
2010/08/02
[ "https://Stackoverflow.com/questions/3387257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400101/" ]
The short answer is that in general [you can't](http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ#SeleniumCoreFAQ-Ican%27tseemtouseSeleniumCoretouploadafile%3BwhenItrytotypeinthefileuploadtextfield%2Cnothinghappens!), due to browser security restrictions. Think about it, if Javascript code could programmatically upl...
We can use Sikuli with selenium. If you are int interested in solution I can provide you better. Please explain your requirement in details.
54,972,838
I have an html table like below from which I convert the data to a json form and send via ajax to a spring controller. In the spring controller I used `@RequestParam Map<String, String>` to get the values, but I got the whole json string as the only key. Using modelAttribute I can achieve this, but I have different sce...
2019/03/03
[ "https://Stackoverflow.com/questions/54972838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9662589/" ]
Change: ``` @RequestParam Map<String, String> attributeMap ``` To ``` @RequestBody List<Map<String, String>> attributeMap ``` Your `JSON` payload is an array of objects.
**example for a array of objects.** Controller: ``` @RequestMapping(value = "alterarSolicitacoesPerfil.do", method = RequestMethod.POST) @ResponseBody public Boolean alterarSolicitacoes(@RequestBody SolicitacaoPerfilAcessoRespostaVO[] solicitacoes) throws Exception { List<SolicitacaoPerfilAcessoRespostaVO> lista...
19,616,692
I’m using free Magento template and `Quick installation` (Copy the Files/Dump the Database) Now the template path is set to `/app/design/frontend/template_name` How can i change it to `/app/design/frontend/default/tempate_name` Where they defind the path to template.. Anyone please?
2013/10/27
[ "https://Stackoverflow.com/questions/19616692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2924726/" ]
Sensitive data should not be in source control - you should use Heroku config variables which will then be exposed as environment variables in your application. Read more on the Heroku site at <https://devcenter.heroku.com/articles/config-vars>
I you were a Microsoft.NET shop you could use config file includes: ``` <connectionStrings configSource="HerokuSpecificConfigFile.config" /> ``` Your publish profile transformation than would replace development connection strings with the include line above. This would allow you to keep `HerokuSpecificConfigFile.c...
57,911
My software uses a TRNG (entropy source) which is part of an MCU. A check of random numbers generated by my software, carried out by a testing authority revealed a problem, which I have to examine now: They ran my random numbers against NIST Test suite: <https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublicat...
2018/03/28
[ "https://crypto.stackexchange.com/questions/57911", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/39543/" ]
One of the failing test discussed in the question was coded for the purpose. It could be useful to validate that code using a known-good pseudo-random source (the output of SHA-256 for incremental values qualifies). If it failed too often, the code would need a fix! The test's definition is complex, for example in [2.7...
How many patterns are you testing? If you are looking for many different patterns. It is expected that at least one of them would be more common. Normally we want the p value to be small to show an affect and use multi hypothesis correction of some sort. However here that would be cheating in our favour and therefor t...
139,331
I have created a `rationalnumber` class and used operator overloading function of C++. My questions are: 1. Have I implemented the class and `<` operator correctly? 2. Objects of class can now inserted in map and set. Is that part done correctly? ``` #include <bits/stdc++.h> using namespace std; class RationalNumbe...
2016/08/22
[ "https://codereview.stackexchange.com/questions/139331", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/115468/" ]
Style: * Use an initialiser list for constructors, with meaningful parameter names. example at the end. * Please use the right type for negative - true/false makes it a lot easier to read and understand inline what type negative is. * Naming: The toString() is easier expressed by *returning* a `std::string` - that can...
I didn't check the correctness of your code, but I have a few comments about it. Anyway, you should write a few unit tests to test your classes and functions. Here are a few suggestions and possible improvements for your code. I'm assuming that you're compiling with C++11 or higher. 1. Including `bits/stdc++.h` seems...
30,122,096
I know we can change element position by creating new node and play with node references. How can i change element position **without creating or deleting node, only by play with node references?** many thanks! ``` public class LinkedList<E extends Comparable<E>> implements Iterable<E> { private Node h...
2015/05/08
[ "https://Stackoverflow.com/questions/30122096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4878291/" ]
your algorithm should be something like this ``` int count = 1; // change to 0 if zero-indexed Node p = null; // previous Node n = head; // current while(count < k) { if(n.next != null) { p = n; n = n.next; count++; } else break; } if(count == k){ p.next = n.next; ...
``` public void changeOrder(){ //keep the pointer to next element of the first ListNode current=front.next; //make first point to the next element first.next=current.next; current.next=first; first=current; //the current one was moved one step back and it points to first. //change t...
63,252,162
I'm trying to figure out how to get a key from an Any type in Angular/Typescript. For example, if some other part of the program is returning this code: ``` { Amy: { age: 7, grade: 2 }, Max: { age: 9, grade: 4 }, Mia: { age: 8, grade: 3 ...
2020/08/04
[ "https://Stackoverflow.com/questions/63252162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14049490/" ]
You can use Object.keys() ```js let obj = { Amy: { age: 7, grade: 2 }, Max: { age: 9, grade: 4 }, Mia: { age: 8, grade: 3 } } console.log(Object.keys(obj)); ```
You don't actually have to use anything from Angular for this you can use plain JavaScript functionality. Just grab the keys from the object with `Object.keys` ```js const myObject:any = { Amy: { age: 7, grade: 2 }, Max: { age: 9, grade: 4 }, Mia: { age:...
44,661,314
I have transaction data which includes a trade date. I want to be able to match the trade date of the transaction with the matching time period. I have a table with 5 different time periods like so: Period 1: 1/1/2000 - 3/31/2000 Period 2: 4/4/2001 - 6/6/2001 Period 3: 10/10/2002 - 12/31/2002 etc. I want to be a...
2017/06/20
[ "https://Stackoverflow.com/questions/44661314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8150532/" ]
``` <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min....
```html <html> <head> <!-- Required meta tags --> <meta charset="utf-8"> <!-- Latest compiled and minified CSS --> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script ...
44,661,314
I have transaction data which includes a trade date. I want to be able to match the trade date of the transaction with the matching time period. I have a table with 5 different time periods like so: Period 1: 1/1/2000 - 3/31/2000 Period 2: 4/4/2001 - 6/6/2001 Period 3: 10/10/2002 - 12/31/2002 etc. I want to be a...
2017/06/20
[ "https://Stackoverflow.com/questions/44661314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8150532/" ]
This works. Copy my code. ``` <!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/boot...
```html <html> <head> <!-- Required meta tags --> <meta charset="utf-8"> <!-- Latest compiled and minified CSS --> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script ...
2,643,288
Hello I want to get user from an email address, eg: ***sajid@webspot.com*** then output must be ***sajid*** for this i use below mentioned code ``` $user = strstr($email, '@', true); ``` but an warning occur **Warning: Wrong parameter count for strstr() in /var/www/DataTable/dialog.php on line 3** & in php man...
2010/04/15
[ "https://Stackoverflow.com/questions/2643288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233679/" ]
``` $user = substr($email, 0, strpos($email, '@')); ```
Look in the [User Generated Comments](http://de.php.net/manual/en/function.strstr.php#92923) on the manual page, there are a few implementations.
2,643,288
Hello I want to get user from an email address, eg: ***sajid@webspot.com*** then output must be ***sajid*** for this i use below mentioned code ``` $user = strstr($email, '@', true); ``` but an warning occur **Warning: Wrong parameter count for strstr() in /var/www/DataTable/dialog.php on line 3** & in php man...
2010/04/15
[ "https://Stackoverflow.com/questions/2643288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233679/" ]
``` $user = substr($email, 0, strpos($email, '@')); ```
``` $name=strtok($email,"@"); ```
2,643,288
Hello I want to get user from an email address, eg: ***sajid@webspot.com*** then output must be ***sajid*** for this i use below mentioned code ``` $user = strstr($email, '@', true); ``` but an warning occur **Warning: Wrong parameter count for strstr() in /var/www/DataTable/dialog.php on line 3** & in php man...
2010/04/15
[ "https://Stackoverflow.com/questions/2643288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233679/" ]
``` $name=strtok($email,"@"); ```
Look in the [User Generated Comments](http://de.php.net/manual/en/function.strstr.php#92923) on the manual page, there are a few implementations.
12,277,441
I have two models in Rails 3 - a User model and a Profile model. ``` class User < ActiveRecord::Base has_one :profile, :dependent => :destroy end class Profile < ActiveRecord::Base belongs_to :user end ``` They are scoped in my routes.rb file, as such: ``` resources :users do resources :profiles end ``` So...
2012/09/05
[ "https://Stackoverflow.com/questions/12277441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575497/" ]
Try like this. ``` <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> </head> <body> <table> <tr> <td>Celsius</td> <td>Fahrenheit</td> </tr> <script type="text/javascript" > //<![CDATA[ for (var celsius = 0; celsius <= 50; celsius++) { document.write("<tr><td>"+ cel...
You should call a javascript function when document has been loaded: ``` if (document.readyState === "complete") { loadTemperatures(); } ``` Your loadTemperatures function will append rows to your table. Have a look here to learn how to do that: <http://viralpatel.net/blogs/dynamically-add-remove-rows-in-html-table-...
12,277,441
I have two models in Rails 3 - a User model and a Profile model. ``` class User < ActiveRecord::Base has_one :profile, :dependent => :destroy end class Profile < ActiveRecord::Base belongs_to :user end ``` They are scoped in my routes.rb file, as such: ``` resources :users do resources :profiles end ``` So...
2012/09/05
[ "https://Stackoverflow.com/questions/12277441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575497/" ]
First off, get that `script` to the bottom of the `body`, right before the `</body>`. Putting it anywhere else will block page loading. Adapt your HTML for proper DOM manipulation by giving IDs to the elements you're going to manipulate: ``` <table> <thead> <tr><th>Celsius</th><th>Fahrenheit</th></tr> ...
You should call a javascript function when document has been loaded: ``` if (document.readyState === "complete") { loadTemperatures(); } ``` Your loadTemperatures function will append rows to your table. Have a look here to learn how to do that: <http://viralpatel.net/blogs/dynamically-add-remove-rows-in-html-table-...
290,511
He was on the borderline of red and yellow health and was paralyzed. For the regi trio I had to use about ten each.
2016/11/06
[ "https://gaming.stackexchange.com/questions/290511", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/170717/" ]
The Premier Ball has the same catch-rate as a regular Pokeball. When you throw the ball, the ball's catch-rate, combined with how 'hard' it is to catch a certain Pokemon is plugged into a formula along with a few other things like current Health to determine whether you caught a Pokemon. Your chances were very low (a...
You only got extremely lucky.Regigigas' catch rate is pretty low,but since premier balls are only there to give you a reward for buying 10+ pokeballs in one visit to the PokeMart,they just have the power of a regular pokeball.
3,960,793
Show that if $(X,\tau)$ is a separable topological space, then $\{x \in X : \{x\} \in \tau\}$ is an enumerable set. I thought this way, if a topological space is separable, this implies that it has a dense and numerable set, that is, if this set is dense, then its closure is the topological space X, which has numberab...
2020/12/24
[ "https://math.stackexchange.com/questions/3960793", "https://math.stackexchange.com", "https://math.stackexchange.com/users/865536/" ]
Let $I$ be the set of isolated points, that is $I=\{x \in X : \{x\} \in \tau\}$ (all singletons that are open). Let $D$ be any countable dense set. Then $I$ must be a subset of $D$, hence $I$ must be countable too. Indeed, suppose the contrary, that $I$ is not a subset of $D$, and pick any $x\in I\setminus D$. Then t...
An uncountable space $X$ can have a countable (numerable) dense subset $D$. For example, $X=\Bbb R$ and $D=\Bbb Q.$ And an extreme example: Let $X$ be any non-empty set; let $p\in X;$ let $\tau=\{\emptyset, \{p\}, X\};$ and let $D=\{p\}$. Let $X^i$ be the set of isolated points of $X$. That is, $X^i=\{p\in X: \{p\}\in...
62,599,473
Is there a way to check if translation exist? ``` <p v-if="$t('some_key')">{{ $t('some_key') }}</p> ``` In this case if there is no translation it will print 'some\_key'. Maybe there is a way to configure global fallback?
2020/06/26
[ "https://Stackoverflow.com/questions/62599473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464900/" ]
You can use the `$te` method. Example usage: ``` <p v-if="$te('some_key')">{{ $t('some_key') }}</p> ``` <https://kazupon.github.io/vue-i18n/api/#vue-injected-methods>
``` <template> <p v-if="te('some_key')">{{ t('some_key') }}</p> </template> <script setup> import { useI18n } from 'vue-i18n'; ... const { t, te } = useI18n(); </script> ```
62,599,473
Is there a way to check if translation exist? ``` <p v-if="$t('some_key')">{{ $t('some_key') }}</p> ``` In this case if there is no translation it will print 'some\_key'. Maybe there is a way to configure global fallback?
2020/06/26
[ "https://Stackoverflow.com/questions/62599473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464900/" ]
You can use the `$te` method. Example usage: ``` <p v-if="$te('some_key')">{{ $t('some_key') }}</p> ``` <https://kazupon.github.io/vue-i18n/api/#vue-injected-methods>
I was interested in this as well and went to look up the documentation. The options above are good and might be best usable as the following can become quite messy when you have large translation files, but it comes from i18n self and might work for some as well: <https://www.i18next.com/principles/fallback> There is...
62,599,473
Is there a way to check if translation exist? ``` <p v-if="$t('some_key')">{{ $t('some_key') }}</p> ``` In this case if there is no translation it will print 'some\_key'. Maybe there is a way to configure global fallback?
2020/06/26
[ "https://Stackoverflow.com/questions/62599473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464900/" ]
``` <template> <p v-if="te('some_key')">{{ t('some_key') }}</p> </template> <script setup> import { useI18n } from 'vue-i18n'; ... const { t, te } = useI18n(); </script> ```
I was interested in this as well and went to look up the documentation. The options above are good and might be best usable as the following can become quite messy when you have large translation files, but it comes from i18n self and might work for some as well: <https://www.i18next.com/principles/fallback> There is...
30,816,567
If I have the code below, where I pass two functions as a parameters into the function `sayHi`, is this an example of a callback? I notice there are two ways of running these 'parameter functions': either as below, we I call the functions where they are defined (as arguments), or alternatively where I call the paramet...
2015/06/13
[ "https://Stackoverflow.com/questions/30816567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114742/" ]
In your first example you're not passing functions, but values; in other words ``` (function(){ return 3; })() ``` is just the integer 3. It is a value obtained calling immediately a function, but this is irrelevant. When you pass a callback it's the receiver that will call it (or pass it to some other function) a...
I guess that would depend on what your *callback* function is actually doing. In your examples, all you're really doing is returning a value. That's not really a "function", it's returning one fixed value every single time. If your function is actually doing a process, or returning a varied result, then I would perso...
30,816,567
If I have the code below, where I pass two functions as a parameters into the function `sayHi`, is this an example of a callback? I notice there are two ways of running these 'parameter functions': either as below, we I call the functions where they are defined (as arguments), or alternatively where I call the paramet...
2015/06/13
[ "https://Stackoverflow.com/questions/30816567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114742/" ]
Yes, functions passed as parameters are always callbacks, even if the intention is that the function is called *synchronously* (c.f. `Array.prototype.map`) rather than *asynchronously* (c.f. `window.setTimeout`). In your first code block you aren't of course actually passing functions. You have two *immediately invoke...
In your first example you're not passing functions, but values; in other words ``` (function(){ return 3; })() ``` is just the integer 3. It is a value obtained calling immediately a function, but this is irrelevant. When you pass a callback it's the receiver that will call it (or pass it to some other function) a...
30,816,567
If I have the code below, where I pass two functions as a parameters into the function `sayHi`, is this an example of a callback? I notice there are two ways of running these 'parameter functions': either as below, we I call the functions where they are defined (as arguments), or alternatively where I call the paramet...
2015/06/13
[ "https://Stackoverflow.com/questions/30816567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3114742/" ]
Yes, functions passed as parameters are always callbacks, even if the intention is that the function is called *synchronously* (c.f. `Array.prototype.map`) rather than *asynchronously* (c.f. `window.setTimeout`). In your first code block you aren't of course actually passing functions. You have two *immediately invoke...
I guess that would depend on what your *callback* function is actually doing. In your examples, all you're really doing is returning a value. That's not really a "function", it's returning one fixed value every single time. If your function is actually doing a process, or returning a varied result, then I would perso...
27,269,068
I use a the ExecutorService to execute my logic. As shown below , the run method should execute in a infinite loop. In short the run method is a message consumer which should remove messages from a queue and process the messages. However, the doSomething() method encounters an Exception, and never returns. After analys...
2014/12/03
[ "https://Stackoverflow.com/questions/27269068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185056/" ]
Try catching exception within your loop like below: ``` ExecutorService service = Executors.newSingleThreadExecutor(); service.submit(new Runnable(){ public void run(){ while(true){ try { doSomething(); } catch (Exception e) { //log exception etc... } } } }); `...
Just surround the run method's content with a try/catch that catches every exception. ``` ExecutorService service = Executors.newSingleThreadExecutor() service.submit(new Runnable(){ public void run(){ while(true){ try { doSomething(); } catch (Exception ...
13,099,253
I am working with an Android and PhoneGap application and am using the HTML5 video tag to play videos on my web page. When I play the video is not visible and video is not playing itself. How can I play a HTML5 video on Android? Code for the same given below ``` <!DOCTYPE HTML> <html> <head> <script type="tex...
2012/10/27
[ "https://Stackoverflow.com/questions/13099253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1610044/" ]
Add these lines before loading HTML content to your WebView. ``` wv.setWebChromeClient(new WebChromeClient() { }); ``` From the documentation: > > In order to support inline HTML5 video in your application, you need to have hardware acceleration turned on, and set a WebChromeClient. For full screen support, implem...
Try this. MainActivity.java ``` public class MainActivity extends Activity { WebView webPage; Button next; String rootDir = "file://" + Environment.getExternalStorageDirectory() + "/iR-unzip/testbook/"; WebChromeClient webChromeClient = new WebChromeClient(); WebViewClient webViewClie...
46,406,406
I'm trying to change all bold characters to italic ones and vica versa. I figured out I need to iterate through the entire document. So far I defined the two styles and a part of the function, not sure if the styles are needed. ``` .bold { font-weight: bold; } .italic { ...
2017/09/25
[ "https://Stackoverflow.com/questions/46406406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6373017/" ]
Well, you could do this with `querySelectorAll`, considering only swapping `.bold` and `.italic` depending on their current class: ```js function swapCollection( collection, from, to ) { if ( !collection ) { return; } for( let i = 0; i < collection.length; ++i ) { const elm = collection[ i ]; ...
You can also use getElementsByClassName to choose class and change style then: ``` function swap() { var mass=document.getElementsByClassName("bold"); for (i in mass){ mass[i].style.fontWeight="normal"; } } ```
46,406,406
I'm trying to change all bold characters to italic ones and vica versa. I figured out I need to iterate through the entire document. So far I defined the two styles and a part of the function, not sure if the styles are needed. ``` .bold { font-weight: bold; } .italic { ...
2017/09/25
[ "https://Stackoverflow.com/questions/46406406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6373017/" ]
Well, you could do this with `querySelectorAll`, considering only swapping `.bold` and `.italic` depending on their current class: ```js function swapCollection( collection, from, to ) { if ( !collection ) { return; } for( let i = 0; i < collection.length; ++i ) { const elm = collection[ i ]; ...
it's not useful to add a JS script for something that can be done once and for all. so try to overwrite the default style of strong and em tags inyour CSS files by adding the following CSS code ``` strong, b{ font-weight: normal!important; font-style: italic!important; } em, i{font-style: normal!important; font-weigh...
46,406,406
I'm trying to change all bold characters to italic ones and vica versa. I figured out I need to iterate through the entire document. So far I defined the two styles and a part of the function, not sure if the styles are needed. ``` .bold { font-weight: bold; } .italic { ...
2017/09/25
[ "https://Stackoverflow.com/questions/46406406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6373017/" ]
Well, you could do this with `querySelectorAll`, considering only swapping `.bold` and `.italic` depending on their current class: ```js function swapCollection( collection, from, to ) { if ( !collection ) { return; } for( let i = 0; i < collection.length; ++i ) { const elm = collection[ i ]; ...
This is a generalize solution, using jQuery, not based only on class names. I do the bolded texts red so you can see it easily. ```js $('div').each(function () { if ($(this).css('font-weight') == 'bold') { $(this).css('color', 'red'); // but you change to italic return; } if ($(this).css('font-style'...
46,406,406
I'm trying to change all bold characters to italic ones and vica versa. I figured out I need to iterate through the entire document. So far I defined the two styles and a part of the function, not sure if the styles are needed. ``` .bold { font-weight: bold; } .italic { ...
2017/09/25
[ "https://Stackoverflow.com/questions/46406406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6373017/" ]
Well, you could do this with `querySelectorAll`, considering only swapping `.bold` and `.italic` depending on their current class: ```js function swapCollection( collection, from, to ) { if ( !collection ) { return; } for( let i = 0; i < collection.length; ++i ) { const elm = collection[ i ]; ...
If it is simply a matter of toggling the classes, you could do it like this. Each time you click the button it will change the bold text to italic and vice versa. ```js const trigger = document.getElementById('trigger'); function toggleClasses() { const // Get all the elements with the bold and/or italic ...
46,406,406
I'm trying to change all bold characters to italic ones and vica versa. I figured out I need to iterate through the entire document. So far I defined the two styles and a part of the function, not sure if the styles are needed. ``` .bold { font-weight: bold; } .italic { ...
2017/09/25
[ "https://Stackoverflow.com/questions/46406406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6373017/" ]
Well, you could do this with `querySelectorAll`, considering only swapping `.bold` and `.italic` depending on their current class: ```js function swapCollection( collection, from, to ) { if ( !collection ) { return; } for( let i = 0; i < collection.length; ++i ) { const elm = collection[ i ]; ...
You may simply collect all items with `.bold` and `.italic` classes under a node list with `document.querySelectorAll(".bold, .italic")` and [toggle](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList#Methods) their `classList`s. ```js var sps = document.querySelectorAll(".bold, .italic"), mbt = d...
37,810,863
I have a AjaxFileUpload control in a usercontrol which is loaded dynamicaly on Postback, the problem here is, once the file is uploaded `IsPostBack` is false due to which the usercontrol is not loaded, causing the `OnUploadCompleteAll` event to not be triggered. I found out that AjaxFileUpload control has its own post...
2016/06/14
[ "https://Stackoverflow.com/questions/37810863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032707/" ]
Set a boolean flag at the beginning of your test depending on if you want to run it on 43 or 47. Check the flag in the code where you're creating your driver, for example like this: ``` boolean useMarionette = true //false URL server = new URL("http://localhost:4444/wd/hub") DesiredCapabilities capabilities = Desired...
Now I have achieved this by following approach :- ``` public static String executeCommand(List<String> commands) throws IOException { ProcessBuilder builder = new ProcessBuilder(commands); builder.redirectErrorStream(true); Process p = builder.start(); BufferedReader r = new...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
The other commentators are right - it is *your* responsibility to make sure that this developer is able to develop in Angular (because they were assigned this task knowing that their background is in Java). > > Even I have to solve 90-95% of his tasks by myself and then he learns > > > DO NOT solve this person's ...
As a team lead a certain amount of managing the performance of the rest of the team is to be expected. It sounds as though so far you've done a fairly minimal amount of that - mainly telling them to study at home or google it. And so far that hasn't been particularly successful, probably because they are pretty unhelp...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
You need to do your job. On the team side, decide whether it is feasible to mentor the underperformer or not. If you think they're willing to learn and capable of being productive and the long-term performance of your team is more important than the short-term costs of a mentoring, then decide to mentor them and infor...
I don't agree with some of the answers listed above, specifically with the expectation that John learn Angular/CSS/HTML on company time. Specifically, the field of Technology is a vast field, and it's a field that is constantly changing. Angular came about in 2010 - I've been a Web Engineer since 2003. When I started ...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
The other commentators are right - it is *your* responsibility to make sure that this developer is able to develop in Angular (because they were assigned this task knowing that their background is in Java). > > Even I have to solve 90-95% of his tasks by myself and then he learns > > > DO NOT solve this person's ...
I don't agree with some of the answers listed above, specifically with the expectation that John learn Angular/CSS/HTML on company time. Specifically, the field of Technology is a vast field, and it's a field that is constantly changing. Angular came about in 2010 - I've been a Web Engineer since 2003. When I started ...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
You need to do your job. On the team side, decide whether it is feasible to mentor the underperformer or not. If you think they're willing to learn and capable of being productive and the long-term performance of your team is more important than the short-term costs of a mentoring, then decide to mentor them and infor...
Give opportunities to John, propose even paid training if need be, but let him fail when the time comes. There seem to be here several very wrong things: * You are enabling someone to keep on your team, that is not qualified to be there * That person is robbing the place of someone else who could be a productive memb...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
The other commentators are right - it is *your* responsibility to make sure that this developer is able to develop in Angular (because they were assigned this task knowing that their background is in Java). > > Even I have to solve 90-95% of his tasks by myself and then he learns > > > DO NOT solve this person's ...
I think you're missing the key parts of what it means to be a team lead. Mentoring your team members so they become better is part of your job. Giving them the support to succeed is part of your job. For example, give your junior team member a training exercise for him to learn. Give him what you think is the right am...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
I won't reiterate dwizum's excellent answer, but I have a few things to add: > > His main problem is that he doesn't do the work in a logical way but always try some random permutations and combinations in order to make his flukes as a successful attempt to do the work. > > > Have you tried showing him more effec...
What you're trying to do shows you don't understand the difference in the skillset of your staff and what is needed. A Java developer, if he has had no background in web development, has no understanding of the client-side and server-side of things. The paradigm is different than a Java standalone. Even if he has wor...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
So here's the part that seems sketchy to me: You've asked your employee, John, to do unpaid overtime work on the weekend. * The reason it's "work" is because learning Angular is not something John would like to do in his free time, hence why he hasn't done it already (and continues to not do it), and it provides no va...
Here's **your** problem: Your team isn't capable of doing the jobs it is supposed to do in the time you are allowed. That one of your colleagues is underperforming is secondary. It is a problem for them, it may lead to them losing their job in the worst case, but **your** problem is the job isn't getting done. There ...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
You need to do your job. On the team side, decide whether it is feasible to mentor the underperformer or not. If you think they're willing to learn and capable of being productive and the long-term performance of your team is more important than the short-term costs of a mentoring, then decide to mentor them and infor...
As a team lead a certain amount of managing the performance of the rest of the team is to be expected. It sounds as though so far you've done a fairly minimal amount of that - mainly telling them to study at home or google it. And so far that hasn't been particularly successful, probably because they are pretty unhelp...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
I don't agree with some of the answers listed above, specifically with the expectation that John learn Angular/CSS/HTML on company time. Specifically, the field of Technology is a vast field, and it's a field that is constantly changing. Angular came about in 2010 - I've been a Web Engineer since 2003. When I started ...
Give opportunities to John, propose even paid training if need be, but let him fail when the time comes. There seem to be here several very wrong things: * You are enabling someone to keep on your team, that is not qualified to be there * That person is robbing the place of someone else who could be a productive memb...
129,926
I'm a Software Developer with experience of more than 1.5 years. After being happy with my performance, the CTO of my company made me a team lead of 3 new employees (2 of them graduated recently). There's an employee, the recent grad (Let's call him John). John knows only basic Java and nothing else. Now, I am mentori...
2019/02/22
[ "https://workplace.stackexchange.com/questions/129926", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/73576/" ]
So here's the part that seems sketchy to me: You've asked your employee, John, to do unpaid overtime work on the weekend. * The reason it's "work" is because learning Angular is not something John would like to do in his free time, hence why he hasn't done it already (and continues to not do it), and it provides no va...
### Put him on a Personal Improvement Plan. Simply put, he's not working on the level expected of his position, and is making things actively worse for the other team members, since they have to spend time helping him and correcting his mistakes. As such, the best course of action is to talk to HR about putting him o...
71,850,008
I have a scenario where I want to have multiple types/interfaces that are all in the same structure: ``` type Base = { type: 'x' | 'y' | 'z' data: Record<string,string> } ``` Now, I want to create types that "implements" this base type, while each of them narrows this type in different way: ``` type MyTypeX = {...
2022/04/12
[ "https://Stackoverflow.com/questions/71850008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7836858/" ]
Maybe you can use a generic type `Base`. Something like the following: ``` type Type = 'x' | 'y' | 'z'; type Base<T extends Type, D extends Record<string, string>> = { type: T; data: D; }; type Foo = Base<'x', { specificKey: string }>; type Bar = Base<'y', { otherKey: string }>; const foo: Foo = { type: 'x', da...
If you can use interfaces, you can use the `extends` keyword, as in: ``` interface MyTypeX extends Base { type: 'x' data: { specificKey: string } } ``` If you made something that was incompatible with Base (eg, you tried to do `type: boolean`), typescript will give an error where you define MyTypeX that My...
53,732,362
This never happened before. Just upgraded Ubuntu to 16.04 and tried reinstalling `roxygen2`. Here is `sessionInfo()` : ``` R version 3.4.4 (2018-03-15) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.5 LTS Matrix products: default BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0 LAPACK: /usr/lib/atla...
2018/12/11
[ "https://Stackoverflow.com/questions/53732362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2434201/" ]
You can use `reduce` for this, the accumulator should be an object containing two values, the first will be the results array and the other will be the current hash string to be used within `reduce` to generate the paths. Once `reduce` finishes its work we can store the `result` property of the accumulator into our res...
My preferred approach would be to map the array to the desired format and then filter out the extraneous markers. ``` const needle = '# '; let directoryName = ''; const b = a.map((elem) => { if (elem.startsWith(needle)) { directoryName = elem.substring(needle.length); return; } return direc...
53,732,362
This never happened before. Just upgraded Ubuntu to 16.04 and tried reinstalling `roxygen2`. Here is `sessionInfo()` : ``` R version 3.4.4 (2018-03-15) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.5 LTS Matrix products: default BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0 LAPACK: /usr/lib/atla...
2018/12/11
[ "https://Stackoverflow.com/questions/53732362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2434201/" ]
You can use `reduce` for this, the accumulator should be an object containing two values, the first will be the results array and the other will be the current hash string to be used within `reduce` to generate the paths. Once `reduce` finishes its work we can store the `result` property of the accumulator into our res...
Here's an approach you can take that utilizes `Array.prototype.reduce` and `Object.keys` ```js function modify(a, delimiter) { const f = a.reduce((accum, el) => { var s = el.replace(/\s/g, ''); if (s.charAt(0) === delimiter) { accum.pointer = s.substring(1); accum.data[accum.pointer] = []; ...
53,732,362
This never happened before. Just upgraded Ubuntu to 16.04 and tried reinstalling `roxygen2`. Here is `sessionInfo()` : ``` R version 3.4.4 (2018-03-15) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.5 LTS Matrix products: default BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0 LAPACK: /usr/lib/atla...
2018/12/11
[ "https://Stackoverflow.com/questions/53732362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2434201/" ]
My preferred approach would be to map the array to the desired format and then filter out the extraneous markers. ``` const needle = '# '; let directoryName = ''; const b = a.map((elem) => { if (elem.startsWith(needle)) { directoryName = elem.substring(needle.length); return; } return direc...
Here's an approach you can take that utilizes `Array.prototype.reduce` and `Object.keys` ```js function modify(a, delimiter) { const f = a.reduce((accum, el) => { var s = el.replace(/\s/g, ''); if (s.charAt(0) === delimiter) { accum.pointer = s.substring(1); accum.data[accum.pointer] = []; ...
30,617,149
My requirement described as below. I am reading a file in stringstream object which contain ``` "NECK_AP \ UL, 217.061, -40.782\n\ UR, 295.625, -40.782\n\ LL, 217.061, 39.194\n\ LR, 295.625, 39.194". ``` when I am trying to populate the value in variables I am getting "," also along with it. Can any one suggest so t...
2015/06/03
[ "https://Stackoverflow.com/questions/30617149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3479893/" ]
**Efficient Jigsaw design is simple and it works like this:** The linked code already shows how to efficiently assemble one of your jigsaw pieces by reusing a single side design. The piece on the right side of you illustration is a traditional (or "Japanese Style") piece. This means its sides are uniform in length a...
I would like to propose an alternative approach - SVG source ========== Why not consider using a SVG image source that you make in Illustrator or some similar software. The tools will allow you to trace the outline of a piece (it can in fact do it almost entirely automatic - see result below). The SVG may use Beziers...
3,246,927
Given vectors $\mathrm a, \bar{\mathrm x} \in \mathbb R^n$ and matrix $\mathrm P \in \mathbb S^n\_{++}$, how to deal with the absolute value in the objective function of this optimization problem in $\mathrm x \in \mathbb R^n$? $$\begin{array}{ll} \text{maximize} & | \mathrm a^{\top} \mathrm x - 1 |\\ \text{subject...
2019/05/31
[ "https://math.stackexchange.com/questions/3246927", "https://math.stackexchange.com", "https://math.stackexchange.com/users/670687/" ]
Since $f$ is convex, given $s < t < u$, we have $$ \frac{f(t) - f(s)}{t - s} \le \frac{f(u) - f(s)}{u - s} \le \frac{f(u) - f(t)}{u - t} $$ If $f$ is constant, the limits exist. If not, suppose $f(s) < f(t)$. Letting $u \rightarrow + \infty$ in the first inequality, we get $\lim\_{x \rightarrow +\infty} f(x) = +\inf...
For the first part, specifically, $\limsup\_{x\rightarrow\infty} f(x)=\liminf\_{x\rightarrow\infty}f(x)$. To see this, let $s\_n$ be the sequence of $x$ that achieves the sup and $m\_n$ be the one for inf. Then $$f(tm\_n+(1-t)m\_{n+1})\leq tf(m\_n)+(1-t)f(m\_{n+1}).$$ As both $m\_n,s\_n$ go to infinity, you can al...
18,947,088
I'm trying to get my head around the *ObjectInputStream/ObjectOutputStream*, so I create a very simple server-client application where the client sends a HashMap object over the created stream and the server receives that and prints it out. This my server code: ```java import java.io.*; import java.net.*; public cla...
2013/09/22
[ "https://Stackoverflow.com/questions/18947088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2772154/" ]
Using the method described in the solution you linked, it's easy to restrict it to only tabs that match a certain pattern, just include `url` field in the queryInfo parameter to `tabs.query`: ``` chrome.tabs.query({url:'*://www.youtube.com/*'}, function(tabs) { ... ```
Yes, you content scripts will be loaded to youtube pages only. Thus no messages listeners on other website pages
15,488,615
Alright, I'm new to scripting and I'm trying to edit a batch script file that sends an email when a file with an extension of .ecl is in a folder longer than 5 min or so. But there are other files with a .ecl.part extension that get flagged and it sends an email instead of the .ecl files. I'm curious if there is someth...
2013/03/18
[ "https://Stackoverflow.com/questions/15488615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2184267/" ]
You're only initialising `curmouse` on `WM_MOUSEMOVE`, not `WM_LBUTTONUP` - so the values in there when you actually get a button up will be random.
SetCapture() restricts the mouse messages to the window of which you passed the handle. Unless you call a ReleaseCapture() the mouse messages on the other window cannot be interpreted.Using SetCapture() and never calling ReleaseCapture() is not a good coding practice. If your rect is in the other window the PtInrect i...
4,121,173
I understand that if $A$ is unitary, then $A^{-1} = A^\ast$ are also unitary matrices. But if $A$ is a unitary upper triangular matrix, then how are $A^{-1}$ and $A^\ast$ also upper triangular? This was from a particular class. Then the statement goes on to say that $A$ will be a diagonal matrix with diagonal entries...
2021/04/29
[ "https://math.stackexchange.com/questions/4121173", "https://math.stackexchange.com", "https://math.stackexchange.com/users/733666/" ]
For something closer to an analytic approach (that hints at a very useful inequality from Schur) just compute the squared Frobenius norm. You know all the eigenvalues of a unitary matrix all have modulus 1 and you know they are on the diagonal of a triangular matrix. Computing the squared Frobenius norm two different ...
Upper triangular matrices are closed under multiplication. If you consider the elementary matrices corresponding to row reduction, all the upper right entries concern changing the upper right entries, so changing them back would use matrices of the same shape. $A^\*$ is a notation that I have seen mean different thin...