qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
26,174,416
I have a a database with zipcode range: ``` id name zip_start zip_end 1 A 1212 1216 2 B 9100 9201 ``` Now I want to check any number is exist within the zipcode range. How can I write the sql for this?
2014/10/03
[ "https://Stackoverflow.com/questions/26174416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1942132/" ]
try where greater and less then ``` WHERE `zip_start` >= '$zip' AND `zip_end` <= '$zip' ``` or between ``` WHERE '$zip' between `zip_start` AND `zip_end` ```
``` set @searchedZip = 1214; select * from zipCodes where @searchedZip between zip_start and zip_end ```
40,566,655
Edited this to show code. Basically when my navbar is at full screen on a desktop, the dropdown menus work fine. But when the menu collapses on mobile, the main menu shows up fine, but it's dropdowns are all bunched up. I can't seem to change the line height for them. [screenshot](https://i.stack.imgur.com/1mJyw.jpg)...
2016/11/12
[ "https://Stackoverflow.com/questions/40566655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7150773/" ]
Not sure the libraries are python, ruby or others. Use `python` as sample. Build seperate `requirements.txt` for each applications, in requirements.txt, you can define the version for each library or packages. <https://pip.readthedocs.io/en/1.1/requirements.html> ``` MyApp Framework==0.9.4 Library>=0.2 ``` In Je...
each microservice should be its own build job. Jenkins keeps the workspace of each job separate, so they shouldn't overwrite each other. ideally, each microservice is in its own source code repository or subfolder. in Jenkins' job definition, you can point to each specific microservice repo. HTH.
23,091,967
I have created some code which will hide/unhide a hidden div when a div("button") is clicked. I would also like the div to be hidden when anywhere on the screen is clicked. These pieces of code seem to be conflicting with each other. ``` $(document).ready(function () { $(document).on("click", "#help-icon", funct...
2014/04/15
[ "https://Stackoverflow.com/questions/23091967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3032973/" ]
``` $(document).click(function (eventObj) { if (eventObj.target.id != "help-icon") { $("#help-menu").hide(); } else { $("#help-menu").toggle(); } }); ``` EDIT: If you want to click on the div that appears without hiding it again: ``` $(document).click(function(eventObj) { if (eventObj...
In my test, the mouseup function fires before the click function. The mouseup function checks for the target of the event. When you click on the button, the target of the mouseup event is the button, so the mouseup function hides the div, then the click function fires and toggles the div back to visible. What I would...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
Why are people willing to die in a revolution? Why do they sacrifice their lives to charitable work? Why do they protest against injustice even if it's not their own cause? This is the inner desire, our inner will to make a change for the better, to cause a memorable impact. If a book is immersive and the cause prese...
This is a cool question. I think in the case you speak of, the author may not have been writing with a specific theme in mind. The author could have just been telling a story, throwing characters into hell and seeing how the characters react so to speak. Some authors don't write with a theme in mind, but let the reader...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
At least part of why we read is to learn something --that doesn't mean the characters in the story need to learn something, and it doesn't necessarily mean a moral lesson. You might simply learn what it feels like to be put in an extreme situation, for instance. Having a theme enhances this sense of learning, and wit...
This is a cool question. I think in the case you speak of, the author may not have been writing with a specific theme in mind. The author could have just been telling a story, throwing characters into hell and seeing how the characters react so to speak. Some authors don't write with a theme in mind, but let the reader...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
Why are people willing to die in a revolution? Why do they sacrifice their lives to charitable work? Why do they protest against injustice even if it's not their own cause? This is the inner desire, our inner will to make a change for the better, to cause a memorable impact. If a book is immersive and the cause prese...
At least part of why we read is to learn something --that doesn't mean the characters in the story need to learn something, and it doesn't necessarily mean a moral lesson. You might simply learn what it feels like to be put in an extreme situation, for instance. Having a theme enhances this sense of learning, and wit...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
In the case of a story I am toying with, the theme (or more accurately, the idea) I am trying to bring across has a bearing on the structure of the story, the plot and the different details I bring out or emphasise in different parts of the story. Since these elements are determined in part by the theme, they should, ...
This is a cool question. I think in the case you speak of, the author may not have been writing with a specific theme in mind. The author could have just been telling a story, throwing characters into hell and seeing how the characters react so to speak. Some authors don't write with a theme in mind, but let the reader...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
I don't think the power or weight of a message, if well-written, is lost or changed by being camouflaged or not. Some premises are made very obvious early on (think His Dark Materials by Philip Pullman), but that explicit theme doesn't detract from the book; unless you do not like the message. If someone is not aligned...
The power comes from the fact that the *premise* (as it is called) is a commonly accepted truth, something that everyone wants to be true (e.g. in the end, evil gets punished), or something that you manage to show to be true. The latter is the most difficult, but the most powerful. Search for the book "The Moral Premi...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
In the case of a story I am toying with, the theme (or more accurately, the idea) I am trying to bring across has a bearing on the structure of the story, the plot and the different details I bring out or emphasise in different parts of the story. Since these elements are determined in part by the theme, they should, ...
The power comes from the fact that the *premise* (as it is called) is a commonly accepted truth, something that everyone wants to be true (e.g. in the end, evil gets punished), or something that you manage to show to be true. The latter is the most difficult, but the most powerful. Search for the book "The Moral Premi...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
Why are people willing to die in a revolution? Why do they sacrifice their lives to charitable work? Why do they protest against injustice even if it's not their own cause? This is the inner desire, our inner will to make a change for the better, to cause a memorable impact. If a book is immersive and the cause prese...
I don't think the power or weight of a message, if well-written, is lost or changed by being camouflaged or not. Some premises are made very obvious early on (think His Dark Materials by Philip Pullman), but that explicit theme doesn't detract from the book; unless you do not like the message. If someone is not aligned...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
At least part of why we read is to learn something --that doesn't mean the characters in the story need to learn something, and it doesn't necessarily mean a moral lesson. You might simply learn what it feels like to be put in an extreme situation, for instance. Having a theme enhances this sense of learning, and wit...
The power comes from the fact that the *premise* (as it is called) is a commonly accepted truth, something that everyone wants to be true (e.g. in the end, evil gets punished), or something that you manage to show to be true. The latter is the most difficult, but the most powerful. Search for the book "The Moral Premi...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
Why are people willing to die in a revolution? Why do they sacrifice their lives to charitable work? Why do they protest against injustice even if it's not their own cause? This is the inner desire, our inner will to make a change for the better, to cause a memorable impact. If a book is immersive and the cause prese...
The power comes from the fact that the *premise* (as it is called) is a commonly accepted truth, something that everyone wants to be true (e.g. in the end, evil gets punished), or something that you manage to show to be true. The latter is the most difficult, but the most powerful. Search for the book "The Moral Premi...
16,831
A novel that has a theme - that is, something to say, a message - has a weight to it that a novel without a theme cannot achieve. I'm sure there are those that might disagree with this, but I believe it is generally accepted as true. With the above in mind therefore, where does this weight, or power, come from? Here'...
2015/04/15
[ "https://writers.stackexchange.com/questions/16831", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/10394/" ]
I don't think the power or weight of a message, if well-written, is lost or changed by being camouflaged or not. Some premises are made very obvious early on (think His Dark Materials by Philip Pullman), but that explicit theme doesn't detract from the book; unless you do not like the message. If someone is not aligned...
This is a cool question. I think in the case you speak of, the author may not have been writing with a specific theme in mind. The author could have just been telling a story, throwing characters into hell and seeing how the characters react so to speak. Some authors don't write with a theme in mind, but let the reader...
35,301,005
I have [this](https://caribbeanvape.com/) website. I have a `div` with an embeded YouTube video and I am trying to hide the lower part of the video with a banner so that the YouTube logo that appears at the bottom is covered. I have added another `div` for the banner, I used `z-index` and `position: absolute; top:700...
2016/02/09
[ "https://Stackoverflow.com/questions/35301005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1724434/" ]
Seems there has been similar problem before this might be helpfull. [Visual Studio debugger error: Unable to start program Specified file cannot be found](https://stackoverflow.com/questions/7013309/visual-studio-debugger-error-unable-to-start-program-specified-file-cannot-be-f)
Go to the specific file location from the error open the program from there. Build it first then try to debug it again.
52,434,485
I am trying to make a function that will take a list such as: ``` l = [["A", 1, 2, 3, 4, 5], ["A", "A", 2, 3, 4, 5], [1, 2, 3, 4, 5, 5], ["A", "A", "A", "A", "A", "A"], ["A", 3, "A", 4, "A", "A"], [1, 3, 5, "A", 5, "A"] ] ``` and a key, for example "A". And will give a list containing a...
2018/09/20
[ "https://Stackoverflow.com/questions/52434485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3687547/" ]
It's probably a bit clunky, but list comprehensions are always an option. ``` def countInGrid(grid, key): return [sum([v[i:i+2].count(key) for v in grid[j:j+2]]) for j in range(0, len(grid), 2) for i in range(0, len(grid[0]), 2)] ``` Going through this, what it's using to come up with the 2x2 grids i...
It's tempting to try for a solution with slicing and comprehensions right off the bat, but I think the risk of confusion is sufficiently high that it's OK to start with a naive solution. The first step is to locate all corners of the sub-squares: ``` 1 . 2 . 3 . . . . . . . 4 . 5 . 6 . . . . . . . 7 . 8 . 9 . . . . ....
7,758
Based on [this question](https://rpg.stackexchange.com/questions/115306/does-supernatural-fury-replace-the-rage-feature-entirely), and the use of the DMs guild tag it made me wonder if the DMsGuild tag is an equivalent to Homebrew or if it should get both tags (one to identify it from DMsGuild and the other to let ever...
2018/02/12
[ "https://rpg.meta.stackexchange.com/questions/7758", "https://rpg.meta.stackexchange.com", "https://rpg.meta.stackexchange.com/users/23024/" ]
Homebrew is not an appropriate tag ================================== From the tag wiki: > > Homebrew, so called by analogy to home-brewing beer, is the creation of new game material by fans (**not the publisher or licensed third party publishers**) for an existing game system. > > > The purpose of [homebrew](h...
[DMs Guild](http://www.dmsguild.com/) doesn't look like homebrew to me: it's a shop of published products selling for real money. At that point you're graduating from “homebrew” to “third party publishing”. DMs Guild is a third-party publishing retail outlet. Its material is third-party published material, and the mat...
57,365,381
I have a wasm process (compiled from c++) that processes data inside a web application. Let's say the necessary code looks like this: ``` std::vector<JSONObject> data for (size_t i = 0; i < data.size(); i++) { process_data(data[i]); if (i % 1000 == 0) { bool is_cancelled = check_if_cancelled(); ...
2019/08/05
[ "https://Stackoverflow.com/questions/57365381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/651174/" ]
For Chrome (only) you may use shared memory (shared buffer as memory). And raise a flag in memory when you want to halt. Not a big fan of this solution (is complex and is supported only in chrome). It also depends on how your query works, and if there are places where the lengthy query can check the flag. Instead you ...
Shared Thread ------------- Since the worker and the C++ function that it called share the same thread, the worker will also be blocked until the C++ loop is finished, and won't be able to handle any incoming messages. I think the a solid option would minimize the amount of time that the thread is blocked by instead i...
4,088,640
I am almost finished changing a cursor-based stored procedure over to set-based. Almost, because I have only one thing left to figure out. They use a stored procedure called `GetSequence` to query a table, update it with a new sequence number (old + 1) and return the new sequence number value. This wasn't an issue whe...
2010/11/03
[ "https://Stackoverflow.com/questions/4088640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462044/" ]
What you're suggesting can't be done in MSSQL (AFAIK). In fact, I doubt the suggestions to convert GetSequence into a function probably won't work either as the latest ud\_campaing\_id probably is stored in some "global" table... Assuming the GetSequence stored procedure is called by different processes "simultaneousl...
This is documented - the BNF for `UPDATE` [in BOL](http://msdn.microsoft.com/en-us/library/ms177523.aspx) (extract) reads ``` ... UPDATE ... SET { column_name = { expression | DEFAULT | NULL } ... ``` The definition for `expression` being: > > expression > > > Is a variable, literal value, e...
4,088,640
I am almost finished changing a cursor-based stored procedure over to set-based. Almost, because I have only one thing left to figure out. They use a stored procedure called `GetSequence` to query a table, update it with a new sequence number (old + 1) and return the new sequence number value. This wasn't an issue whe...
2010/11/03
[ "https://Stackoverflow.com/questions/4088640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462044/" ]
This is documented - the BNF for `UPDATE` [in BOL](http://msdn.microsoft.com/en-us/library/ms177523.aspx) (extract) reads ``` ... UPDATE ... SET { column_name = { expression | DEFAULT | NULL } ... ``` The definition for `expression` being: > > expression > > > Is a variable, literal value, e...
You can't call a function or stored procedure from UPDATE statement (if somebody find out in MS SQL, please let me know how), but you can definitely run UPDATE in-between your code. So whatever it is that you are trying to achieve with your function or stored procedure, run UPDATE statement right within your function ...
4,088,640
I am almost finished changing a cursor-based stored procedure over to set-based. Almost, because I have only one thing left to figure out. They use a stored procedure called `GetSequence` to query a table, update it with a new sequence number (old + 1) and return the new sequence number value. This wasn't an issue whe...
2010/11/03
[ "https://Stackoverflow.com/questions/4088640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462044/" ]
What you're suggesting can't be done in MSSQL (AFAIK). In fact, I doubt the suggestions to convert GetSequence into a function probably won't work either as the latest ud\_campaing\_id probably is stored in some "global" table... Assuming the GetSequence stored procedure is called by different processes "simultaneousl...
You can't call a function or stored procedure from UPDATE statement (if somebody find out in MS SQL, please let me know how), but you can definitely run UPDATE in-between your code. So whatever it is that you are trying to achieve with your function or stored procedure, run UPDATE statement right within your function ...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
Some really good answers already, but I think there is one important part missing: It's up to the leadership of the company to "sell" the layoff to the rest of the employees. A layoff is an indication that something went massively wrong, so the leadership owes the employees an explanation. That explanation should incl...
The less anyone (laid off or surviving) has (or voices) the impression (justified or unjustified) that they have been (or are being) lied to (ignorantly, benevolently or malevolently), the better.
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
Jay's list is already good, I'd like to add one point from personal observation from when I was laid off: As a survivor, **do not feel guilty.** Assuming you did not personally pick who should stay and who should go, don't feel responsible for it. Don't feel like you have to tread lightly or be any different from the ...
I feel like we work for the same company. I just got a layoff notice and my teams morale is at an all time low and most of the ones who were "rebadged" or "retained" are still looking elsewhere because "they might be next." I actually addressed this with my boss. I think there are a number of things that can be done. S...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
You're asking how to maintain morale and productivity, but with that, **you're skipping a step that you cannot really skip.** And that step is, **what is, realistically, the outlook and chances for the company** in the short, intermediate and long run? As in, **did the company actually fix their problems, or are the...
I feel like we work for the same company. I just got a layoff notice and my teams morale is at an all time low and most of the ones who were "rebadged" or "retained" are still looking elsewhere because "they might be next." I actually addressed this with my boss. I think there are a number of things that can be done. S...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
I feel like we work for the same company. I just got a layoff notice and my teams morale is at an all time low and most of the ones who were "rebadged" or "retained" are still looking elsewhere because "they might be next." I actually addressed this with my boss. I think there are a number of things that can be done. S...
The less anyone (laid off or surviving) has (or voices) the impression (justified or unjustified) that they have been (or are being) lied to (ignorantly, benevolently or malevolently), the better.
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
The situation you're describing is tough. Layoffs have a very real impact on both the individuals that are let go and those that remain. I'm sorry you're experiencing this. Here are some things to consider that may help you and your colleagues cope with the added stress and emotions following a layoff: 1. **Acknowled...
Some really good answers already, but I think there is one important part missing: It's up to the leadership of the company to "sell" the layoff to the rest of the employees. A layoff is an indication that something went massively wrong, so the leadership owes the employees an explanation. That explanation should incl...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
The situation you're describing is tough. Layoffs have a very real impact on both the individuals that are let go and those that remain. I'm sorry you're experiencing this. Here are some things to consider that may help you and your colleagues cope with the added stress and emotions following a layoff: 1. **Acknowled...
Jay's list is already good, I'd like to add one point from personal observation from when I was laid off: As a survivor, **do not feel guilty.** Assuming you did not personally pick who should stay and who should go, don't feel responsible for it. Don't feel like you have to tread lightly or be any different from the ...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
You're asking how to maintain morale and productivity, but with that, **you're skipping a step that you cannot really skip.** And that step is, **what is, realistically, the outlook and chances for the company** in the short, intermediate and long run? As in, **did the company actually fix their problems, or are the...
The less anyone (laid off or surviving) has (or voices) the impression (justified or unjustified) that they have been (or are being) lied to (ignorantly, benevolently or malevolently), the better.
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
Some really good answers already, but I think there is one important part missing: It's up to the leadership of the company to "sell" the layoff to the rest of the employees. A layoff is an indication that something went massively wrong, so the leadership owes the employees an explanation. That explanation should incl...
I feel like we work for the same company. I just got a layoff notice and my teams morale is at an all time low and most of the ones who were "rebadged" or "retained" are still looking elsewhere because "they might be next." I actually addressed this with my boss. I think there are a number of things that can be done. S...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
Jay's list is already good, I'd like to add one point from personal observation from when I was laid off: As a survivor, **do not feel guilty.** Assuming you did not personally pick who should stay and who should go, don't feel responsible for it. Don't feel like you have to tread lightly or be any different from the ...
You're asking how to maintain morale and productivity, but with that, **you're skipping a step that you cannot really skip.** And that step is, **what is, realistically, the outlook and chances for the company** in the short, intermediate and long run? As in, **did the company actually fix their problems, or are the...
153,324
In what was perhaps a textbook example of bad optics, our company announced layoffs recently. To make things worse, the environment was such that many of us were personal friends as well as colleagues. The employees who are left are facing incredibly low morale, difficulty maintaining productivity, an increased workl...
2020/02/18
[ "https://workplace.stackexchange.com/questions/153324", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/46894/" ]
The situation you're describing is tough. Layoffs have a very real impact on both the individuals that are let go and those that remain. I'm sorry you're experiencing this. Here are some things to consider that may help you and your colleagues cope with the added stress and emotions following a layoff: 1. **Acknowled...
The less anyone (laid off or surviving) has (or voices) the impression (justified or unjustified) that they have been (or are being) lied to (ignorantly, benevolently or malevolently), the better.
4,753,759
In JavaScript, the `==` operator isn't necessarily transitive: ``` js> '0' == 0 true js> 0 == '' true js> '0' == '' false ``` Is the same true in PHP? Can you give an example?
2011/01/20
[ "https://Stackoverflow.com/questions/4753759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65387/" ]
**No**, the `==` operator is not transitive. The exact same scenario gives the same result in PHP. ``` echo var_dump('0'==0); echo var_dump(0==''); echo var_dump('0'==''); ``` yields: ``` boolean true boolean true boolean false ```
The same is true in PHP: ``` //php '0'==0 //true 0=='' //true ''=='0' //false ``` Did you not test it yourself? These are the same statements you provided for javascript.
4,753,759
In JavaScript, the `==` operator isn't necessarily transitive: ``` js> '0' == 0 true js> 0 == '' true js> '0' == '' false ``` Is the same true in PHP? Can you give an example?
2011/01/20
[ "https://Stackoverflow.com/questions/4753759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65387/" ]
**No**, the `==` operator is not transitive. The exact same scenario gives the same result in PHP. ``` echo var_dump('0'==0); echo var_dump(0==''); echo var_dump('0'==''); ``` yields: ``` boolean true boolean true boolean false ```
``` array() == NULL // true 0 == NULL // true array() == 0 // false ``` The problem with scripting languages is that we start comparing things in a non-strict way, which leads to different senses of "equality." when you are comparing "0" and 0, you mean something different then when you are comparing "0" and...
4,753,759
In JavaScript, the `==` operator isn't necessarily transitive: ``` js> '0' == 0 true js> 0 == '' true js> '0' == '' false ``` Is the same true in PHP? Can you give an example?
2011/01/20
[ "https://Stackoverflow.com/questions/4753759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65387/" ]
The same is true in PHP: ``` //php '0'==0 //true 0=='' //true ''=='0' //false ``` Did you not test it yourself? These are the same statements you provided for javascript.
``` array() == NULL // true 0 == NULL // true array() == 0 // false ``` The problem with scripting languages is that we start comparing things in a non-strict way, which leads to different senses of "equality." when you are comparing "0" and 0, you mean something different then when you are comparing "0" and...
19,821
We are building a service witch require a huge database. We are actually planning on getting more than 100 millions rows in our biggest table. So, what are the best options to store all this data in our database and afterward access to this data (search in the database) ? No need to say that it must be fast. Thanks.
2012/06/24
[ "https://dba.stackexchange.com/questions/19821", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/9618/" ]
100 million rows in a table does not make a database "huge" by today's standards This is also not MySql related in most ways - because you leave pretty fat the server software level and talk hardware. The standard answer to this is that it all depends on your workload profile. Is it transactional, reporting, OLAP? Y...
Since the speed of any query against this database will depend very much on what search values you put into the query, one option could be creating a simple setup with a mysql database, then generating some testdata which are similar to the real data, creating a few typical queries and also the heaviest queries you can...
424,733
I am using a 74HCT1G125 buffer as an '5 V output driver', but, in some cases it has a 12 V, low impedance source presented at its output pin (but in these cases its enable is false, i.e the output should be high impedance (Hi-Z)). When I do this, the 5 V supply (that the buffer uses also) is pushed up to around 8 V. Su...
2019/02/27
[ "https://electronics.stackexchange.com/questions/424733", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/163520/" ]
You aren't allowed to put more than VCC+0.5V on the output pin, even if it's in high-Z state. If you do, you could damage the chip. [![enter image description here](https://i.stack.imgur.com/lmaSS.png)](https://i.stack.imgur.com/lmaSS.png) What's happening in your circuit is there's a diode connected from the output ...
Many chips are poorly specified with regard to output clamping behavior. There is generally some amount of current that would be sourced or sinked to indefinitely without disrupting operation or causing the pin to reach a voltage that would damage it, and there is usually some upper and lower voltage bounds which would...
2,305,651
I've got dependency injection working with Unity and it runs nicely but I want to reduce the amount of cruft in the app.config as it is getting huge. This is an issue because the customer routinely 'cleans up' the config by removing comments etc and we end up with a few hundred lines of nasty XML without explanation. ...
2010/02/21
[ "https://Stackoverflow.com/questions/2305651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26221/" ]
From my point of view you have two options: * Move to another config file. * Write the IoC stuff in code, I like this way more because it is more readable. You can have a static container variable that you create through code: in the normal case by default or with mocks in unit tests. RepositoryContainer.Contanier= ...
Write the **configuration in code** instead. Unless you explicitly need to be able to vary the mappings from abstract to concrete types after compilation, using the config file only makes your system more brittle. Unity doesn't have a lot of convention-based features, but you can always write some yourself. In code, t...
16,235,617
I have this structure for my content: ``` <div id="content" style="overflow:scroll;height:500px; width: 500px;"> <div style="width:500px;height:100px;> <img src='http://graph.facebook.com/user1/picture?width=50&height=50'> </div> <div style="width:500px;height:100px;> <img src='http://graph.faceb...
2013/04/26
[ "https://Stackoverflow.com/questions/16235617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1928789/" ]
``` class MainClass(): def __init__(self, another_class): self.another_class = another_class class AnotherClass(): def required_method(self): blah blah blah another = AnotherClass() main_class = MainClass(another_class) main_class.another_class.required_method() ```
If you use composition, it's mostly because you want to hide some classes functionality into another class: ``` class ComplexClass(object): def __init__(self, component): self._component = component def hello(self): self._component.hello() class Component(object): def hello(self): ...
20,433,265
I have a function that may throw an exception. I would like to expose that exception as if it were thrown (essentially the same UI experience, so that it shows as an exception in the browser window and console, any debug tools). But I don't want the exception to halt execution of the original function. One solution to ...
2013/12/06
[ "https://Stackoverflow.com/questions/20433265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1274248/" ]
If you want to just report an error in the console without interrupting the execution, use ``` console.error(e); ``` instead. It may cause some issues in IE, since `console` is not defined while development tools not opened. So you can either do ``` console = window.console || {error: function(){}}; ``` somewhere...
No timeout necessary if you are only interested in writing an error to the console: ``` var f = function() { try { // exception could throw in here somewhere } catch (e) { console.error(e); } } ```
37,363
I'm doing an update like this: ``` UPDATE dbo.Table1 SET BirthDate = b.BirthDate FROM Table1 a JOIN Table2 b ON a.ID = b.ID ``` And I want to use the OUTPUT clause to back up my changes. ``` UPDATE dbo.Table1 SET BirthDate = b.BirthDate OUTPUT inserted.Id, inserted.BirthDate AS New_BirthDate, deleted...
2013/03/22
[ "https://dba.stackexchange.com/questions/37363", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/20225/" ]
AFAIK, the target table must exist, though [the documentation is not explicit](http://msdn.microsoft.com/en-us/library/ms177564.aspx) and probably should be. I can't see anything in the syntax diagram that would support any type of extension to create the output table at the same time.
Use a subquery. Into an existing table: ``` insert into dbo.ExistingTable select * from ( UPDATE dbo.Table1 SET BirthDate = b.BirthDate OUTPUT inserted.Id, inserted.BirthDate AS New_BirthDate, deleted.BirthDate AS Old_BirthDate FROM Table1 a JOIN Table2 b ON a.ID = ...
37,363
I'm doing an update like this: ``` UPDATE dbo.Table1 SET BirthDate = b.BirthDate FROM Table1 a JOIN Table2 b ON a.ID = b.ID ``` And I want to use the OUTPUT clause to back up my changes. ``` UPDATE dbo.Table1 SET BirthDate = b.BirthDate OUTPUT inserted.Id, inserted.BirthDate AS New_BirthDate, deleted...
2013/03/22
[ "https://dba.stackexchange.com/questions/37363", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/20225/" ]
AFAIK, the target table must exist, though [the documentation is not explicit](http://msdn.microsoft.com/en-us/library/ms177564.aspx) and probably should be. I can't see anything in the syntax diagram that would support any type of extension to create the output table at the same time.
Aaron Bertrand is right. The documentation for the `OUTPUT` clause is not explicit in saying that a table cannot be created with its use. I've run into the same issue. What I ended up doing was using two statements: ``` --This creates the table with the needed columns without inserting any data. SELECT TOP 0 [myColumn...
37,363
I'm doing an update like this: ``` UPDATE dbo.Table1 SET BirthDate = b.BirthDate FROM Table1 a JOIN Table2 b ON a.ID = b.ID ``` And I want to use the OUTPUT clause to back up my changes. ``` UPDATE dbo.Table1 SET BirthDate = b.BirthDate OUTPUT inserted.Id, inserted.BirthDate AS New_BirthDate, deleted...
2013/03/22
[ "https://dba.stackexchange.com/questions/37363", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/20225/" ]
Aaron Bertrand is right. The documentation for the `OUTPUT` clause is not explicit in saying that a table cannot be created with its use. I've run into the same issue. What I ended up doing was using two statements: ``` --This creates the table with the needed columns without inserting any data. SELECT TOP 0 [myColumn...
Use a subquery. Into an existing table: ``` insert into dbo.ExistingTable select * from ( UPDATE dbo.Table1 SET BirthDate = b.BirthDate OUTPUT inserted.Id, inserted.BirthDate AS New_BirthDate, deleted.BirthDate AS Old_BirthDate FROM Table1 a JOIN Table2 b ON a.ID = ...
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
Try the following: ``` <td> @(item.Customer != null ? item.Customer.Name : "") </td> ``` Edit: Enclosed to ensure it will work in Razor.
``` @foreach (var item in Model.Where(item => item.Customer != null)) ```
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
Try the following: ``` <td> @(item.Customer != null ? item.Customer.Name : "") </td> ``` Edit: Enclosed to ensure it will work in Razor.
Not sure how you build up these objects but another way of handling this is by using the Null Object design pattern this would remove the need to have a test and allow you to output meaningful text for the name ("Unknown", "",None whatever) <http://sourcemaking.com/refactoring/introduce-null-object>
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
A simple if should do the job: ``` <td> @if (item.Customer != null) { <text>@item.Customer.Name</text> } </td> ``` This being said and shown, that's only a workaround. The real solution consists in defining and using a specific view model.
``` @foreach (var item in Model.Where(item => item.Customer != null)) ```
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
A simple if should do the job: ``` <td> @if (item.Customer != null) { <text>@item.Customer.Name</text> } </td> ``` This being said and shown, that's only a workaround. The real solution consists in defining and using a specific view model.
Not sure how you build up these objects but another way of handling this is by using the Null Object design pattern this would remove the need to have a test and allow you to output meaningful text for the name ("Unknown", "",None whatever) <http://sourcemaking.com/refactoring/introduce-null-object>
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
Not sure how you build up these objects but another way of handling this is by using the Null Object design pattern this would remove the need to have a test and allow you to output meaningful text for the name ("Unknown", "",None whatever) <http://sourcemaking.com/refactoring/introduce-null-object>
``` @foreach (var item in Model.Where(item => item.Customer != null)) ```
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
Firstly you can use built-in html helper `Html.DisplayFor(m => m[i].Customer.Name)` if you would using for iteration instead of foreach. But this have few downside. You may not have indexer collection property and DisplayFor method get expression parameter and compile it which is costly. Instead of them you can create...
``` @foreach (var item in Model.Where(item => item.Customer != null)) ```
5,794,433
I have an MVC razor view that iterates over an Orders collection. Each order has a Customer, which can be null. Trouble is, I get a null reference exception when this is the case. ``` @foreach (var item in Model) { <tr> <td> @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLi...
2011/04/26
[ "https://Stackoverflow.com/questions/5794433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7140/" ]
Firstly you can use built-in html helper `Html.DisplayFor(m => m[i].Customer.Name)` if you would using for iteration instead of foreach. But this have few downside. You may not have indexer collection property and DisplayFor method get expression parameter and compile it which is costly. Instead of them you can create...
Not sure how you build up these objects but another way of handling this is by using the Null Object design pattern this would remove the need to have a test and allow you to output meaningful text for the name ("Unknown", "",None whatever) <http://sourcemaking.com/refactoring/introduce-null-object>
57,383,594
I want to print a text by dividing by a trailing margin ```php $text = "Lorem Ipsum is simply dummy text"; $ex = explode(" ",$text); ``` as a result I want: ``` Lorem Ipsum is simply dummy text Lorem Ipsum is simply dummy Lorem Ipsum is simply Lorem Ipsum is Lorem Ipsum Lorem ```
2019/08/06
[ "https://Stackoverflow.com/questions/57383594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11891689/" ]
Here's one way to do it: 1. Echo the string. ``` echo $text . PHP_EOL; ``` 2. Remove the last word. ``` $text = substr($text, 0, strrpos($text, ' ')); ``` Repeat that process until there's no more string. ``` while ($text) { echo $text . PHP_EOL; $text = substr($text, 0, strrpos($text, ' ')); } ``` Thi...
You can use a while loop and strpos to find the positions of the spaces. Since this will get the string in reverse order from what you want I add it to an array that I can reverse and implode. ``` $text = "Lorem Ipsum is simply dummy text"; $pos = 0; while($pos = strpos($text, " ", $pos+1)){ $arr[]= substr($te...
13,691,175
Posting an Open Graph action using the Node.js [`facebook-node-sdk`](https://github.com/Thuzi/facebook-node-sdk/) module gives me `{"error": "An active access token must be used to query information about the current user."}`. ``` var FB = require( 'fb' ) var path = '/me?' + namespace + ':' + action_type_name var body...
2012/12/03
[ "https://Stackoverflow.com/questions/13691175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/623999/" ]
Try this: ``` //td[contains(text(),'Beach')]/../td/a[contains(@class,'delete_link')] ```
`tr[@id="district_22"]//a[contains(@class,'delete_link')]` would be a lot better. It's not good to look at the text. After all it may get localized and edited in other ways. ID's however are ment to be unchanging and not duplicated.
13,691,175
Posting an Open Graph action using the Node.js [`facebook-node-sdk`](https://github.com/Thuzi/facebook-node-sdk/) module gives me `{"error": "An active access token must be used to query information about the current user."}`. ``` var FB = require( 'fb' ) var path = '/me?' + namespace + ':' + action_type_name var body...
2012/12/03
[ "https://Stackoverflow.com/questions/13691175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/623999/" ]
Try this: ``` //td[contains(text(),'Beach')]/../td/a[contains(@class,'delete_link')] ```
I think you want to execute a automate scripts in loop, if this is the case then you can try the below code: ``` for(i=1,dist=22; i<-count; i++,dist++) { .... .... driver..findElement(By.xpath("//*[@id=District_"+dist+"]/...")) } ```
13,691,175
Posting an Open Graph action using the Node.js [`facebook-node-sdk`](https://github.com/Thuzi/facebook-node-sdk/) module gives me `{"error": "An active access token must be used to query information about the current user."}`. ``` var FB = require( 'fb' ) var path = '/me?' + namespace + ':' + action_type_name var body...
2012/12/03
[ "https://Stackoverflow.com/questions/13691175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/623999/" ]
`tr[@id="district_22"]//a[contains(@class,'delete_link')]` would be a lot better. It's not good to look at the text. After all it may get localized and edited in other ways. ID's however are ment to be unchanging and not duplicated.
I think you want to execute a automate scripts in loop, if this is the case then you can try the below code: ``` for(i=1,dist=22; i<-count; i++,dist++) { .... .... driver..findElement(By.xpath("//*[@id=District_"+dist+"]/...")) } ```
1,164,493
Prove by induction: $$\frac1{n+1} + \frac1{n+2} + \cdots +\frac1{3n+1} > 1$$ adding $1/(3m+4)$ as the next $m+1$ value proves pretty fruitless. Can I make some simplifications in the inequality that because the $m$ step is true by the inductive hypothesis, the 1 is already less than all those values?
2015/02/25
[ "https://math.stackexchange.com/questions/1164493", "https://math.stackexchange.com", "https://math.stackexchange.com/users/193953/" ]
**Hint:** When you increase $n$ by $1$, the sum loses one term and gains three. What is the sum of the three gained terms minus the lost one?
More generally (one of my favorite phrases), let $s\_k(n) =\sum\limits\_{i=n+1}^{kn+1} \frac1{i} $. I will show that $s\_k(n+1)>s\_k(n)$ for $k \ge 3$. In particular, for $n \ge 1$ $s\_3(n) \ge s\_3(1) =\frac1{2}+\frac1{3}+\frac1{4} =\frac{6+4+3}{12} =\frac{13}{12} > 1 $. $\begin{array}\\ s\_k(n+1)-s\_k(n) &=\sum\li...
1,164,493
Prove by induction: $$\frac1{n+1} + \frac1{n+2} + \cdots +\frac1{3n+1} > 1$$ adding $1/(3m+4)$ as the next $m+1$ value proves pretty fruitless. Can I make some simplifications in the inequality that because the $m$ step is true by the inductive hypothesis, the 1 is already less than all those values?
2015/02/25
[ "https://math.stackexchange.com/questions/1164493", "https://math.stackexchange.com", "https://math.stackexchange.com/users/193953/" ]
**Hint:** When you increase $n$ by $1$, the sum loses one term and gains three. What is the sum of the three gained terms minus the lost one?
Hint: use that $$\frac1{3n+2}+\frac1{3n+3}+\frac1{3n+4}-\frac1{n+1}=\cdots >0.$$
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
It may or may not have a reference to the Subject, depending on the concrete problem. The Subject might only call the update() function and just set some value in the Observer, thus the Observer does not need a reference. Or it can notify the Observer that there has been a change, and the Observer will contact the Sub...
Hello Amandeep you can read this article it's very interessant, you have all design patterns of GOF You have class diagram, sample code It explain all concepts about observation : Subject, ConcreteSubject, Observer and ConcreteObserver <http://www.dofactory.com/Patterns/PatternObserver.aspx>
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
Specifically to your last question, given C# and Java as programming languages, how would one object "know" about another object, except via a reference? The relationship between an observer and a subject needs to be stored somewhere, and in Java and C# can only be stored via references, if any actions need to be inv...
Hello Amandeep you can read this article it's very interessant, you have all design patterns of GOF You have class diagram, sample code It explain all concepts about observation : Subject, ConcreteSubject, Observer and ConcreteObserver <http://www.dofactory.com/Patterns/PatternObserver.aspx>
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
It may or may not have a reference to the Subject, depending on the concrete problem. The Subject might only call the update() function and just set some value in the Observer, thus the Observer does not need a reference. Or it can notify the Observer that there has been a change, and the Observer will contact the Sub...
One `Observer` can observe many `Observable` so when he gets notified it can handle the change in a specific manner. For example : ``` import java.util.Observable; import java.util.Observer; public class ObserverSample { static class ObservableExtension extends Observable { void doSomething() { ...
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
It may or may not have a reference to the Subject, depending on the concrete problem. The Subject might only call the update() function and just set some value in the Observer, thus the Observer does not need a reference. Or it can notify the Observer that there has been a change, and the Observer will contact the Sub...
Specifically to your last question, given C# and Java as programming languages, how would one object "know" about another object, except via a reference? The relationship between an observer and a subject needs to be stored somewhere, and in Java and C# can only be stored via references, if any actions need to be inv...
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
It may or may not have a reference to the Subject, depending on the concrete problem. The Subject might only call the update() function and just set some value in the Observer, thus the Observer does not need a reference. Or it can notify the Observer that there has been a change, and the Observer will contact the Sub...
Quick Short Answer There can be several variations of the Observer Pattern. One of them allows only to detect changes of the observed objects, and maybe display their properties values. Other allows to perform an operation also.
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
Specifically to your last question, given C# and Java as programming languages, how would one object "know" about another object, except via a reference? The relationship between an observer and a subject needs to be stored somewhere, and in Java and C# can only be stored via references, if any actions need to be inv...
One `Observer` can observe many `Observable` so when he gets notified it can handle the change in a specific manner. For example : ``` import java.util.Observable; import java.util.Observer; public class ObserverSample { static class ObservableExtension extends Observable { void doSomething() { ...
12,076,660
I have seen few examples of Observer pattern. Why does the update method in the Observer interface in some cases include a reference to the object being observed? Doesn't the observer know what object it is observing? Please explain with example.
2012/08/22
[ "https://Stackoverflow.com/questions/12076660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2095411/" ]
Specifically to your last question, given C# and Java as programming languages, how would one object "know" about another object, except via a reference? The relationship between an observer and a subject needs to be stored somewhere, and in Java and C# can only be stored via references, if any actions need to be inv...
Quick Short Answer There can be several variations of the Observer Pattern. One of them allows only to detect changes of the observed objects, and maybe display their properties values. Other allows to perform an operation also.
60,196,423
I have to hashes as follows: ``` my %hash1 = ( 'modules' => { 'top0' => { 'instances' => { 'sub_top' => { 'instances' => { 'inst2' => 2, 'inst0' => 0 } } } ...
2020/02/12
[ "https://Stackoverflow.com/questions/60196423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9760498/" ]
One of possible ways to merge hashes on predefined key. See if it satisfies your expectation. ``` use strict; use warnings; use feature 'say'; use Data::Dumper; my $debug = 0; my %hash1 = ( 'modules' => { 'top0' => { 'instances' => { 'sub_top' => { 'instan...
If you look at the [Synopsis for Hash::Merge](https://metacpan.org/pod/Hash::Merge#SYNOPSIS), the example shows two hashes that look practically identical in structure. The hashes that you want to merge may have many similarities, but they also have significant differences. So, I would only expect that you can only mer...
3,757,328
I have been exploring Excel C API and am now good at getting multi-cell input, doing computations and outputing the result in a single cell. Now I want to output the result in multiple cells, for example: 1) Get a column range as input 2) Sort the numbers (in the cells) 3) Write the sorted numbers in a new column or t...
2010/09/21
[ "https://Stackoverflow.com/questions/3757328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409994/" ]
Use <http://nxll.codeplex.com> to simplify creating 2-dimensional OPERs. It makes it as easy as writing a VBA add-in except you can use modern C++.
In VBA you'd assign a Variant type to a Range for multi-cell assignment. It looks like the equivalent type in the SDK is [XLOPER/XLOPER12](http://msdn.microsoft.com/en-us/library/bb687869.aspx). Not having used the SDK I couldn't tell you how to use this, but hopefully it gets you started.
15,799,377
I have written a small piece of code in MATLAB. This is actually a function to make a linear index from a 3D matrix. This is actually part of a bigger project. the problem is the code works but it is not optimized and it is slow. When I run the profiler on MATLAB, 90% of the computation time is consumed by this functio...
2013/04/03
[ "https://Stackoverflow.com/questions/15799377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1926629/" ]
just use [sub2ind](http://www.mathworks.com/help/matlab/ref/sub2ind.html) - a built in function that convert subscripts to linear indices. `linearInd = sub2ind(arraySize, dim1Sub, dim2Sub, dim3Sub, ...)` returns the linear index equivalents to the specified subscripts for each dimension of an N-dimensional array of si...
The best way to optimize this code would be to vectorize it, but I can't seem to figure out how to do that right now, however, I see some thing open to optimization that would probabbly give you a small speedup, first, the line ``` [oX,oY] = func1(rX,rY); ``` could be taken out of the loop and `func1`updated in ord...
15,799,377
I have written a small piece of code in MATLAB. This is actually a function to make a linear index from a 3D matrix. This is actually part of a bigger project. the problem is the code works but it is not optimized and it is slow. When I run the profiler on MATLAB, 90% of the computation time is consumed by this functio...
2013/04/03
[ "https://Stackoverflow.com/questions/15799377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1926629/" ]
The best way to optimize this code would be to vectorize it, but I can't seem to figure out how to do that right now, however, I see some thing open to optimization that would probabbly give you a small speedup, first, the line ``` [oX,oY] = func1(rX,rY); ``` could be taken out of the loop and `func1`updated in ord...
For one you could get rid of func1. You can replace it by ``` for ox = C1:( (C3-C1)/(W-1) ):C3 ``` oy is analogous. Actually I wonder if it is an error that you increase the counter inside the if condition. Cause then the position in lIR and lIC depend depend on the result. Also it is the only value that depend...
15,799,377
I have written a small piece of code in MATLAB. This is actually a function to make a linear index from a 3D matrix. This is actually part of a bigger project. the problem is the code works but it is not optimized and it is slow. When I run the profiler on MATLAB, 90% of the computation time is consumed by this functio...
2013/04/03
[ "https://Stackoverflow.com/questions/15799377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1926629/" ]
just use [sub2ind](http://www.mathworks.com/help/matlab/ref/sub2ind.html) - a built in function that convert subscripts to linear indices. `linearInd = sub2ind(arraySize, dim1Sub, dim2Sub, dim3Sub, ...)` returns the linear index equivalents to the specified subscripts for each dimension of an N-dimensional array of si...
For one you could get rid of func1. You can replace it by ``` for ox = C1:( (C3-C1)/(W-1) ):C3 ``` oy is analogous. Actually I wonder if it is an error that you increase the counter inside the if condition. Cause then the position in lIR and lIC depend depend on the result. Also it is the only value that depend...
22,671,045
I found this macro, to run code for specific project path: ``` (defmacro project-specifics (name &rest body) `(progn (add-hook 'find-file-hook (lambda () (when (string-match-p ,name (buffer-file-name)) ,@body))) (add-hook 'dired-after-readin-hook (l...
2014/03/26
[ "https://Stackoverflow.com/questions/22671045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387194/" ]
The Problem ----------- The reason is probably that the found object is the *first* in `list`, in which case `(delete item list)` returns `(cdr list)` instead of modifying its structure to preserve identity. The important point here is that `delete` **cannot** guarantee that ``` (eq x (delete item x)) ==> t ``` e....
Add the lambdas to the hooks and to your own hash table keyed by name. Then when you need to remove it, look up the lambda in the hash table and delq it from the hook. About Elisp hash tables: <http://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html> Btw (eq (car item) 'lambda) will fail when lexica...
22,671,045
I found this macro, to run code for specific project path: ``` (defmacro project-specifics (name &rest body) `(progn (add-hook 'find-file-hook (lambda () (when (string-match-p ,name (buffer-file-name)) ,@body))) (add-hook 'dired-after-readin-hook (l...
2014/03/26
[ "https://Stackoverflow.com/questions/22671045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387194/" ]
The Problem ----------- The reason is probably that the found object is the *first* in `list`, in which case `(delete item list)` returns `(cdr list)` instead of modifying its structure to preserve identity. The important point here is that `delete` **cannot** guarantee that ``` (eq x (delete item x)) ==> t ``` e....
I would like to propose a refactoring which allows you to define the hook once, then have it run the actual action only when some conditions are fulfilled. ``` (defvar project-specific-name-regex "projects/test" "*Regex to match on buffer name in order to trigger `project-specific-fun'.") (defvar project-specific-fu...
22,671,045
I found this macro, to run code for specific project path: ``` (defmacro project-specifics (name &rest body) `(progn (add-hook 'find-file-hook (lambda () (when (string-match-p ,name (buffer-file-name)) ,@body))) (add-hook 'dired-after-readin-hook (l...
2014/03/26
[ "https://Stackoverflow.com/questions/22671045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387194/" ]
Add the lambdas to the hooks and to your own hash table keyed by name. Then when you need to remove it, look up the lambda in the hash table and delq it from the hook. About Elisp hash tables: <http://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html> Btw (eq (car item) 'lambda) will fail when lexica...
I would like to propose a refactoring which allows you to define the hook once, then have it run the actual action only when some conditions are fulfilled. ``` (defvar project-specific-name-regex "projects/test" "*Regex to match on buffer name in order to trigger `project-specific-fun'.") (defvar project-specific-fu...
68,140,852
I have a String that look like this: ``` String str = "Jun 26th 2021, 04:30:15 pm NY"; ``` I want to convert it to `ZonedDateTime`, for this I use `DateTimeFormatterBuilder`: ``` DateTimeFormatter formatter = new DateTimeFormatterBuilder() .parseCaseInsensitive() .appendPattern("MMM dd'th' uuuu, h:m...
2021/06/26
[ "https://Stackoverflow.com/questions/68140852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14087681/" ]
[`DateTimeFormatter#parse(CharSequence, ParsePosition)`](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#parse-java.lang.CharSequence-java.text.ParsePosition-) is at your disposal. Note that `NY` is not the name of a timezone. The naming convention for timezone is ***Region/City*** e....
As highlighted by Sweeper, NY is not a recognised timezone by Java. To minimize changes to your code you can use the [`DateTimeFormatter#withZone`](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#withZone-java.time.ZoneId-) method of your `DateTimeFormatter` formatter returning a copy ...
66,132
A bit silly but I may have a *small* crush for an HR advisor in my company. The company is large and the culture is quite formal. Ideally I'd like to meet her outside work and **talk to her normally** but there are no occasions to do so. Is it really inappropriate in a workplace if I ask someone out?
2016/04/28
[ "https://workplace.stackexchange.com/questions/66132", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49884/" ]
It's inadvisable to do more than the piece of cake. Especially if she is in HR, but even if she wasn't. Best if you met her outside work, but of course that would imply finding out where she goes outside work, which might be thought to be stalking. But really that is the safest way. Office romances are not a great ide...
Ask HR... seriously =================== This is a pretty unique thing, and the best risk free way to do this is to approach her as a colleague in a formal context and ask what the policy is *without letting on who specifically you are interested in*. As an employee you are entitled to know what the company stance is ...
66,132
A bit silly but I may have a *small* crush for an HR advisor in my company. The company is large and the culture is quite formal. Ideally I'd like to meet her outside work and **talk to her normally** but there are no occasions to do so. Is it really inappropriate in a workplace if I ask someone out?
2016/04/28
[ "https://workplace.stackexchange.com/questions/66132", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49884/" ]
It's inadvisable to do more than the piece of cake. Especially if she is in HR, but even if she wasn't. Best if you met her outside work, but of course that would imply finding out where she goes outside work, which might be thought to be stalking. But really that is the safest way. Office romances are not a great ide...
Do not do anything. Bringing piece of cake especially for her would definitely tell her you are interested in her. If you see her , smile at her and see if she responds. Chances are she already has a boyfriend if she is pretty. Best to move on and find another girl.
66,132
A bit silly but I may have a *small* crush for an HR advisor in my company. The company is large and the culture is quite formal. Ideally I'd like to meet her outside work and **talk to her normally** but there are no occasions to do so. Is it really inappropriate in a workplace if I ask someone out?
2016/04/28
[ "https://workplace.stackexchange.com/questions/66132", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49884/" ]
It's inadvisable to do more than the piece of cake. Especially if she is in HR, but even if she wasn't. Best if you met her outside work, but of course that would imply finding out where she goes outside work, which might be thought to be stalking. But really that is the safest way. Office romances are not a great ide...
Im going to take a different tone to the existing answers. **Go for it.** Seriously, you stated that your company policy doesn't explicitly forbid it, so there is no real company-side risk for this. Be sensible about it too, don't get stalker-ish, but expressing interest is worth it. Jobs change and percieved unprofe...
66,132
A bit silly but I may have a *small* crush for an HR advisor in my company. The company is large and the culture is quite formal. Ideally I'd like to meet her outside work and **talk to her normally** but there are no occasions to do so. Is it really inappropriate in a workplace if I ask someone out?
2016/04/28
[ "https://workplace.stackexchange.com/questions/66132", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49884/" ]
Ask HR... seriously =================== This is a pretty unique thing, and the best risk free way to do this is to approach her as a colleague in a formal context and ask what the policy is *without letting on who specifically you are interested in*. As an employee you are entitled to know what the company stance is ...
Do not do anything. Bringing piece of cake especially for her would definitely tell her you are interested in her. If you see her , smile at her and see if she responds. Chances are she already has a boyfriend if she is pretty. Best to move on and find another girl.
66,132
A bit silly but I may have a *small* crush for an HR advisor in my company. The company is large and the culture is quite formal. Ideally I'd like to meet her outside work and **talk to her normally** but there are no occasions to do so. Is it really inappropriate in a workplace if I ask someone out?
2016/04/28
[ "https://workplace.stackexchange.com/questions/66132", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49884/" ]
Im going to take a different tone to the existing answers. **Go for it.** Seriously, you stated that your company policy doesn't explicitly forbid it, so there is no real company-side risk for this. Be sensible about it too, don't get stalker-ish, but expressing interest is worth it. Jobs change and percieved unprofe...
Ask HR... seriously =================== This is a pretty unique thing, and the best risk free way to do this is to approach her as a colleague in a formal context and ask what the policy is *without letting on who specifically you are interested in*. As an employee you are entitled to know what the company stance is ...
66,132
A bit silly but I may have a *small* crush for an HR advisor in my company. The company is large and the culture is quite formal. Ideally I'd like to meet her outside work and **talk to her normally** but there are no occasions to do so. Is it really inappropriate in a workplace if I ask someone out?
2016/04/28
[ "https://workplace.stackexchange.com/questions/66132", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49884/" ]
Im going to take a different tone to the existing answers. **Go for it.** Seriously, you stated that your company policy doesn't explicitly forbid it, so there is no real company-side risk for this. Be sensible about it too, don't get stalker-ish, but expressing interest is worth it. Jobs change and percieved unprofe...
Do not do anything. Bringing piece of cake especially for her would definitely tell her you are interested in her. If you see her , smile at her and see if she responds. Chances are she already has a boyfriend if she is pretty. Best to move on and find another girl.
39,103,000
I'm generating a token on our auth server (Node.js) in [node-jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) that will be passed to an API (PHP Laravel) and verified by [tymondesigns/jwt-auth](https://github.com/tymondesigns/jwt-auth). * A token generated by tymondesigns/jwt-auth will be verified successfull...
2016/08/23
[ "https://Stackoverflow.com/questions/39103000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64730/" ]
The last version of the `namshi/jose` library is 7.0. There is also a known bugs for all `ESxxx` algorithms. If you cannot verify signatures using that library, you could try with another one. I developed [a library](https://github.com/Spomky-Labs/jose) that supports all features described in the RFCs related to the J...
The reason is, as mentioned by Spomky aswell, a bug in **namshi/jose** related to the `iss` claim. It is resolved in `7.0` which is used by **tymon/jwt-auth** `1.0.0-alpha.2`. However, since there currently isn't a documented way to install 1.0.0-alpha.2, we probably have to wait for a stable release. Until then, sinc...
39,103,000
I'm generating a token on our auth server (Node.js) in [node-jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) that will be passed to an API (PHP Laravel) and verified by [tymondesigns/jwt-auth](https://github.com/tymondesigns/jwt-auth). * A token generated by tymondesigns/jwt-auth will be verified successfull...
2016/08/23
[ "https://Stackoverflow.com/questions/39103000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64730/" ]
The last version of the `namshi/jose` library is 7.0. There is also a known bugs for all `ESxxx` algorithms. If you cannot verify signatures using that library, you could try with another one. I developed [a library](https://github.com/Spomky-Labs/jose) that supports all features described in the RFCs related to the J...
In my case I had a url inside the payload. PHP escapes slashes by default when encoding to JSON, while Node.js doesn't. When the verification JWT gets generated in PHP (with those extra backslashes) of course the final hashes won't match since the payload is just different. Solution is to use the JSON\_UNESCAPED\_SLASH...
39,103,000
I'm generating a token on our auth server (Node.js) in [node-jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) that will be passed to an API (PHP Laravel) and verified by [tymondesigns/jwt-auth](https://github.com/tymondesigns/jwt-auth). * A token generated by tymondesigns/jwt-auth will be verified successfull...
2016/08/23
[ "https://Stackoverflow.com/questions/39103000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64730/" ]
The reason is, as mentioned by Spomky aswell, a bug in **namshi/jose** related to the `iss` claim. It is resolved in `7.0` which is used by **tymon/jwt-auth** `1.0.0-alpha.2`. However, since there currently isn't a documented way to install 1.0.0-alpha.2, we probably have to wait for a stable release. Until then, sinc...
In my case I had a url inside the payload. PHP escapes slashes by default when encoding to JSON, while Node.js doesn't. When the verification JWT gets generated in PHP (with those extra backslashes) of course the final hashes won't match since the payload is just different. Solution is to use the JSON\_UNESCAPED\_SLASH...
2,258
Are alternative chess rules/styles considered favourably by the main chess community? To be more specific I mean games like 3D chess (as seen in Star Trek) or landscape chess, as explained here: <http://intrepidis.blogspot.co.uk/2012/08/landscape-chess.html> Are there tournaments for chess variants?
2013/04/06
[ "https://chess.stackexchange.com/questions/2258", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/1207/" ]
The only variants I can think of that experienced chess players seem to have any interest in are [Chess960](http://en.wikipedia.org/wiki/Chess960) (aka Fischerandom) and [Bughouse](http://en.wikipedia.org/wiki/Bughouse_chess). Even [Seirawan chess](http://en.wikipedia.org/wiki/Seirawan_chess), which has the imprimatur ...
I have not heard of any regular tournaments for any chess variant with the exception of Chess960.
12,925,379
In this code: ``` int * p = new int(44); ``` p is allocated on the heap and the value it points to is 44; but now I can also do something like this: ``` p[1] = 33; ``` without getting an error. I always thought ``` int * p = new int(44); ``` was just another way of saying "P is allocated on the heap and points...
2012/10/17
[ "https://Stackoverflow.com/questions/12925379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1467202/" ]
You were right: P is allocated on the heap and points to an address containing 44. There's no array allocated. `p[1] = 33;` is what they call "undefined behavior". Your program **might** crash, but it's not guaranteed to crash every single time you do this.
``` int *p_scalar = new int(5); //allocates an integer, set to 5. ``` If you access p\_scalar[n] (n <> 0) it may crash
12,925,379
In this code: ``` int * p = new int(44); ``` p is allocated on the heap and the value it points to is 44; but now I can also do something like this: ``` p[1] = 33; ``` without getting an error. I always thought ``` int * p = new int(44); ``` was just another way of saying "P is allocated on the heap and points...
2012/10/17
[ "https://Stackoverflow.com/questions/12925379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1467202/" ]
You were right: P is allocated on the heap and points to an address containing 44. There's no array allocated. `p[1] = 33;` is what they call "undefined behavior". Your program **might** crash, but it's not guaranteed to crash every single time you do this.
In your example, the C++ language gives you a default implementation for the subscript operator for pointers that looks somehow similar to this: ``` (*Ptr)& operator[](size_t index) { return *(address + index*sizeof(*Ptr)); } ``` This can always be overloaded and replaced for any type. Integers are not an excepti...
2,739,596
I am writing this application in eclipse I added all the jar files.I am pasting the code and error.Please let me know what changes I should make to run the application properly. ``` import javax.mail.*; import javax.mail.internet.*; import java.util.*; public class SendMail { public static void main(String [] args) ...
2010/04/29
[ "https://Stackoverflow.com/questions/2739596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327136/" ]
You're trying to send mail over a connection that expects an encrypted connection (TLS in this case). This sun forum has several solutions that you might try: <http://forums.sun.com/thread.jspa?threadID=617974>
For javamail to GMail SMTP I use the following properties: ``` mail.smtp.host="smtp.gmail.com" mail.smtp.port="587" mail.smtp.auth="true" mail.smtp.starttls.enable="true" ``` I wasn't aware that GMail accepted mail on port 25. Perhaps that is the source of your problem. Obviously you still need to perform authentic...
2,739,596
I am writing this application in eclipse I added all the jar files.I am pasting the code and error.Please let me know what changes I should make to run the application properly. ``` import javax.mail.*; import javax.mail.internet.*; import java.util.*; public class SendMail { public static void main(String [] args) ...
2010/04/29
[ "https://Stackoverflow.com/questions/2739596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327136/" ]
Actually, you also have to set the smtps properties when using smtps. Simply set the mail properties to include: ``` mail.smtps.host mail.smtps.auth ```
You're trying to send mail over a connection that expects an encrypted connection (TLS in this case). This sun forum has several solutions that you might try: <http://forums.sun.com/thread.jspa?threadID=617974>
2,739,596
I am writing this application in eclipse I added all the jar files.I am pasting the code and error.Please let me know what changes I should make to run the application properly. ``` import javax.mail.*; import javax.mail.internet.*; import java.util.*; public class SendMail { public static void main(String [] args) ...
2010/04/29
[ "https://Stackoverflow.com/questions/2739596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327136/" ]
Actually, you also have to set the smtps properties when using smtps. Simply set the mail properties to include: ``` mail.smtps.host mail.smtps.auth ```
For javamail to GMail SMTP I use the following properties: ``` mail.smtp.host="smtp.gmail.com" mail.smtp.port="587" mail.smtp.auth="true" mail.smtp.starttls.enable="true" ``` I wasn't aware that GMail accepted mail on port 25. Perhaps that is the source of your problem. Obviously you still need to perform authentic...
43,749,836
this is part of my json file and the data contain this useless symbol **''\''** ...: ``` "{\"0\":{\"index\":23,\"indicator\":\"ClassC Time\",\"month\":201611,\"ww\":201648,\"test_time\":0.0,\"p\":48.0,\"Product\":\"RB\"},\"1\":{\"index\":24,\"indicator\":\"ClassC\",\"month\":201612,\"ww\":201649,\"test_time\":47.4...
2017/05/03
[ "https://Stackoverflow.com/questions/43749836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7892936/" ]
Is this what you are looking for? ```js var trIndex = 0; document.getElementById("show").onclick = function() { if(trIndex === 5) return; trIndex += 1; document.getElementById(trIndex).style.display = "table-row"; }; document.getElementById("hide").onclick = function() { if(trIndex === 0) return; d...
Button: ``` <input type="button" id="show" value="show" onclick="showHidden()"/> <input type="button" id="show" value="show" onclick="hideVisible()"/> ``` Javascript: ``` function showHidden() { $("td:hidden").first().show(); } function hideVisible() { $("td:visible").last().hide(); } ``` Be carefull with th...
43,749,836
this is part of my json file and the data contain this useless symbol **''\''** ...: ``` "{\"0\":{\"index\":23,\"indicator\":\"ClassC Time\",\"month\":201611,\"ww\":201648,\"test_time\":0.0,\"p\":48.0,\"Product\":\"RB\"},\"1\":{\"index\":24,\"indicator\":\"ClassC\",\"month\":201612,\"ww\":201649,\"test_time\":47.4...
2017/05/03
[ "https://Stackoverflow.com/questions/43749836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7892936/" ]
You can use Jquery like this ```js $(document).ready(function(){ var id_num = 0; // define the id number $('#show').on('click',function(){ id_num++; // add +1 to the id number $('#' + id_num).show(); // show tr with that id ...
Is this what you are looking for? ```js var trIndex = 0; document.getElementById("show").onclick = function() { if(trIndex === 5) return; trIndex += 1; document.getElementById(trIndex).style.display = "table-row"; }; document.getElementById("hide").onclick = function() { if(trIndex === 0) return; d...
43,749,836
this is part of my json file and the data contain this useless symbol **''\''** ...: ``` "{\"0\":{\"index\":23,\"indicator\":\"ClassC Time\",\"month\":201611,\"ww\":201648,\"test_time\":0.0,\"p\":48.0,\"Product\":\"RB\"},\"1\":{\"index\":24,\"indicator\":\"ClassC\",\"month\":201612,\"ww\":201649,\"test_time\":47.4...
2017/05/03
[ "https://Stackoverflow.com/questions/43749836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7892936/" ]
Is this what you are looking for? ```js var trIndex = 0; document.getElementById("show").onclick = function() { if(trIndex === 5) return; trIndex += 1; document.getElementById(trIndex).style.display = "table-row"; }; document.getElementById("hide").onclick = function() { if(trIndex === 0) return; d...
``` var count = 0; $("show").on("click",function(ev){ ev.preventDefault(); if(count > 5) return; count++; $("#"+count).show(); }) $("#hide").on("click",function(ev){ ev.preventDefault(); if(count<=0) return; $("#"+count).hide(); count--; }) ```
43,749,836
this is part of my json file and the data contain this useless symbol **''\''** ...: ``` "{\"0\":{\"index\":23,\"indicator\":\"ClassC Time\",\"month\":201611,\"ww\":201648,\"test_time\":0.0,\"p\":48.0,\"Product\":\"RB\"},\"1\":{\"index\":24,\"indicator\":\"ClassC\",\"month\":201612,\"ww\":201649,\"test_time\":47.4...
2017/05/03
[ "https://Stackoverflow.com/questions/43749836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7892936/" ]
You can use Jquery like this ```js $(document).ready(function(){ var id_num = 0; // define the id number $('#show').on('click',function(){ id_num++; // add +1 to the id number $('#' + id_num).show(); // show tr with that id ...
Button: ``` <input type="button" id="show" value="show" onclick="showHidden()"/> <input type="button" id="show" value="show" onclick="hideVisible()"/> ``` Javascript: ``` function showHidden() { $("td:hidden").first().show(); } function hideVisible() { $("td:visible").last().hide(); } ``` Be carefull with th...
43,749,836
this is part of my json file and the data contain this useless symbol **''\''** ...: ``` "{\"0\":{\"index\":23,\"indicator\":\"ClassC Time\",\"month\":201611,\"ww\":201648,\"test_time\":0.0,\"p\":48.0,\"Product\":\"RB\"},\"1\":{\"index\":24,\"indicator\":\"ClassC\",\"month\":201612,\"ww\":201649,\"test_time\":47.4...
2017/05/03
[ "https://Stackoverflow.com/questions/43749836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7892936/" ]
You can use Jquery like this ```js $(document).ready(function(){ var id_num = 0; // define the id number $('#show').on('click',function(){ id_num++; // add +1 to the id number $('#' + id_num).show(); // show tr with that id ...
``` var count = 0; $("show").on("click",function(ev){ ev.preventDefault(); if(count > 5) return; count++; $("#"+count).show(); }) $("#hide").on("click",function(ev){ ev.preventDefault(); if(count<=0) return; $("#"+count).hide(); count--; }) ```
105,975
Currently in my tray I have: - wireless network connection ... with a troubled signal - local area connection (disconnected) - safely remove hardware - Nokia PC suite - that little grey speaker - on AC power - some weird printer icon - ActionOutline - AdVantage (I have no idea what this is .....
2010/02/07
[ "https://superuser.com/questions/105975", "https://superuser.com", "https://superuser.com/users/2127/" ]
In the taskbar and Start Menu properties, there is an option called **hide inactive icons** which may be what you're after: ![alt text](https://i.stack.imgur.com/CFRZu.png) After you have a certain amount of icons in the tray, it will hide the inactive ones so it doesn't take up as much space.
One thing to double check is that for each of the applications that shows an icon check to see if there's an option within the application itself to turn the icon off. If there is clear it. Also if you don't know what the application is (e.g. AdVantage) why not uninstall it? Though on second thoughts you ought to chec...
105,975
Currently in my tray I have: - wireless network connection ... with a troubled signal - local area connection (disconnected) - safely remove hardware - Nokia PC suite - that little grey speaker - on AC power - some weird printer icon - ActionOutline - AdVantage (I have no idea what this is .....
2010/02/07
[ "https://superuser.com/questions/105975", "https://superuser.com", "https://superuser.com/users/2127/" ]
In the taskbar and Start Menu properties, there is an option called **hide inactive icons** which may be what you're after: ![alt text](https://i.stack.imgur.com/CFRZu.png) After you have a certain amount of icons in the tray, it will hide the inactive ones so it doesn't take up as much space.
Mike Lin offers a little utiliy on his website, called TraySaver: > > **[TraySaver](http://www.mlin.net/other.shtml)** is a System Tray Manager. It allows you to hide system > tray icons, restores icons normally > lost when Explorer crashes, and > enables any window to be minimized to > the tray. This gives you a...
105,975
Currently in my tray I have: - wireless network connection ... with a troubled signal - local area connection (disconnected) - safely remove hardware - Nokia PC suite - that little grey speaker - on AC power - some weird printer icon - ActionOutline - AdVantage (I have no idea what this is .....
2010/02/07
[ "https://superuser.com/questions/105975", "https://superuser.com", "https://superuser.com/users/2127/" ]
In the taskbar and Start Menu properties, there is an option called **hide inactive icons** which may be what you're after: ![alt text](https://i.stack.imgur.com/CFRZu.png) After you have a certain amount of icons in the tray, it will hide the inactive ones so it doesn't take up as much space.
There is also the [Tray It!](http://www.teamcti.com/trayit/trayit.htm). The program is free and has a reasonable memory footprint. It's made to put custom icons in the tray bar, but it has also an option to remove unwanted symbols. It won't hide some of the system symbols though (like the wifi indicator).
105,975
Currently in my tray I have: - wireless network connection ... with a troubled signal - local area connection (disconnected) - safely remove hardware - Nokia PC suite - that little grey speaker - on AC power - some weird printer icon - ActionOutline - AdVantage (I have no idea what this is .....
2010/02/07
[ "https://superuser.com/questions/105975", "https://superuser.com", "https://superuser.com/users/2127/" ]
One thing to double check is that for each of the applications that shows an icon check to see if there's an option within the application itself to turn the icon off. If there is clear it. Also if you don't know what the application is (e.g. AdVantage) why not uninstall it? Though on second thoughts you ought to chec...
Mike Lin offers a little utiliy on his website, called TraySaver: > > **[TraySaver](http://www.mlin.net/other.shtml)** is a System Tray Manager. It allows you to hide system > tray icons, restores icons normally > lost when Explorer crashes, and > enables any window to be minimized to > the tray. This gives you a...
105,975
Currently in my tray I have: - wireless network connection ... with a troubled signal - local area connection (disconnected) - safely remove hardware - Nokia PC suite - that little grey speaker - on AC power - some weird printer icon - ActionOutline - AdVantage (I have no idea what this is .....
2010/02/07
[ "https://superuser.com/questions/105975", "https://superuser.com", "https://superuser.com/users/2127/" ]
One thing to double check is that for each of the applications that shows an icon check to see if there's an option within the application itself to turn the icon off. If there is clear it. Also if you don't know what the application is (e.g. AdVantage) why not uninstall it? Though on second thoughts you ought to chec...
There is also the [Tray It!](http://www.teamcti.com/trayit/trayit.htm). The program is free and has a reasonable memory footprint. It's made to put custom icons in the tray bar, but it has also an option to remove unwanted symbols. It won't hide some of the system symbols though (like the wifi indicator).
105,975
Currently in my tray I have: - wireless network connection ... with a troubled signal - local area connection (disconnected) - safely remove hardware - Nokia PC suite - that little grey speaker - on AC power - some weird printer icon - ActionOutline - AdVantage (I have no idea what this is .....
2010/02/07
[ "https://superuser.com/questions/105975", "https://superuser.com", "https://superuser.com/users/2127/" ]
There is also the [Tray It!](http://www.teamcti.com/trayit/trayit.htm). The program is free and has a reasonable memory footprint. It's made to put custom icons in the tray bar, but it has also an option to remove unwanted symbols. It won't hide some of the system symbols though (like the wifi indicator).
Mike Lin offers a little utiliy on his website, called TraySaver: > > **[TraySaver](http://www.mlin.net/other.shtml)** is a System Tray Manager. It allows you to hide system > tray icons, restores icons normally > lost when Explorer crashes, and > enables any window to be minimized to > the tray. This gives you a...
10,961
I'm looking for a SharePoint (MOSS) shared hosting provider that supports deployment of custom solutions (.WSPs) - it'd be okay if it was medium trust. I'm building a public Internet site on SP and the client doesn't want to host it or pay for the license all up front. Any suggestions? [Previously asked on SO - no goo...
2009/05/21
[ "https://serverfault.com/questions/10961", "https://serverfault.com", "https://serverfault.com/users/1694/" ]
MOSSHosting, Rackspace, and FpWeb are all capable hosters - hopefully you can work out a plan that works. The thing that makes MOSS hosting with SharePoint Server 2007 is that the web applications share execution space, and just as Aaron answered, deployed code for one application can affect another, peer application....
The hosting provider [Mosshosting.com](http://www.mosshosting.com/) is pretty highly recommended. Do they offer what you are looking for? It will be hard to find the flexibility you need without hosting it yourself.
10,961
I'm looking for a SharePoint (MOSS) shared hosting provider that supports deployment of custom solutions (.WSPs) - it'd be okay if it was medium trust. I'm building a public Internet site on SP and the client doesn't want to host it or pay for the license all up front. Any suggestions? [Previously asked on SO - no goo...
2009/05/21
[ "https://serverfault.com/questions/10961", "https://serverfault.com", "https://serverfault.com/users/1694/" ]
MOSSHosting, Rackspace, and FpWeb are all capable hosters - hopefully you can work out a plan that works. The thing that makes MOSS hosting with SharePoint Server 2007 is that the web applications share execution space, and just as Aaron answered, deployed code for one application can affect another, peer application....
It is probably going to be really hard to find a hosting company that will allow you to upload and deploy your own custom WSP in a shared environment. This is because by uploading a WSP you can run code with really high privileges which can result in a security breach and/or performance issue. The recommended approach...
49,952,752
I have the following code which throws the following error ``` engine = create_engine('postgresql+psycopg2:....', convert_unicode=True) metadata = sqlalchemy.MetaData() table = sqlalchemy.Table('omni.all_order', metadata, sqlalchemy.Column('o_id', sqlalchemy.Integer), sqlalchemy.Column('order', sqlalchemy.St...
2018/04/21
[ "https://Stackoverflow.com/questions/49952752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4965791/" ]
Pass the table's schema using the [`schema=`](http://docs.sqlalchemy.org/en/latest/core/metadata.html#sqlalchemy.schema.Table.params.schema) keyword argument instead of including it in the table's name: ``` table = sqlalchemy.Table('all_order', metadata, sqlalchemy.Column('o_id', sqlalchemy.Integer), sqlalchem...
I had the same problem and I found the solution in this link: <https://dba.stackexchange.com/questions/192897/postgres-relation-does-not-exist-error>. When you create the table name from a variable, the name is passed with quotes, so the name is case sensitive and need the quotes when you called again.
1,867,626
> > Find the maximum value that the quantity $2m+7n$ can have such that there exist distinct positive integers $x\_i$ $(1 \leq i \leq m)$, $y\_j$ $(1 \leq j \leq n)$ such that the $x\_i$'s are even, the $y\_j$'s are odd, and $\displaystyle \sum\_{i = 1}^m x\_i+\sum\_{j=1}^n y\_j = 1986$. > > > We see that $\displa...
2016/07/22
[ "https://math.stackexchange.com/questions/1867626", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297795/" ]
Your sum of the $x$'s is not correct. You should have $\displaystyle \sum\_{i = 1}^m x\_i \geq 2+4+\cdots+2m = \dfrac{(2m+2)m}{2} = m(m+1)$ You must have $n$ even-why? You are maximizing $2m+7n$ subject to $m(m+1)+n^2 \le 1986$. Clearly we must have $n \le \lfloor \sqrt 1986 \rfloor=44$ The simple approach is to step $...
Alternatively, rewrite $m(m+1)+n^2\leq 1986$ as $(2m+1)^2+(2n)^2\leq 4\cdot 1986+1=7945$. By the Cauchy-Schwarz Inequality, $$\begin{align} (2m+7n)+1=(2m+1)+\frac{7}{2}(2n) &\leq \sqrt{1^2+\left(\frac{7}{2}\right)^2}\,\sqrt{(2m+1)^2+(2n)^2} \\ &\leq\sqrt{\frac{53}{4}}\,\sqrt{7945}<325\,. \end{align}$$ Thus, $$2m+7n<324...