qid int64 10 74.7M | question stringlengths 15 26.2k | date stringlengths 10 10 | metadata list | response_j stringlengths 27 28.1k | response_k stringlengths 23 26.8k |
|---|---|---|---|---|---|
24,235,467 | I am writing some program to get the list of shortcut files on Desktop.
and I find some strange things about this.
Most programs will create shortcut files on Windows Desktop like "Mozilla Firefox.lnk" or "Google Chrome.lnk" after installed. I can see these shortcuts on Desktop and use them to launch programs.
But... | 2014/06/16 | [
"https://Stackoverflow.com/questions/24235467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351537/"
] | The answer is:
Some lnk files are in the "All Users\Desktop" folder
not in the current user's Desktop
Thanks to @DanielA.White | I know this is a really old thread, but I thought I'd share anyway. I had a .Ink file on my desktop that would not delete. After trying to delete it a number of times in different ways I decided to just right click the desktop and click refresh. It disappeared! Sounds too easy to be true doesn't it? |
1,824,214 | Is there any way to open the YouTube app from my app, with a defined search query?
If not, is there a way to just *open* YouTube, without playing any video?
All I'm finding is ways to play videos. | 2009/12/01 | [
"https://Stackoverflow.com/questions/1824214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87158/"
] | You can use [*event delegation*](https://stackoverflow.com/questions/1687296/what-is-dom-event-delegation) for that. Basically you add one clickhandler to your table. This handler reads out the tagname of the clicked element and moves up the DOM tree until the containing row is found. If a row is found, it acts on it a... | The `this` keyword can be used to get the `parentNode` of the cell, which is a `<tr>` element. The `<tr>` element has a property for the row number, `.rowIndex`.
The Event:
----------
```
onclick='fncEditCell(this)'
```
The Function:
-------------
```
window.fncEditCell = function(argThis) {
alert('Row number ... |
31,632,922 | The situation
-------------
In table I have columns configurated as `ENUM('0','1')`. I have select query build with PDO like this example
```
$value = isset($_POST['value']) ? $_POST['value'] : (isset($_GET["value"]) ? $_GET["value"] : null);
$sql = $pdo->prepare("SELECT * FROM tablename WHERE column = :value");
$sq... | 2015/07/26 | [
"https://Stackoverflow.com/questions/31632922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4530969/"
] | To make sure `num` is a whole number, without having to define all possibilities, use:
```
if (num % 1 == 0)
``` | You have to edit the "If" loop:
```
if (num == 1 || num == 2 || num == 3 || num == 4 || num == 5)
``` |
10,554 | I claim that it is commonly believed that Mathematical objects can be seen as genuinely static, with no "Platonic" time in which they do genuinely evolve.
Nevertheless time has its place in mathematics:
1. An [endomorphism](https://en.wikipedia.org/wiki/Endomorphism) of a set (seen as a set of states of a system) int... | 2010/11/16 | [
"https://math.stackexchange.com/questions/10554",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1792/"
] | I wish I had this reference handy, but Atiyah said something to the effect that algebra is about time and geometry is about space. The "processes" in mathematics are, in the broadest sense, the things concerned with time. (This doesn't take into account the idea of "reification", the transformation of a process into an... | If you consider TCS to be maths, then formal semantics, in particular small-step or big-step semantics, might be of interest. Those map input data and a series of operations to a sequence of universes/states, on per time step. |
43,984,504 | I am having a Dictionary which have multiple values for each key. Now, I need to get the count of each distinct value instance for that key.
lets say
```
dict(key, list{value}) = ({1,{1,1,2,3,3}},{2,{1,1,1,2,3,3}})
```
I need
```
count of 1 for key 1 : 2
count of 2 for key 1 : 1
count of 3 for key 1 : 2
```
I ... | 2017/05/15 | [
"https://Stackoverflow.com/questions/43984504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7643826/"
] | Well, problem was solved by simply deleting everything related to vue-cli installed before. And re-installing vue-cli. | I have faced simillar issue and re-installing vue-cli didn't work for me. Strange thing is vue and vue-cli get installed successfully but once I tried to create project by using below command
```
vue init webpack myfirstproject
```
I get below error:
```
'vue' is not recognized as an internal or external comman... |
28 | And other than public domain science fiction, how can I track down Creative Commons science fiction that is safe for re-mixing, i.e. fan fic? | 2011/01/11 | [
"https://scifi.stackexchange.com/questions/28",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/10/"
] | The [Dryden Experiment](https://web.archive.org/web/20140510000931/http://www.thedrydenexperiment.com/) is an entirely Creative Commons 3.0 driven universe. | The universe I created in Blaze Master Mysterium of the Universe is safe for use in your fanfictions, if you like my stories feel free to use the world and settings, I am a little attached to the main character though, but feel free to use the rest, just credit me on the ideas you use. |
3,309,754 | 1. Is the series $$\sum\_{k=1}^{\infty} \frac{\sqrt{k}}{k^2+1}$$ convergent?
This behaves similar to $\frac{\sqrt{k}}{k^2} = \frac{1}{k^{3/2}}$ so do we use the comparison test??? | 2019/07/31 | [
"https://math.stackexchange.com/questions/3309754",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/619325/"
] | Note that for all $k\geq 1$,
$$
0\leq\frac{\sqrt{k}}{k^{2}+1}\leq\frac{\sqrt{k}}{k^{2}}=\frac{1}{k^{3/2}}.
$$
The series
$$
\sum\_{k=1}^{\infty}\frac{1}{k^{3/2}}
$$
converges since $3/2>1$. Therefore, by the Basic Comparison test, your series also converges. | Yes, since $\frac{\sqrt{k}}{k^2+1} \le \frac{\sqrt{k}}{k^2}$, this is exactly the right approach. Then use the $p$-series test. |
55,011,646 | 1st week into a JS and trying to solve first Kata in CodeWars.
Your task is to write a function that takes a string and return a new string with all vowels removed.
For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!".
My code:
```js
function disemvowel(str) {
var newStr... | 2019/03/05 | [
"https://Stackoverflow.com/questions/55011646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11156342/"
] | Some annotations:
* declare `i`,
* loop until `i < str.length`, because arrays and strings are zero based,
* take a string for checking a character with [`String#includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes),
* use a single character by taking a [property ... | My Solution !
```
function disemvowel(str) {
let newStr = (str.replace(/A|E|I|O|U|a|e|i|o|u/g, ''))
return newStr;
}
``` |
67,405,791 | I just updated Android Studio to version 4.2. I was surprised to not see the Gradle tasks in my project.
In the previous version, 4.1.3, I could see the tasks as shown here:
[](https://i.stack.imgur.com/7fhMP.png)
But now I only see the dependencies in ... | 2021/05/05 | [
"https://Stackoverflow.com/questions/67405791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4424400/"
] | **Solution 1:**
You can alternatively use the below gradle command to get all the tasks and run those in terminal
```
./gradlew tasks --all
```
**Solution 2.**
You can also create run configuration to run the tasks like below:
Step 1:
[](https:/... | I had a similar issue and I solved it by executing the following terminal command in my Android Studio Terminal:
```
./gradlew tasks --all
``` |
67,045,725 | Hi i'm new to python and i am having issues with exceptions. i have added an exception but it is not working. Below is a sample of my problem.
```
if x == '1':
print("----------------------------------")
print("1. REQUEST FOR A DOG WALKER")
print("----------------------------------")
try:
... | 2021/04/11 | [
"https://Stackoverflow.com/questions/67045725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7174831/"
] | Whenever you use a try/except statement you are trying to catch something happening in the code the shouldn't have happened. In your example, you are haveing the user enter a number for a duration:
```
print("Select a Duration (in hours) - eg 2")
duration = input()
```
At this point, duration might equal something l... | There is nothing in your code that can produce `ValueError`.
So the `except ValueError:` is not matched. |
145,563 | Scenario:
I was unemployed from January through July 2021.
I started new job at the end of July 2021.
Employer allows me to join 401k plan after 90 days, which means I’m enrolled starting November 1, 2021.
On a 40 hour week, paid hourly, assuming no vacations taken/holidays taken (as they are unpaid), my income would m... | 2021/10/12 | [
"https://money.stackexchange.com/questions/145563",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/106986/"
] | >
> So my question is... suppose a stock price were to continuously drop despite high company performance (profits)... Is there something the shareholders can do to get some share of the profits?
>
>
>
This seems like a faulty premise. The stock price is based on the market's estimate of the company's future prosp... | A dollar bill has the same intrinsic value as a 100 dollar bill yet I'm sure you'd rather have someone give you the latter; the entire premise of this question is completely flawed. Perception is reality, and in everyday life you will constantly encounter countless things with low intrinsic value yet are highly valued,... |
343,896 | While easy on Linux, not as easy on Windows from what I've been able to gather so far. I've found the command that kinda does what I want which is:
```
net user username /domain
```
However I wish to strip all of the data except for the list of the groups. I think findstr may be the answer but I'm not sure of how to... | 2011/10/07 | [
"https://superuser.com/questions/343896",
"https://superuser.com",
"https://superuser.com/users/100387/"
] | ```
dsquery user -name "My Full Name" | dsget user -memberof | dsget group -samid
```
I found this pretty much gives me what I was looking for, in case anyone was curious! :) | Use PowerShell!
```
$user = [wmi] "Win32_UserAccount.Name='JohnDoe',Domain='YourDomainName'"
$user.GetRelated('Win32_Group')
```
or only for group names:
```
$user = [wmi] "Win32_UserAccount.Name='JohnDoe',Domain='YourDomainName'"
$user.GetRelated('Win32_Group') | Select Name
```
<http://social.technet.microsoft.... |
42,630,042 | I have set up a stored procedure which I am passing a data table into and calling directly from Entity Framework.
I have created a Type with the following sql:
```
CREATE TYPE Regions AS TABLE
( RegionId int,
Region varchar(max),
BodyId ... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42630042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390501/"
] | Try this approach:
```
//create parameter
var param = new SqlParameter("@regions", SqlDbType.Structured);
param.Value = myDataTable;
param.TypeName = "dbo.Regions";
//return result set
return _context.ExecuteFunction<RegionDetails>("dbo.Regions", param);
//OR
//execute stored procedure for inserts, returns r... | Answer based on @SteveD's answer but to clarify exactly what I did incase it helps any one else.
There was nothing wrong with my stored procedure. It was purely my calling of it. It needed the parameter name in the actual call like so:
```
SqlParameter param = new SqlParameter();
param.SqlDbType = SqlDbTy... |
68,218,092 | I'm trying to do cost optimization to reduce the cost of using AWS resources by stopping EC2 and RDS instance when they are not in use.
I managed to create a scheduler using AWS CloudFormation service, and the instances are stopping according to the scheduler configurations but the problem is that after the instance g... | 2021/07/01 | [
"https://Stackoverflow.com/questions/68218092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5692288/"
] | You **can't stop** instances in Elastic Beanstalk (EB) by just stopping, as they run in [AutoScaling Group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html). So once you stop the instance, ASG will launch a replacement, which is expected.
The proper way to stop the instances ... | I would like to thank @**Marcin** and @**Jatin** for their answers.
>
> Notes:
>
>
>
* Detaching EC2 instance without setting the Desired capacity and
Minimum capacity to 0 won't help because ASG will launch a new
instance.
* If you set Desired capacity and Minimum capacity to 0 instance will
get terminated autom... |
9,629,659 | Say I have an appropriately sized image inside an `Image()`
I want to change the Thumb or Knob of the `JScrollBar` component to be this image.
I know I need to subclass the `ScrollBarUI`
Here is where I am at right now.
```
public class aScrollBar extends JScrollBar {
public aScrollBar(Image img) {
supe... | 2012/03/09 | [
"https://Stackoverflow.com/questions/9629659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/625562/"
] | i am using this for sending email, in ASP.net MVC3
```
System.Web.Helpers.WebMail.SmtpServer = smtp_server;
System.Web.Helpers.WebMail.SmtpPort = smtp_port;
System.Web.Helpers.WebMail.EnableSsl = true;
System.Web.Helpers.WebMail.From = "fromaddress";
StringBuilder sb = n... | It look like you are trying to send emails through GMail's SMTP service, which this SO question already covers: [Sending email in .NET through Gmail](https://stackoverflow.com/questions/32260/sending-email-in-net-through-gmail)
The only thing that looks missing in your code is that you've set `client.UseDefaultCredent... |
5,366,761 | I have an app that speaks words. However, when word B is pressed, I want to stop word A. Is there a way to do that? This is my code for speaking the words:
```
-(IBAction)sayIt:(id)sender
{
//NSLog(@"%s", __FUNCTION__);
CFBundleRef mainBundle = CFBundleGetMainBundle();
FlashCardsAppDelegate *mainDelegate = (FlashCards... | 2011/03/20 | [
"https://Stackoverflow.com/questions/5366761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542019/"
] | Sadly, there isn't one at the moment, although a lot of people would love there to be one. My advice to anyone who asks this question is to simply output the report as a PDF on the server, and host it in an Iframe overlayed on your application (or hosted in the WebBrowser control if running outside the browser). I incl... | There is no free viewer I am aware of, but commercially you have this - <http://www.perpetuumsoft.com/Silverlight-Viewer-for-Reporting-Services.aspx> |
20,628,525 | I have a small script.
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$( "p" ).first().replaceWith("Hello world!");
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is anothe... | 2013/12/17 | [
"https://Stackoverflow.com/questions/20628525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1455347/"
] | According to performance test [found here](http://jsperf.com/jquery-first-vs-first-selector) the second way (`$("p").first();`) is much faster. | First on `:filter` is slower as it includes sizzler library. which needs to do extra work.
[Here is a test to run and see performance](http://jsperf.com/eq-vs-eq) |
9,594,482 | Running Mac Eclipse Helios SR2, the menu that appears on `command`-hovering over a method sometimes comes up empty instead of the usual Declaration/Implementation option:

The last time this happened, it went back to normal after a few days with no obvious i... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9594482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/85950/"
] | There is a CTags package for Sublime Text that makes it possible to use a project level ~~.ctags~~ `.tags` index file to jump to the definition of the symbol under the cursor by hitting `ctrl`+`t` twice: <https://github.com/SublimeText/CTags> | For Python,
I added the project to sublime.
I press `CTRL+R` and then start typing the name of my function. The cursor then points to the beginning of function definition.
Hope this helps. |
22,273,504 | I have a list of categories and items, and I want to return only the categories that have one type of Item. For instance:
Stuff table:
```
Cat 1 | Item 1
Cat 1 | Item 1
Cat 1 | Item 2
Cat 1 | Item 2
Cat 1 | Item 3
Cat 1 | Item 3
Cat 1 | Item 3
Cat 2 | Item 1
Cat 2 | Item 1
```
I would like to return
```
Cat 2 | ... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22273504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1629047/"
] | You should remove `item` from your `GROUP BY` clause and run this instead:
```
SELECT category, MAX(item)
FROM stuff
GROUP BY category
HAVING COUNT(DISTINCT item) = 1
```
Example [SQLFiddle](http://sqlfiddle.com/#!6/e1f4aa/1).
Otherwise, each group returned from the `GROUP BY` clause will naturally have exactly one... | Possibly your database does not allow you to have a variable in the select that is neither in the group by nor aggregated.
Taking advantage that there is only one item, you could try:
```
SELECT category, MIN(item) AS item
FROM stuff
GROUP BY category
HAVING Count(Distinct item) = 1
``` |
3,681 | There is the concept of faith (śraddhā) in Buddhism. There is also the concept of faith found in Christianity. Both concepts have been translated into the English word faith but in what ways are the concepts different and also are there ways in with the concepts have similarities.
I'd find it particularly interesting... | 2014/09/20 | [
"https://buddhism.stackexchange.com/questions/3681",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/157/"
] | There's [a Wikipedia article here](http://en.wikipedia.org/wiki/Faith_in_Christianity#New_Testament) about the word "faith" in Christianity; which begins,
>
> The word "faith", translated from the Greek πιστις (pi'stis), was primarily used in the New Testament with the Greek perfect tense and translates as a noun-ver... | The role of faith is as follows:
* Other teachings: unquestioned belief in a dogma or central teaching, which cannot be verified through practice, which cannot be questioned or scrutinised, and which generally is a promise after death that cannot be realized within this lifetime and experienced here and now. Also here... |
30,474,008 | I am using cells with two heights based on some status.
When start is **StatusAwarded** it shows full cell else it will show a part of it.
Here is the code to achieve this.
```
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
SomeClass *someClass = dataArray[index... | 2015/05/27 | [
"https://Stackoverflow.com/questions/30474008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2099097/"
] | I found a similar [question](https://stackoverflow.com/a/35580597/1334228). In which the solution is explained better by @augusto-goncalves. His solution works for me. It is similar to the solution of @victor-behar but more elaborated and clears confusion. | There's also a way to transpile scss in express using node sass middleware, for example <https://github.com/sass/node-sass-middleware>.
That way you can override bootstrap scss. You can do the same for JS with webpack: transpile client-side js and then include the bundle.js in your frontend. |
1,416,113 | Data I possess: Transaction Date (A:A), Customer Name (B:B), Sales Order Number (C:C), Product Name (D:D), Units (E:E), Revenue (F:F)
New order would be anything that the customer hasn't ordered in the past 6 months or ever.
A reorder would be if the customer had purchased that specific product in the past 6 months.
... | 2019/03/21 | [
"https://superuser.com/questions/1416113",
"https://superuser.com",
"https://superuser.com/users/1010291/"
] | Perhaps I’m misunderstanding something, but this seems to be fairly simple.
My understanding of the question is that a row represents a reorder
if there is at least one row above the current one
that has the same Customer Name (Column `B`) as the current row,
the same Product Name (Column `D`), and a Transaction Date ... | *My approach is bit different to solve the issue, since I've picked OP's thread,,*
1. **New order would be anything that the customer
hasn't ordered in the past 6 months or ever.**
2. **A reorder would be if the customer had
purchased that specific product in the past
6 months.**
---
[![enter image descriptio... |
17,760,311 | How to go about mimicking ::MessageBox() behavior in a custom popup(WS\_POPUP) window, where the popup window waits for user click on one of the buttons and return the result of the click ? like in a ::MessageBox() when you have MB\_YESNO in uType and handle to the owner window is supplied, it returns either ID\_YES or... | 2013/07/20 | [
"https://Stackoverflow.com/questions/17760311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1414923/"
] | DialogBox() is the core winapi function.
If you want to completely spin your own then you must:
1. iterate all top-level windows on the thread with EnumThreadWindows() and disable them with EnableWindow
2. run a message loop with GetMessage + DispatchMessage
3. add an exit condition to that loop, using a variable tha... | When you handle button's `BN_CLICKED` notification, delivered to the owner window via `WM_COMMAND` message, a call of [`EndDialog(m_hWnd, IDYES)`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms645472%28v=vs.85%29.aspx) ends dialog box and supplies the API with a value (`IDYES`) to return to higher level cal... |
29,876,631 | I'm trying to simplify Parcelable code in Kotlin:
```
public class C() : Parcelable {
var b1: Boolean = false
var b2: Boolean = false
var b3: Boolean = false
var i1: Int = 0
var i2: Int = 0
val parcelBooleans = listOf(b1, b2, b3)
val parcelInts = listOf(i1, i2)
override fun writeToPa... | 2015/04/26 | [
"https://Stackoverflow.com/questions/29876631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/600351/"
] | ***NOTE:*** *The question is not clear if the author is trying to mutate properties `b1`, `b2`, `b3` via a reference within the list. Or if he is trying to modify the contents of list `parcelBooleans` which is a copy of the values from the properties. If the first, see answer from @Bashor (or just make the values of th... | A way to do it is to map each value:
```
parcelBooleans = parcelBooleans.map{ p.readBoolean() }
```
You have to make `parcelBooleans` a mutable variable, though. |
936,241 | If I have code like this:
```
<script>
function determine()
{
// ????
}
</script>
<a href="blah1" onclick="determine()">blah1</a>
<a href="blah2" onclick="determine()">blah2</a>
```
Is there a way in `determine()` to see which link was clicked?
(Yes, I know, the easy and correct thing to do would be to pass `t... | 2009/06/01 | [
"https://Stackoverflow.com/questions/936241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57120/"
] | You can with straight up JavaScript, but I prefer to use something like jQuery:
```
<a href="blah1">blah1</a>
<script type="text/javascript">
$('a[href=blah1]').click(function() {
var link = $(this); // here's your link.
return false; // acts like the link was not clicked. return true to carry out the click... | Another solution:
Add an onclick handler to the document. When a user clicks the link, the click event will "bubble" up to the window, and you will have access to the event to determine which link was clicked.
This might be useful if you only want the code to run for those links that already have onclick="determine()... |
26,285,183 | I create a new activity (when the timer ended), but it didn't show, because my app was minimized. How can I fix it? | 2014/10/09 | [
"https://Stackoverflow.com/questions/26285183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4126554/"
] | in your onResume of the parent activity from where you are firing the intent check if timer has finished or not. if yes then fire the intent from onResume() itself.
In this was if the app was minimised and user enters the app again he will directly navigated to the fired intent activity . | When your activity is minimized then all the operations that you perform in code are not executed as the application goes to PAUSE state. Better you start an SERVICE when your timer count ends and from that particular SERVICE do what you want to do.
Advantage:
Service will never go to halt state when your application ... |
56,347,818 | I am trying to split a string of nucleotides in a way that allows me to find the outlier in the center of the nucleotide sequence, and turn it into a triplet by adding "n" to fill in the gaps.
I have tried splitting by number of characters, but the problem is that it happens from left to right, and I have been trying ... | 2019/05/28 | [
"https://Stackoverflow.com/questions/56347818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10577019/"
] | Apparently the WebSocket functionality was added in FastAPI 0.24, which was just released. I was using an older version. | run `pip install websockets` and configure it as following:
```
from fastapi import FastAPI, WebSocket
@app.websocket("/ws")
async def send_data(websocket:WebSocket):
print('CONNECTING...')
await websocket.accept()
while True:
try:
await websocket.receive_text()
resp = {
... |
6,476,736 | I have a big winform with 6 tabs on it, filled with controls. The first tab is the main tab, the other 5 tabs are part of the main tab. In database terms, the other 5 tabs have a reference to the main tab.
As you can imagine, my form is becoming very large and hard to maintain. So my question is, how do you deal with ... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6476736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40676/"
] | Consider your aim before you start. You want to aim for [SOLID principles](http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29), in my opinion. This means, amongst other things, that a class/method should have a **single responsibility**. In your case, your form code is probably coordinating UI stuff *and* ... | I would suggest you to read about the CAB ( Composite UI Application Block ) from Microsoft practice and patterns, which features the following patterns : Command Pattern, Strategy Pattern, MVP Pattern ... etc.
[Microsoft Practice and patterns](http://msdn.microsoft.com/en-us/practices/bb190351)
[Composite UI Applica... |
106,947 | The WLAN module of my RPI 4 B+ disappeared. At first I thought that the hardware component had blown. How can I properly diagnose whether there is a hardware or software problem?
What I have done for diagnosting so far:
```
# uname -a
Linux xxx 4.19.88-1-ARCH #1 SMP PREEMPT Wed Dec 11 20:19:41 UTC 2019 armv7l GNU/Lin... | 2020/01/05 | [
"https://raspberrypi.stackexchange.com/questions/106947",
"https://raspberrypi.stackexchange.com",
"https://raspberrypi.stackexchange.com/users/-1/"
] | A little research reveals that the RPI4 is using the dual band wifi-chipset Cypress [CYW43455](https://github.com/sakaki-/genpi64-overlay/blob/master/README.md). I assume the chipset must be initialized in the early userland to work properly.
After encrypting the root partition the drivers can't be accessed from the e... | I can confirm that the missing .txt file needs to be included in the initramfs image. You can confirm this by reloading the driver once the system has fully booted and all the firmware files are available:
```
# rmmod brcmfmac
# modprobe brcmfmac
```
This got the `wlan0` device appearing for me, and `dmesg` reported... |
228,229 | Is it possible to divide a matrix by another? If yes, What will be the result of $\dfrac AB$ if
$$
A = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix},
B = \begin{pmatrix}
w & x \\
y & z \\
\end{pmatrix}?
$$ | 2012/11/03 | [
"https://math.stackexchange.com/questions/228229",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/33634/"
] | There is a way to perform a sort of division , but I am not sure if it is the way you are looking for. For motivation, consider the ordinary real numbers $\mathbb{R}$. We have that for two real numbers, $x/y$ is really the same as multiplying $x$ and $y^{-1}=1/y$. We call $y^{-1}$ the inverse of y, and note that it has... | There are two issues: first, that matrices have divisors of zero; second, that matrix multiplication is in general not commutative.
To give meaning to $A/B$, you need to give meaning to $I/B$ (because then $A/B=A(I/B)$. Now, no one ever writes $I/B$, people actually write $B^{-1}$. Anyway, what is $B^{-1}$? It should... |
47,657,851 | I am trying to make my code better, as every beginner I have problem to make it more "systematic", I would like your advice on how to do it.
I open few workbook, so now my macro looks like this.
```
Sub OpenWorkbooks()
workbooks.Open Filename :="C/.../file1.xlsx"
workbooks.Open Filename :="C/.../file2.xlsx"
wor... | 2017/12/05 | [
"https://Stackoverflow.com/questions/47657851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6457870/"
] | To answer the first part of your question:
```
Sub OpenWorkbooks()
For i = 1 to 3 ' Loop 3 times
Workbooks.Open Filename:=Sheet1.cells(i,1).value
'Cells refers to Row and column, so i will iterate three times while keeping the column the same.
Next i
End sub
```
If you don't know how many loops you will wa... | I had to figure out how do something similar recently. Try this ...
```
Dim i As Long
Dim SelectedFiles As Variant
SelectedFiles = Application.GetOpenFilename("Excel Files (*.xlsx), *.xlsx", _
Title:="Select files", MultiSelect:=True)
If IsArray(SelectedFiles) Then
For i = LBound(SelectedFiles) To UBound(Sel... |
60,727,208 | I was trying to install one of my go files. But I bumped into this error
```
C:\mygoproject>go install kafkapublisher.go
\#command-line-arguments
.\kafkapublisher.go:8:65: undefined: kafka.Message
.\kafkapublisher.go:10:19: undefined: kafka.NewProducer
.\kafkapublisher.go:10:38: undefined: kafka.ConfigMap
.\kafkap... | 2020/03/17 | [
"https://Stackoverflow.com/questions/60727208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12816111/"
] | I already figured out this one. I installed Confluent's Kafka Go Client.
Instructions are here: <https://docs.confluent.io/current/clients/go.html#>
The library is not supported on windows though, so I had to use virtual machine (Oracle VM Box) to build and run my code.
I also needed to compile and install librdkafka... | CGO\_ENABLED=1 go build -ldflags"$(shell ./build/scripts/go-build-ldflags.sh $(MODULE\_ROOT)/ldflags)" -o bin/XXX/main.go
tips:
test in mac & linux os ,as for reason,i think it depends on some C language library |
42,646,168 | This question **is not** a copy of another: I have an issue that I don't find somewhere else.
I want to convert a date as `String` to the `Date` format. This `String` date is supposed to be the same format as `Date` because I used to upload it as String in a database. Here is what the `String` date looks like:
"201... | 2017/03/07 | [
"https://Stackoverflow.com/questions/42646168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6855056/"
] | Use `yyyy-MM-dd HH:mm:ss Z` not `yyyy-MM-dd hh:mm:ss Z`.
Because `hh` for ***hour in am/pm (1~12).***
You also can do with: `yyyy-MM-dd HH:mm:ss xxxx` or `yyyy-MM-dd HH:mm:ss XXXX`, etc.
[Read more](http://userguide.icu-project.org/formatparse/datetime) | Try this...
```
let beginDateString: String = "2017-03-10 22:16:00 +0000"
let df: DateFormatter = DateFormatter()
df.dateFormat = "yyyy-MM-dd HH:mm:ss Z"
if let beginDate = df.date(from: beginDateString)
{
print(beginDate)
}
```
And as @javimuu said you have to change your template. |
334,059 | This is my first time using LaTeX and I am running into the following issue:
I am trying to denote a set of functions `x_t` which belong to `K` but for some reason the entire sentence gets italicized. I have attached screenshots of my code as well as the compiled result. Can anyone help me fix this? Cheers
[![enter ... | 2016/10/14 | [
"https://tex.stackexchange.com/questions/334059",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/116354/"
] | That code is surely giving you errors when you compile, which will be telling you at least something about the problem. TeX will complain about missing `$` signs and add them in, but it can only guess where to put them.
You want everything from `f_{t}` to `\mathbb{R}`between one set of `$ ... $` and then from `x_{t}`... | `<rant>`
As a regular user of Mathematics.SE, I'm really impressed about the poor quality of TeX/LaTeX input. I acknowledge that some compromise with the limited possibilities offered by MathJax is necessary, but when I see
```
$\rm\ (p-1)!\ mod\ p\:$
```
written by a high rep user, my heart bleeds. Apart from th... |
19,634,454 | I am trying get **confirmation** message **while click** on **delete** button in **GridView**. If I **conform** only the row will be delete in **GridView**.
\***.ASPX**
```
<Columns>
<asp:CommandField ButtonType="Button" ShowDeleteButton="true" />
</Columns>
```
\***.ASPX.CS**
```
protected void grdPersTab... | 2013/10/28 | [
"https://Stackoverflow.com/questions/19634454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2590999/"
] | Change the rowdatabound event as below.
```
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((Button)e.Row.Cells[0].Controls[0]).OnClientClick = "return confirm('Are you sure you want to delete?');";
}
}
``` | ```
<asp:TemplateField HeaderText="DELETE" ShowHeader="False">
<ItemTemplate>
<span onclick="return confirm('Are you sure to Delete?')">
<asp:Button ID="Button1" runat="server" CausesValidation="False"
CommandNam... |
34,503,445 | ```
OS: Ubuntu 14.04
```
I created a test file called test and in it I have:
```
#!/bin/bash
NEW_VALUE = "/home/"
echo $NEW_VALUE
chmod +x test
./test
```
Produces the following:
```
./test: line 2: NEW_VALUE: command not found
```
Any ideas why this is not working? | 2015/12/29 | [
"https://Stackoverflow.com/questions/34503445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1016958/"
] | In Bash you can't have any space around the `=` sign when assigning a variable.
Any space will end the assignment, even after the `=`, e.g.:
```
test_var=this is bad
#=> is: command not found
```
[@CharlesDuffy's comment explaining why this happens](https://stackoverflow.com/questions/34503445/assigning-value-not-wo... | Remove the white space while assigning then it'll work fine. just like:
```
#!/bin/bash
NEW_VALUE="/home/"
echo $NEW_VALUE
``` |
23,239,357 | Android activities A which is a list activity , B is a detail information about list item
A is calling B and send data Id and Category
```
ListView lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
... | 2014/04/23 | [
"https://Stackoverflow.com/questions/23239357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3450082/"
] | Apart from that you forgot to specify class name in the definition of member function getState (there must be
```
int Node::getState(void)
{
//return 0;
return state;
}
```
) your code is invalid. First of all the class has no constructor with two parameters. SO the compiler shall issue an error for statem... | Just indicate which class `int getState(void)` belongs to, with `int Node::getState(){return state;}` |
25,153,523 | i have gridview and i used stored procedure in backend . The issue is i have not used any textbox or label only gridview.
When i run my code, It shows a compilation error that spproduct1 expects parameter @id which is expected not supplied.
Can you please fix the error
```
public partial class WebForm1 : System.Web... | 2014/08/06 | [
"https://Stackoverflow.com/questions/25153523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3904158/"
] | If you want to add a value to a parameter defined in your query you can use the following:
```
cmd.Parameters.AddWithValue("@id", GridView1.ToString());
```
for a better implementation:
1. try to put all database related functions in a separate file and call them in your form.
2. define an stored procedure over you... | ```
protected void Button3_Click(object sender, EventArgs e)
{
viewrecord s = new viewrecord();
s.std_id = Convert.ToInt32(TextBox2.Text);
SqlConnection conn2 = new SqlConnection(connstring);
try
{
SqlDataAdapter da = new SqlDataAdapter("viewrecord", conn2);
da.SelectCommand.Command... |
36,218,643 | I tried to create a repeat loop function based on logical case as follow:
```
n=5 # number of element in lambda
t=10 # limit state
lambda=c(runif(n,2,4)) #vector to be tested
tes=function(x)
{
if(x>=t) {a=0;b=0;c=0}
else
{
repeat
{
a=runif(1,0.5,0.8)
b=runif(1, 5, 8)
c=x+a+b
... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36218643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6092897/"
] | You can accumulate the results onto a data.frame.
I would also recommend you not assign identifiers like `c` and `t`, since those are built-in functions which can be masked by locals, especially if you're passing around functions as arguments, such as `do.call(c,...)`.
I also suggest that it's probably appropriate to... | You can save the intermediate results in a list, then return it (`loop_results`). See below. I have also formatted a bit your code so that, intermediate results are printed in a more intelligible/compact way, and the returned list is named.
```
tes <- function(x) {
if(x>=t) {
a=0;b=0;c=0
} else {
loop_... |
8,157,081 | I'm having trouble with loading textures regarding their resolution on openGL for Android. If the texture is 256x256 everything works perfectly, but if it's other resolution, the program throws this exception on start:
android.content.res.Resources$NotFoundException: Resource ID #0x........
I found a code on the inte... | 2011/11/16 | [
"https://Stackoverflow.com/questions/8157081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1050323/"
] | You need `$id = isset( $_GET['id']) ? intval( $_GET['id']) : 0;` at the top of your download script. | ```
<?php
$id = $_GET['ID'];
if($id)
{
getting info from db
}
?>
``` |
353,130 | When talking about end-game builds, a lot of players commonly refer to their builds having "x amount of Shaper DPS". That said, I don't actually understand what Shaper DPS is.
I know there is tooltip DPS, which shows me how much average DPS I am dealing with a specific skill, but the game itself has no listed stat for... | 2019/06/19 | [
"https://gaming.stackexchange.com/questions/353130",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/18916/"
] | >
> What is the difference between Shaper DPS and tooltip DPS?
>
>
>
[The Shaper](https://poedb.tw/us/mon.php?n=The+Shaper) has 40% elemental resistances, 25% chaos resistance, and 66% reduced curse effectiveness. These effects can significantly reduce the damage that many builds can deal against him, especially b... | The existing answers are fine but there's a fine distinction:
a. Tooltip dps - literally the in-game displayed tooltip, which is commonly a number made up by multiplying your skill's base dmg \* attacks/casts per second \* crit chance \* crit multiplier \* accuracy rolls (for attacks)
b. A skill's "real" dps - a comp... |
37,634,486 | In one definition of my view I am doing this
```
return HttpResponseRedirect(reverse('home'),{"fail":"true"})
```
then the destination receiving definition in a view does this
```
def Validate(request):
rslt = request.GET.get("fail", "False") #--->fail is always false
....
....
```
In the above the v... | 2016/06/04 | [
"https://Stackoverflow.com/questions/37634486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1305891/"
] | The `args` and `kwargs` passed to the `HttpResponseRedirect` constructor
```
def __init__(self, redirect_to, *args, **kwargs):
...
```
are not being used to construct a `QueryDict` (get or post). You are initialising a response here, not a request. As doniyor has already stated you basically have to append the q... | You need give a second parameter at reverse function... as de arguments... this works well for me!!!
```
return reverse('home', args='true')
``` |
8,342,950 | From what I understand using `.stop()` will prevent the callback functions to fire, right?
Unfortunately, it seems that this does not work in my current script:
```
newSubMenu.stop().slideToggle(250, function() {
newSubMenu.css('visibility', 'visible').addClass('open');
});
```
The animation now stops when double... | 2011/12/01 | [
"https://Stackoverflow.com/questions/8342950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/668190/"
] | From the [documentation](http://api.jquery.com/stop/):
>
> When `.stop()` is called on an element, the currently-running animation (if any) is immediately stopped. … Callback functions are not called.
>
>
>
Callback functions *are* called if the third argument to `stop()` is `true`.
In the code you provide, tho... | To see why this happens, you have to understand, what toggle does.
Everytime you click, the `slideToggle` gets itself the information to `slideDown` or `slideUp`.
The conclusion is: everytime the toggle is complete, your function will be called and your newSubMenu gets the `visibility:visible` *style*, plus the class ... |
55,271,298 | I want to create a series of possible equations based on a general specification:
```
test = ["12", "34=", "56=", "78"]
```
Each string (e.g. "12") represents a possible character at that location, in this case '1' or '2'.)
So possible equations from test would be "13=7" or "1=68".
I know the examples I give are not... | 2019/03/20 | [
"https://Stackoverflow.com/questions/55271298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2335363/"
] | Let
```
xs = [["","34","56","78"],["12","=","56","78"],["12","34","=","78"],["12","34","56",""]]
```
in
```
filter (not . any null) xs
```
will give
```
[["12","=","56","78"],["12","34","=","78"]]
```
If you want list comprehension then do
```
[x | x <- xs, and [not $ null y | y <- x]]
``` | The easiest waty to achieve what you want is to create all the combinations and to filter the ones that have a meaning:
```
Prelude> test = ["12", "34=", "56=", "78"]
Prelude> sequence test
["1357","1358","1367","1368","13=7","13=8","1457","1458","1467","1468","14=7","14=8","1=57","1=58","1=67","1=68","1==7","1==8","2... |
18,263,668 | I have a webpage which I want to display users who have that page opened. (I'm using node.js for server side)
**My current attempt:**
On server side, there's a counter that counts the amount of time he submits the GET request to that webpage. Hence if he opens that page more than once, `counter++`
Everytime the user... | 2013/08/15 | [
"https://Stackoverflow.com/questions/18263668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2567834/"
] | I think the real way to do this would be to override the default `$interpolateProvider` to enable filters that return promises. That way, you could defer the rendering of certain filtered expressions until they are resolved.
Remember, though, that you cannot do this for chained filters trivially. You will probably be ... | For anyone that is interested:
I solved this by simply catching the error thrown due to undefined object, and then I throw an error like `throw "Object not yet loaded. Trying again...";`
```
app.filter('translate', function() {
return function(input) {
try {
var index = input.toUpp... |
36,416,427 | Since a few days ago we've been getting an error response from Instagram API - it complains that we are using an invalid cursor 'min\_id' when accessing the Tags endpoint.
Thing is we don't use 'min\_id'. We use 'min\_tag\_id', which according to the documentation ([deprecated](https://www.instagram.com/developer/depr... | 2016/04/05 | [
"https://Stackoverflow.com/questions/36416427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/124132/"
] | I got this response from Instagram when enquiring about invalid pagination tokens
>
> "Thanks for the report. We are aware of this issue and it happens when
> pictures are un-tagged (e.g. The comment with the tag is deleted). We
> are working on a fix but I don’t have an eta to share at the moment."
>
>
> | OK, so this is how I solved it - after waiting for a few days and seeing that nothing happens then I have deleted all min\_tag\_id values that I have in store. I also altered my app logic to deal with the situation (in my case when there's no min\_tag\_id then I load some historical posts, which I commented out for thi... |
98,453 | I have done a research paper with someone in industry, while doing a Phd. Is it important to include my supervisor name also in research paper. Will three names be a good thing or should i go with 2 names. | 2017/11/06 | [
"https://academia.stackexchange.com/questions/98453",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/82494/"
] | Authorship should be decided by who made intellectual contributions to the work, not by feelings that three is or is not a better number than two. | The [Vancouver Protocol](https://www.etikkom.no/en/ethical-guidelines-for-research/medical-and-health-research/the-vancouver-protocol/) is generally considered as the authoritative guideline for ethics in science publishing. Here it is stated:
"Authorship should be limited to those who have made a significant contribu... |
276,197 | **Problem:**
Need to disable hibernation ( or enable Wake On Lan/ pattern ) for backup routine.
**Issue:**
Computer does not respond to WOL or any type of network requests. Also, hibernates regardless of NIC or power settings.
**Specs:**
Model: Dell Opti 780
NIC: 82567LM-3 Intel
**What I've Tried**
* Wake On... | 2011/04/27 | [
"https://superuser.com/questions/276197",
"https://superuser.com",
"https://superuser.com/users/70813/"
] | You cannot remove/disable/or inhibit the functionality of links in NTFS. It's a feature of the base file-system. I am a bit curious as to why you're wanting to disable them. Symbolic & Hard links both have been used for decades in varying forms. As far as exploitability goes... if a virus/hacker/??? can get access to t... | You can't. Windows Vista and later actually actively use these filesystem features internally (an example is Vista/7's `%SystemDrive%\Documents and Settings` junction).
Symbolic links *already* require elevated (high-integrity) privileges for them to be created.
Think of these objects as "shortcuts". They allow Windo... |
4,411,020 | I have this dll that I created a long time ago and use to connect to the db of a specific software that I develop for. I have had no issues for well over 4 years and countless applications with this dll.
Trying to deploy my latest creation, I get the following error:
```
System.IO.FileNotFoundException: Could not lo... | 2010/12/10 | [
"https://Stackoverflow.com/questions/4411020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4225/"
] | I had the same issue with a dll yesterday and all it referenced was System, System.Data, and System.Xml. Turns out the build configuration for the Platform type didn't line up. The dll was build for x86 and the program using it was "Any CPU" and since I am running a x64 machine, it ran the program as x64 and had issues... | 1) Copy DLLs from "Externals\ffmpeg\bin" to your project's output directory (where executable stays);
2) Make sure your project is built for x86 target (runs in 32-bit mode).
[Follow this thread for more](http://www.aforgenet.com/forum/viewtopic.php?f=2&t=2230) |
164 | A recent example is 6 questions posted by [turkistany](https://cstheory.stackexchange.com/users/495/turkistany).
Right now when I look at
<https://cstheory.stackexchange.com/questions?sort=newest>
I see the following 11 questions posted by him among the newest questions:
1. [Best bounds for the longest path optimizat... | 2010/08/27 | [
"https://cstheory.meta.stackexchange.com/questions/164",
"https://cstheory.meta.stackexchange.com",
"https://cstheory.meta.stackexchange.com/users/186/"
] | I believe this behaviour is essentially destructive of the ethos of a high-level site for research-level questions. I think it should be discouraged, perhaps by posting the same questions in more fully fleshed out form (with a link back to the original question for attribution). This might be a better use of moderator ... | I think we need to have some policy on this type of thing. Or some way to strongly discourage badly phrased questions. For example, see this thread:
[Complexity of a variant of the Mandelbrot set decision problem?](https://cstheory.stackexchange.com/questions/778/complexity-of-a-variant-of-the-mandelbrot-set-decision-... |
9,614,434 | my script, serializing a large array was working without problems on PHP 5.3.8 with APC. My server crashed I installed PHP 5.3.10 with APC and I get following error.
```
Allowed memory size of 31457280 bytes exhausted (tried to allocate 262263 bytes).
```
I increased memory\_limit to 256M in php.ini. On same script... | 2012/03/08 | [
"https://Stackoverflow.com/questions/9614434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/490940/"
] | Well, its pretty clear that 31457280 bytes is 30 MB, therefore the limit has not been increased, so i'd check that again.
To make this answer more useful, you should probably be looking at serialising this large array in batches, as its never a good idea to hog so much memory at one time.
Also, you should probably lo... | Call phpinfo() to check if the memory\_limit is actually changed. Maybe you simply edited the wrong php.ini file. |
58,551,754 | I have classes as below
```
public class ClassA
{
public int Id { get; set;}
}
public class ClassB : List<ClassA>
{
}
```
How do I convert List to ClassB?
I am doing simple casting as below but throws exception.
```
var list1= new List<ClassA>();
var list2= (ClassB)list1;
```
regards,
Alan | 2019/10/25 | [
"https://Stackoverflow.com/questions/58551754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/740902/"
] | expose a constructor to create instance of ClassB from List
```
public class ClassB : List<ClassA>
{
public ClassB(IList<ClassA> source) : base(source)
{
}
}
```
then use
```
var list1 = new List<ClassA>();
var list2 = new ClassB(list1);
```
you can also expose an explicit operator to make your castin... | no,you can't.
parent class object cannot be converted to sub class
```
var list1= new List<ClassA>();
var list2= (ClassB)list1;
```
it can be simplified to below code
```
List<ClassA> list2 = new ClassB();
``` |
46,979,586 | I'm trying to set up related posts that show posts in the same category as the current. The way the clients blog is set up is that they all share the category "blog", the related posts will show the same thing for every post.
```
<?php $related = get_posts( array(
'category__in' => wp_get_post_categor... | 2017/10/27 | [
"https://Stackoverflow.com/questions/46979586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5636406/"
] | It worked for me after adding the **spring-boot-starter-aop dependency** like below:
```
compile ("org.springframework.boot:spring-boot-starter-aop:1.5.10.RELEASE")
``` | spring-retry uses spring aop, make sure you have aop added in your pom and try clean building the application.
for spring app :
```
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
```
for spring boot :
```
<dependency>
... |
49,360,887 | So, i'd like my user session to persist upon login/signup, which it does not.
The official documentation says to add this to start with :
```
app.use(express.session({ secret: 'keyboard cat' }));
app.use(passport.initialize());
app.use(passport.session());
```
which I did. Then it goes on to specify :
*In a... | 2018/03/19 | [
"https://Stackoverflow.com/questions/49360887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7461599/"
] | ```
//npm modules
const express = require('express');
const uuid = require('uuid/v4')
const session = require('express-session')
const FileStore = require('session-file-store')(session);
const bodyParser = require('body-parser');
const passport = require('passport');
const LocalStrategy = require('passport-local').Stra... | 1
Check hostname.
In my case, cookie was set on `127.0.0.1`, not `localhost`.
2
Make sure `express session` is called before `passport session`. |
6,985,148 | For those who don't know what a 5-card Poker Straight is: <http://en.wikipedia.org/wiki/List_of_poker_hands#Straight>
I'm writing a small Poker simulator in Scala to help me learn the language, and I've created a *Hand* class with 5 ordered *Cards* in it. Each *Card* has a *Rank* and *Suit*, both defined as *Enumerati... | 2011/08/08 | [
"https://Stackoverflow.com/questions/6985148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/109191/"
] | You could do something like:
```
val ids = ranks.map(_.id)
ids.max - ids.min == 4 && ids.distinct.length == 5
```
Handling aces correctly requires a bit of work, though.
**Update:** Here's a much better solution:
```
(ids zip ids.tail).forall{case (p,q) => q%13==(p+1)%13}
```
The `% 13` in the comparison handles... | How about something like:
`def isStraight(cards:List[Card]) = (cards zip cards.tail) forall { case (c1,c2) => c1.rank+1 == c2.rank}`
`val cards = List(Card(1),Card(2),Card(3),Card(4))`
```
scala> isStraight(cards)
res2: Boolean = true
``` |
6,906,916 | This relates to [this question](https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript). I am using the code below from [this answer](https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523) to generate a UUID in JavaScript:
```
'xxxxxxxx-xxxx-4xxx... | 2011/08/02 | [
"https://Stackoverflow.com/questions/6906916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10793/"
] | Indeed there are collisions, but only under Google Chrome. Check out my experience on the topic in *[Google Chrome random number generator issue](https://web.archive.org/web/20190121220947/http://devoluk.com/google-chrome-math-random-issue.html)*
It seems like collisions only happen on the first few calls of Math.rand... | The answers here deal with "what's causing the issue?" (Chrome Math.random seed issue) but not "how can I avoid it?".
If you are still looking for how to avoid this issue, I wrote [this answer](https://stackoverflow.com/a/8809472/508537) a while back as a modified take on Broofa's function to get around this exact pr... |
26,508 | Check my profile and you will know all I have done on this site in the past 2-3 months is ask some questions. I want to answer some questions and be of use on this site(where a lot of easy questions must be piling up everyday). I have completed high school and I am about to join a college. I thought that there must be ... | 2017/06/14 | [
"https://math.meta.stackexchange.com/questions/26508",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/425945/"
] | I looked at your profile and found
* 0 posts edited
* 0 helpful flags
* 4 votes cast
You can help this site by voting, editing and improving posts (+2 for your reputation), and, if it makes sense, flagging answers, posts and comments. The query uses a parameter Tag that you have to supply. You can enter % so that the... | Looking at the [most popular tags](https://math.stackexchange.com/tags) I can suggest:
* [calculus](https://math.stackexchange.com/questions/tagged/calculus "show questions tagged 'calculus'") \*
* [probability](https://math.stackexchange.com/questions/tagged/probability "show questions tagged 'probability'") \*
* [al... |
22,955,263 | This is the exception i am getting:
```
D:\Programming\Java\bin>JAVAC Demo.java
D:\Programming\Java\bin>java Demo
Error: Could not find or load main class Demo
D:\Programming\Java\bin>java -cp . Demo
Exception Born java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDrive
r
java.lang.ClassNotFoundException: ... | 2014/04/09 | [
"https://Stackoverflow.com/questions/22955263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3386500/"
] | When you launch a Java application you need to specify a classpath, otherwise it will not be able to find classes (like the Oracle JDBC driver).
You need to download the Oracle JDBC driver and put it somewhere on your system (say `C:\oraclejdbc\ojdbc7.jar`), then run Java with:
```
java -cp .;C:\oraclejdbc\ojdbc7.jar... | I was facing a similar problem adding ;.; to the end of CLASSPATH worked for me.
eg. C:\Oracle\product\10.1.0\Client\_1\jdbc\lib\ojdbc14.jar;.; |
65,380,064 | I just learned how to use the machine learning model Random Forest; however, although I read about the random\_state parameter, I couldn't understand what it does. For example, what is the difference between `random_state = 0` and `random_state = 300`
Can someone please explain? | 2020/12/20 | [
"https://Stackoverflow.com/questions/65380064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14354649/"
] | You don't pass values from child to parent in React. React is unidirectional - data flows one way - from parent to child.
What you can do is to move given state from child to parent (so that you have one source of truth) and then pass to the child the data it needs as well as a function that allows to change the state... | you can pass the setGiftAid down to the child component and use that in the child component to set the state. |
19,062,631 | I want to read a string from keyboard and store in `buf` . I set a `char buf[6]` array , this array at most can store 5 characters and `\0` .
Then I type `123 456 789` it contain 11 characters and a `\0` , the program still can run , but if I type a longer string `123 456 789 123 456 789` it will crash at run time .
... | 2013/09/28 | [
"https://Stackoverflow.com/questions/19062631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2131116/"
] | Yes it is possible to call plain javascript function in data-binding. Try it in your project, it's working. There may be some problem in the jsfiddle script. | **Yes**, you can.
Please note the **[official Knockout documentation](http://knockoutjs.com/documentation/click-binding.html)** for the `click` binding:
>
> You can reference any JavaScript function - it doesn't have to be a function on your view model. You can reference a function on any object by writing click: so... |
9,708,266 | Hello I have a little problem with assigning property values from one lists items to anothers. I know i could solve it "the old way" by iterating through both lists etc. but I am looking for more elegant solution using LINQ.
Let's start with the code ...
```
class SourceType
{
public int Id;
public string Nam... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9708266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1269810/"
] | I would just build up a dictionary and use that:
```
Dictionary<int, string> map = sourceList.ToDictionary(x => x.Id, x => x.Name);
foreach (var item in destinationList)
if (map.ContainsKey(item.Id))
item.Name = map[item.Id];
destinationList.RemoveAll(x=> x.Name == null);
``` | Barring the last requirement of "avoid creating new destinationList" this should work
```
var newList = destinationList.Join(sourceList, d => d.Id, s => s.Id, (d, s) => s);
```
To take care of "avoid creating new destinationList", below can be used, which is not any different than looping thru whole list, except tha... |
15,660 | In the spirit of the holidays, and as someone already started the winter theme([Build a snowman!](https://codegolf.stackexchange.com/questions/15648/build-a-snowman)) I propose a new challenge.
Print the number of days, hours, minutes, and seconds until Christmas(midnight(00:00:00) December 25th) on a stand alone wind... | 2013/12/06 | [
"https://codegolf.stackexchange.com/questions/15660",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/9516/"
] | Ruby with [Shoes](http://shoesrb.com/), 96 - 33 = 63
====================================================
```ruby
Shoes.app{p=para
animate{p.text="0 days 0 hours 0 minutes #{1387951200-Time.new.to_f} seconds"}}
```
Well, you never said we *couldn't*. ;)

Updates on... | Python 2, 115
-------------
```
from datetime import datetime as d
n=d.now()
print str(24-n.day),str(23-n.hour),str(59-n.minute),str(60-n.second)
```
This counts newlines as 2 characters. |
51,584,146 | Sort of new to Excel, so not sure if this is possible.
In Sheet 1 I have the fixtures of teams playing in matchday 1;
```
A B C D E
----------------------------
Matchday 1
Team 1 - Team 4
Team 2 - Team 5
Team 3 - Team 6
```
In Sheet 2 I have the previous years f... | 2018/07/29 | [
"https://Stackoverflow.com/questions/51584146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3113377/"
] | Since this question has changed from "What's the fastest way to parse a `float`?" to "What's the fastest way to get a `string` from a `char[]`?", I wrote some benchmarks with [`BenchmarkDotNet`](https://benchmarkdotnet.org/) to compare the various methods. My finding is that, if you already have a `char[]`, you can't g... | Interesting topic for working out optimization details at home :) good health to you all..
My goal was: convert an Ascii CSV matrix into a float matrix as fast as possible in C#. For this purpose, it turns out string.Split() rows and converting each term separately will also introduce overhead. To overcome this, I mod... |
7,621,066 | I have a string that is made up of a list of numbers, seperated by commas. How would I add a space after each comma using Regex? | 2011/10/01 | [
"https://Stackoverflow.com/questions/7621066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/67641/"
] | Use [`String.replace`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) with a [regexp](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp).
```
> var input = '1,2,3,4,5',
output = input.replace(/(\d+,)/g, '$1 ');
> output
"1, 2, 3, 4, 5"
``` | ```
var numsStr = "1,2,3,4,5,6";
var regExpWay = numStr.replace(/,/g,", ");
var splitWay = numStr.split(",").join(", ");
``` |
31,405,793 | I have defined 2 numpy array 2,3 and horizontally concatenate them
```
a=numpy.array([[1,2,3],[4,5,6]])
b=numpy.array([[7,8,9],[10,11,12]])
C=numpy.concatenate((a,b),axis=0)
```
c becomes 4,3 matrix
Now I tried same thing with 1,3 list as
```
a=numpy.array([1,2,3])
b=numpy.array([4,5,6])
c=numpy.concatenate((a,b),a... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31405793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5108825/"
] | You didn't do anything wrong. [`numpy.concatenate`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.concatenate.html) join a sequence of arrays together.which means it create an integrated array from the current array's element which in a 2D array the elements are nested lists and in a 1D array the elements a... | This is happening because you are concatenating along `axis=0`.
In your first example:
```
a=numpy.array([[1,2,3],[4,5,6]]) # 2 elements in 0th dimension
b=numpy.array([[7,8,9],[10,11,12]]) # 2 elements in 0th dimension
C=numpy.concatenate((a,b),axis=0) # 4 elements in 0th dimension
```
In your second ex... |
1,145,286 | I have a large xml file (40 Gb) that I need to split into smaller chunks. I am working with limited space, so is there a way to delete lines from the original file as I write them to new files?
Thanks! | 2009/07/17 | [
"https://Stackoverflow.com/questions/1145286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98778/"
] | If you're on Linux/Unix, why not use the split command like [this guy](http://www.techiecorner.com/107/how-to-split-large-file-into-several-smaller-files-linux/) does?
```
split --bytes=100m /input/file /output/dir/prefix
```
EDIT: then use [csplit](http://linux.die.net/man/1/csplit). | Here is my script...
```
import string
import os
from ftplib import FTP
# make ftp connection
ftp = FTP('server')
ftp.login('user', 'pwd')
ftp.cwd('/dir')
f1 = open('large_file.xml', 'r')
size = 0
split = False
count = 0
for line in f1:
if not split:
file = 'split_'+str(count)+'.xml'
f2 = open(file, 'w')... |
313,581 | The data was IN my phone or ON my phone?
Well, IN being generally more of a 'containment' preposition, I would think its usage here is okay, and the phone is perceived as `bag`. However, I wonder which preposition would end up being the one used because sometimes things in English have both a 'contained' property (whe... | 2016/03/14 | [
"https://english.stackexchange.com/questions/313581",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/121141/"
] | I would say **on** the computer/phone and **in** the computer/phone are equally common.
With a particular app/system **in** is more likely; in Sharepoint, in the database. But where it is stored physically is generally **on**; on disk, on tape, on a USB flash drive. | Data are saved **in** a register **on** a device. Thus, considering a phone mainly a register for contacts and messages, that information is saved **in** the phone, considering the phone as a device, the information is saved **on** the phone. |
12,682,660 | Ok i have a dynamic page where people can post events in the city, we will call that page: city.php. In order to get to the page though, you must select a state from states.php, then a city from allcities.php. The states and cities are all in mysql database. On the city.php page you can click "add event" and it will ta... | 2012/10/01 | [
"https://Stackoverflow.com/questions/12682660",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1665920/"
] | There are a number of ways to do something like this in PHP. I personally disagree with your method as it sounds. I could be wrong about what it seems like you're saying though.
As adam said, $\_SESSION is the first thing in mind. You can also look into $\_COOKIE:
<http://php.net/manual/en/features.cookies.php>
or ju... | Quite generic but key is in the relational db structure. Displaying is easy, so make sure that news, job, events tables has `id_city` for building correct queries.
Example DB style as answer to your comment:
```
cities : id_city | city_name | city_slug | id_state
events : id_event | id_city | event_name | other_event... |
16,802 | I'm running GNU Emacs 24.5.4 on Mac OS X 10.10.5 in Terminal.app.
In this (stock) setup, Emacs has a transparent background. With a transparent background, the colors that Emacs uses to display text are auto-adjusted based on the color *underneath* Emacs. In my case, "underneath Emacs" is a Terminal.app window with an... | 2015/09/21 | [
"https://emacs.stackexchange.com/questions/16802",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/9589/"
] | A simple method, close to what you have:
```el
(defun current-line-empty-p ()
(string-match-p "\\`\\s-*$" (thing-at-point 'line)))
``` | Here is another simple solution for it, taken from `comment-dwim-2` package
```
(defun is-empty-line-p ()
(string-match-p "^[[:blank:]]*$"
(buffer-substring (line-beginning-position)
(line-end-position))))
``` |
3,377,954 | When I insert some text written in Unicode into database, they become question marks. Database encoding is set to UTF-8. What else may be incorrect? When I check in phpMyAdmin there are question marks inserted only!
This is the code I use for connecting to database:
```
define ("DB_HOST", "localhost"); // Set databas... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3377954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/352959/"
] | Is the text you inserted encoded in UTF-8 too? Or is your PHP files not UTF-8? Have you set the MySQL Client connection to UTF-8?
If not, then that is probably the cause of the problem. | ```
// First make sure your file produce UTF-8 characters
header('Content-Type: text/html; charset=utf-8');
// Make sure with your spelling
// write
mysql_query("SET CHARSET utf8");
// Instead of
mysql_query("SET CHARACTER SET utf8");
// For some reasons
mysql_query("SET CHARSET SET utf8");
// It works on so... |
60,897,536 | I can globally replace a regular expression with `re.sub()`, and I can count matches with
```
for match in re.finditer(): count++
```
Is there a way to combine these two, so that I can count my substitutions without making two passes through the source string?
Note: I'm not interested in whether the substitution ma... | 2020/03/28 | [
"https://Stackoverflow.com/questions/60897536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116/"
] | You can pass a `repl` function while calling the `re.sub` function.
*The function takes a single match object argument, and returns the replacement string. The `repl` function is called for every non-overlapping occurrence of pattern.*
**Try this:**
```
count = 0
def count_repl(mobj): # --> mobj is of type re.Match
... | ```
import re
text = "Jack 10, Lana 11, Tom 12"
count = len([x for x in re.finditer(r"(\d+)", text)])
print(count)
# Output: 3
```
Ok, there's a better way
------------------------
```
import re
text = "Jack 10, Lana 11, Tom 12"
count = re.subn(r"(\d+)", repl="replacement", string=text)[1]
print(count)
# Output:... |
42,346,206 | ```
image(imageurl){
return "http://web.com/"+imageurl+".jpg";
```
How to use this url in CSS background-image ?
here is css
```
<div style="width: 100%;
height: 300px;
background-image: url ('image(post.postimage)');
background-repeat: no-repeat;
background-size: cover;">
</div>
``` | 2017/02/20 | [
"https://Stackoverflow.com/questions/42346206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | First of all, if `char` corresponds to `unsigned char`, a `char` cannot have a trap representation; [however if `char` corresponds to `signed char` it can have trap representations](https://stackoverflow.com/questions/6725809/trap-representation). Since using a trap representation has undefined behaviour, it is more in... | This is a category of behavior where the Standard would strongly imply a behavior, and nothing in the Standard would invite an implementation to jump the rails, but the official "interpretation" would nonetheless allow compilers to behave in arbitrary fashion. As such, it would not be accurate to describe the behavior ... |
52,024,365 | I want to transfer the negative values at the current row to the previous row by adding them to the previous row within each group.
Following is the sample raw data I have:
```
raw_data <- data.frame(GROUP = rep(c('A','B','C'),each = 6),
YEARMO = rep(c(201801:201806),3),
VALUE = c... | 2018/08/26 | [
"https://Stackoverflow.com/questions/52024365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7879423/"
] | ```
Right click on the console > Preferences > Console buffer size.
> Uncheck the "Limit console output" checkbox.
```
There was no error in my code.
It was just that the result had been truncated by the 80000 character limit.
I released the limit and got the result that I expected. | ```
Code written for to read multiple test files from multiple folder:
In the try block the FileReader reads a file and the second works as a constructor parameter and has a readline() method.
public static void main(String[] args) {
String dir = "c:\\html_test\\amdar";
File dir = new File(dir... |
17,708,518 | I have a table with 3 fields "Start Date" and "End Date" and "Allocation %". I will need to find out all the records in this table which falls within 3 months from the current date,
And (this one is tricky) only the records with overlapped date ranges where the Sum(Allocation %) > 100.
Please help me to come up with ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17708518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336907/"
] | You have two general solutions. Which is best is dependent on the size of ResourceAllocation, the frequency of conflicts, and how you intend to present the data.
**Solution 1: Make a list of dates in the next 3 months and join against that to identify which dates are overallocated**
```
WITH
datelist AS (
SELEC... | I assume that Start Date and End date are formatted as Date time or Date.
I'm not sure if you are trying to determine if the start date records fall within the past 3 months or the end date records.
Also you'll need a limit to determine the Sum(Allocation %). What unique records are you wanting to sum. Since you want... |
21,598,804 | I have a json file with all link images from specific folder like this
```
["http://img1.png","http://img2.png","http://img3.png","http://img4.png"]
```
And I want to create a `<ul>` list with this but I don't know how.
Can someone help me with a small example?
Thanks | 2014/02/06 | [
"https://Stackoverflow.com/questions/21598804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3115043/"
] | Using json you can connect <http://shared1.ad-lister.co.uk/GetImagesList.aspx?contextId=c9d56aca-506c-40be-9068-037d0fba62c9&Folder=_design/car-marques>
```
$.post("http://shared1.ad-lister.co.uk/GetImagesList.aspx?contextId=c9d56aca-506c-40be-9068-037d0fba62c9&Folder=_design/car-marques", function (json) {
var h... | ```
var urls = ["http://img1.png","http://img2.png","http://img3.png","http://img4.png"];
var ul = $('<ul>');
for (var i = 0; i < urls.length; i++) {
var li = $('<li>');
li.appendTo(ul);
$('<img>').attr('src', urls[i]).appendTo(li);
}
var container = $('#container');
container.append(ul);
``` |
45,384,391 | How to use findOne() in Yii2 without using any parameters?
i mean querying like
"select top 1 \* from table1" or
"select \* from table1 LIMIT 1"
Thanks! | 2017/07/29 | [
"https://Stackoverflow.com/questions/45384391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8384514/"
] | query like below
```
$user = User::find()->one();
``` | Also query `$user = User::find()->limit(1)->one();` working faster then `$user = User::find()->one();` |
10,756 | >
> **Possible Duplicate:**
>
> [Will my new HTML5 website decrease my Google ranking?](https://webmasters.stackexchange.com/questions/9936/will-my-new-html5-website-decrease-my-google-ranking)
>
>
>
For example, currently, I understand that search engines give the most emphasis to `h1` elements, followed by `... | 2011/03/16 | [
"https://webmasters.stackexchange.com/questions/10756",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/-1/"
] | The HTML specs say that user agents that don't understand an HTML tag are to ignore it. Assuming that search engine bots follow this spec, and they do, then using HTML5 tags that aren't yet recognized by the search engines are ignored and shouldn't hurt your rankings.
In your example the `<h1>` tag is not being used i... | There's an article [here](http://www.redsauce.com/update-on-html5-seo-and-google-how-html5-may-affect-your-page-rankings-5759) about that. It basically says that Google crawlers are used to not being able to parse all HTML markup – be it from broken HTML, embedded XML content or from the new HTML5 tags. And there is no... |
25,344 | I'm looking for a way to handle a grid field with the channel entry API.
Documentation has nothing, and could barely find anything else online about except for this: [Inserting a new Grid row using the API](https://expressionengine.stackexchange.com/questions/22448/inserting-a-new-grid-row-using-the-api), but there i... | 2014/08/27 | [
"https://expressionengine.stackexchange.com/questions/25344",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/1994/"
] | I'm pretty sure you can just pass in the fieldname the row and column like
```
$data['field_id_X'][rows][new_row_1][col_id_1] = 'row 1';
$data['field_id_X'][rows][new_row_2][col_id_1] = 'row 2';
```
Just increment new\_row\_x as needed and match up your col\_id\_x numbers | Very close to @johnathan-waters answer I imported new grid rows using this code
`$data['field_id_X']['rows']['new_row_Y']['col_id_Z'] = 'value';` |
166 | There are tons that are out there for recording routes, and such. There's also the physical mounting. Is the iPhone actually good/useful for bikers? | 2010/08/25 | [
"https://bicycles.stackexchange.com/questions/166",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/105/"
] | A lot of the jogging apps will work well for on the bicycle as well, since most of the data collection is done via the GPS. As for the mounts, I've seen [this one](http://www.thinkgeek.com/electronics/cell-phone/df25/) used a bit and it looks fairly sturdy. Not sure about the attachment to the bars, though.
I would ju... | Ride with GPS app is one of my favorites.
<https://ridewithgps.com/>
You can use the website to create routes, and the app to follow them. It's the best route creation and editing solution I've found. It also integrates with Wahoo Elemnt and Wahoo RFLKT+ computers.
It also allows you to record a ride whether you ar... |
37,800,195 | I have a jenkinsfile dropped into the root of my project and would like to pull in a groovy file for my pipeline and execute it. The only way that I've been able to get this to work is to create a separate project and use the `fileLoader.fromGit` command. I would like to do
```groovy
def pipeline = load 'groovy-file-... | 2016/06/13 | [
"https://Stackoverflow.com/questions/37800195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4227839/"
] | If you have pipeline which loads more than one groovy file and those groovy files also share things among themselves:
**JenkinsFile.groovy**
```
def modules = [:]
pipeline {
agent any
stages {
stage('test') {
steps {
script{
modules.first = load "first.g... | You have to do `checkout scm` (or some other way of checkouting code from SCM) before doing `load`. |
259 | There are many things you have to do/consider when you want to enable HTTP compression on IIS 6.0 (Windows Server 2003).
Can somebody please provide a comprehensive list of the actions you have to take in order to enable HTTP compression properly? | 2009/04/30 | [
"https://serverfault.com/questions/259",
"https://serverfault.com",
"https://serverfault.com/users/45/"
] | Does anyone know how you TEST if your IIS6 server is sending zipped content?
Is there a "test your website" site out there that can tell you??
Can you use Firefox to tell you (firebug or some other plug in?)
**[UPDATE]**
Using YSlow with FireBug. Click on the "components" tab and it shows raw and gzipped sizes. | I played around with getting this set-up on our server (IIS 6) and while enabling it was fairly simple, it didn't give us as much control over it as I needed. I ended up purchasing [httpZip from port80 Software](http://www.port80software.com/products/httpzip/). It made it trivial to enable and configure it. It looks li... |
66,440,755 | I'm looking to take one table (Name to Dept) and look up corresponding entries on a second (Dept to Plan) to get a third column that's "flat", showing all plans each name corresponds to.
I have:
| Name | Dept |
| --- | --- |
| a | x |
| b | y |
| c | z |
| d | z |
and
| Dept | plan |
| --- | --- |
| x | 1 |
| x | 2... | 2021/03/02 | [
"https://Stackoverflow.com/questions/66440755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15315103/"
] | You can use the [**`onGloballyPositioned`**](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnGloballyPositionedModifier) modifier:
```
var size by remember { mutableStateOf(IntSize.Zero) }
Box(Modifier.onGloballyPositioned { coordinates ->
size = coordinates.size
}) {
//...
}
```
... | You can do this several ways. `BoxWithConstraints` does not always return correct size because as the name describes it returns `Constraints`. **Max width or height** of `Constraints` doesn't always match **width or height** of your Composable.
Using Modifier.onSizeChanged{size:IntSize} or Modifier.onGloballyPositione... |
25,078,497 | There is a report contains 1000s of pages of data.Is there any way to make a button on the first page of the report so that ,if click on the button it goes to the end of the pages.
Is there any expression to be written,with out writing the vb.net code? | 2014/08/01 | [
"https://Stackoverflow.com/questions/25078497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1254579/"
] | There is a button like that in SSRS (you can also type page number in the box and press enter):

EDIT:
You can add a bookmark at the end of your report and then make a textbox which will jump to it (textbox properties->Action->mark "go to bookmark" ... | There are 2 ways of reaching the last page or the data on the last page:
>
> **Sol 1.** @kyooryu has already mentioned above in his solution along with a screenshot.
>
>
> **Sol 2.** You can freeze the header and set the display result to show the data on a single page. This way you will not have multiple pages and... |
16,569,449 | I'm passing a listview in to an onselect but theres a couple of ways it's called from different listviews. So i'm trying to work out which listview is being clicked.
I thought I could do the following however the string thats returned is like com.myapp.tool/id/32423423c (type thing) instead of lvAssets.
Here is what ... | 2013/05/15 | [
"https://Stackoverflow.com/questions/16569449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/900659/"
] | The `urlExists` function doesn't have a `return` statement at all (so it will always return `undefined`).
The functions that do are event handlers assigned to the ajax handler. They won't even fire until after the HTTP response is received, which will be after the `urlExists` function has finished running and returned... | the `success` and `error` functions are callback methods. They are not part of the function `urlExists`. Rather they are part of the parameters passed to `$.ajax`. |
20,163,753 | Instead of writing such lines again and again, what should be the professional way & optimized way to write this same code? Please help
```
$(function(){
$('<img src="map/map_slice_1.jpg"/>').appendTo('#map_slice_1');
$('<img src="map/map_slice_2.jpg"/>').appendTo('#map_slice_2');
$('<img src="map/map_slice_3.jpg"/>'... | 2013/11/23 | [
"https://Stackoverflow.com/questions/20163753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1977954/"
] | I would do something like this :
```
$(function () {
var i = 0;
while (i++ < 8) {
$('#map_slice_' + i).append(
'<img src="map/map_slice_' + i + '.jpg"/>'
);
}
});
``` | try
```
$(function(){
for (var i=0; i<8; i++)
{
$('<img src="map/map_slice_" + i + ".jpg"/>').appendTo('#map_slice_' + i);
}
});
``` |
41,722,534 | I am trying to collaborate 3 queries to perform arithmetic operation. The queries are shown in
```
(SELECT ITEM_ID,ISNULL(SUM(REC_GOOD_QTY),0)
FROM INVENTORY_ITEM
WHERE COMPANY_ID = 1
AND INVENTORY_ITEM.COMPANY_BRANCH_ID = 1
AND INVENTORY_ITEM.INV_ITEM_STATUS = 'Inward'
AND GRN_DATE < CAST('2017-01-10 00:00:00.0' AS... | 2017/01/18 | [
"https://Stackoverflow.com/questions/41722534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4008515/"
] | This can happen for one of two reasons:
Firstly, either the `fromDate` or the `toDate` is out of that range, or (most likely):
One of your date variables (either `fromDate` or `toDate`) could not be parsed by the `TryParse()`. When this happens, the date is set to the default `C#` value of `0001-01-01`.
In `SQL Serv... | Well, `SqlDbType.DateTime` has a value ranging from January 1, 1753 to December 31, 9999, so you should try to use `SqlDbType.DateTime2` instead.
Also, no point of parsing the `DateTimePicker.Text` property to `DateTime`, since it already has a DateTime property called `Value`.
Try this instead:
```
SqlDat... |
54,459,442 | I'm trying to create a JupyterLab extension, it uses typescript.
I've successfully added the package "@types/node" allowing me to use packages such as 'require('http')'.
But as soon as I try to use child process, using 'require("child\_process")' I get the following error when trying to build the extension.
```
Modu... | 2019/01/31 | [
"https://Stackoverflow.com/questions/54459442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1904282/"
] | In newer versions I used:
```
// webpack.config.js
...,
resolve: {
extensions: [".ts", ".js"],
fallback: {
"child_process": false,
// and also other packages that are not found
}
},
``` | I stayed blocked for a couple of times on that.
As far I understood, it seems impossible to execute some child\_process ( which is literally executing some cmd ) from the browser, which also makes sense at some point.
The solution given works for me, adding below to `package.json` is working
```
"browser": { "fs": f... |
3,266,117 | I am working on form and I am looking for a free calendar/date/timestamp app that i can include in my form. basically, in the input text, i want users to click on the calendar icon and pick a date and a time stamp. that value should populate in the input text.
my next question is, in my mysql db, i am calling this fie... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3266117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/255391/"
] | For the user interface you are describing to be added to the input field, jQuery Datepicker springs to mind.
<http://jqueryui.com/demos/datepicker/>
You'll need to include the jQuery library as well as the jQuery UI library. You can use the 'build your download' link and documentation on the jQuery library page to ge... | This can be done with GUI
Take a look at jQuery UI Date-picker: <http://jqueryui.com/demos/datepicker/>
Regards to the date conversion there is plenty of functions to help you
<http://www.php.net/manual/en/ref.datetime.php> |
15,286 | Heatmaps are one of the best tools we have to mesure the impact of a design, not just in [UX terms](http://www.squidoo.com/heat-map) but also in [marketing/conversion](http://www.thoughtmechanics.com/analyze-the-heat-map-for-better-ctr-and-sales-conversions/) terms.
I've found that most of the free or less-expensive s... | 2011/12/21 | [
"https://ux.stackexchange.com/questions/15286",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/5058/"
] | This is a question I've pondered myself. One major problem with heatmaps that I can think of is that I often move my cursor out of the way of what I want to look at, whether they be images, video, or text. So aside from when I'm actually moving the mouse to click on a link or button, I usually place my cursor in an emp... | Random cursor movements are generally an indication that the user doesn't actually understand what to do on a page. |
1,430,883 | If the PHP Engine is already in the middle of executing a script on the server what would happen to other simultaneous browser requests to the same script?
* Will the requests be queued?
* Will they be ignored?
* Will each request have its own script
instance?
* Any other possibility? | 2009/09/16 | [
"https://Stackoverflow.com/questions/1430883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142299/"
] | If 2 clients calls the server at the same time, the server is most probably able to reply both clients almost simultaneously. The clients here I define them to the browser level.
Meaning to say that on the same machine, if you're using 2 browsers to load the same website/page at the same time, both should be loaded at... | Just ran into this myself. Basically you need to call `session_write_close()` to prevent single user locking. Make sure once you call `session_write_close()` you don't try and modify any session variables though. Once you call it, treat sessions as read-only from then on. |
884,656 | I need to use an old Java applet for a certain website, but newer Java versions cannot run it, as it has a self-signed certificate. Reading on Oracle's Deployment Guide, I need to make my own deployment .JAR, with a proper certificate signing (not self signed), just to create the exception I need to run applets from a ... | 2015/02/11 | [
"https://superuser.com/questions/884656",
"https://superuser.com",
"https://superuser.com/users/24010/"
] | Just add the following files to `C:\Windows\Sun\Java\Deployment` folder.
**deployment.properties:**
```
deployment.user.security.exception.sites=C:/Windows/Sun/Java/Deployment/exception.sites
deployment.system.config.mandatory=True
```
**deployment.config:**
```
deployment.system.config=file:///C:/Windows/Sun/Java... | The exceptions are store here, C:\Users{username}\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites
Populate your file with what you want to add, copy it to a file share and use a logon script to copy the file for each user. This will make it to where users will not be able to add new sites.
Source: <http:... |
261,548 | In known wordlists like crackstation.lst there are random emails in the list. Why are they there? | 2022/04/26 | [
"https://security.stackexchange.com/questions/261548",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/275693/"
] | Presumably it's just people using their email address as their password.. | There are two main reasons:
**1. People using them for privacy**
Some people are privacy oriented, and they will create random looking email addresses for different services. This way it's not easy to link all of its personas based on the email address.
**2. They are fake and used to track leakage**
They are called... |
7,732,705 | Does anybody know how I can get the URL of any open IE processes on a computer?
I don't need to manipulate the IE instance at all -- just get information about the page that's currently loaded.
Thanks! | 2011/10/11 | [
"https://Stackoverflow.com/questions/7732705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/789476/"
] | A simple solution, and it works:
<http://omegacoder.com/?p=63> | * Start IE yourself through automation (i.e `var oIE = WScript.CreateObject("InternetExplorer.Application", "IE_");`) and listen to `NavigateComplete2`.
* Peek inot ROT (running objects table) - I think IE documents should show up there - Win32/COM - <http://msdn.microsoft.com/en-us/library/ms684004(VS.85).aspx>
* Just... |
9,954,775 | Maybe you easily said how to I provide table names and row counts?
Pseudo SQL:
```
for "select tablename from system.Tables" into :tablename
execute "select count(*) from ? into ?" using :tablename, :count
return row(:tablename, :count)
end for
```
Can you tell me show me this script in T-SQL? | 2012/03/31 | [
"https://Stackoverflow.com/questions/9954775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362214/"
] | ```
-- Shows all user tables and row counts for the current database
-- Remove OBJECTPROPERTY function call to include system objects
SELECT o.NAME,
i.rowcnt
FROM sysindexes AS i
INNER JOIN sysobjects AS o ON i.id = o.id
WHERE i.indid < 2 AND OBJECTPROPERTY(o.id, 'IsMSShipped') = 0
ORDER BY o.NAME
``` | Try this
```
-- drop table #tmpspace
create table #tmpspace (
name sysname
, rows int
, reserved varchar(50)
, data varchar(50)
, index_size varchar(50)
, unused varchar(50)
)
dbcc updateusage(0) with NO_INFOMSGS
exec sp_msforeachtable 'insert #tmpspace exec sp... |
11,457,192 | I have a header that needs to delay for a certain amount of time on page load, then fade out. [It can be tested here](http://[http://jsfiddle.net/yurcj/][1]). I also add the code:
**html**
```
<header id="main-header">
<div id="inner"></div>
</header>
```
**css**
```
#main-header {height: 70px;}
#inner {height... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11457192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1521516/"
] | `remove_method` should work in most cases. But if your `alias_method` overwrites an existing method, you may need to save the original via a separate `alias_method` call.
```
# assuming :contains? is already a method
alias_method :original_contains?, :contains?
alias_method :contains?, :include?
```
Then to restore... | ```
def hello
puts "Hello World"
end
alias :hi :hello
hi #=> "Hello World"
undef hi
hi #=> NameError
hello #=> "Hello World"
```
EDIT: Note that this will only work on methods created on the `main` object. In order to enact this on a class, you'd need to do something like , `Hello.class_eval("undef hi")`
Howeve... |
2,551 | Is it **always** valid to use *make* as a verb which causes a change by force in the personality/emotions/behaviors of objects?
Is it **always** valid to use *become* before all human emotions/senses/adjectives to express a change?
Is there any general rule which one to use when? | 2013/02/14 | [
"https://ell.stackexchange.com/questions/2551",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/476/"
] | Here, *make* is used in a context of "to cause something":
*You **make** me cry* — meaning, I was not crying, but because of you I start.
*Become* is simply *"to change {one's own} state"*.
Imagine Alice sees a sad Bob. Alice tells a funny joke to Bob, and he becomes happy. The following sentences are all valid:
... | "make" is a transitive verb, therefore it infers an action to the object.
On the other hand, "become" is an intransitive verb, denoting a change in state.
For example:
>
> "She will make the dinner."
>
>
>
and
>
> "The acorn that became the mighty oak."
>
>
>
Both have wide usage, but usually there... |
59,868,755 | So I'm trying to update `Date` from `DF1` with values from `Date` in `DF2`, whenever two columns `ColA` and `ColB` match, like so:
DF1:
```
ColA | ColB | Date
a | b | 12/22/2099
a | s | 12/22/2099
v | p | 12/22/2099
v | s | 12/22/2099
m | p | 12/22/2099
DF1 = pd.DataFrame( { 'Col... | 2020/01/22 | [
"https://Stackoverflow.com/questions/59868755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4573703/"
] | run:
```
DF1['Date'] = DF1['Date'].apply(pd.to_datetime)
DF2['Date'] = DF2['Date'].apply(pd.to_datetime)
```
then `update` | You can convert date to string before your operations:
```
DF1['Date'].strftime('%m/%d/%Y')
DF2['Date'].strftime('%m/%d/%Y')
``` |
6,953,498 | I have had a brief search in StackOverflow, it seems that for a webstart application, if some of the JARs are signed and other are unsigned, it will end up treated as unsigned if unsigned code are accessed in call stack.
However, what if I only put resources (e.g. config files) in an unsigned JAR? (In fact I have som... | 2011/08/05 | [
"https://Stackoverflow.com/questions/6953498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/395202/"
] | I think you need to try using `-webkit-transform` or `webkitTransform` instead of `webkit-transform`. | ```
el.style["-webkit-transition"] = "-webkit-transform 500ms linear";
el.style["webkit-transform"] = "translate3d(30px, 30px, 0px)";
```
Your missing the - on the second line, this could be the problem. |
68,363,529 | I wish to have a fast way to deal with rowwise calculations where values of cells depend on values in previous rows of different columns, prefering vectorization over looping through individual rows (follow-up from [here](https://stackoverflow.com/questions/67707005/fast-way-to-calculate-value-in-cell-based-on-value-in... | 2021/07/13 | [
"https://Stackoverflow.com/questions/68363529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12284689/"
] | Though [My friend's output/strategy](https://stackoverflow.com/a/68364377/2884859) is fabulous, but since we cannot have two input vectors in baseR's `Reduce()` so I used this trick-
* Generated fresh values of `var1` in `data.frame()` inside the `Reduce()`
* Where you want to use current values of `var1` use `.y`
* w... | Here is another solution in base R you could use:
```
do.call(rbind, Reduce(function(x, y) {
data.frame(var1 = dt$var1[y],
var2 = x[["var2"]] + x[["var3"]] - (dt$var1[y] / constant),
var3 = dt$var1[y - 1] + 0.1 * ((x[["var2"]] + x[["var3"]] - (dt$var1[y] / constant)) / constant))
}, init =... |
241,888 | Given an integer **N** from 1-9, you must print an **N**x**N** grid of **N**x**N** boxes that print alternating 1s and **N**s, with each box having an alternating starting integer.
**Examples**
```
Input: 1
Output:
1
Input: 2
Output:
12 21
21 12
21 12
12 21
Input: 3
Output:
131 313 131
313 131 313
131 ... | 2022/01/27 | [
"https://codegolf.stackexchange.com/questions/241888",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/103859/"
] | [Pari/GP](http://pari.math.u-bordeaux.fr/), 48 bytes
====================================================
```
n->matrix(n,,i,j,matrix(n,,k,l,n^((i+j+k+l)%2)))
```
[Try it online!](https://tio.run/##RcpBCoAgEEDRqwxBMIPjomirRwncGKM2ibjo9larNh8e/Bqa2KOOCG6o9WfoTW5UZuHEvzIX1h1RTDLZFJpXIhrxaqjgYGHYGGoT7a8nsP5NRP2eBw "Par... | [JavaScript (Node.js)](https://nodejs.org), 56 bytes
====================================================
```javascript
f=(n,w=4,y)=>w?[...Array(n)].map(_=>f(n,w-1,y=!y)):y?n:1
```
[Try it online!](https://tio.run/##bY3NCoJAFIX3PsVtNxd0QGqlXKXnqMjBNBS7I@OoDNGzT9oPbVqd78D5adWkhtI0vY1YXyrvaxIczrQLHVI25wcp5d4Y5QTjSd5UL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.