qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
10,088,521 | I have read all possible answer [here](https://stackoverflow.com/questions/4533317/netbeans-with-glassfish-have-no-suitable-driver-found-for-mysqljdbc) and [here](https://stackoverflow.com/questions/9622105/java-sql-sqlexception-no-suitable-driver-found-for-netbeans) and [here](https://stackoverflow.com/questions/28393... | 2012/04/10 | [
"https://Stackoverflow.com/questions/10088521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932307/"
] | Include the following piece of code in your code:
```
Class.forName("com.mysql.jdbc.Driver");//load driver
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/bolsms", "root", "@#$5869@#$");//connect to the database
``` | Check to make sure that your mysql-connector-java-(version)-bin.jar is here:
C:\Murach\Servlets and JSP\jsp2\_allfiles\servlet\_jsp\netbeans\ex\_starts\ch14sqlGateway\build\web\WEB-INF\lib
Also check to see if it is in here:
C:\Murach\Servlets and JSP\jsp2\_allfiles\servlet\_jsp\netbeans\ex\_starts\ch14sqlGateway\we... |
10,088,521 | I have read all possible answer [here](https://stackoverflow.com/questions/4533317/netbeans-with-glassfish-have-no-suitable-driver-found-for-mysqljdbc) and [here](https://stackoverflow.com/questions/9622105/java-sql-sqlexception-no-suitable-driver-found-for-netbeans) and [here](https://stackoverflow.com/questions/28393... | 2012/04/10 | [
"https://Stackoverflow.com/questions/10088521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932307/"
] | When you use it in Tomcat you have to explicitly load jdbc driver. I experienced the same error in a servlet in Tomcat. And adding `Class.forName("com.mysql.jdbc.Driver");` solve it.
The other thing I think, is to put the jar file in your `WEB-INF/lib`, then in your project properties, in Libraries, add the JAR you st... | you could also import it using the jsp tag <%@page import='com.mysql.jdbc.\*'%>
or the usual way Class.forName("com.mysql.jdbc.Driver").newInstance();
in the try catch of the jsp page. Good luck |
10,088,521 | I have read all possible answer [here](https://stackoverflow.com/questions/4533317/netbeans-with-glassfish-have-no-suitable-driver-found-for-mysqljdbc) and [here](https://stackoverflow.com/questions/9622105/java-sql-sqlexception-no-suitable-driver-found-for-netbeans) and [here](https://stackoverflow.com/questions/28393... | 2012/04/10 | [
"https://Stackoverflow.com/questions/10088521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932307/"
] | When you use it in Tomcat you have to explicitly load jdbc driver. I experienced the same error in a servlet in Tomcat. And adding `Class.forName("com.mysql.jdbc.Driver");` solve it.
The other thing I think, is to put the jar file in your `WEB-INF/lib`, then in your project properties, in Libraries, add the JAR you st... | Check to make sure that your mysql-connector-java-(version)-bin.jar is here:
C:\Murach\Servlets and JSP\jsp2\_allfiles\servlet\_jsp\netbeans\ex\_starts\ch14sqlGateway\build\web\WEB-INF\lib
Also check to see if it is in here:
C:\Murach\Servlets and JSP\jsp2\_allfiles\servlet\_jsp\netbeans\ex\_starts\ch14sqlGateway\we... |
614,111 | I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it.
My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the... | 2009/03/05 | [
"https://Stackoverflow.com/questions/614111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19307/"
] | I you are only going to do downloading and don't need other async processing, you can just use the async methods of the [`WebClient`](http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx) class. Though since you already have your own class, that's probably not a solution for you.
Otherwise, you can use [`... | The backgroundworker looks like it should work... There is an example on MSDN.
<http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx>
Or you could do something like:
```
WaitCallBack workCallBack= new WaitCallBack(DownloadMethod);
if(!ThreadPool.QueueUserWorkItem(workCallBack, "ThreadP... |
614,111 | I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it.
My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the... | 2009/03/05 | [
"https://Stackoverflow.com/questions/614111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19307/"
] | I'd strongly advise `BackgroundWorker` if you need to provide feedback to the user on the UI. The `ProgressChanged` and `RunWorkerCompleted` events are run on the UI thread, so there's no need to do marshalling, which can make your code more complex. | The backgroundworker looks like it should work... There is an example on MSDN.
<http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx>
Or you could do something like:
```
WaitCallBack workCallBack= new WaitCallBack(DownloadMethod);
if(!ThreadPool.QueueUserWorkItem(workCallBack, "ThreadP... |
614,111 | I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it.
My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the... | 2009/03/05 | [
"https://Stackoverflow.com/questions/614111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19307/"
] | I've created several different classes that incorporate BackgroundWorker. What I generally do is have a BackgroundWorker component on the form that will be open when the job is being performed, then I pass that instance to the constructor of my job class.
Here is what your job class might look like:
```
Private m_bwM... | The backgroundworker looks like it should work... There is an example on MSDN.
<http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx>
Or you could do something like:
```
WaitCallBack workCallBack= new WaitCallBack(DownloadMethod);
if(!ThreadPool.QueueUserWorkItem(workCallBack, "ThreadP... |
614,111 | I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it.
My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the... | 2009/03/05 | [
"https://Stackoverflow.com/questions/614111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19307/"
] | I you are only going to do downloading and don't need other async processing, you can just use the async methods of the [`WebClient`](http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx) class. Though since you already have your own class, that's probably not a solution for you.
Otherwise, you can use [`... | The class that uses clsDownload (probably your Form class) should use BackgroundWorker to run the download method. |
614,111 | I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it.
My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the... | 2009/03/05 | [
"https://Stackoverflow.com/questions/614111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19307/"
] | I'd strongly advise `BackgroundWorker` if you need to provide feedback to the user on the UI. The `ProgressChanged` and `RunWorkerCompleted` events are run on the UI thread, so there's no need to do marshalling, which can make your code more complex. | The class that uses clsDownload (probably your Form class) should use BackgroundWorker to run the download method. |
614,111 | I want to start a job in a new thread or using backgroundworker to do it but havent done that before and asking you wich way I should do it.
My program has a datagridview with a list of files, one file per row. I want the user to be able to select a row and then press "Start download" to start a background job of the... | 2009/03/05 | [
"https://Stackoverflow.com/questions/614111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19307/"
] | I've created several different classes that incorporate BackgroundWorker. What I generally do is have a BackgroundWorker component on the form that will be open when the job is being performed, then I pass that instance to the constructor of my job class.
Here is what your job class might look like:
```
Private m_bwM... | The class that uses clsDownload (probably your Form class) should use BackgroundWorker to run the download method. |
91,403 | I have been struggling to get Windows 8 installed on a brand new Macbook Pro Retina. It seemed simple enough to just run Boot Camp 5 with a 16GB flash drive in the USB port and a Windows 8 Professional ISO sitting on the desktop with the intent of creating a bootable USB drive, but it's not working for me. After select... | 2013/05/15 | [
"https://apple.stackexchange.com/questions/91403",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/49393/"
] | Have you tried to use a different flash drive? I have had issues particularly with SanDisk Cruzer flash drive that are unable to be used as boot devices because of the firmware on the flash drive. Try a different flash drive and see if you have the same result. I have an 8 GB Sony flash drive and a 4 GB Kingston flash ... | When I had this problem, I reformatted the external disk (USB) to MS-DOS FAT.
Opened up BootCamp and it copied the files all fine! |
245,899 | For a square matrix $A$. Define $exp(A)=I+\sum\_{n}A^{n}/(n!)$
. I need to prove two things
1. exp(A) converges and is invertible.
2. Its inverse is given by exp(-A).
Second part is straightforward. Can anyone help on first part? | 2012/11/27 | [
"https://math.stackexchange.com/questions/245899",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/41541/"
] | We can show convergence by normal convergence.
$\sum\_{k=0}^{\infty} ||\frac{A^k}{k!}|| \le \sum\_{k=0}^{\infty} \frac{||A||^k}{k!} = e^{||A||}$. Where $||\cdot||$ is a sub-multiplicative norm (e.g. operator norm)
For invertibility, there's probably a nicer way to show this, but I would just show that if $A$ and $B$ ... | It's possible to do this rather cutely with [Jacobi's formula](https://en.wikipedia.org/wiki/Jacobi%27s_formula), which can be used to show that: $$ \det(e^{cA})=e^{\text{tr}(cA)} $$
Let $c=1$. Then $\det(e^{A})=e^{\text{tr}(A)}$, but $e^{\text{tr}(A)}>0$, so $\det(e^A)\ne 0$, which means $e^A$ must be invertible. (Fo... |
48,292,498 | I have a little problem at my work.
Here is my code.
* parent window
```
child = window.open(url, "pop", "width=790,height=890,scrollbars=yes");
$("#module").attr("action", "https://~~~").attr("async", false).attr("method", "GET").attr("target", "pop").attr("acceptCharset", "UTF-8").submit().focus();
```
* child w... | 2018/01/17 | [
"https://Stackoverflow.com/questions/48292498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9227080/"
] | I think this is a Java 9 specific issue. Beam does not officially support Java 9 yet - see <https://issues.apache.org/jira/browse/BEAM-2530> for current progress.
You can try working around this specific issue by specifying the classpath elements via `--filesToStage` instead (this will bypass the autodetection based o... | A workaround that works for me in Java 9 is defining filesToStage programmatically based on the classpath.
Her is an example how you can generate the file set from the class path:
```
dataflowPipelineOptions.setFilesToStage(
Arrays.
asList(System.getProperty("java.class.path").split(File.pathSeparator)).
s... |
11,477,579 | Say I wanna create an array of images and i used this:
```
NSMutableArray *images = [[NSMutableArray alloc]init];
```
what role does init really play here? won't it work if I simply use:
```
NSMutableArray *images = [NSMutableArray alloc];
```
Please help. Thanks. | 2012/07/13 | [
"https://Stackoverflow.com/questions/11477579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490706/"
] | No, you absolutely cannot just say `[NSMutableArray alloc]`. Calling a method on the results of sending `+alloc` to *any* class is absolutely incorrect unless that method is one of the `-init...` methods. All `+alloc` does is reserve the memory for the object. It's basically equivalent to calling `calloc(sizeof(class),... | [Apple Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/Reference/Reference.html)
For the best performance when using NSMutableArrays, you always want to use `initWithCapacity:25` or thereabouts. This clears enough memory for a reasonable amount o... |
11,477,579 | Say I wanna create an array of images and i used this:
```
NSMutableArray *images = [[NSMutableArray alloc]init];
```
what role does init really play here? won't it work if I simply use:
```
NSMutableArray *images = [NSMutableArray alloc];
```
Please help. Thanks. | 2012/07/13 | [
"https://Stackoverflow.com/questions/11477579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490706/"
] | This applies not just to arrays, but to any Objective-C class that can be instantiated: `alloc` allocates memory to hold the instance but doesn't put anything in it, and `init` actually initializes an object in that memory location. | [Apple Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/Reference/Reference.html)
For the best performance when using NSMutableArrays, you always want to use `initWithCapacity:25` or thereabouts. This clears enough memory for a reasonable amount o... |
11,477,579 | Say I wanna create an array of images and i used this:
```
NSMutableArray *images = [[NSMutableArray alloc]init];
```
what role does init really play here? won't it work if I simply use:
```
NSMutableArray *images = [NSMutableArray alloc];
```
Please help. Thanks. | 2012/07/13 | [
"https://Stackoverflow.com/questions/11477579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490706/"
] | No, you absolutely cannot just say `[NSMutableArray alloc]`. Calling a method on the results of sending `+alloc` to *any* class is absolutely incorrect unless that method is one of the `-init...` methods. All `+alloc` does is reserve the memory for the object. It's basically equivalent to calling `calloc(sizeof(class),... | This applies not just to arrays, but to any Objective-C class that can be instantiated: `alloc` allocates memory to hold the instance but doesn't put anything in it, and `init` actually initializes an object in that memory location. |
11,477,579 | Say I wanna create an array of images and i used this:
```
NSMutableArray *images = [[NSMutableArray alloc]init];
```
what role does init really play here? won't it work if I simply use:
```
NSMutableArray *images = [NSMutableArray alloc];
```
Please help. Thanks. | 2012/07/13 | [
"https://Stackoverflow.com/questions/11477579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490706/"
] | No, you absolutely cannot just say `[NSMutableArray alloc]`. Calling a method on the results of sending `+alloc` to *any* class is absolutely incorrect unless that method is one of the `-init...` methods. All `+alloc` does is reserve the memory for the object. It's basically equivalent to calling `calloc(sizeof(class),... | Though there are lots of "swizzles" inside Objective-C to short-circuit the scheme in some cases, in the theoretical model `alloc` creates (allocates from heap) space for the object only. The contents of the space is essentially random -- whatever was left over from the previous object to occupy that location.
After `... |
11,477,579 | Say I wanna create an array of images and i used this:
```
NSMutableArray *images = [[NSMutableArray alloc]init];
```
what role does init really play here? won't it work if I simply use:
```
NSMutableArray *images = [NSMutableArray alloc];
```
Please help. Thanks. | 2012/07/13 | [
"https://Stackoverflow.com/questions/11477579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490706/"
] | This applies not just to arrays, but to any Objective-C class that can be instantiated: `alloc` allocates memory to hold the instance but doesn't put anything in it, and `init` actually initializes an object in that memory location. | Though there are lots of "swizzles" inside Objective-C to short-circuit the scheme in some cases, in the theoretical model `alloc` creates (allocates from heap) space for the object only. The contents of the space is essentially random -- whatever was left over from the previous object to occupy that location.
After `... |
22,729,858 | I developed the following sorting algorithm but there are some run time errors that I cant figure out. The program terminates when it comes to the part of filling the array. I'm still a beginner in ada so I couldn't figure out where the problem is...
```
With Ada.Text_IO;
With Ada.Integer_Text_IO;
Use Ada.Integer_Text... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22729858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your Problem is that you are insisting on writing Ada code using c - Style programming paradigms.
**Firstly**:
The declarations:
```
Type Arr is array(1..20) of Integer;
Type int_access is access Arr;
MyArr : int_access;
```
Where you use `Int_Acc : in out int_access` as parameters to procedures are usel... | ```
if j<n **and then** Int_Acc(j+1)>Int_Acc(j) then
j:=j+1;
```
I think you want just 'and' instead of 'and then,' although I haven't looked at Ada code in years.
Did that compile? |
22,729,858 | I developed the following sorting algorithm but there are some run time errors that I cant figure out. The program terminates when it comes to the part of filling the array. I'm still a beginner in ada so I couldn't figure out where the problem is...
```
With Ada.Text_IO;
With Ada.Integer_Text_IO;
Use Ada.Integer_Text... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22729858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | NWS has nailed it : there is a pointer, but no array there.
But it's clear that you have learned C, which leaves you with a lot to learn about other languages including Ada. There really are better ways of doing many things, that aren't taught to C programmers because C doesn't allow them.
---
Allocating variable si... | ```
if j<n **and then** Int_Acc(j+1)>Int_Acc(j) then
j:=j+1;
```
I think you want just 'and' instead of 'and then,' although I haven't looked at Ada code in years.
Did that compile? |
22,729,858 | I developed the following sorting algorithm but there are some run time errors that I cant figure out. The program terminates when it comes to the part of filling the array. I'm still a beginner in ada so I couldn't figure out where the problem is...
```
With Ada.Text_IO;
With Ada.Integer_Text_IO;
Use Ada.Integer_Text... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22729858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your Problem is that you are insisting on writing Ada code using c - Style programming paradigms.
**Firstly**:
The declarations:
```
Type Arr is array(1..20) of Integer;
Type int_access is access Arr;
MyArr : int_access;
```
Where you use `Int_Acc : in out int_access` as parameters to procedures are usel... | NWS has nailed it : there is a pointer, but no array there.
But it's clear that you have learned C, which leaves you with a lot to learn about other languages including Ada. There really are better ways of doing many things, that aren't taught to C programmers because C doesn't allow them.
---
Allocating variable si... |
24,880,327 | ```
names = {'bob':3, 'jack':1,'suzy':0,'amy':5}
def only_child(d:dict)->dict:
'''if the value(# of siblings) for the key(the person) == 0, change the value to True,
otherwise leave the dictionary entry as is.'''
return {name:True for name in d if d[name] == 0}
```
this only gives me `{'suzy': True}`
I tried ... | 2014/07/22 | [
"https://Stackoverflow.com/questions/24880327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3863147/"
] | You are filtering out the non-zero items, see the below:
```
def only_child(d:dict)->dict:
return {name: True if num == 0 else num for name, num in d.items() }
```
and [this construct](https://docs.python.org/3/reference/expressions.html#conditional-expressions) is called a `conditional expression`, or the `tern... | If I understand what you are asking:
```
>>> names = {'bob':3, 'jack':1,'suzy':0,'amy':5}
>>> {k:(v==0 or v) for k,v in names.items()}
{'amy': 5, 'bob': 3, 'jack': 1, 'suzy': True}
``` |
24,880,327 | ```
names = {'bob':3, 'jack':1,'suzy':0,'amy':5}
def only_child(d:dict)->dict:
'''if the value(# of siblings) for the key(the person) == 0, change the value to True,
otherwise leave the dictionary entry as is.'''
return {name:True for name in d if d[name] == 0}
```
this only gives me `{'suzy': True}`
I tried ... | 2014/07/22 | [
"https://Stackoverflow.com/questions/24880327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3863147/"
] | You are filtering out the non-zero items, see the below:
```
def only_child(d:dict)->dict:
return {name: True if num == 0 else num for name, num in d.items() }
```
and [this construct](https://docs.python.org/3/reference/expressions.html#conditional-expressions) is called a `conditional expression`, or the `tern... | **TL;DR: You should have the conditional as part of the value expression, not the dict comprehension**
If you put the test in the condition, then the result of the comprehension will be restricted. If you want to change the value the test should be in the value expression instead. You can use a ternary for that.
```
... |
28,031,896 | I'm very new to MicroStrategy and I'm trying to build a URL to navigate to a report bypassing the prompts. The report has 2 prompts for dates, then a multi-select prompt (search/add items from one listbox into another). I can get it to answer the date prompts (bypass them), but I can't figure out how to answer the mult... | 2015/01/19 | [
"https://Stackoverflow.com/questions/28031896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2044258/"
] | something like this? <http://jsfiddle.net/swm53ran/129/>
`.val()` of a td element doesnt exist like it does for an input. for the td, value is an attribute, so you access it by `.attr('value')`
```
$(document).ready(function() {
$('#mytbody > tr > td.cb').each(function(){
console.log($(this).attr('value'... | `$().val()` is strictly intended to get `value=""` attributes from form inputs, such as `<input>` or `<textarea>`.
If you still wish to assign a `value=""` attribute to the `<td>` element (not recommended), you can retrieve it using `$('#mytbody').attr('value')`. The same can also be used to retrieve the value of any ... |
63,659,739 | I am seriously worried that I don't understand the very fundamentals of C programming. I am reading numbers from a text file, and I am going to check if they are prime numbers or not. However, the problem is that the `IsPrime` function is never being called from the `main` function. I have tried making the `number` var... | 2020/08/30 | [
"https://Stackoverflow.com/questions/63659739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13607493/"
] | We use generic like this in our Storybook:
Maybe you can do a similar thing
```
import React from 'react'
import { Meta, Story } from '@storybook/react/types-6-0'
import SelectDropdown, { ISelectDropdownProps, SelectOption } from './SelectDropdown'
export default {
title: 'Shared/Components/SelectDropdown',
com... | I liked the idea of a helper function so I went playing around. It does cast to `any` inside the function but it doesn't matter for it's usage.
```
import React from "react";
import { Meta, Story } from "@storybook/react";
import { Box, BoxProps } from "./Box";
type BindTemplate = <T extends Story<any>>(template: T, ... |
320,296 | My question might sound stupid, but is there any way that i could connect my desktop PC with my laptop without setting up any router-LAN or without any USB/Ext.HDD. | 2011/08/08 | [
"https://superuser.com/questions/320296",
"https://superuser.com",
"https://superuser.com/users/23211/"
] | Find yourself a [crossover Ethernet cable](http://en.wikipedia.org/wiki/Ethernet_crossover_cable) (they are usually red or are terminated in red connectors) and you connect the PC's directly to each other.
This will have the same effect as being on the same network/LAN without the need for a router/switch/other interm... | You could use firewire if you have the ports, or you can try something like an HDMI to firewire converter.
Using crossover ethernet cables is probably the easiest way. |
320,296 | My question might sound stupid, but is there any way that i could connect my desktop PC with my laptop without setting up any router-LAN or without any USB/Ext.HDD. | 2011/08/08 | [
"https://superuser.com/questions/320296",
"https://superuser.com",
"https://superuser.com/users/23211/"
] | Find yourself a [crossover Ethernet cable](http://en.wikipedia.org/wiki/Ethernet_crossover_cable) (they are usually red or are terminated in red connectors) and you connect the PC's directly to each other.
This will have the same effect as being on the same network/LAN without the need for a router/switch/other interm... | **Option 1:**
You should be able to run a normal ethernet cable between the two machines. Once upon a time this required a crossover cable, but just about any network card made in the last 10 years has a feature called "[auto mdix](http://en.wikipedia.org/wiki/Medium_dependent_interface#Auto-MDIX)" that will handle th... |
150,089 | I have a schottky diode in a sot23 package that is composed by 2 schottky diodes with a common catode connection. I need to use one of them.
Should I let the second floating with unconnected pin or should I connect it to ground? | 2015/01/20 | [
"https://electronics.stackexchange.com/questions/150089",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/59850/"
] | Yes, you can leave the anode of the second diode unconnected.
But, why use a dual diode package in the first place? There are plenty of single Shottky diodes available in small packages. Unless you are using the dual diodes elsewhere in the same design, just use the right part. | If it is literally just a 2 diode package the extra diode can float with no ill effects. Any other connection may cause problems. |
150,089 | I have a schottky diode in a sot23 package that is composed by 2 schottky diodes with a common catode connection. I need to use one of them.
Should I let the second floating with unconnected pin or should I connect it to ground? | 2015/01/20 | [
"https://electronics.stackexchange.com/questions/150089",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/59850/"
] | If the common is connected to a low-impedance node you can leave it floating. If not, I'd short it out lest it act as an accidental antenna/detector.
I'd also suggest using the single out of the pair that would be present if you bought the one-diode version of the 3-pin package (if possible), just for future compatib... | If it is literally just a 2 diode package the extra diode can float with no ill effects. Any other connection may cause problems. |
150,089 | I have a schottky diode in a sot23 package that is composed by 2 schottky diodes with a common catode connection. I need to use one of them.
Should I let the second floating with unconnected pin or should I connect it to ground? | 2015/01/20 | [
"https://electronics.stackexchange.com/questions/150089",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/59850/"
] | If the common is connected to a low-impedance node you can leave it floating. If not, I'd short it out lest it act as an accidental antenna/detector.
I'd also suggest using the single out of the pair that would be present if you bought the one-diode version of the 3-pin package (if possible), just for future compatib... | Yes, you can leave the anode of the second diode unconnected.
But, why use a dual diode package in the first place? There are plenty of single Shottky diodes available in small packages. Unless you are using the dual diodes elsewhere in the same design, just use the right part. |
150,089 | I have a schottky diode in a sot23 package that is composed by 2 schottky diodes with a common catode connection. I need to use one of them.
Should I let the second floating with unconnected pin or should I connect it to ground? | 2015/01/20 | [
"https://electronics.stackexchange.com/questions/150089",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/59850/"
] | Yes, you can leave the anode of the second diode unconnected.
But, why use a dual diode package in the first place? There are plenty of single Shottky diodes available in small packages. Unless you are using the dual diodes elsewhere in the same design, just use the right part. | Seems like there is a third option besides floating or grounded, shorted? i.e. connect the anode to the cathode. |
150,089 | I have a schottky diode in a sot23 package that is composed by 2 schottky diodes with a common catode connection. I need to use one of them.
Should I let the second floating with unconnected pin or should I connect it to ground? | 2015/01/20 | [
"https://electronics.stackexchange.com/questions/150089",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/59850/"
] | If the common is connected to a low-impedance node you can leave it floating. If not, I'd short it out lest it act as an accidental antenna/detector.
I'd also suggest using the single out of the pair that would be present if you bought the one-diode version of the 3-pin package (if possible), just for future compatib... | Seems like there is a third option besides floating or grounded, shorted? i.e. connect the anode to the cathode. |
234,142 | I beg your pardon for such a silly question, but I've never really understood the explanation they gave in the Geography textbooks. If the slanting Sun's rays due to the Earth's axial tilt can cause such a huge temperature difference, why isn't all our ocean get frozen when the Earth is farthest from the Sun (in the Ea... | 2016/02/06 | [
"https://physics.stackexchange.com/questions/234142",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/74626/"
] | If you compare the Earth-Sun distance in the summer and in the winter, you will notice that it differs by only about 4%. Given that the radiation strength of the Sun is proportional to 1/distance^2, the radiation intensity is roughly 8% STRONGER in the WINTER (on the northern hemisphere) than in the summer.
But the d... | It is a very general doubt and really important.
Slanting sun rays coming to earth from sun are refracted and rarely reach earth. They deviate by refraction.
At equator and tropics refraction is less.
As you know for $\theta = 0$ no refraction take place and as angle increase refraction increase.
As poles do not get... |
82,662 | In the *13 Reasons Why* episode where Hannah kills herself, that particular morning she wears a scarf along with a blue jacket. Earlier, when she wore the same jacket, I don't remember her wearing that scarf.
Is the presence of the scarf supposed to mean something? | 2017/11/13 | [
"https://movies.stackexchange.com/questions/82662",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/53624/"
] | After the rape, she must have started to be insecure about her body and chose to cover it as much as she could. So hence, the scarf. | The state of a person's mind also determines his/her choice of clothing. Given the situation Hannah was in, people tend to wear more clothes because they feel comfortable with being more covered (the connection to the mind) and also the fact that the body temperature decreases when you are afraid or are fearful or tens... |
638,078 | Here is a problem I need to solve:
$$ \sum\_{k=2}^n \frac{1}{k^2-1} $$
It came with another one alreay done in the same task:
$$ \sum\_{k=1}^n \frac{1}{k(k+1)} = \sum\_{k=1}^n \frac{(k+1)-k}{k(k+1)} = \sum\_{k=1}^n \frac{1}{k} - \sum\_{k=1}^n \frac{1}{k+1} = \sum\_{k=1}^n \frac{1}{k} - \sum\_{k=2}^{n+1} \frac{1}{k} ... | 2014/01/14 | [
"https://math.stackexchange.com/questions/638078",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/105908/"
] | **Hint**
$$\frac{1}{k^2-1}=\frac 1 2\left(\frac{1}{k-1}-\frac{1}{k+1}\right)=\frac 1 2\left(\frac{1}{k-1}-\frac 1 k+\frac 1 k-\frac{1}{k+1}\right)$$ | $\frac{1}{(k-1)(k+1)}=\frac{1}{2}\frac{1}{k-1}-\frac{1}{2}\frac{1}{k+1}$ |
138,984 | So we are venturing out into the world of SharePoint and it seems that I have to install SharePoint Server directly on each developer's box. Is this correct? I have SharePoint up and running on a separate sever so it seems redundant to have to install it on each box. Not to mention installing SharePoint on Windows 7 is... | 2010/05/05 | [
"https://serverfault.com/questions/138984",
"https://serverfault.com",
"https://serverfault.com/users/42344/"
] | No you don't need to install sharepoint on every box, just VS and the SDK. You should have a separate dev instance for them to connect to, but that should be a real server not a win7 desktop.
So you should have
1 Server with sharepoint 2010
N Dev workstations that have VS2010 and the SDK installed. | We've used Microsfoft VPC and installed Server 2008 and Sharepoint on that. Then do dev either on your host PC or the VPC and deploy to the Sharepoint instance on your VPC to test your changes. This way developers are stepping all over each other in a Development environment. |
138,984 | So we are venturing out into the world of SharePoint and it seems that I have to install SharePoint Server directly on each developer's box. Is this correct? I have SharePoint up and running on a separate sever so it seems redundant to have to install it on each box. Not to mention installing SharePoint on Windows 7 is... | 2010/05/05 | [
"https://serverfault.com/questions/138984",
"https://serverfault.com",
"https://serverfault.com/users/42344/"
] | No you don't need to install sharepoint on every box, just VS and the SDK. You should have a separate dev instance for them to connect to, but that should be a real server not a win7 desktop.
So you should have
1 Server with sharepoint 2010
N Dev workstations that have VS2010 and the SDK installed. | SharePoint 2008 cannot be installed on Microsoft VPC due to the fact that it needs Windows Server 2008 64-bit. Microsoft VPC cannot run a 64-bit Operating System, you'll need a different Virtualization Platform.
This can be confusing due to the fact that you can run a 64-bit version of Microsoft VPC. |
138,984 | So we are venturing out into the world of SharePoint and it seems that I have to install SharePoint Server directly on each developer's box. Is this correct? I have SharePoint up and running on a separate sever so it seems redundant to have to install it on each box. Not to mention installing SharePoint on Windows 7 is... | 2010/05/05 | [
"https://serverfault.com/questions/138984",
"https://serverfault.com",
"https://serverfault.com/users/42344/"
] | No you don't need to install sharepoint on every box, just VS and the SDK. You should have a separate dev instance for them to connect to, but that should be a real server not a win7 desktop.
So you should have
1 Server with sharepoint 2010
N Dev workstations that have VS2010 and the SDK installed. | Here is couple practical tips for setting up SharePoint 2010 development environment:
[SharePoint 2010 Team Development Environment](https://learn.microsoft.com/en-us/archive/blogs/vesku/sharepoint-2010-team-development-environment) by Vesa Juvonen
[SharePoint 2010 Development Environment Practical Tips](https://web.... |
138,984 | So we are venturing out into the world of SharePoint and it seems that I have to install SharePoint Server directly on each developer's box. Is this correct? I have SharePoint up and running on a separate sever so it seems redundant to have to install it on each box. Not to mention installing SharePoint on Windows 7 is... | 2010/05/05 | [
"https://serverfault.com/questions/138984",
"https://serverfault.com",
"https://serverfault.com/users/42344/"
] | We've used Microsfoft VPC and installed Server 2008 and Sharepoint on that. Then do dev either on your host PC or the VPC and deploy to the Sharepoint instance on your VPC to test your changes. This way developers are stepping all over each other in a Development environment. | SharePoint 2008 cannot be installed on Microsoft VPC due to the fact that it needs Windows Server 2008 64-bit. Microsoft VPC cannot run a 64-bit Operating System, you'll need a different Virtualization Platform.
This can be confusing due to the fact that you can run a 64-bit version of Microsoft VPC. |
138,984 | So we are venturing out into the world of SharePoint and it seems that I have to install SharePoint Server directly on each developer's box. Is this correct? I have SharePoint up and running on a separate sever so it seems redundant to have to install it on each box. Not to mention installing SharePoint on Windows 7 is... | 2010/05/05 | [
"https://serverfault.com/questions/138984",
"https://serverfault.com",
"https://serverfault.com/users/42344/"
] | We've used Microsfoft VPC and installed Server 2008 and Sharepoint on that. Then do dev either on your host PC or the VPC and deploy to the Sharepoint instance on your VPC to test your changes. This way developers are stepping all over each other in a Development environment. | Here is couple practical tips for setting up SharePoint 2010 development environment:
[SharePoint 2010 Team Development Environment](https://learn.microsoft.com/en-us/archive/blogs/vesku/sharepoint-2010-team-development-environment) by Vesa Juvonen
[SharePoint 2010 Development Environment Practical Tips](https://web.... |
13,059,548 | I am writing a generic repository to interface with EF using DBContext.
I have a generic Get() method which receives a primary key value and returns the entity:
```
public class DALRepository<DALEntity> : IDisposable, IGenericRepository<DALEntity> where DALEntity : class
{
private IDbSet<DALEntity> dbSet;
private NW... | 2012/10/24 | [
"https://Stackoverflow.com/questions/13059548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/826132/"
] | Kind of wierd answering your own question but in case anyone else has this issue here's what I did. I used the dynamic LINQ stuff and used the string overloaded version of .Where(). I used one of the links mentioned to figure out how to grab the primary key (and mine is from a DBContext as well), and the method now loo... | You could get your Key dinamycally the way it is described here : <https://stackoverflow.com/a/10796471/971693>
That being said, I can't see a way without using some reflection :
```
public IEnumerable<DALEntity> Get(params string IDs)
{
var objectSet = objectContext.CreateObjectSet<YourEntityType>();
var keyNa... |
13,059,548 | I am writing a generic repository to interface with EF using DBContext.
I have a generic Get() method which receives a primary key value and returns the entity:
```
public class DALRepository<DALEntity> : IDisposable, IGenericRepository<DALEntity> where DALEntity : class
{
private IDbSet<DALEntity> dbSet;
private NW... | 2012/10/24 | [
"https://Stackoverflow.com/questions/13059548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/826132/"
] | Kind of wierd answering your own question but in case anyone else has this issue here's what I did. I used the dynamic LINQ stuff and used the string overloaded version of .Where(). I used one of the links mentioned to figure out how to grab the primary key (and mine is from a DBContext as well), and the method now loo... | Use Linq's [Single](http://msdn.microsoft.com/en-us/library/system.linq.enumerable.single.aspx) or [First](http://msdn.microsoft.com/en-us/library/system.linq.enumerable.first.aspx) methods, which allow you to search on `IQueryable` objects.
```
public DALEntity Get(string ID, IEnumerable<string> IncludeEntities = nul... |
25,353,216 | Whats the difference between containsValue and contains method of Hashtable
<http://docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html> | 2014/08/17 | [
"https://Stackoverflow.com/questions/25353216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936690/"
] | There isn't one. Emphasis mine.
>
> Returns true if this hashtable maps one or more keys to this value.
> Note that **this method is identical in functionality to `contains` (which predates the Map interface).**
>
>
>
So you can use either one, I would perfer `containsValue()` because it is a bit more self-expla... | If you read the full documentation for `contains()`, you will see
>
> Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).
>
>
> |
25,353,216 | Whats the difference between containsValue and contains method of Hashtable
<http://docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html> | 2014/08/17 | [
"https://Stackoverflow.com/questions/25353216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3936690/"
] | There isn't one. Emphasis mine.
>
> Returns true if this hashtable maps one or more keys to this value.
> Note that **this method is identical in functionality to `contains` (which predates the Map interface).**
>
>
>
So you can use either one, I would perfer `containsValue()` because it is a bit more self-expla... | They are the same. If you don't believe the documentation, look into the [source code](http://www.docjar.com/html/api/java/util/Hashtable.java.html) (line 314):
```
public boolean containsValue(Object value) {
return contains(value);
}
``` |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | Chrome v63 forces .dev domains to HTTPS. The Internet Engineering Task Force [RFC2606](https://www.rfc-editor.org/rfc/rfc2606) specified what top level domains should be used for local development, and .dev isn't on that list.
Google owns the .dev top level domain and automatically redirects all .dev domain names to a... | I can't improve the answer of @benedikt, as it is correct. There are good temporary fixes: * [typing "badidea" on the warning page](https://stackoverflow.com/a/47756943/7372952), this might not work if you have SSL set up (hacked together) locally. It bypasses the warning, but my local SSL isn't setup correctly and sho... |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | Chrome v63 forces .dev domains to HTTPS. The Internet Engineering Task Force [RFC2606](https://www.rfc-editor.org/rfc/rfc2606) specified what top level domains should be used for local development, and .dev isn't on that list.
Google owns the .dev top level domain and automatically redirects all .dev domain names to a... | I have found a quick work-around that worked for my needs and may help someone else.
I use [Browser Sync](https://browsersync.io) when developing and I just set the proxy argument to "testsite.dev" and it will serve up correctly in Chrome.
Here is the command I am using:
```
browser-sync start --proxy "testsite.dev"... |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | Chrome v63 forces .dev domains to HTTPS. The Internet Engineering Task Force [RFC2606](https://www.rfc-editor.org/rfc/rfc2606) specified what top level domains should be used for local development, and .dev isn't on that list.
Google owns the .dev top level domain and automatically redirects all .dev domain names to a... | I too use the .dev extension and will change to some other domain in the future but for my existing .dev sites, when the privacy error shows up, click anywhere on the screen and type 'badidea' and chrome will redirect you to the site. It works! |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | Chrome v63 forces .dev domains to HTTPS. The Internet Engineering Task Force [RFC2606](https://www.rfc-editor.org/rfc/rfc2606) specified what top level domains should be used for local development, and .dev isn't on that list.
Google owns the .dev top level domain and automatically redirects all .dev domain names to a... | **Solution 1 - choose a reserved and future-proof gLTD like .localhost or .test**
Edit your hosts file (for Windows it is C:\Windows\System32\Drivers\etc\hosts)
```
127.0.0.1 testsite.localhost
```
**Solution 2 - install a self-signed certificate for .dev**
1. Create the certificate. Open Powershell as Admni... |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | I can't improve the answer of @benedikt, as it is correct. There are good temporary fixes: * [typing "badidea" on the warning page](https://stackoverflow.com/a/47756943/7372952), this might not work if you have SSL set up (hacked together) locally. It bypasses the warning, but my local SSL isn't setup correctly and sho... | I have found a quick work-around that worked for my needs and may help someone else.
I use [Browser Sync](https://browsersync.io) when developing and I just set the proxy argument to "testsite.dev" and it will serve up correctly in Chrome.
Here is the command I am using:
```
browser-sync start --proxy "testsite.dev"... |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | I can't improve the answer of @benedikt, as it is correct. There are good temporary fixes: * [typing "badidea" on the warning page](https://stackoverflow.com/a/47756943/7372952), this might not work if you have SSL set up (hacked together) locally. It bypasses the warning, but my local SSL isn't setup correctly and sho... | I too use the .dev extension and will change to some other domain in the future but for my existing .dev sites, when the privacy error shows up, click anywhere on the screen and type 'badidea' and chrome will redirect you to the site. It works! |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | I can't improve the answer of @benedikt, as it is correct. There are good temporary fixes: * [typing "badidea" on the warning page](https://stackoverflow.com/a/47756943/7372952), this might not work if you have SSL set up (hacked together) locally. It bypasses the warning, but my local SSL isn't setup correctly and sho... | **Solution 1 - choose a reserved and future-proof gLTD like .localhost or .test**
Edit your hosts file (for Windows it is C:\Windows\System32\Drivers\etc\hosts)
```
127.0.0.1 testsite.localhost
```
**Solution 2 - install a self-signed certificate for .dev**
1. Create the certificate. Open Powershell as Admni... |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | I have found a quick work-around that worked for my needs and may help someone else.
I use [Browser Sync](https://browsersync.io) when developing and I just set the proxy argument to "testsite.dev" and it will serve up correctly in Chrome.
Here is the command I am using:
```
browser-sync start --proxy "testsite.dev"... | I too use the .dev extension and will change to some other domain in the future but for my existing .dev sites, when the privacy error shows up, click anywhere on the screen and type 'badidea' and chrome will redirect you to the site. It works! |
47,735,877 | A few days ago, Chrome started redirecting all of my vHosts in Wampserver to https. Everything was working fine until a couple days ago, then one day I logged on to work on my site and Chrome said that the site couldn't be reached, even though I used the same URL i always did in the past. Wamp is running as well as Apa... | 2017/12/10 | [
"https://Stackoverflow.com/questions/47735877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560768/"
] | I have found a quick work-around that worked for my needs and may help someone else.
I use [Browser Sync](https://browsersync.io) when developing and I just set the proxy argument to "testsite.dev" and it will serve up correctly in Chrome.
Here is the command I am using:
```
browser-sync start --proxy "testsite.dev"... | **Solution 1 - choose a reserved and future-proof gLTD like .localhost or .test**
Edit your hosts file (for Windows it is C:\Windows\System32\Drivers\etc\hosts)
```
127.0.0.1 testsite.localhost
```
**Solution 2 - install a self-signed certificate for .dev**
1. Create the certificate. Open Powershell as Admni... |
113,522 | I've just installed a 3.5 Inch RPi LCD (A) V3 (XPT2046 Touch Controller) on my Raspberry Pi 3 Model B+ and I'm having problems with the colors of the display. I'm attaching an image to show you.
[](https://i.stack.imgur.com/Wp2C0.jpg)
I'm using the driver from this lin... | 2020/06/17 | [
"https://raspberrypi.stackexchange.com/questions/113522",
"https://raspberrypi.stackexchange.com",
"https://raspberrypi.stackexchange.com/users/100014/"
] | According to the Debian Wiki it could be possible, because RPi4 now boots from CPU instead of GPU.
Unfortunately, it seems that currently the Debian kernel does not support the RPi4.
Sources:
<https://wiki.debian.org/RaspberryPi#Raspberry_Pi_4> | Pure Debian on RPi 4B
---------------------
The kernel in use for Bullseye now makes this possible, with some caveats.
* This works for RPi 4B, other hardware not tested.
* The SD card is not recognized.
* The install is to a USB-3 drive.
* The install is with wired Ethernet.
* This requires the testing release (Bull... |
1,102,309 | I am working on gestures using acceleration values (x, y, z) from a device.
If I hold the device in my hand in a resting position (x,y,z) = ((0,0,0)). But if I change the direction of device (still at resting position) the values are changed to something like ((766,766,821)). As all the x, y, z axis are changed compar... | 2009/07/09 | [
"https://Stackoverflow.com/questions/1102309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116663/"
] | The acceleration due to gravity will always be present. It appears you are subtracting that value from one of the axes when the device is in a particular orientation.
What you will need to do to detect gestures is to detect the tiny difference that momentarily appears from the acceleration due to gravity as the device... | I find your question unclear. What exactly do you measure and what do you expect?
In general, an accelerometer will, if held in fixed position, measure the gravity of the earth. This is displayed as acceleration upwards, which might sound strange at first but is completely correct: as the gravity is accelerating "down... |
1,102,309 | I am working on gestures using acceleration values (x, y, z) from a device.
If I hold the device in my hand in a resting position (x,y,z) = ((0,0,0)). But if I change the direction of device (still at resting position) the values are changed to something like ((766,766,821)). As all the x, y, z axis are changed compar... | 2009/07/09 | [
"https://Stackoverflow.com/questions/1102309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116663/"
] | The acceleration due to gravity will always be present. It appears you are subtracting that value from one of the axes when the device is in a particular orientation.
What you will need to do to detect gestures is to detect the tiny difference that momentarily appears from the acceleration due to gravity as the device... | Your comment makes your question clearer. What you need to do is *calibrate* your accelerometer every time the orientation changes. There is no getting around this. You could make it a UI element in your application or if it fits with your uses, recalibrate to 0 if the acceleration is relatively constant for some amoun... |
1,102,309 | I am working on gestures using acceleration values (x, y, z) from a device.
If I hold the device in my hand in a resting position (x,y,z) = ((0,0,0)). But if I change the direction of device (still at resting position) the values are changed to something like ((766,766,821)). As all the x, y, z axis are changed compar... | 2009/07/09 | [
"https://Stackoverflow.com/questions/1102309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116663/"
] | The acceleration due to gravity will always be present. It appears you are subtracting that value from one of the axes when the device is in a particular orientation.
What you will need to do to detect gestures is to detect the tiny difference that momentarily appears from the acceleration due to gravity as the device... | If the device is not compensating automatically for the gravitational acceleration you need to substract the (0,0,~9.8m/s2) vector from the output of the device.
However, you will also need to have the orientation of the device (Euler angle or Rotation Matrix). If your device isn't providing that it's basically impos... |
25,319,787 | Can anyone share an example of RabinMillerTest() that works? My googlefu is sadly lacking.
Here is my test code:
```
#include "integer.h"
#include "nbtheory.h"
#include "cryptlib.h"
#include "osrng.h"
#include <iostream>
int main(int argc,char *argv[])
{
CryptoPP::RandomNumberGenerator rng;
CryptoPP::Integer ... | 2014/08/15 | [
"https://Stackoverflow.com/questions/25319787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3920315/"
] | `var this.list = [];` is the problem `this.list = [];` will do...
`this.list` is not a variable, here `list` is a property of an object referred by `this` so there is no need to use `var`.
Also there is a context problem in your each loop, so
```
var Deck = Class.create({
init: function () {
this.list = ... | You don't need `var` in front of `this.list` — you are assigning a property to an already existing object, not creating a new one. |
42,405 | How to distribute English alphabet letters among Boggle game dice? How to make rolling for example letter "A" more often than others? How to choose how many copies of each letter to make, and how many copies of them to put on one dice? Can you please answer to these questions? | 2011/05/31 | [
"https://math.stackexchange.com/questions/42405",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/11451/"
] | Let's work with Scrabble tiles (without blanks) instead of Boggle dice, just to keep things as simple as possible. (At the end, you can make your Boggle dice by sticking the Scrabble tiles onto them.) Suppose we have $n$ tiles, with $n \ge 26$, and a table of letter frequencies (for instance, [this one](http://en.wikip... | Assuming you want it to approximately match the distribution of letters in English words, you can generate a histogram with something like this:
>
> cat /usr/share/dict/words |perl -pe 's/[^a-z]//gs' |perl -e 'print join("\n", split //, <>) . "\n"' |sort |uniq -c
>
>
>
Convert these values into probabilities by d... |
42,405 | How to distribute English alphabet letters among Boggle game dice? How to make rolling for example letter "A" more often than others? How to choose how many copies of each letter to make, and how many copies of them to put on one dice? Can you please answer to these questions? | 2011/05/31 | [
"https://math.stackexchange.com/questions/42405",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/11451/"
] | I think the question you're trying to ask is: 'how can I distribute my letters among the faces of the (16) Boggle dice so as to approximately match English probabilities?' This is actually a more interesting question than it looks at first glance, because the first-order approximation is easy, but subtle 'nonlinear' ef... | Assuming you want it to approximately match the distribution of letters in English words, you can generate a histogram with something like this:
>
> cat /usr/share/dict/words |perl -pe 's/[^a-z]//gs' |perl -e 'print join("\n", split //, <>) . "\n"' |sort |uniq -c
>
>
>
Convert these values into probabilities by d... |
42,405 | How to distribute English alphabet letters among Boggle game dice? How to make rolling for example letter "A" more often than others? How to choose how many copies of each letter to make, and how many copies of them to put on one dice? Can you please answer to these questions? | 2011/05/31 | [
"https://math.stackexchange.com/questions/42405",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/11451/"
] | Assuming you want it to approximately match the distribution of letters in English words, you can generate a histogram with something like this:
>
> cat /usr/share/dict/words |perl -pe 's/[^a-z]//gs' |perl -e 'print join("\n", split //, <>) . "\n"' |sort |uniq -c
>
>
>
Convert these values into probabilities by d... | I've just written a simple python program to do this, and am looking for the actual letters that occur on the dice.
You want a 16 element array, each element of which is a 6-element array of ints.
```
import array
lets = [array.array('i',[0]*6)]*16
```
constructs the required array. Then you put the appropriate cha... |
42,405 | How to distribute English alphabet letters among Boggle game dice? How to make rolling for example letter "A" more often than others? How to choose how many copies of each letter to make, and how many copies of them to put on one dice? Can you please answer to these questions? | 2011/05/31 | [
"https://math.stackexchange.com/questions/42405",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/11451/"
] | I think the question you're trying to ask is: 'how can I distribute my letters among the faces of the (16) Boggle dice so as to approximately match English probabilities?' This is actually a more interesting question than it looks at first glance, because the first-order approximation is easy, but subtle 'nonlinear' ef... | Let's work with Scrabble tiles (without blanks) instead of Boggle dice, just to keep things as simple as possible. (At the end, you can make your Boggle dice by sticking the Scrabble tiles onto them.) Suppose we have $n$ tiles, with $n \ge 26$, and a table of letter frequencies (for instance, [this one](http://en.wikip... |
42,405 | How to distribute English alphabet letters among Boggle game dice? How to make rolling for example letter "A" more often than others? How to choose how many copies of each letter to make, and how many copies of them to put on one dice? Can you please answer to these questions? | 2011/05/31 | [
"https://math.stackexchange.com/questions/42405",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/11451/"
] | Let's work with Scrabble tiles (without blanks) instead of Boggle dice, just to keep things as simple as possible. (At the end, you can make your Boggle dice by sticking the Scrabble tiles onto them.) Suppose we have $n$ tiles, with $n \ge 26$, and a table of letter frequencies (for instance, [this one](http://en.wikip... | I've just written a simple python program to do this, and am looking for the actual letters that occur on the dice.
You want a 16 element array, each element of which is a 6-element array of ints.
```
import array
lets = [array.array('i',[0]*6)]*16
```
constructs the required array. Then you put the appropriate cha... |
42,405 | How to distribute English alphabet letters among Boggle game dice? How to make rolling for example letter "A" more often than others? How to choose how many copies of each letter to make, and how many copies of them to put on one dice? Can you please answer to these questions? | 2011/05/31 | [
"https://math.stackexchange.com/questions/42405",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/11451/"
] | I think the question you're trying to ask is: 'how can I distribute my letters among the faces of the (16) Boggle dice so as to approximately match English probabilities?' This is actually a more interesting question than it looks at first glance, because the first-order approximation is easy, but subtle 'nonlinear' ef... | I've just written a simple python program to do this, and am looking for the actual letters that occur on the dice.
You want a 16 element array, each element of which is a 6-element array of ints.
```
import array
lets = [array.array('i',[0]*6)]*16
```
constructs the required array. Then you put the appropriate cha... |
79,940 | Fubini's theorem, from 1907, expresses integration with respect to a product measure in terms of iterated integrals. The simpler version of this theorem for multiple Riemann integrals was used long before Fubini was around and of course was not known by his name. Nowadays it is common for the relation between multiple ... | 2011/11/07 | [
"https://math.stackexchange.com/questions/79940",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/619/"
] | There is a note by R. T. Seeley in the American Mathematical Monthly from 1961 (vol. 68, pp. 56-57) titled *Fubini Implies Leibniz Implies $F\_{yx}=F\_{xy}$.* The note can be found in *Selected Papers on Calculus* (1969), edited by a committee chaired by Tom Apostol. I quote from the second paragraph:
"The note first ... | Here's what I can verify: Fubini apparently proved the general form of the theorem in 1907 and began dispersing the proof in oral lectures. It did not appear in a fully detailed statement and proof in the literature until 1958. It is sometimes called the Tonnelli theorem because Fubini's result is actually a modified f... |
79,940 | Fubini's theorem, from 1907, expresses integration with respect to a product measure in terms of iterated integrals. The simpler version of this theorem for multiple Riemann integrals was used long before Fubini was around and of course was not known by his name. Nowadays it is common for the relation between multiple ... | 2011/11/07 | [
"https://math.stackexchange.com/questions/79940",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/619/"
] | I used a Google search on ['Fubini 's Theorem' on books from 1947 to 1976](https://www.google.com/search?q=%22Fubini%27s%20theorem%22&tbs=bks:1,cdr:1,cd_min:1947,cd_max:1976&lr=lang_en#lr=lang_en&psj=1&q=%22Fubini%27s%20theorem%22&tbm=bks&tbs=cdr:1,cd_min:1947,cd_max:1976,lr%3alang_1en,sbd:1) and read the snippets of t... | Here's what I can verify: Fubini apparently proved the general form of the theorem in 1907 and began dispersing the proof in oral lectures. It did not appear in a fully detailed statement and proof in the literature until 1958. It is sometimes called the Tonnelli theorem because Fubini's result is actually a modified f... |
79,940 | Fubini's theorem, from 1907, expresses integration with respect to a product measure in terms of iterated integrals. The simpler version of this theorem for multiple Riemann integrals was used long before Fubini was around and of course was not known by his name. Nowadays it is common for the relation between multiple ... | 2011/11/07 | [
"https://math.stackexchange.com/questions/79940",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/619/"
] | There is a note by R. T. Seeley in the American Mathematical Monthly from 1961 (vol. 68, pp. 56-57) titled *Fubini Implies Leibniz Implies $F\_{yx}=F\_{xy}$.* The note can be found in *Selected Papers on Calculus* (1969), edited by a committee chaired by Tom Apostol. I quote from the second paragraph:
"The note first ... | I used a Google search on ['Fubini 's Theorem' on books from 1947 to 1976](https://www.google.com/search?q=%22Fubini%27s%20theorem%22&tbs=bks:1,cdr:1,cd_min:1947,cd_max:1976&lr=lang_en#lr=lang_en&psj=1&q=%22Fubini%27s%20theorem%22&tbm=bks&tbs=cdr:1,cd_min:1947,cd_max:1976,lr%3alang_1en,sbd:1) and read the snippets of t... |
2,598,904 | Given Linear Transformation $T: R^3->R^2 $ so that:
$$T \begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix} =\begin{bmatrix} 2 \\ -1 \end{bmatrix} , T \begin{bmatrix} 2 \\ -2 \\ 0 \end{bmatrix} =\begin{bmatrix} -2 \\ -2 \end{bmatrix} , T \begin{bmatrix} 2 \\ -1 \\ -2 \end{bmatrix} =\begin{bmatrix} -1 \\ 1 \end{bmatrix}$$
a... | 2018/01/09 | [
"https://math.stackexchange.com/questions/2598904",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/510401/"
] | Let $V,W$, $T:V\rightarrow W$ and $\{v\_i\},\{w\_i\}$ as above. The matrix representation of $T$ is now constructed as follows:
* First, if $\mbox{dim }V=m$ and $\mbox{dim }W=n$ the matrix is $n\times m$ (because you applied it to $m\times1$ matrices to get $n\times 1$), and the size is independent of the choice of ba... | The following matrix
$$M\_{T,B}= \begin{bmatrix} 2 &-2&-1 \\ -1&-2&1 \end{bmatrix}$$
represent the transformation T from the basis $\mathcal{B}$
$$v\_{1,B}=\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}, v\_{2,B}= \begin{bmatrix} 2 \\ -2 \\ 0 \end{bmatrix} , v\_{3,B} \begin{bmatrix} 2 \\ -1 \\ -2 \end{bmatrix}$$
to the ... |
31,806 | In English you sometimes pronounce words in very different pitches/tones to express your emotions.
For example when you're offended, surprised or when being sarcastic.
Depending on the situation you may for instance answer a question with a sort of falling tone "No.". If the question offends you may answer "No." with... | 2018/10/28 | [
"https://chinese.stackexchange.com/questions/31806",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/20658/"
] | Well in China,we use the same way to pronounce words in sentences.We may speak louder with angry tone when we are angry or quarrlling with someone.
For if changing tone may at the same time change the meaning,I want to say that it doesn't matter when you try to understand the meaning of the whole sentence.If you pick ... | In Chinese, I think we pronounce words in different pitches and voice volume to express different emotions with tones staying unchanged.
If you want to put an emphasis on certain words, you can speak them louder, with a higher pitch, or both.
If you change the tone, it will change the meaning in Chinese. |
4,649,000 | How can I retrieve the value of specified column of the selected row in a multicolumn listbox?
I populate the listbox by setting the RowSource property with a SQL string. BoundColumn set to value 1.
I can retrieve the value of the bound column (of the selected row) by using `ListBox.Value`. But I also want the value ... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4649000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293843/"
] | Use `listboxControl.Column(intColumn,intRow)`. Both Column and Row are zero-based. | Just a little addition.
If you've only selected 1 row then the code below will select the value of a column (index of 4, but 5th column) for the selected row:
```
me.lstIssues.Column(4)
```
This saves having to use the ItemsSelected property.
Kristian |
4,649,000 | How can I retrieve the value of specified column of the selected row in a multicolumn listbox?
I populate the listbox by setting the RowSource property with a SQL string. BoundColumn set to value 1.
I can retrieve the value of the bound column (of the selected row) by using `ListBox.Value`. But I also want the value ... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4649000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293843/"
] | Use `listboxControl.Column(intColumn,intRow)`. Both Column and Row are zero-based. | For multicolumn listbox extract data from any column of selected row by
```
listboxControl.List(listboxControl.ListIndex,col_num)
```
where col\_num is required column ( 0 for first column) |
4,649,000 | How can I retrieve the value of specified column of the selected row in a multicolumn listbox?
I populate the listbox by setting the RowSource property with a SQL string. BoundColumn set to value 1.
I can retrieve the value of the bound column (of the selected row) by using `ListBox.Value`. But I also want the value ... | 2011/01/10 | [
"https://Stackoverflow.com/questions/4649000",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293843/"
] | Just a little addition.
If you've only selected 1 row then the code below will select the value of a column (index of 4, but 5th column) for the selected row:
```
me.lstIssues.Column(4)
```
This saves having to use the ItemsSelected property.
Kristian | For multicolumn listbox extract data from any column of selected row by
```
listboxControl.List(listboxControl.ListIndex,col_num)
```
where col\_num is required column ( 0 for first column) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | Tools that I would use
[Nmap](http://nmap.org/) Sister Tool [SQLMap](http://sqlmap.sourceforge.net/doc/README.html)
and [Nessus](http://nessus.org/nessus/)
also quick scanning for XSS and HTML Injection <http://www.seoegghead.com/tools/scan-for-html-injection.seo> also <http://www.cirt.net/nikto2>
Make sure you hav... | [Nikto](http://www.cirt.net/nikto2 "Nikto") is a nice start to look for well known vulnerabilities. Works on Windows and Linux, etc. Simple enough even for noobs like me :) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | [McAfee Secure](http://www.mcafeesecure.com/us/) offers a pretty decent scanning service that will look at the web server, network, and the web site itself in an automated, on-demand way. Their scanner is certified for PCI scans, so it's pretty comprehensive. | There is a variety of public license tools out there at your disposal, however, where I operate, we use Firefox and Paros Proxy to manipulate posts and gets, WebInspect for application vulnerablity reporting, and QualysGuard Enterprise for a good old fashioned hosts scan. Depending on what the results are, we make adju... |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | [Nikto](http://www.cirt.net/nikto2 "Nikto") is a nice start to look for well known vulnerabilities. Works on Windows and Linux, etc. Simple enough even for noobs like me :) | [Free Nikto, Nmap, OpenVas vulnerability scans available online from this website](http://www.hackertarget.com) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | [Nikto](http://www.cirt.net/nikto2 "Nikto") is a nice start to look for well known vulnerabilities. Works on Windows and Linux, etc. Simple enough even for noobs like me :) | Actually i'm the main creator of a new pentest LiveCD Distro, which is a fork of Backtrack 4.
The Distro embbeds everything needed to make good penetration tests ( OpenVAS, Metasploit, fasttrack, milw0rm exploits...). Its name is shadowcircle, and you can check it out @
www.shadowcircle.org.
Hope you'll like it ;) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | Top l0 list of Vulnerability scanners: http:// sectools.org/vuln-scanners.html
There's also Microsoft's Baseline Security Analyzer which should be part of your base setup if its not already before you deploy a server to prod: http:// www.microsoft.com/downloads/details.aspx?familyid=F32921AF-9DBE-4DCE-889E-ECF997EB18E... | Regardless of the technology you need to know the threats. You need to know what is the data that you are trying to protect? You need to know how your website works. Do a threat model first forgetting about these magical security bullet technology methods. You need to figure out where you are at before you spend wastel... |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | The first thing would be a **network scan**. Since you're on the windows stack, use [zenmap](http://nmap.org/zenmap/) and scan the webserver and both sql servers. This will tell you about open ports and services running. Run zenmap on the comprehensive test. I would use this info to tweak your firewall to block ports t... | Actually i'm the main creator of a new pentest LiveCD Distro, which is a fork of Backtrack 4.
The Distro embbeds everything needed to make good penetration tests ( OpenVAS, Metasploit, fasttrack, milw0rm exploits...). Its name is shadowcircle, and you can check it out @
www.shadowcircle.org.
Hope you'll like it ;) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | the whitehat consultants i've seen come in & use [this tool](http://nessus.org/) then send you a massive bill.
Take a look at [OWASP](http://owasp.org) (Open Web Application Security Project) they're very informative & free! they have a very detailed [pen-testing guide](http://www.owasp.org/index.php/Category:OWASP_Te... | [Nikto](http://www.cirt.net/nikto2 "Nikto") is a nice start to look for well known vulnerabilities. Works on Windows and Linux, etc. Simple enough even for noobs like me :) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | Tools that I would use
[Nmap](http://nmap.org/) Sister Tool [SQLMap](http://sqlmap.sourceforge.net/doc/README.html)
and [Nessus](http://nessus.org/nessus/)
also quick scanning for XSS and HTML Injection <http://www.seoegghead.com/tools/scan-for-html-injection.seo> also <http://www.cirt.net/nikto2>
Make sure you hav... | Actually i'm the main creator of a new pentest LiveCD Distro, which is a fork of Backtrack 4.
The Distro embbeds everything needed to make good penetration tests ( OpenVAS, Metasploit, fasttrack, milw0rm exploits...). Its name is shadowcircle, and you can check it out @
www.shadowcircle.org.
Hope you'll like it ;) |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | [McAfee Secure](http://www.mcafeesecure.com/us/) offers a pretty decent scanning service that will look at the web server, network, and the web site itself in an automated, on-demand way. Their scanner is certified for PCI scans, so it's pretty comprehensive. | Regardless of the technology you need to know the threats. You need to know what is the data that you are trying to protect? You need to know how your website works. Do a threat model first forgetting about these magical security bullet technology methods. You need to figure out where you are at before you spend wastel... |
12,847 | We're deploying a new website, hosted ourselves. Short of getting in white hats how would you go about penetration testing from outside the network? | 2009/05/27 | [
"https://serverfault.com/questions/12847",
"https://serverfault.com",
"https://serverfault.com/users/2277/"
] | [McAfee Secure](http://www.mcafeesecure.com/us/) offers a pretty decent scanning service that will look at the web server, network, and the web site itself in an automated, on-demand way. Their scanner is certified for PCI scans, so it's pretty comprehensive. | [Nikto](http://www.cirt.net/nikto2 "Nikto") is a nice start to look for well known vulnerabilities. Works on Windows and Linux, etc. Simple enough even for noobs like me :) |
21,674,469 | I have to build a code for algorithm. What I have to achieve with my algorithm is the following:
I have three numbers, 4,6,8. I have to generate sums with two of those numbers and then all sums with three of those numbers and then with four and so forth. Ofcourse there can be duplicates like in this example: 4+4+6
I ... | 2014/02/10 | [
"https://Stackoverflow.com/questions/21674469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/885838/"
] | Try this, `is_numeric` return boolean
```
if (is_numeric($_REQUEST['a']) && $_REQUEST['a'] < 10) {
$a = 'show some text';
}
``` | Here is\_numeric that you have used in if condition will return true or false
so if condition will get either 0 or 1 as result.
So use dual condition within if like below
```
if(is_numeric($_REQUEST['a'] && $_REQUEST['a']<10)
{
//anything you need to do
}
```
Thank you |
70,670,771 | I am trying to figure out the following problem. I have a list with integers.
```
list = [1, 2, 3, 5, 6, 9, 10]
```
The goal is to find the longest sub-list within the list. The sub-list is defined by having the difference between two integers not being more than 1 (or -1). In this example, the longest sub-list resp... | 2022/01/11 | [
"https://Stackoverflow.com/questions/70670771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13574924/"
] | Given:
```
lista = [1, 2, 3, 5, 6, 9, 10]
```
You can construct a new list of tuples that have the index and difference in the tuple:
```
diffs=[(i,f"{lista[i]}-{lista[i+1]}={lista[i]-lista[i+1]}",lista[i]-lista[i+1])
for i in range(len(lista)-1)]
>>> m
[(0, '1-2=-1', -1), (1, '2-3=-1', -1), (2, '3-5=-2', -... | A nice and simple solution based on more\_itertools:
```
#!pip install more_itertools
l = [1, 2, 3, 5, 6, 9, 10]
import more_itertools as mit
sublists = []
for group in mit.consecutive_groups(l):
sublists.append(list(group))
max(sublists, key=len)
```
This outputs:
```
[1,2,3]
```
Which is the longest sub... |
70,670,771 | I am trying to figure out the following problem. I have a list with integers.
```
list = [1, 2, 3, 5, 6, 9, 10]
```
The goal is to find the longest sub-list within the list. The sub-list is defined by having the difference between two integers not being more than 1 (or -1). In this example, the longest sub-list resp... | 2022/01/11 | [
"https://Stackoverflow.com/questions/70670771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13574924/"
] | Given:
```
lista = [1, 2, 3, 5, 6, 9, 10]
```
You can construct a new list of tuples that have the index and difference in the tuple:
```
diffs=[(i,f"{lista[i]}-{lista[i+1]}={lista[i]-lista[i+1]}",lista[i]-lista[i+1])
for i in range(len(lista)-1)]
>>> m
[(0, '1-2=-1', -1), (1, '2-3=-1', -1), (2, '3-5=-2', -... | Here's a solution without the use of libraries:
```
l = [1, 2, 3, 4, 10, 11, 20, 19, 18, 17, 16, 30, 29, 28, 27, 40, 41]
r = []
if len(l) > 1:
t = [l[0]]
for i in range(0, len(l)-1):
if abs(l[i]-l[i+1]) == 1:
t.append(l[i+1])
if len(t) > len(r):
r = t.copy()
... |
70,670,771 | I am trying to figure out the following problem. I have a list with integers.
```
list = [1, 2, 3, 5, 6, 9, 10]
```
The goal is to find the longest sub-list within the list. The sub-list is defined by having the difference between two integers not being more than 1 (or -1). In this example, the longest sub-list resp... | 2022/01/11 | [
"https://Stackoverflow.com/questions/70670771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13574924/"
] | Given:
```
lista = [1, 2, 3, 5, 6, 9, 10]
```
You can construct a new list of tuples that have the index and difference in the tuple:
```
diffs=[(i,f"{lista[i]}-{lista[i+1]}={lista[i]-lista[i+1]}",lista[i]-lista[i+1])
for i in range(len(lista)-1)]
>>> m
[(0, '1-2=-1', -1), (1, '2-3=-1', -1), (2, '3-5=-2', -... | You can get differences between items and their predecessor with zip(). This will allow you to generate a list of break positions (the indexes of items that cannot be combined with their predecessor). Using zip on these breaking positions will allow you to get the start and end indexes of subsets of the list that form ... |
424,767 | I am trying to create a set of smartphone-readable lecture notes.
I want the page to have almost no margins and the text to be relatively big. I was able to do that and I'm happy with the layout. However, Text overflows to the right and in the bottom. So words extend outside of the page and there is content missing o... | 2018/04/04 | [
"https://tex.stackexchange.com/questions/424767",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/159870/"
] | Just two problems with your MWE, (thank you for this) which I have tried to fix below (I have marked my additional/changed code with `% -----`
```
% phoneprob.tex SE 424767
\documentclass[20pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[a5paper,bindingoffset=0in, left=0.3in, right=0.3in,... | ```
\documentclass[10pt]{article}
\begin{document}
\Huge
\begin{tabular}{p{2cm}p{10cm}}
1.& ThisIsOverflowingRootNote\\
2 & ThisIsAnOverflowingRootNode\\
3 & Vektorrechnung\\
3.1 & L\"{a}ngen\\
3.2 &Skalarprodukte\\
4 &Lineare Gleichungssysteme\\
5&Elimination\\
5.1 & Matrixoperationen\\
5.2 & Inverse Matrizen\\
5.3 &... |
424,767 | I am trying to create a set of smartphone-readable lecture notes.
I want the page to have almost no margins and the text to be relatively big. I was able to do that and I'm happy with the layout. However, Text overflows to the right and in the bottom. So words extend outside of the page and there is content missing o... | 2018/04/04 | [
"https://tex.stackexchange.com/questions/424767",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/159870/"
] | Just two problems with your MWE, (thank you for this) which I have tried to fix below (I have marked my additional/changed code with `% -----`
```
% phoneprob.tex SE 424767
\documentclass[20pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[a5paper,bindingoffset=0in, left=0.3in, right=0.3in,... | ```
\documentclass[11pt]{article}
\textwidth= 16cm
\begin{document}
\flushleft
\Huge 1. This Is Overflowing Root Note\\
\Huge 2. This Is An Overflowing Root Node\\
\Huge 3. Vektorrechnung\\
\hspace{1cm}{\LARGE{3.1 L\"{a}ngen}\\
\hspace{1cm}{\LARGE{3.2 Skalarprodukte}\\
\Huge 4. Lineare Gleichungssysteme\\
\Hug... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | Code you wrote for work is property of your company. Publishing it, as open source or otherwise, is copyright infringement and will get you fired. It also creates a legal nightmare for anyone taking this code, assuming it is open source, when in reality it is owned by your company.
And “adapting” the code doesn’t hel... | In my company we have an open source policy.
To use open source, the license has to be cleared for use, and all the restrictions stipulated.
To contribute to open source, the code has to be prepared and submitted for review and approved.
You need to find out the policies in Your company. |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | I disagree with the majority here. Clearly the majority of folks are saying you shouldn't do this. I don't necessarily disagree with that, but the subtext and in many cases the overt message is *you legally cannot do this* rather than simply *you shouldn't do this*. The legal correctness of that message is far from cle... | >
> Can I adapt code I wrote for work and release it as open source
>
>
>
Never without an explicit authorization from the owner of the intellectual property, which may be your employer, your client or your employer's client.
Programmers are not code monkeys, the value in a program is not only in the code but als... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | Code you wrote for work is property of your company. Publishing it, as open source or otherwise, is copyright infringement and will get you fired. It also creates a legal nightmare for anyone taking this code, assuming it is open source, when in reality it is owned by your company.
And “adapting” the code doesn’t hel... | **I am not a lawyer.** But a software developer (in France), and I do contribute (professionally) to open source projects, and sometimes even develop open source software professionally.
**You need to get permission from your employer.**
Remember that source code is often protected by copyright or trade secrets, and ... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | I have actually done this. At one point I wrote some code at work, and I realized that it would be generally useful, well beyond the scope of the specific project I was working on. So I asked my boss (who was also the CEO; it was a very small company) if it was OK to publish this as open source, and he said sure, that ... | If you want the code to be usable open source, you need to get the license legally out there. Releasing code with an invalid source license so it's available is setting up legal time bombs for people who use it in good faith. They can be sued for damages, and can get injunctions against using the copyrighted material. ... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | I have actually done this. At one point I wrote some code at work, and I realized that it would be generally useful, well beyond the scope of the specific project I was working on. So I asked my boss (who was also the CEO; it was a very small company) if it was OK to publish this as open source, and he said sure, that ... | **I am not a lawyer.** But a software developer (in France), and I do contribute (professionally) to open source projects, and sometimes even develop open source software professionally.
**You need to get permission from your employer.**
Remember that source code is often protected by copyright or trade secrets, and ... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | While the answers provided thus far are good advice, I think they go way too far. The code you wrote belongs to your employer but they generally do not own the knowledge and skills you gained while implementing it.
Let's pretend you were tasked with implementing a random number generator using a proprietary API that i... | If you want the code to be usable open source, you need to get the license legally out there. Releasing code with an invalid source license so it's available is setting up legal time bombs for people who use it in good faith. They can be sued for damages, and can get injunctions against using the copyrighted material. ... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | I have actually done this. At one point I wrote some code at work, and I realized that it would be generally useful, well beyond the scope of the specific project I was working on. So I asked my boss (who was also the CEO; it was a very small company) if it was OK to publish this as open source, and he said sure, that ... | The short answer is **not without express permission**.
You need to ask your superiors. Quite possibly your manager may need to pass the question up the chain.
If you are lucky, the company has a process for this. If not, it may be helpful to find out if this has previously been done. Ask your coworkers. A previous ... |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | I disagree with the majority here. Clearly the majority of folks are saying you shouldn't do this. I don't necessarily disagree with that, but the subtext and in many cases the overt message is *you legally cannot do this* rather than simply *you shouldn't do this*. The legal correctness of that message is far from cle... | In my company we have an open source policy.
To use open source, the license has to be cleared for use, and all the restrictions stipulated.
To contribute to open source, the code has to be prepared and submitted for review and approved.
You need to find out the policies in Your company. |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | The short answer is **not without express permission**.
You need to ask your superiors. Quite possibly your manager may need to pass the question up the chain.
If you are lucky, the company has a process for this. If not, it may be helpful to find out if this has previously been done. Ask your coworkers. A previous ... | In my company we have an open source policy.
To use open source, the license has to be cleared for use, and all the restrictions stipulated.
To contribute to open source, the code has to be prepared and submitted for review and approved.
You need to find out the policies in Your company. |
129,053 | Recently I've been working on making some API calls to a 3rd party. I couldn't find anything available to use, so I had to do it from the ground up. Now I'm wondering whether it would be okay for me to rewrite all the platform specific parts and release that as open source (I'd say that would change ~50% of the code)?
... | 2019/02/14 | [
"https://workplace.stackexchange.com/questions/129053",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/-1/"
] | I disagree with the majority here. Clearly the majority of folks are saying you shouldn't do this. I don't necessarily disagree with that, but the subtext and in many cases the overt message is *you legally cannot do this* rather than simply *you shouldn't do this*. The legal correctness of that message is far from cle... | The short answer is **not without express permission**.
You need to ask your superiors. Quite possibly your manager may need to pass the question up the chain.
If you are lucky, the company has a process for this. If not, it may be helpful to find out if this has previously been done. Ask your coworkers. A previous ... |
61,804,822 | I am new to Vue Js and Firebase. I want to learn firebase /firestore db connection ,data in/out but i am not getting any proper documentation or tutorial for the same.Please suggest.
I am using VUE CLI 2. | 2020/05/14 | [
"https://Stackoverflow.com/questions/61804822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13181177/"
] | It's simple. you have to do only `car = list[a]` which will give you 'BMW'.
```
myList = ["Ford", "Volvo", "BMW"]
x = len(myList)
a = x - 1
car = myList[a]
print(car) # 'BMW'
```
I have renamed the variable name. While you are giving variable name just careful about the predefined/built in keywords because its not... | At first, don't use `list` as a variable, `list` is a keyword in python. Try some other name. And you are now printing the value of a which is an index not an element of the list. You have to use `list[a]` to print an element of a list positioned at index a. |
15,397,138 | I am using jQuery [Isotope](http://isotope.metafizzy.co/). It's a great plugin but I'm having a little issue with aligning the items in masonry mode. My container is 960px wide and my goal is to get 4 items to line up perfectly as if it were using the 960px grid system. So, both the left and right edges would be touchi... | 2013/03/13 | [
"https://Stackoverflow.com/questions/15397138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can change the Dataset shown by a DBGrid quite easily at runtime quite easily. There two approaches:
1: use a single DataSource assigned to DBGrid.DataSource and change the DataSource.DataSet to the desired DataSet. Here is a simple example with all assignments made at runtime.
```
procedure TForm1.FormCreate(Sen... | You probably need to change the `DataSource.DataSet` instead:
```
procedure SetDataFromDataSet(const aDataSource: TDataSource;
const aNewDataSet: TDataSet);
begin
aDataSource.DataSet.Close;
aDataSource.DataSet := aNewDataSet;
if not aNewDataSet.Active then
aNewDataSet.Open;
end;
```
Sample use:
```
SetD... |
15,397,138 | I am using jQuery [Isotope](http://isotope.metafizzy.co/). It's a great plugin but I'm having a little issue with aligning the items in masonry mode. My container is 960px wide and my goal is to get 4 items to line up perfectly as if it were using the 960px grid system. So, both the left and right edges would be touchi... | 2013/03/13 | [
"https://Stackoverflow.com/questions/15397138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You probably need to change the `DataSource.DataSet` instead:
```
procedure SetDataFromDataSet(const aDataSource: TDataSource;
const aNewDataSet: TDataSet);
begin
aDataSource.DataSet.Close;
aDataSource.DataSet := aNewDataSet;
if not aNewDataSet.Active then
aNewDataSet.Open;
end;
```
Sample use:
```
SetD... | Tested with Delphi5 pro.
```
procedure TForm1.setDataSourceDataSet(var newDataSource:TDataSource);
begin
if DBgrid1.DataSource = nil then begin
DBgrid1.DataSource:=newDataSource;
end else begin
if DBgrid1.DataSource.Name = newDataSource.Name then exit;
DBGrid1.DataSource.Enabled:=False;
DBgrid1.DataSource:=newDataS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.