qid int64 10 74.7M | question stringlengths 15 26.2k | date stringlengths 10 10 | metadata list | response_j stringlengths 27 28.1k | response_k stringlengths 23 26.8k |
|---|---|---|---|---|---|
110,860 | Based on what I have read on this site and heard from a rav, the majority of what most people currently do during burial is minhag rather than halacha.
Is there a written or online compilation of halachot and minhagim (Ashkenaz, Sephardi, or others) explaining both the procedures as well as the reasons for what is com... | 2020/01/14 | [
"https://judaism.stackexchange.com/questions/110860",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/5275/"
] | If you are somewhat language limited and prefer English, you should consider **[Mourning in Halacha](https://www.artscroll.com/Products/MOUH.html)** by Rabbi Chaim Binyamin Goldberg.
It is quite comprehensive and heavily footnoted.
The subject of burial is covered primarily in chapters 9 and 10 with some related info... | [The Laws of Mourning by Rabbi Shmuel Tendler](https://www.israelbookshop.com/the-laws-of-mourning-step-by-step-guide-for-the-mourner-by-rabbi-sm-tendler.html)
is a concise book of laws ranging from last hours of life to the yahrzeit.
Product Description from [Amazon](https://rads.stackoverflow.com/amzn/click/com/0967... |
58,770,630 | I'm trying to implement a quite basic validation for a form field/select. Validation schema:
```
vehicleProvider: Yup.object() // This is an object which is null by default
.required('formvalidation.required.message')
.nullable(),
reserveVehicle: Yup.number().when('vehicleProvider', { // This is a number whic... | 2019/11/08 | [
"https://Stackoverflow.com/questions/58770630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5243272/"
] | You should use **typeError**
Here is an example from my code:
```
amount: Yup.number()
.typeError('Amount must be a number')
.required("Please provide plan cost.")
.min(0, "Too little")
.max(5000, 'Very costly!')
``` | You can use:
```
amount: yup.number().typeError("")
```
This will omit the validation message, but you should be **careful** when doing this. |
71,991,800 | I need show Splash Screen(image: background\_light\_SC.png) when user open my application and flutter load my application. I use this [package](https://pub.dev/packages/flutter_native_splash), and all work good. But if I start my application in android 12, I see white background with my icon app in Splash Screen.
**pu... | 2022/04/24 | [
"https://Stackoverflow.com/questions/71991800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18906338/"
] | As mentioned in @Dani3le\_ answer "Note that a background image is not supported". its means you can only play with the launch screen icon and background color, not with the background image...
another hack is used in old school way to show the splash screen after the launch screen for 3 sec ... but you gonna end up w... | As specified into the [package](https://pub.dev/packages/flutter_native_splash):
>
> **Android 12 Support**
> ----------------------
>
>
> Android 12 has a [new method](https://developer.android.com/about/versions/12/features/splash-screen) of adding splash
> screens, which consists of a window background, icon, an... |
57,624,065 | I want to define a custom bash function, which gets an argument as a part of a dir path.
I'm new to bash scripts. The codes provided online are somehow confusing for me or don't work properly.
---
For example, the expected bash script looks like:
```sh
function my_copy() {
sudo cp ~/workspace/{$1} ~/tmp/{$2}
... | 2019/08/23 | [
"https://Stackoverflow.com/questions/57624065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7149195/"
] | If you have the below function in say `copy.sh` file and if you [source](http://www.theunixschool.com/2012/04/what-is-sourcing-file.html) it ( `source copy.sh` or `. copy.sh`) then the function call `my_copy` will work as expected.
`$1` and `$2` are [positional parameters](https://www.gnu.org/software/bash/manual/html... | There is a syntax error in your code. You don't call a variable like `{$foo}`. If `1=a` and `2=b` then you execute
`sudo cp ~/workspace/{$1} ~/tmp/{$2}`
BASH is going to replace `$1` with `a` and `$2` with `b`, so, BASH is going to execute
`sudo cp ~/workspace/{a} ~/tmp/{b}`
That means tha `cp` is going to fail b... |
17,508,481 | I am looking to have a script to output a large amount of sequential numbers (One million at a time) from a number that is 17 char's long. (EG 12345678912345678)
I essentially want it to work like this site (<http://sequencegenerator.com>) but use MY CPU and not his. His site locks up when I tell it to do a million an... | 2013/07/07 | [
"https://Stackoverflow.com/questions/17508481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2009282/"
] | To avoid all problems with the reliable range of VBScript's Double/Currency numbers, split your start number (string) into a stable/never changing prefix and a Long number tail that gets incremented:
```
Option Explicit
Dim sStart : sStart = "12345678901234567"
Dim nCount : nCount = 20
Dim sPfx : sPfx = Left(sSt... | Ekkehard.Horner's script with some slight modifications. Working as I wanted. Thanks!
```
Option Explicit
Dim sStart : sStart = "1234567891234567"
Dim nCount : nCount = 1000000
Dim sPfx : sPfx = Left(sStart, 10)
Dim nStart : nStart = CLng(Mid(sStart, 11))
Dim n
For n = 1 To nCount
Dim fs
Set fs = CreateObject("Sc... |
9,252,392 | This prepared statement seems like valid SQL to me.
```
PreparedStatement dropTable = cnx.prepareStatement(
"DROP TABLE IF EXISTS ?");
dropTable.setString(1, "features");
dropTable.execute();
```
But when I run this, I get the error:
>
> Exception in thread "main"
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntax... | 2012/02/12 | [
"https://Stackoverflow.com/questions/9252392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/61104/"
] | I think your code prepares this statement:
```
DROP TABLE IF EXISTS 'features'
```
while you want:
```
DROP TABLE IF EXISTS features
``` | PreparedStatements are used for making database compile the query (make the execution plan) once, so executing the same query with different parameters happens faster.
In short in a PreparedStatement you can not have a wildcard for database objects. Including table name, column name, different where clauses and .... |
599,281 | My computer randomly restarts. Is it more likely my motherboard or processor? So, I know which one to return or replace first.
* Windows 7 SP1 64-bit
* Motherboard: Asus P8Z68-V/GEN3
* CPU: Intel i7
**Times it restarts**
* randomly during use in Windows 7
* during boot
* while in BIOS
* before BIOS
* basically rando... | 2013/05/23 | [
"https://superuser.com/questions/599281",
"https://superuser.com",
"https://superuser.com/users/59178/"
] | Your options are:
* Remove all but 1 stick of ram
* Disable sound card, network card, and any other devices in the bios
* Remove any other PCI devices (video card, sound card, cd rom ect..)
Once you have done that, and the issue continues:
* **Remove the motherboard from the case. It could be grounding out on a moth... | Disconnect the power button and reset button and see if that fixes it. Start your computer by shorting the power pins with a screwdriver or something without the buttons attached. If it doesn't have the problem any more, focus on the buttons. Based on your description, it is highly likely your power or reset button is ... |
53,852,484 | I am Using angular Material design and i used Textarea but the height is not change is fixed i tried so many ways but not working i like want
However, it is always the same size. Even Change css Also but its just changing height and i can say its not working
***Any idea on how to change the size of the textarea?***... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53852484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8636516/"
] | You need to add:
```
matAutosizeMinRows=5 matAutosizeMaxRows=20
```
This will set a minimum number of rows and the maximum number of rows which control the height also.
If you tried the above, as you edited the question, and you are getting a different results. Then probably another CSS overrides the `textarea` hei... | set `line-height` style for `textarea`.
e.g:
```
<mat-form-field >
<textarea matInput placeholder="Description" style="line-height: 20px !important"></textarea>
</mat-form-field>
``` |
63,731,443 | **Summary:**
In the most recent (Sept. 2020) version of 64-bit cygwin, the symlinks in the `/bin/` and `/lib` directories have puzzling features, and seem to differ from any of the various other documented symlinks. The questions are:
1. why are they hidden from CMD.EXE, but visible elsewhere, unlike
other symlink ty... | 2020/09/03 | [
"https://Stackoverflow.com/questions/63731443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/666886/"
] | Inside the map function, put them all in an array and then sort them. Then you can return a new object in the map with the order you wish.
```js
let arr = [
{ length: 5.6, width: 5.1, height: 5.3 },
{ length: 7.7, width: 6.4, height: 6.5 },
{ length: 2.7, width: 6.3, height: 9.5 }
];
let res = arr.map(({l... | If the properties of the objects within the array are always `length`, `width` and `height` then yes, you can achieve this with the `map` function:
```js
const arr = [
{ length: 5.6, width: 5.1, height: 5.3 },
{ length: 7.7, width: 6.4, height: 6.5 }
]
const result = arr.map(obj => {
const max = Math.max(obj.le... |
14,129,773 | I am new to use the AJAX tool kit in ASP.NET
I have a masked edit extender for start date. How can I specify minimum date value on this?
Currently this is accepting 11/11/1111.
```
<asp:MaskedEditExtender runat="server"
ID="meeStartDate"
Mask="99/99/9999"
... | 2013/01/02 | [
"https://Stackoverflow.com/questions/14129773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/529866/"
] | Try this :
```
MaximumValue="01/01/2099" MinimumValue="01/01/2000"
``` | You can try this
```
this._minDate = DateTime.Now.Date;
this._maxDate = DateTime.Now.Date.AddDays(120);
``` |
162,804 | My girlfriend left a job on good terms to work for a different company. Apparently the payroll manager (one person department, it’s a company of <100 employees) forgot to take her off the payroll because she’s still getting paid her old salary. Does she have a legal obligation to pay the money back or inform them of th... | 2020/08/15 | [
"https://workplace.stackexchange.com/questions/162804",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/109782/"
] | I would suggest checking the pay stubs or whatever system tracks work hours. If she doesn't have access to any of that, contact the company for clarification of the situation. Communicating through email may be helpful to get their answer in writing in case things escalate to the point of needing a lawyer.
If the paym... | Her employer has a legal right to reclaim the overpayment; see for example [this Nolo article](https://www.nolo.com/legal-encyclopedia/can-employer-deduct-previous-overpayment-paycheck.html). Since she's no longer employed there it's probably a bit harder for them to actually take that money back (though if it was dire... |
12,365,958 | While uploading multiple image at a time i want to show progress bar which show the progress bar in statusbar notification area with the info 1/5 and 2/5 and so on. where 1 is no of image uploaded and 5 is total no of image to be uploaded.
here i am able show progress bar in notification area. can any one suggest me, ... | 2012/09/11 | [
"https://Stackoverflow.com/questions/12365958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/795688/"
] | Take a look at this TL;DR blog post/tutorial. You should be able to do something similar. You'll want to use a `ProgressDialog`, updating its state using an `ASyncTask`. If you're already using an `ASyncTask` for your image upload, you already have the pieces in place.
<http://toolongdidntread.com/android/android-mult... | Where are your images? you have to do like
```
File fav = new File(Environment.getExternalStorageDirectory().getPath());
File[] filesav = fav.listFiles();
for (int i = 0; i < filesav.length; i++) {
inside you send your pictures and count
}
```
the variable i is your image number and filesav.length is your... |
33,525 | I am using TrueCrypt's 'Full Disk Encryption' and according to TrueCrypt's FAQ I should 'Permanently Decrypt System Partition/Drive' before reinstalling Windows. This does not make any sense to me. Would reinstalling Windows not undo the encryption in the first place?
The reason I would like to know, is because 'Perma... | 2013/03/31 | [
"https://security.stackexchange.com/questions/33525",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/11351/"
] | Reading the FAQ in question the TrueCrypt folks are trying to explain relates to reinstalling Windows on a system with a data volume encrypted that you wish to keep. The idea is that even though you don't reformat that volume the details needed to access it are lost in the Windows installation and thus the data is no l... | If the system partition/drive is encrypted and you want to reinstall or upgrade Windows, you need to decrypt it first (select System > Permanently Decrypt System Partition/Drive). However, a running operating system can be updated (security patches, service packs, etc.) without any problems even when the system partiti... |
128,875 | The problem I have, is that most of the C++ books I read spend almost forever on syntax and the basics of the language, e.g. `for` and loops `while`, arrays, lists, pointers, etc.
But they never seem to build anything that is simple enough to use for learning, yet practical enough to get you to understand the philosop... | 2012/01/06 | [
"https://softwareengineering.stackexchange.com/questions/128875",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/41595/"
] | Do you want to know how stepping on the accelerator makes the car go faster, or do you only care that stepping on the accelerator makes the car go faster?
You are seeing the benefit to black box programming, which is a great way to design a system when all the boxes work. Someone has to make the black boxes though an... | Qt is widely used in the commercial world because it provides a full cross platform toolset and development environment, including a good GUI library.
It also fully supports internationalization, including the excellent 'Linguist' tool.
If you plan an academic career then I wouldn't bother with Qt. If, on the other ... |
11,731,107 | How do I modify this so that if one sound is playing already and another is clicked on, the previous stops playing and the newly selected starts? Thanks everyone for their help in advance. (this is not all the code just the most important)
```
public class newBoard extends Activity {
/** Called when the activity is fi... | 2012/07/30 | [
"https://Stackoverflow.com/questions/11731107",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/972096/"
] | How about simply iterating through the array and compare the names?
```
resultObjectsArray = [NSMutableArray array];
for(NSDictionary *wine in allObjectsArray)
{
NSString *wineName = [wine objectForKey:@"Name"];
NSRange range = [wineName rangeOfString:nameString options:NSCaseInsensitiveSearch];
if(range.loca... | remember to break; out your for loop once your object has been found |
26,705,215 | Is there any better way to write this type of code in Tweenmax?
```
TweenMax.to("#second-scene .layer-one", 0.5, {delay:0.2, top:0, onComplete: function() {
TweenMax.to("#second-scene .layer-two", 0.5, {top:0, onComplete: function() {
TweenMax.to("#second-scene .layer-thr... | 2014/11/02 | [
"https://Stackoverflow.com/questions/26705215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4208552/"
] | The comments above worked for me (`syntax spell toplevel`) and this setting works for me even when run later (so no need to copy anything from /usr). But I didn't want that setting to be active for all tex files - instead, I customize it for the given file in my *.vimrc*:
```
au BufNewFile,BufRead body.tex syntax spel... | I used a hack for this problem. Add the following to the top of your file:
```
\iffalse{}\section{vim-hack}\fi{}
```
This way, vim's syntax and spell algorithms find some token to get them started, but due to the "if" the section will be ignored by latex itself.
(I did not test whether more specialized editors igno... |
361,498 | I installed Centos onto my server and I noticed that when I compared the date command's output to time.gov (same timezones, of course), the output was 4 minutes behind. This also affects my timestamps in MySQL so this is an annoying problem.
Is there some way to permanently fix this so that even after the server reboo... | 2011/11/25 | [
"https://superuser.com/questions/361498",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Yes, there is -- you need to sync your system time with the external time servers. A high-end solution is to run `ntp`, a simpler solution is to just call `ntpclient`, or `ntpdate`.
Watch out that because too many Linux machines were hitting the same time servers, there are now some per-distro wrappers. E.g. on an Ubu... | Install [ntp](http://www.ntp.org/). Or as a temporary fix run `ntpdate pool.ntp.org` in a terminal. |
22,303 | Godville is what's known as a ZPG (Zero Player Game) - it's a MMORPG where you - the player - don't actually control the hero in typical RPG way - the hero levels up without player doing any work. The player just sits around and rewards/punishers the hero.
There appear to be two **very similar** versions of Godville a... | 2011/05/16 | [
"https://gaming.stackexchange.com/questions/22303",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/7912/"
] | On many box arts and title screens, the buster is on his right arm, but in some it is on his left arm or in none of them. So, one can assume that he "morphs" his arm into a buster, and that he may do that with either of the arms, depending on how clear a shot would be in each case. I agree with Oscar Cheung, Megaman is... | Most people have covered the answer by now (he's an ambidextrous, which makes sense, because he's a *robot*.... why program something limiting like right or left-handedness? He's a SUPER FIGHTING ROBOT, he don't have time for that!)
Just wanted to add another source for that answer: The Megaman TV show. Anime/style a... |
11,206,328 | I need some help with Java Swing components and its capabilities. I need to add a `JPanel` to a `JFrame` and paint an `Ellipse2D` on it. Onto the `Ellipse2D` I want to add another element, in my case it is a picture (right now I use an `ImageIcon`, maybe wrong). How can I achieve adding the `Ellipse2D` and the picture ... | 2012/06/26 | [
"https://Stackoverflow.com/questions/11206328",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599110/"
] | What you need is to create a custom `JPanel` implementation and override `paintComponent` method.
Inside it, you just do:
```
public void paintComponent(Graphics g) {
super.paintComponent(g);
// Draw ellipse here
// Draw your image here. It will be drawn on top of the ellipse.
}
```
This way, you ca... | * your idea could be very good described (including code example) in the Oracles tutorial [How to Decorate Components with the JLayer Class](http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html)
* notice `JLayer` is available only for Java7, but its based on (for Java6) [JXLayer](http://java.net/projects/jxl... |
5,446,295 | I'm trying to convert a url string into a label for a [Google Chart](http://code.google.com/apis/chart/docs/making_charts.html).
My question is this: my input is something like `www.mysite.com/link` and it needs to be encoded so it can itself be embedded into the Google charts URL.
Before: `www.mysite.com/link/test`
... | 2011/03/27 | [
"https://Stackoverflow.com/questions/5446295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/341583/"
] | There's also [`CGI.escape`](http://www.ruby-doc.org/stdlib/libdoc/cgi/rdoc/classes/CGI.html#M000093) from the standard library:
```
>> CGI.escape('www.mysite.com/link/test')
=> "www.mysite.com%2Flink%2Ftest"
``` | Rails 3.0 is based on [Rack](http://rack.rubyforge.org/), Rack provides a [Rack::Utils.escape](http://rack.rubyforge.org/doc/classes/Rack/Utils.src/M000082.html) method.
```
s = "www.mysite.com/link/test"
# => "www.mysite.com/link/test
Rack::Utils.escape(s)
# => "www.mysite.com%2Flink%2Ftest"
``` |
61,671,362 | I have a data which is a nested json. It contains some objects with count 0 which needs to be removed from the JSON. The data is given below
```
const data = {
"name": "A",
"desc": "a",
"count": 2,
"children": [
{
"name": "A1",
"desc": "a1",
"count": 2,
"children": [
{
... | 2020/05/08 | [
"https://Stackoverflow.com/questions/61671362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9567578/"
] | Instead of 2 look alike functions, you can do this in just one function.
The only problem with this function is that it reverses orders of keys of objects. If you don't need it in same order, then this function is fine.
```js
const filterObject = (obj) =>
Object.keys(obj)
.slice(0)
.reduce((accumulator, cur... | beacuse you are deleting from obj not from tempObj which you are returning
```
if(obj[key] === 0){
Object.keys(obj).forEach(function(key) {
delete obj[key];
});
```
Following code is working for me
```
const deepCopy = (arr) => {
let copy = [];
arr.forEach(elem => {
if(Array.isArray(ele... |
13,318,812 | Given a pair of lat/lng values, how do I determine if the pair is within a polygon? I need to do this in PHP. I see that Google Maps API has a `containsLocation` method: <https://developers.google.com/maps/documentation/javascript/reference>. Is there a way to leverage this from PHP? | 2012/11/10 | [
"https://Stackoverflow.com/questions/13318812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253976/"
] | very big thanks to David Strachan and Darel Rex Finley
i want to share my php version, is slightly different beacause it takes the point as an array ([lat, lng]) and the polygon as an array of point ([[lat, lng],[lat, lng],...])
```
function pointInPolygon($point, $polygon){//http://alienryderflex.com/polygon/
... | There are a copuple of ways to do this I think. The first would be to use this extension or something like this to determine if the point is inside the polygon:
[Google-Maps-Point-in-Polygon Extension](https://github.com/tparkin/Google-Maps-Point-in-Polygon)
Here is an explanation on the Ray casting algorithm that sh... |
42,199,903 | The problem I have is that I want to have a settings button which when the user clicks it, takes them to a specified path in the settings such as sound settings. The only issue is that every method I've tried has been outdated for more recent versions of iOS 10. Does anyone have any suggestions for a method which I can... | 2017/02/13 | [
"https://Stackoverflow.com/questions/42199903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7382004/"
] | I use this script in a file named "index.js" to "export default all exported default in every file in the current folder" sort of thing:
```
const files = require.context('.', false, /\.js$/)
const modules = {}
files.keys().forEach((key) => {
if (key === './index.js') return
modules[ key.replace(/(\.\/|\.js)/g, ''... | Based on Potray and Fosuze's working answers for easy reference:
```
const files = require.context('.', false, /\.vue$/)
const modules = {}
files.keys().forEach((key) => {
if (key === './index.js') return
modules[key.replace(/(\.\/|\.vue)/g, '')] = files(key)
})
export default modules
``` |
8,322,742 | Based on the JQuery-Mobile example of the [Split button list](http://jquerymobile.com/demos/1.0/docs/lists/lists-split.html) I am trying to generate a listview component in Android with two extra buttons to the right, one next to the other. The problem is that the code generates only one button and the second one is ad... | 2011/11/30 | [
"https://Stackoverflow.com/questions/8322742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047055/"
] | I was able at last to achieve something similar:

In case anyone is interested, here is the final code:
```
<ul data-role="listview" data-filter="true" data-theme="b" style="margin-bottom: 50px;">
<li>
<a href="#" onclick="alert('the item!');">
<h3>Th... | Inspired by Pablo's answer
```
<ul data-role="listview">
<li>
<a href="#">
<img class="cover" src="images/cover.jpg"/>
<h3>title</h3>
<p>description</p>
</a>
<div class="split-custom-wrapper">
<a href="#" data-role="button" class="split-custom... |
2,422,050 | Are there any Pythonic solutions to reading and processing RAW images. Even if it's simply accessing a raw photo file (eg. cr2 or dng) and then outputting it as a jpeg.
Ideally a dcraw bindings for python, but anything else that can accomplish the came would be sufficient as well. | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422050",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/96723/"
] | Here is a way to convert a canon CR2 image to a friendly format with [rawkit](https://github.com/photoshell/rawkit), that works with its current implementation:
```
import numpy as np
from PIL import Image
from rawkit.raw import Raw
filename = '/path/to/your/image.cr2'
raw_image = Raw(filename)
buffered_image = np.a... | I'm not sure how extensive the RAW support in Python Imaging Library (PIL <http://www.pythonware.com/products/pil/>) is, but you may want to check that out.
Otherwise, you could just call dcraw directly since it already solves this problem nicely. |
4,292,756 | Sometimes when you run a piece of jQuery, you put a # symbol in the HREF attribute, but why? I do understand what # means, but i'm asking if you have this `<a href="#" id="runScript">Run</a>`
why would you actually put a # in the href and return false, could you just leave it blank and achieve the same results? | 2010/11/27 | [
"https://Stackoverflow.com/questions/4292756",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/478144/"
] | Leaving the `href` attribute blank will not accomplish the same as stopping the default action. A blank value may either be percieved by the browser as a non-value, causing it to render the element as a bookmark instead of a link, or as a link to the same page, causing a reload.
The value `#` is just an URL that cause... | As the above posts said, it won't be styled as a clickable link. But instead you can just do:
```
a{
cursor:pointer;
}
```
in the CSS. |
24,277,734 | I am creating a tester class for a simple input database program. I do not have to store information nor delete anything, but there are two arrays in my the class I am running my tester class for.
This is my tester class:
```
import java.util.Scanner;
public class Asst_3 {
private static Scanner keyboard;
... | 2014/06/18 | [
"https://Stackoverflow.com/questions/24277734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3751018/"
] | null pointer occurring in
```
private static void newPolicy(Policy insurance)
```
this method. For these lines
```
insurance.getPolicyNumber();
insurance.get....();
insurance.get....();
```
because the reference/object `insurance` coming as a parameter from where its being called . in you case you are passing... | The `insurance` that you are passing to `newPolicy` is null
```
case 1: newPolicy(null);
```
hence
```
insurance.getPolicyNumber();
```
will throw a NPE |
40,128 | I wonder if the word "县子" colloquially exists in the Chinese language.
I’ve probably heard this word before, and I‘m not exactly sure, but I blurrily remember it was from a conversation between my grandparents.
I suppose this is like an infrequently used dialectical term in Chinese and the infrequency of its usage, a... | 2020/07/18 | [
"https://chinese.stackexchange.com/questions/40128",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/25806/"
] | I need more examples. but "县" means "county, the administrative district one level lower than the city", such as "桐庐县" is a county in "杭州市", "宝应县" is a county in "扬州市". "子" is usually a suffix, has no actual meaning, like "桌子" "筷子". "县子" maybe is a dialect words means "县" or "县城". | 县子 = town
她们几个去那儿的县子了。
A few of the girls went to the town over there.
Especially in rural areas 县、县子 may still be used as town.
怀化市 (spoken: fyfashi, they don't like h in 怀化市!) 的 会同县 in 湖南省
省、市、县、区 |
56,756,906 | I have string like this: `$string = "1A1R0A"` and I want to split that $string into 2 arrays:
```
array1 (
[0] => 1
[1] => 1
[2] => 0
)
array2 (
[0] => A
[1] => R
[2] => A
)
```
Can you help me to do that ?
I've tried using `str_split` like this:
```
$subs = str_split($string,1);
```
bu... | 2019/06/25 | [
"https://Stackoverflow.com/questions/56756906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11430096/"
] | You can use a regex to match all patterns of numbers followed by non-numbers.
```
preg_match_all('/(\d+)(\D+)/', $string, $matches);
```
Your arrays of numbers/letters will be in the matches. You can work with them directly in `$matches[1]` and `$matches[2]`, or extract them into a more readable format.
```
$result... | `preg_match_all()` provides a direct, single-function technique without looping.
Capture the digits (`$out[1]`) and store the letters in the fullstring match (`$out[0]`). No unnecessary subarrays in `$out`.
Code: ([Demo](https://3v4l.org/9mu9U))
```
$string = "1A1R0A";
var_export(preg_match_all('~(\d)\K\D~', $string... |
9,778,033 | Hi I have configured the DSN settings for vertica in Ubuntu 10.10 32 bit version machine.
The settings are all fine and I have cross checked them.
Here is my odbc.ini file:
```
[VerticaDSN]
Description = VerticaDSN ODBC driver
Driver = /opt/vertica/lib/libverticaodbc_unixodbc.so
Servername = myservername
Da... | 2012/03/19 | [
"https://Stackoverflow.com/questions/9778033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1018818/"
] | From the error we can see you are using unixODBC and I presume "DSI" is what Vertica calls itself as ODBC error text is formatted with entries in [] from left to right as the path though the different components (see [Example diagnostic messages](http://www.easysoft.com/developer/interfaces/odbc/diagnostics_error_statu... | Arun -- if you can let me know the version of the database and the version of the driver I can get you more detail. Also, I might try posting this on the official Vertica community forum.
<http://my.vertica.com/forums/forum/application-and-tools-area/client-drivers/>
If I had to guess what your issue is I think it mi... |
23,167,703 | I have two buttons one for Groups and second is for Skills. when i click on groups button one popup will show and in the popup the groups are showing with checkbox. wheni select the groups and click on save button the checked groups will show on the uper of group button and popup will close.and this same is for skills ... | 2014/04/19 | [
"https://Stackoverflow.com/questions/23167703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3489787/"
] | No. You don't even need variable names in the declaration of a function. Their purpose there is documentation.
Obviously this can be trivially checked:
```
void foo(int); // or void foo(int bar);
int main()
{
foo(42);
}
#include <iostream>
void foo(int n)
{
std::cout << n << std::endl;
}
```
In general, I can... | No, the prototype doesn't need to match the definition of a function (either it is a member function of a `class` or a simple function).
You can have it like this,
```
class myClass {
public:
void myMethod (const int &name1);
}
```
And the definition.
```
void myClass::myMethod (const int &name2) {
// use ... |
62,371,643 | I need to use kafka-node under typescript:
```
const kafkaHost = 'localhost:9092';
const client = new Client({ kafkaHost });
```
After launching index.ts I get this error:
```
Property '_write' in type 'ProducerStream' is not assignable to the same property in base type 'Writable'.
Type '(message: ProduceRequest... | 2020/06/14 | [
"https://Stackoverflow.com/questions/62371643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | **July 22, 2020**
In [Room 2.3.0-alpha02](https://developer.android.com/jetpack/androidx/releases/room#2.3.0-alpha02) was added support for RxJava3 types.
Though it's still in alpha, but you can consider this option.
According to release description:
>
> Similar to RxJava2 you can declare DAO methods whose return t... | Currently updating a project and having the same problem.
I'm using room-rxjava2 to generate the DAOs (as before) with RxJava2 types.
But for my business logic I'm using <https://github.com/akarnokd/RxJavaBridge> to convert to RxJava3 types. |
924 | This question seems similar to [this one](https://photo.stackexchange.com/questions/533/how-can-i-backup-my-photos-while-travelling), but my needs are different :
* I shoot in RAW exclusively
* I'm looking for a 100% offline solution: while traveling, Internet won't be accessible
* the "laptop" solution is too heavy f... | 2010/07/20 | [
"https://photo.stackexchange.com/questions/924",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/68/"
] | Unless weight and size are an over-over-overwhelming consideration then you would be very hard put to find something that beats a small netbook computer. It makes no sense to reject a computer solution absolutely - it should simply be put in the list along with the rest and compete on its own merits.
---
Netbook:
Do... | I did all of this but today I simply use 2 CF oder 2 SD cards and make my camera write the images to both cards (many cameras have two card slots).
This has many advantages:
* no hard disk
* no SSD
* no card reader and usb cable
* no tablet or laptop
* you don't dive through your images at night during your trip
* ch... |
2,032,881 | In C++, is there any way to query the type of an object and then use that information to dynamically create a new object of the same type?
For example, say I have a simple 3 class hierarchy:
```
class Base
class Foo : public Base
class Bar : public Base
```
Now suppose I give you an object cast as type Base -- whic... | 2010/01/09 | [
"https://Stackoverflow.com/questions/2032881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/246991/"
] | Clone method
------------
There is nothing provided by the language that queries type and lets you construct from that information, but you can provide the capability for your class hierarchy in various ways, the easiest of which is to use a virtual method:
```
struct Base {
virtual ~Base();
virtual std::auto_ptr... | ```
class Base
{
public:
virtual ~Base() { }
};
class Foo : public Base
{
};
class Bar : public Base
{
};
template<typename T1, typename T2>
T1* fun(T1* obj)
{
T2* temp = new T2();
return temp;
}
int main()
{
Base* b = new Foo();
fun<Base,Foo>(b);
}
``` |
25,227,759 | Assume a text file with 40 lines of data. How can I remove lines 3 to 10, 13 to 20, 23 to 30, 33 to 40, in place using bash script?
I already know how to remove lines 3 to 10 with `sed`, but I wonder if there is a way to do all the removing, in place, with only one command line. I can use `for loop` but the problem is... | 2014/08/10 | [
"https://Stackoverflow.com/questions/25227759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492151/"
] | ```
sed -i '3,10d;13,20d;23,30d;33,40d' file
``` | @Kent's answer is the way to go for this particular case, but in general:
```
$ seq 50 | awk '{idx=(NR%10)} idx>=1 && idx<=2'
1
2
11
12
21
22
31
32
41
```
The above will work even if you want to select the 4th through 7th lines out of every 13, for example:
```
$ seq 50 | awk '{idx=(NR%13)} idx>=4 && idx<=7'
4
5
6
... |
54,439 | [Multani, Yavimaya's Avatar](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bMultani%2c%5d%2b%5bYavimaya%27s%5d%2b%5bAvatar%5d)'s activated ability doesn't require having to declare any targets, and it only cost {1}{G} and returning two lands to hand. The ability doesn't say Multani has to be in the ya... | 2021/03/19 | [
"https://boardgames.stackexchange.com/questions/54439",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/35644/"
] | You won't be able to active Multani on the battlefield. See Comprehensive Rules 113.6k:
>
> 113.6k An ability whose cost or effect specifies that it moves the object it's on out of a particular zone functions only in that zone, unless that ability's trigger condition, or a previous part of that ability's cost or effe... | Generally, abilities of permanent cards and tokens *only* work on the battlefield.
>
> 113.6. Abilities of an instant or sorcery spell usually function only while that object is on the stack. Abilities of all other objects usually function only while that object is on the battlefield. The exceptions are as follows:
>... |
58,997,142 | I have a variable which contains output from a shell command, I'm trying to 'grep' the variable but it seems that the output is all in one line without linebreaks. So when I 'grep' the variable everything is returned.
For example my variable contains this:
```
standalone 123 abc greefree ten1 stndalone 334 abc fregr... | 2019/11/22 | [
"https://Stackoverflow.com/questions/58997142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2226069/"
] | The environment you pass to `CreateProcessA` must include `SYSTEMROOT`, otherwise the Win32 API call `CryptAcquireContext` will fail when called inside python during initialization.
When passing in NULL as lpEnvironment, your new process inherits the environment of the calling process, which has `SYSTEMROOT` already d... | To follow up with an example how this can very easily be triggered in pure Python software out in the real world, there are times where it is useful for Python to open up an instance of itself to do some task, where the sub-task need a specific `PYTHONPATH` be set. Often times this may be done lazily on less fussy plat... |
53,781,727 | I am trying to implement pagination but It's not working. Here is my code:
**pager.service.ts:**
```
import * as _ from 'underscore';
@Injectable({
providedIn: 'root',
})
export class PagerService {
getPager(totalItems: number, currentPage: number = 1, pageSize: number = 10) {
// calculate total pa... | 2018/12/14 | [
"https://Stackoverflow.com/questions/53781727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Following the error text, you have to import and add your `PagerService` in the **Provider** part of your `app.module.ts` file:
```
providers: [
PagerService,
],
```
And don't forget to declare it as `Injectable`:
```
@Injectable()
export class PagerService {
// ...
}
``` | Page Service or Job Service both should have Injectable attribute applied or check if you are injecting something in these services also then same applies to that also. |
5,391,268 | I am learning about handling UTF8 character sets and the recommendation is to explicitly set the encoding type in the output headers within your PHP script like so:
```
header('Content-Type: text/html; charset=utf-8');
```
My question is about where I should place this header. I have a config file that is included i... | 2011/03/22 | [
"https://Stackoverflow.com/questions/5391268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/97816/"
] | I'm only recommending this as an alternative. But the setting can be fixated in the php.ini using:
```
default_mimetype = "text/html; charset=UTF-8"
```
It's less common on shared hosters, where some of the users might depend on L1. But if you use your own server and want to ensure that it's correctly set regardless... | As long as it is inside the -tags and BEFORE you create any output (echo, print, print\_r and so on - or any HTML BEFORE the -tags).
OKAY METHOD:
```
<?php
$var = "hello world";
$var2 = "Goodbye world!";
header();
echo $var2;
?>
```
OKAY METHOD:
```
<?php
header();
$var = "hello world";
$var2 = "Goodbye world!"... |
4,751,885 | Since a `struct` in C# consists of the bits of its members, you cannot have a value type `T` which includes any `T` fields:
```
// Struct member 'T.m_field' of type 'T' causes a cycle in the struct layout
struct T { T m_field; }
```
My understanding is that an instance of the above type could never be instantiated\*... | 2011/01/20 | [
"https://Stackoverflow.com/questions/4751885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105570/"
] | As far as I know, within a field signature that is stored in an assembly, there are certain hardcoded byte patterns representing the 'core' primitive types - the signed/unsigned integers, and floats (as well as strings, which are reference types and a special case). The CLR knows natively how to deal with those. Check ... | >
> My understanding is that an instance of the above type could never be instantiated any attempt to do so would result in an infinite loop of instantiation/allocation (which I guess would cause a stack overflow?)—or, alternately, another way of looking at it might be that the definition itself just doesn't make sens... |
117,611 | If I am predicting probability of a business to reach (x) milestone (classification 1), but the only data I have is live production data, how much of the production data should I use to train the model? My assumption is that if I use all the data, the probability of any business that hasn't reached the milestone alread... | 2023/01/08 | [
"https://datascience.stackexchange.com/questions/117611",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/144636/"
] | You can use 100% of the data. The more data you feed to the model, the more accurate the prediction is going to be. If you have only two features - time and live production data, 30k records is not going to be a problem. Select a timepoint - somewhere between 70%-95% of the time passed, and use the data before the time... | Note that your dataset might be considered time-series. In time-series it is common to evaluate a model via back-testing rather than a single train/test split. Back-testing uses as training data all data before time T, and as test data all data after time T, and then we do this for many different values of T and averag... |
61,648,096 | So I have a **Mongoose** Model called `Profile`:
```js
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const ProfileSchema = new Schema({
user: {
type: mongoose.Schema.ObjectId,
ref: "user",
},
company: {
type: String,
},
website: {
type: String,
},
loc... | 2020/05/07 | [
"https://Stackoverflow.com/questions/61648096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/333757/"
] | It is not possible to access a mongoose model schema as a Profile object. Instead if you want to update a specific part of the model, in this case `experience`, you can do as follows:
```js
try {
const await profile = Profile.findOneAndUpdate(
{ experience: { $elemMatch: { _id: req.params.exp_id } } },
... | Thats a normal response for mongoose, Because Profile is a **Collection Model Schema**, not an **Profile object**. Also if you want to update an specific element on the array, You need to add query to help mongo to find which data will only update on the array.
Here's the alternate query for updating collection data o... |
1,295,973 | How do you calculate the following limits?
>
> $$\lim\_{n \to \infty} \left(1 + \frac{1}{n!}\right)^n$$ $$\lim\_{n \to \infty} \left(1
> + \frac{1}{n!}\right)^{n^n}.$$
>
>
>
I really don't have any clue about how to proceed: I know the famous limit that defines $e$ ($\lim\_{n \to \infty} \left(1 + \frac{1}{n}\r... | 2015/05/23 | [
"https://math.stackexchange.com/questions/1295973",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/174765/"
] | HINT:
$$
\lim\_{n \to \infty} \left(1 + \frac{1}{n!}\right)^n=\lim\_{n \to \infty} \left(\left(1 + \frac{1}{n!}\right)^{n!}\right)^{n/n!}
$$
and the inner limit is $e$, hence the final one is 1. The second case is similar. | First limit is easy. Let $$f(n) = \left(1 + \frac{1}{n!}\right)^{n}$$ We will use the fact that the sequence $a\_{n} = (1 + (1/n))^{n}$ is strictly increasing for $n \geq 3$ and tends to a positive limit (when $n \to \infty$) denoted by $e$. Also $2 < e < 3$. These facts can be proven (and given in many textbooks) with... |
19,219,236 | I am creating a c# application which requires to use a database and i am also planning to create an installer for my application. I just want to ask which database would be best to use in my application and how do i install it on a user machine while installing my application through installer file.
I have thought of u... | 2013/10/07 | [
"https://Stackoverflow.com/questions/19219236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2283679/"
] | You do not have to ship a full database server with your application; only the redistributable runtime which your application would use to connect to the actual database server remotely. In the case of MySQL, you only need the assemblies.
Applications I wrote relied heavily on SQL Server. In order to simplify evaluati... | Have a look at [SQL Server Express Edition](http://www.microsoft.com/en-us/sqlserver/editions/2012-editions/compact.aspx).
It's just a file which you can copy and a class library which allows to access it. And after you finished your installation you can just delete the files (or to keep them if you need them to unins... |
36,227,993 | I have a list of lists which are of variable length. The first value of each nested list is the key, and the rest of the values in the list will be the array entry. It looks something like this:
```
[[1]]
[1] "Bob" "Apple"
[[2]]
[1] "Cindy" "Apple" "Banana" "Orange" "Pear" "Raspberry"
[... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36227993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5597209/"
] | How about:
```
names(entries) <- unlist(keys)
toJSON(entries)
``` | I think this has already been sufficiently answered but here is a method using `purrr` and `jsonlite`.
```
library(purrr)
library(jsonlite)
sample_data <- list(
list("Bob","Apple"),
list("Cindy","Apple","Banana","Orange","Pear","Raspberry"),
list("Mary","Orange","Strawberry"),
list("George","Banana")
)
sampl... |
16,112,513 | I am trying to exclude pages from wp\_nav\_menu
Here is the function to exclude pages from menu
Works well when
```
<?php $page = get_page_by_title('my title' );
wp_nav_menu( array( 'theme_location' => 'menu-2', 'exclude' => $page->ID ) ); ?>
```
Works properly
BUt when using
```
<?php $page = get_p... | 2013/04/19 | [
"https://Stackoverflow.com/questions/16112513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1820088/"
] | Here is the correct solution
I hope it helps some other people
```
<?php
$page = get_page_by_title('my title' );
$pag1 = get_page_by_title('my title 1' );
$pag2 = get_page_by_title('my title2' );
$ids = "{$page->ID},{$pag1->ID},{$pag2->ID}";
wp_nav_menu( array( 'theme_location' => 'menu-2', 'exclude' => $ids ) ); ... | Managed it using the exclude method, but exclude by page id:
```
wp_nav_menu(
array(
'theme_location' => 'menu-2',
'exclude' => '599, 601'
)
);
```
(599 & 601 are page id's)
which is written here:
<http://bacsoftwareconsulting.com/blog/index.php/wordpress-cat/wordpress-tip-how-to-exclude-pages-fro... |
2,972,770 | Another way to look at it is $x^x = e$.
It seems possible, but I really don't know. It seems very helpful to know the exact value where a function's y value is the same as its slope. | 2018/10/26 | [
"https://math.stackexchange.com/questions/2972770",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/608979/"
] | Per the comment of clathratus, the Lambert W function is relevant here; since $x\ln x=1$, take $x=1/W(1)$ for some branch $W$ of the function. However, if you actually want a few decimal places of $x$ in a hurry, numerical methods such as the Newton-Raphson method are prudent. Define $f(x):=x\ln x-1$ so $f'=\ln x+1$ an... | This can be solved either by using **Lambert W function** or **Newton Raphson method**.
The above equation can be written as -> 1 = x\*ln(x)
**1. (Using Lambert W function):**
W(x\*ln(x)) = W(1) ---- [1]
as per Lambert W function: W(x\*ln(y)) = ln(y)
hence,
ln(x) = W(1) *{substituting in [1]}*
so,
x = e^(W(1))
b... |
6,847,262 | Note: This question has been updated with new info. Please see the bottom half of this text. (The original quesiton is left here for context.)
---
Is there any way I can define my attribute so that if it's defined on a method that is overidden, the attribute is still applied?
The reason I ask is that I have an attri... | 2011/07/27 | [
"https://Stackoverflow.com/questions/6847262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38055/"
] | Setting the `border: 0 none;` CSS property should fix that, if you wanted it to occur on all images wrapped in links, you could use it as such:
```
a img
{
border: 0 none;
}
```
**For use in an e-mail**, you may have to include a style block in the actual e-mail:
```
<style type='text/css'>
a img
{
border:... | This question is a few months old, but I ended up here with the same question, so hopefully this may save someone the time I wasted.
The td has a background color of that neon blue, and by default has a bit of padding.
I just styled the td with...
```
style="background:none;"
```
I knew all about the border style ... |
91,076 | 2 self driving vehicles are being tested. Both vehicles are exactly the same. Both are fitted with a camera on the
Dashboard, although in car A it is a slightly older model and is 1 kg heavier than in vehicle B. The M25 is 117 miles long. Vehicle A started 2 mins before vehicle B and they both crossed the line within 6... | 2019/11/11 | [
"https://puzzling.stackexchange.com/questions/91076",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/63734/"
] | This makes use of Stiv's observation above, but develops it differently.
>
> The extra weight of car A does make a small difference to its speed, but not a considerable one. This means that car B does over time catch up with car A. However, in order to pass car A, it has to pull out into an overtaking lane and is no... | >
> They never mentioned that velocity(magnitude) of both car is same. Their velocity(in magnitude) would be different in order to follow that situation.
>
>
> |
32,017,354 | I know there are strong opinions about mixing plot types in the same figures, especially if there are two y axes involved. However, this is a situation in which I have no alternative - I need to create a figure using R that follows a standard format - a histogram on one axis (case counts), and a superimposed line graph... | 2015/08/14 | [
"https://Stackoverflow.com/questions/32017354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2186883/"
] | `?n2mfrow` finds a default layout for you; in fact, it's already used by `grid.arrange` if `nrow` and `ncol` are missing
```
grid.arrange(grobs = replicate(7, rectGrob(), simplify=FALSE))
```
[](https://i.stack.imgur.com/9Cfqj.png) | In practice there are a limited number of plots that can reasonably be displayed and few arrangements that are aesthetically pleasing, so you could just tabulate.
However, what we can do is specify a tolerance for the ratio of the larger dimension to the smaller. Then we find the closest two numbers that factor our ta... |
14,116 | I have encrypted Android `so` library that decrypts itself on load. I want to get its unencrypted code. For me it looks good idea to dump that library from memory when application started.
I used `/proc/self/maps` to get loaded process memory map. I found 3 segments that correspond to the library in memory maps and us... | 2016/12/05 | [
"https://reverseengineering.stackexchange.com/questions/14116",
"https://reverseengineering.stackexchange.com",
"https://reverseengineering.stackexchange.com/users/18321/"
] | Frida is the way to go, you can simply do:
```
memorydump: function (address, size) {
Memory.protect(ptr(address), size, "rwx");
var a = Memory.readByteArray(ptr(address),size-1000);
return a;
}
moduleaddress: function (lib){
try{
var ret = [];
var module = Process.findModuleByName(lib);
va... | Maybe this helps: <https://www.andnixsh.com/2015/11/tutorial-how-to-decrypt-encrypted-dll.html>
You can create dump from memory using `gcore <path>` command and recover any plain files (.dex, .dll, .mp3, etc) using custom GDB for Android. I'm not sure if you can recover decrypted .so file.
Custom GDB only works on AR... |
49,808,616 | i'm trying to filter array that the results of value {purchase} id contain in array of {products.transactions.purchase} id.
I want to filter by transaction which have same purchase id value.
the data:
```
var data = [
{
"purchase": "5ace99b014a759325776aabb",
"products":
[{
"transactions":
... | 2018/04/13 | [
"https://Stackoverflow.com/questions/49808616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5834822/"
] | I was not able to directly pipe the input, but did it in two steps:
```
searchBar.rx.text
.orEmpty
.subscribe(onNext: {query in
self.shownGenes.value = AllGenes.filter { $0.hasPrefix(query) }
})
self.shownGenes
.asObservable()
.bind(to: tableVie... | I had this problem when the `UISearchBar` delegate had been set to my view controller in the storyboard. Try opening up the storyboard in interface builder and right-clicking on the search bar. If you see a connection for the delegate then remove it. Hope that helps |
26,334,565 | I've got this, and it works. It just takes a large amount of time for numbers 100000+ I'm looking to cut it down so that it can calculate the 1,000,000th prime in less than 3 minutes. I've set it so that our number (chk) is only having numbers (odds) being divided into it, to check for divisibility, up to the square ro... | 2014/10/13 | [
"https://Stackoverflow.com/questions/26334565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4131923/"
] | A better way would be to generate a list of prime numbers as you go along, and check if the number can be divided by a number of that list
```
list = [ ]
while primes < goal:
found = false
for n in list
if chk % n = 0
# is prime
found = true
break
if not found
list.append(chk)
```
T... | If you only care about the first million primes, the easiest solution is to pre-compute the list of the first million primes, using the Sieve of Eratosthenes, then index into the list to find the nth prime. Here's a simple Sieve of Eratosthenes:
```
def primes(n): # sieve of eratosthenes
i, p, ps, m = 0, 3, [2], n... |
4,595,964 | I access my MySQL database via PDO. I'm setting up access to the database, and my first attempt was to use the following:
The first thing I thought of is `global`:
```
$db = new PDO('mysql:host=127.0.0.1;dbname=toto', 'root', 'pwd');
function some_function() {
global $db;
$db->query('...');
}
```
This is c... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4595964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/407054/"
] | Consider simply how your solution differs from the one presented in the PHP docs. In fact, there is just one "small" difference: your solution provides callers of the getter with a `PDO` instance, while the one in the docs provides callers of `Database::singleton` with a `Database` instance (they then use the getter on... | When programming there is not "right" and "wrong"; there is "good practice" and "bad practice".
Singletons are generally created as a class to be reused later. They need to be created in such a way that the programmer doesn't accidentally instantiate two instances while drunkenly coding at midnight.
If you have a sim... |
22,823,204 | This might be a very common question but i searched lot and finally decided to get some expert advice.
I was wondering if someone have uploaded file directly from URL to cPanel file manager. I can upload file from my computer using upload tab in file manager but not able to find any option for extracting data from UR... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22823204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2044188/"
] | You can use [RapidLeech](http://rapidleech.com/forum/). It's a CMS to "Transload" files (server-to-server) instead of uploading. But the Hosts usually ban you for using RL, because it consumes too much resources. But it has really cool functions. You can get Youtube videos directly with any screen size you want, and al... | Best Way
========
This Worked For Large Files
---------------------------
1. First create a file on the public\_html "get.php"
2. Copy blow code and save
3. Replace YOUR\_URL with your URL
4. Open the sitename.com/get.php
5. Enjoy :)
code:
```
<?PHP
ini_set('max_execution_time', '0');
define('BUFSIZ', 4095)... |
275,020 | I would like to plot a sequence of functions in one plot.
My function is defined piecewise:
```
f[x_] := Piecewise[{{-1, -1 <= x < -(1/n)}, {n x, -(1/n) <= x <= 1/n}, {1,
1/n < x <= 1}}];
```
I would like to plot the functions for let's say
```
n = {1,2,3}
```
in one plot.
How could I do that?
My ideas were ... | 2022/10/22 | [
"https://mathematica.stackexchange.com/questions/275020",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/34881/"
] | * If the `quarter circle` means the region of disk.
```
RegionPlot[x^2 + y^2 <= 4^2, {x, 0, 4}, {y, 0, 4}]
```
[](https://i.stack.imgur.com/PIOZ9.png)
* If the `quarter circle` means only the circumference.
```
RegionPlot[ImplicitRegion[x^2 + y^2 ... | ```
RegionPlot[Norm[{x, y}] < 4 && x > 0 && y > 0, {x, -4, 4}, {y, -4, 4}]
```
[](https://i.stack.imgur.com/zIu67.png)
---
Also try:
```
Manipulate[
RegionPlot[Norm[{x, y}, p] < 4
, {x, -4, 4}, {y, -4, 4}]
, {{p, 2}, 1, 6}
]
``` |
53,919,995 | My header css is giving me pain. It's effecting what comes after it. I just want to put 3 links/button in center of the content. But when I try to make it. Not working properly. `p` tag or `h1` tags doesn't matter, Always stuck behind the header. I used clear fix but not quite working. I am not sure why next div stuck ... | 2018/12/25 | [
"https://Stackoverflow.com/questions/53919995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If anyone wants to use command which is recommended for creating pem file,
then here is solution on [my gist](https://gist.github.com/mrugeshtank/8c3b8014c34f57bb599f7f9d06c6da25).
1. `openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem`
2. `openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushCha... | `openssl x509 -inform der -in certificate.cer -out certificate.pem`
Look no further. This is all that it takes. |
9,806,887 | **I have a Enumeration as shown in below program**
```
public class Test {
public static void main(String args[]) {
Vector v = new Vector();
v.add("Three");
v.add("Four");
v.add("One");
v.add("Two");
Enumeration e = v.elements();
load(e) ; // **Passing the ... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9806887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/784597/"
] | Sure. You could use the `elementAt` method, [documented here](http://docs.oracle.com/javase/6/docs/api/java/util/Vector.html#elementAt%28int%29), to get the value you wanted. Do you have a specific reason you are using a Vector? Some of the `List` implementations might be better. | Enumerations don't have the idea of "first value", "second value", etc. They just have the current value. You could work around this in various ways:
1. The easy way -- convert it to something easier to work with, like to a `List`.
```
List<String> inputs = Collections.list(rs);
stud.one = inputs.get(0);
stud.two = i... |
57,413,739 | I have a CircleCI config in which I am running machine executor, starting up my application using docker-compose, then running E2E tests in Cypress, that are not in docker, against this app. Cypress basically spins up a headless browser and tries to hit the specified url.
Now, no matter what my first test always fails... | 2019/08/08 | [
"https://Stackoverflow.com/questions/57413739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494150/"
] | I think your server isn’t ready.
Before run cypress test, you have to wait for server.
If so, don't use sleep.
You can use wait-on or start-server-and-test.
You can check this doc. <https://docs.cypress.io/guides/guides/continuous-integration.html#Boot-your-server> | I had the same issue. Solved it by server/route/wait. I first start the server, then create a rout alias, wait for it to call the Api endpoint (which triggers the app to fill the dom) then do the rest (cy.get/click).
Example before:
```
cy.get('myCssSelector')
```
**After server/route/wait:**
```
cy.server()
cy.ro... |
22,855,140 | I am trying to show a form when a button is clicked. But it shows for a second or so and then hides again. i have tried to debug it with console.log() but my jQuery is not reaching in the anonymous function in click event in chrome console it is showing me this error "Failed to load resource: the server responded with ... | 2014/04/04 | [
"https://Stackoverflow.com/questions/22855140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3496690/"
] | The form is probably submitting, do it like this
```
addBtn.on("click", function (e) {
e.preventDefault();
console.log('in anonymous func');
subForm.show();
});
```
Note that the id `irrAdd` does not seem to exist in the markup, and that you could also change the buttons type to `button` | Use jquery toggle(); function
```
$(document).ready(function () {
var subForm = $("#MainContent_dynamicSubForm");
var addBtn = $("#irrAdd");
console.log("before hide");
subForm.hide();
console.log("after hide");
addBtn.on("click", function () {
console.log('... |
1,848,390 | I have 2 buttons next to a textbox and another textbox after the 2 buttons. The tabindex for the first textbox is 1000, the first button is 1001 and the second button is 1002. The second textbox has a tabindex of 1003.
When I press tab, the tabindex works fine in all browsers except for Safari, where it immediately mo... | 2009/12/04 | [
"https://Stackoverflow.com/questions/1848390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/81711/"
] | By default tab-access is disabled in safari(!). To enable it, check "Preferences > Advanced > Press tab to highlight each item on a page". | Making Safari and a Mac accessible:
Testing on a Mac:
System Preferences -> Keyboard -> ShortCuts (tab) -> Full Keyboard Access -> All Controls
For Tabbing to work on Safari:
Preferences -> Advanced -> Press tab to highlight each item on a page (check this) |
22,524,149 | I went to the Oracle site to download the release JDK 8 for ARM and the version labeled as JDK 8 is actually JDK 7 update 40. Does anyone know where to find the JDK 8 for ARM or how to let Oracle know about the problem? | 2014/03/20 | [
"https://Stackoverflow.com/questions/22524149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/814270/"
] | You can find a couple of logically pure, monotone implementations of list intersection and union in [my answer](https://stackoverflow.com/a/29819232/4609915) to the related question "[Intersection and union of 2 lists](https://stackoverflow.com/questions/9615002/intersection-and-union-of-2-lists)".
Let's see a sample... | Usually `sets` in Prolog are represented with sorted lists, then avoiding the *ambiguity* of the representation that arises in presence of duplicate elements. Let's ignore this problem...
This fact `setIntersection([], [], []).` is *subsumed* by `setIntersection([], _, []).`, then can (should!) be deleted.
The same fo... |
2,626,649 | In the following JavaScript code main() is called.
My question is why the second constructor is called rather than the first one ?
What am I missing here ?
Thanks !!
```
function AllInputs() {
alert("cons 1");
this.radioInputs = [];
alert(this);
}
function AllInputs(radioElement) {
alert("cons 2");
th... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2626649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/247243/"
] | Javascript does not support overloaded functions.
When you define the same function twice, the second definition replaces the first one.
Instead, you should make a single function, and check `arguments.length` to see how many arguments were passed.
For example:
```
function AllInputs(radioElement) {
this.radioI... | In JavaScript, the last definition of an identifier is used:
```
function foo() { return "bar"; }
var foo = "foo";
alert(foo);
```
In that case, `foo` was a variable with the value "foo". Had `foo` been a function, it would have simply said that `foo` was a function. If you don't believe it, try using `alert(foo())... |
18,332,244 | I have 2 different system, lets say SystemA and SystemB.
In SystemB, there is page, say calculate.aspx, where it receive certain parameter and will perform some calculation. This page doesn't display and info, and only serves to execute the code behind.
Now i have a page in SystemA, lets say execute.aspx, that will n... | 2013/08/20 | [
"https://Stackoverflow.com/questions/18332244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1158142/"
] | You can either use a web service which would be the preferred way or use AJAX to send data to the page and get result in response. | try this
```
namespace SampleService // this is service
{
public class Service1 : IService1
{
public string GetMessage()
{
return "Hello World";
}
public string GetAddress()
{
return "123 New Street, New York, NY 12345";
}
}
}
pro... |
10,510,319 | There are lots of times Eclipse can't connect to emulator that I turned on from AVD Manager, and just starts a new emulator by itself,( two emulators are the same ):((. How can I make eclipse find the emulator ? | 2012/05/09 | [
"https://Stackoverflow.com/questions/10510319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1377713/"
] | I guess that you might suffer from the issue that the manually started emulator got disconnected somehow, shown with a message like
`Error: emulator-5554 disconnected`
in the Eclipse console view. There are several related questions and answers on stackoverflow like [Why do I get a emulator-5554 disconnected message]... | If the emulator is still active, you can use adb to connect to it via tcp. In this way you can connect a disconnected emulator to your development system's loopback one port higher, just like if you are using emulator-5554, you can connect to it by using a higher port.
```
adb connect localhost:5555
```
There was be... |
39,723,320 | I'm not able to find the logs of application I have submitted on the the yarn on ambari cluster via log search service. | 2016/09/27 | [
"https://Stackoverflow.com/questions/39723320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3338663/"
] | Try this
```
import sys, os, django
sys.path.append("/path/to/store") #here store is root folder(means parent).
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "store.settings")
django.setup()
from store_app.models import MyModel
```
This script you can use anywhere in your system. | Django standalone script.
* Place it in the same directory as manage.py file
* Rename PROJECT\_NAME to your project's name
```
import os
PROJECT_NAME = 'ENTER YOUR PROJECT NAME HERE'
def main():
# import statemts
# from app.models import Author,Category,Book
# code logic - anything you want
if __name_... |
64,532,025 | I know there have been multiple instances of this question such as [Print all lines between two patterns, exclusive, first instance only (in sed, AWK or Perl)](https://stackoverflow.com/questions/55220417/print-all-lines-between-two-patterns-exclusive-first-instance-only-in-sed-aw)
but my question is for if the two pat... | 2020/10/26 | [
"https://Stackoverflow.com/questions/64532025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14519899/"
] | Could you please try following, written and tested based on your shown samples only in GNU `awk`.
```none
awk '
/PATTERN1/ && found1 && !found2{
found1=found2=val=""
}
/PATTERN1/{
found1=1
next
}
/PATTERN2/{
found2=1
if(found1){
print val
}
found1=found2=val=""
next
}
{
val=(val?val ORS:"")$0
}
'... | If `Perl` happens to be your option, would you please try:
```
perl -0777 -ne '/.*PATTERN1\n(.*?)PATTERN2/s && print $1' input
```
Result:
```
ggg
hhh
iii
```
* `-0777` option tells `Perl` to slurp all lines at once.
* `s` option to the regex tells `Perl` to include newline character in metacharacter `.`.
* `.*PA... |
9,547 | Every time I apply for a job I write a new cover letter, research statement, and teaching statement. While each statement is personalized for the specific job, I tend to do a lot of cutting and pasting and little new writing (yes I have a whole collection of past statements). This seems like something that might be use... | 2013/04/22 | [
"https://academia.stackexchange.com/questions/9547",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/929/"
] | I am in the middle of my job search and I do the following to keep myself organised:
Directory structure: ('#' for comments and '/' for directories)
```
/Interested
/<deadline>-University1
#job ad and README.txt in here
/<deadline>-University2
/Not Interested or Expired
/<deadline>-University3
/Su... | While I keep my correspondence in version control, I don't have the same document for cover letters that go to different schools. I simply prepend the name of the school to all of my correspondence for that school, and/or file everything into folders with the school's name.
As you point out, you end up personalizing a... |
32,487,502 | So I understand somewhat what the command sll is doing, as I read [this](http://chortle.ccsu.edu/assemblytutorial/Chapter-12/ass12_2.html) and its pretty much just shifting all the bits left by 1. I'm just wondering why would I do this?
I have an assignment from class with an example of it...
Where $s6 and $s7 is the ... | 2015/09/09 | [
"https://Stackoverflow.com/questions/32487502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4282688/"
] | >
> its pretty much just shifting all the bits left by 1
>
>
>
The example they showed was a shift by 1 bit. The `sll` instruction isn't limited to just shifting by 1 bit; you can specify a shift amount in the range 0..31 (a shift by 0 might seem useless, but `SLL $zero, $zero, 0` is used to encode a `NOP` on MIPS... | Shifting a number one bit to the left is the same as multiplying that number by 2.
More generally, shifting a number N bits to the left is the same as multiplying that number by 2^N.
It is widely used to compute the offset of an array, when each element of the array has a size that is a power of 2. |
174,555 | Please, help me with this query:
Table conversation\_reply:
```
#id reply from_id to_id timestamp
--------------------------------------------------------------------
1 Hello 1 2 2017/05/23 12:26:40
2 Hi 2 1 2017/05/23 ... | 2017/05/25 | [
"https://dba.stackexchange.com/questions/174555",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/99512/"
] | Assuming that you are looking to get conversation between two users displayed in order of how the conversation/chat proceeds.
Also assuming that you will be using this query in an application where the two users chatting are known to the application (i.e. logged in to the system). In this case I will assume that these... | ```
SELECT
Crep.[#id],
u.name,
crep.reply
FROM
conversation_reply Crep join users u on Crep.[from_id] = u.[#id]
order by Crep.[#id]
``` |
13,829,648 | I'm an experienced .NET programmer, but I'm new to this whole web programming thing. My ASP.NET MVC website has a global layout that includes some content (menu links at the top of the page) that I want to hide under conditions that are detected dynamically by controller code.
My inclination -- the simple approach tha... | 2012/12/11 | [
"https://Stackoverflow.com/questions/13829648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1637105/"
] | I dislike using the view model of the action outside of the view returned by the action. Using base view model for this scenario feels very clunky.
I believe it's cleaner and more obvious to just use a separate (child) action that contains the logic for specifying how the global menu should be displayed. This action r... | What you've described (putting a bool into the ViewBag) will work fine. But personally, I like the strongly-typed model experience, so when I want to have UI logic like what you're describing in the master/layout page (which is pretty much always), I prefer to put those flags into a base model that my other models inhe... |
3,131,979 | So, I've spent hours on this question and it's frustrating me way too much so I created an account for StackExchange just to understand how you solve this problem.
Let me start by sharing the question: *"Sally has hidden her brother's birthday present somewhere in the backyard. When writing instructions for finding th... | 2019/03/02 | [
"https://math.stackexchange.com/questions/3131979",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/649776/"
] | If you know complex numbers, the problem becomes almost trivial to solve. Complex numbers lend themselves very naturally to mapping to vectors and points on the 2-d plane.
So you start at the origin (point $0+0i$) and walk halfway to $8+6i$, which means you end up at $4+3i$. At this point you turn ninety degrees to yo... | Go to (4,3), and then walk in the direction of slope -4/3, i.e., left 3 and up 4, twice as far, i.e., left 6 and up 8. So, 4-6=-2, and 3+8=11. There’s a 3,4,5 right triangle and a 6,8,10 right triangle involved.
Solving quadratic equations is serious overkill. |
49,117,365 | Has anyone ran across this error when querying with erlang odbc:
>
> {:error, :process\_not\_owner\_of\_odbc\_connection}
>
>
>
I am writing a connection pool and the :ODBC.connect('conn string) is ran inside the genserver and the returned pid is put into the state... But when i get that PID back out of the gen ... | 2018/03/05 | [
"https://Stackoverflow.com/questions/49117365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/959912/"
] | That's going to be a problem, like Kevin pointed out you can't transfer connection ownership for odbc and other drivers like mysql/otp.
If you want to use a connection pool, take a look at this instead <https://github.com/mysql-otp/mysql-otp-poolboy>
Otherwise, you can use any pool but the process that executes the ... | According to the [relevant documentation](http://erlang.org/doc/man/odbc.html#connect-2), an `odbc` connection is private to the `Genserver` process that created the connection.
>
> Opens a connection to the database. The connection is associated with
> the process that created it and can only be accessed through i... |
65,463,442 | I am coding a solution to the LeetCode problem "Odd Even Linked List" which can be read [here](https://leetcode.com/problems/odd-even-linked-list/).
My code is failing the test case with the error
```
================================================================
==31==ERROR: AddressSanitizer: heap-use-after-free o... | 2020/12/27 | [
"https://Stackoverflow.com/questions/65463442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14091616/"
] | ### Underlying Problem
At least from the looks of things, the problem is that you're failing to terminate your linked list correctly.
You're starting with a single linked list, and separating it into odd and even pieces just fine.
Then at the end, you (correctly) concatenate the `evens` list to the end of the `odds`... | Most things that you can do wrong in a C++ program fall into the category of [undefined behaviour](https://en.cppreference.com/w/cpp/language/ub). Using memory after is has been freed, dereferencing a null pointer, reading an uninitialised variable, reading or writing beyond the bounds of an array, all of these invoke ... |
13,285,664 | We are having a little problem with a functional test with casper.js.
We request the same resource twice, first with the GET and then with POST method.
Now when waiting for the second resource (POST) it matches the first resource and directly goes to the "then" function.
We would like to be able to check for the HTT... | 2012/11/08 | [
"https://Stackoverflow.com/questions/13285664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1808618/"
] | You must place the code in a function
```
$(document).ready(function() {
$('.login-popover').popover({
placement: 'bottom',
title: 'Sign in to the website builder',
content: 'testing 123',
trigger: 'click'
});
});
```
or
```
$(function () {
$(".login-popover").popover();
});
```
then i... | As I checked the current version (v2.2.2) this bug had been resolved. Please download the latest one. |
39,189,400 | I wondering if anyone has a clever way of ensuring the last element of an array is selected during a array\_slice operation. The first element is easily selected, but if an offset is applied you cannot be sure the last element is selected unless you add an additional `if else` logic after the loop.
For example here is... | 2016/08/28 | [
"https://Stackoverflow.com/questions/39189400",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6743474/"
] | For your example, this code works:
```
<?php
$latlong[] = [1,2];
$latlong[] = [3,4];
$latlong[] = [5,6];
$latlong[] = [7,8];
$latlong[] = [9,10];
$latlong[] = [11,12];
$latlong[] = [19,110];
$latlong[] = [21,132];
$off = 3;
for ($i=0; $i < count($latlong); $i+=$off){
if(count($latlong) - $i <= $off){
$l... | I'm sure there are other ways like calculating the modulus but this works:
```
for ($i=0; $i < count($latlong); $i+=$off){
$data[] = array_slice($latlong, $i,1);
$last = $i;
}
var_dump(array_slice($latlong, $last+1));
```
If I add 2 other elements to the array, it will be empty. Also, you might want to take... |
41,147,768 | I tried to find the solution for the below problem, but none of them worked for me. I am developing **Angular + Spring Boot** application using **MySQL + flyway**. Please guide whats going wrong here.
```
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined... | 2016/12/14 | [
"https://Stackoverflow.com/questions/41147768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I had the same issue and I believe this occurred because of checksum between linux and windows (also mac).
you can `use repair()` command in flyway.
```
flyway.repair();
```
Be careful , if you are in production environment , make sure that you did not change the migration SQL file; because when you run the `flyway.... | If you have your problem in production, you must have **V2\_\_create\_shipwreck.sql** identically to the one you have in your latest version where it has not been modified.
Then the checksum will be correct again |
2,064,282 | I have the following method (below), as you can see it serializes an object to an XML file. The main problem I am having is I want to get the function to overwrite a file if it exists.
I know I could delete the file first if it does exist, but this would also mean that I might induce some error drag into my applicatio... | 2010/01/14 | [
"https://Stackoverflow.com/questions/2064282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41543/"
] | The FileStream and XMLWriter should be placed in a using block
```
using (FileStream fs = File.Create(filename))
using (var w = XmlWriter.Create(fs, settings))
{
// your code
}
```
I believe that using the code below will fail to release the file stream. So if you run the code twice in one session it will fail
... | Make a Backup of the Destination file if exist, if an error occurred, write back the file. |
171,302 | I am trying to understand the principles of asymmetric encryption, and have read the following in a book:
>
> One key is completely public and can be read and used by everyone. The
> other part is private and should never be shared with someone else.
> When you encrypt something with the public key, it can be decry... | 2017/10/15 | [
"https://security.stackexchange.com/questions/171302",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/161270/"
] | **The usage of asymmetric keys** is as follows:
* Encryption is done using the *public key*
* Signing is done using the *private key*
**Encryption:**
* The data is encrypted using the *public key*
* The encrypted data is decrypted using the *private key*
+ Only the owner of the private key can read the encrypted me... | Yes it can be done. This will be useful in the case when you are trying to verify that the person (Bob) has encrypted the file by himself and not by any other person (Eve), as it will be only decrypted by the bob's public key. |
54,958 | At the end of my assault on the Cerberus Headquarters I unfortunately didn't meet the Illusive Man in person so that I could put a bullet in his brain. He left his assassin Kai Leng though to deal with me.

I have to say, compared to him the Reapers ... | 2012/03/10 | [
"https://gaming.stackexchange.com/questions/54958",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/4103/"
] | An important thing to note is that during the melee cutscenes, you should be pressing the melee button to fight back. It took a lot of searching to find this, considering I instinctively tried every button besides the melee button because intuitively it does not come to mind to use the melee button (which is 'F' on the... | Well, as Soldier the Geth Shotgun and Garrus wih Widow worked for me. After second recharge, got him! |
18,721,968 | I've recently been looking into the networking aspect of the iOS platform. And I want to incorporate JSON feeds into my application. So I have few questions:
1. What's the best built-in class to parse JSON objects and retrieve them ?
2. When the JSON data is downloaded, how do I store and use it ?
Do I use `NSURL` an... | 2013/09/10 | [
"https://Stackoverflow.com/questions/18721968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648067/"
] | I suggest you to use the `AFNetworking` framework
you can donwload it [here](https://github.com/AFNetworking/AFNetworking)
Here is the documentation about the JSON requests :
<http://cocoadocs.org/docsets/AFNetworking/1.3.2/Classes/AFJSONRequestOperation.html>
You can also have a look [here](http://samwize.com/... | For JSON posts in my app I use SBJson. This method uses an NSURLConnection along with a HTTP Post request. The return data, when parsed, will come in the form of keys and strings in an NSDictionary. (jsonData is an NSDictionary established somewhere elese) (Apparently NSJSONSerialization does the same thing though)
``... |
1,633,213 | What could be the optimum programming languages (Perl, PHP, Java, Python or something else) to implement server (multi-threaded?) using tcp/ip socket serving like 1000's of clients with the streaming data? | 2009/10/27 | [
"https://Stackoverflow.com/questions/1633213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/197473/"
] | Python with Twisted Framework
www.twistedmatrix.com
Java with XSocket or Apache Mina Frameworks (which Red5 Flash/video streaming media sever based on)
mina.apache.org
xsocket.sourceforge.net
They all are multithreaded , easy and very powerful. | Erlang of course :-) But then again, your requirements are not clear ;-)
It was designed from ground up to handle multi-threaded networking applications. It's origin comes from Ericsson: they use Erlang in (some of) their networking products. |
3,813,291 | I'm solving this exercise in Klenke's book:
Let $X\_1,X\_2, \dots $ be i.i.d. nonnegative random variables. By virtue of the Borel-Cantelli lemma, show that for every $c \in(0,1)$,
$$\sum\_{n=1}^\infty e^{X\_n} c^n \begin{cases}
< \infty \textrm{ a.s.} & \textrm{if } \mathbb E[X\_1] < \infty; \\
= \infty \textrm{ a.s.... | 2020/09/03 | [
"https://math.stackexchange.com/questions/3813291",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/573277/"
] | **Hint:**
After cheating with WA, here is the solution: notice that "by magic",
$$\int\frac{x^2(1-\log x)}{(\log x)^4-x^4}dx
=\int\frac{\dfrac{1-\log x}{x^2}}{\dfrac{(\log x)^4}{x^4}-1}dx
=\int\frac1{\dfrac{(\log x)^4}{x^4}-1}d\frac{\log x}x.$$
Now
$$\frac1{u^4-1}=\frac1{4 (u-1)} -\frac 1{4 (1 + u)} - \frac1{2 (1 + ... | Let $u=\frac{\ln x }{x}$ then $du = \frac{1 - \ln x }{x^2} dx$ so $dx =\frac{x^2 du}{1-\ln x } $
$$\int \frac{x^2 (1-\ln x )}{x^4 (u^4-1)}\frac{x^2 du}{1-\ln x } $$ |
2,855,483 | >
> Let $f:\mathbb{R}\to \mathbb{R}$ be continuous at $x$ for every $x\in I$ where $I\subset \mathbb R$ could be arbitrary. Does there always exist a function $F:\mathbb{R}\to \mathbb{R}$ differentiable on $I$ and $F'(x) = f(x)$ for every $x \in I$?
>
>
>
The definition of a primitive is naturally defined on an in... | 2018/07/18 | [
"https://math.stackexchange.com/questions/2855483",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/417942/"
] | Please do not upvote this answer! It's just a detailed version of an answer that appeared on [MO](https://mathoverflow.net/questions/306472/existence-of-an-antiderivative-function-on-an-arbitrary-subset-of-mathbbr/306502#306502); if you feel the need to upvote something please upvote that answer instead.
$\newcommand\u... | A few comments: If the answer is yes I have no idea how to prove it.
**Edit:** Maybe it's not hopeless. Given $f:\Bbb R\to\Bbb R$ the set of $x$ such that $f$ is continuous at $x$ is a $G\_\delta$. So we can assume that $I$ is a $G\_\delta$. It's certainly true if $I$ is open, so perhaps...
Of course the answer woul... |
11,518,631 | I am trying to push values onto an array like so:
```
$scoreValues[$i][] = $percent ;
$scoreValues[$i][] = '<span id="item'.$i.'" class="suggestElement" data-entityid="'.$row['id'].'" data-match="'.$percent.'">'.rawurldecode($row['name']).'</span>' ;
```
I basically want to link together the $percent with the string... | 2012/07/17 | [
"https://Stackoverflow.com/questions/11518631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1320129/"
] | Simplest way would be to use two arrays :
```
$percents[$i] = $percent;
$scores[$i] = "<span....>");
```
Or one array, but indexed like this
```
$data = new arrray('percents' => array(), 'scores' => array());
$data['percents'][$i] = $percent;
$data['scores'][$i] = "<span....>");
```
Once this is done, you then so... | Try this:
```
$val = array(
'percent' => $percent,
'html' => '<span id="item' . $i .
'" class="suggestElement" data-entityid="'.$row['id'].
'" data-match="'.$percent.'">'.rawurldecode($row['name']).
'</span>'
);
// This just pushes it onto the end of the array
$scoreVa... |
277,510 | Considering the full list of PDC videos published [here](http://channel9.msdn.com/posts/pdc2008/RSS/Default.aspx) what are, in your opinion, the best session to download and see, considering their relevance to your work, technology and so on? Pleas, one session per answer (exception only for the sessions split in two p... | 2008/11/10 | [
"https://Stackoverflow.com/questions/277510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11673/"
] | I would have to say that my favorite session was the "future of C#" video, very nice to be able to see what is coming in the future for C# and the .NET framework. | Scott Hanselmans
**Microsoft .NET Framework: Overview and Applications for Babies** <http://channel9.msdn.com/pdc2008/TL49/> |
6,965,932 | Im new to Java and JSP. Pls help me in resolving this problem.
I have two files Page1.jsp and Page2.jsp under WebContent/web/jsp directory. When I click a hyperlink (using a href tag) in Page1.jsp, it should navigate to Page2.jsp.
Here is the code below written in Page1.jsp:
```
Navigate to Page2 <a href="../jsp/Pag... | 2011/08/06 | [
"https://Stackoverflow.com/questions/6965932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/881662/"
] | Just set font-size to 1px; IE is limiting height of this div to font size. | It's really hard to tell without the context... aside from resetting the padding to 0 it could have to do with other elements (probably above). Especially if they're floated. May also try clear:both; Also make sure it doesn't have display:inline; anywhere... It's block by default, and should be block.
It's really poki... |
1,278,290 | It's come to my attention that I don't actually understand what a square root really is (the operation). The only way I know of to take square roots (or nth root, for that matter) it to know the answer! Obviously square root can be rewritten as $x^{1/2}$ , but how does one actually multiply something by itself half a t... | 2015/05/12 | [
"https://math.stackexchange.com/questions/1278290",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/233527/"
] | >
> *How does one actually multiply something by itself half a time ?*
>
>
>
Zen Buddhism has a similar question: *What is the sound of one hand clapping ?* When my father told me, in passing, one day, that $\sqrt x=x^{1/2}$ I had pretty much the same reaction. But then I started thinking to myself: What is the fu... | Lazy people should use be careful to avoid having to perform a division in each step of Newton's method. They should consider the equation:
$$\frac{1}{x^2}- \frac{1}{y} = 0$$
This then yields the recursion:
$$x\_{n+1} = \frac{x\_n}{2}\left(3-\frac{x\_n^2}{y}\right)$$
Here, you only have division by fixed numbers in... |
28,089,599 | Default build openjdk 7,target version is:
>
> Target Build Versions:
>
>
> JDK\_VERSION = 1.7.0
>
>
> MILESTONE = internal
>
>
> RELEASE = 1.7.0-internal
>
>
> FULL\_VERSION = 1.7.0-internal-senrsl\_2015\_01\_22\_20\_38-b00
>
>
> BUILD\_NUMBER = b00
>
>
>
but I will build version name this:
>
> RELEA... | 2015/01/22 | [
"https://Stackoverflow.com/questions/28089599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3655363/"
] | It's actually a little bit complicated, you have to get an array with the numbers from the `.sum` elements, then find the highest number, then remove all those from the array, then find the next highest number, and finally target all elements containing those two numbers.
In code, that would look like
```
var sum = $... | Ok this take me a while. To find max number was kinda easy using the following code:
```
//declare a variable for max taking the value of first td
var max = $("#table-results tr:last td:eq(1)").text();
//iterate through the last row of the table
$("#table-results tr:last td").each(function () {
//get the value... |
41,018 | So I've found this command:
```
dd if=/dev/sdx of=/directory/for/image bs=1M
```
But that gives me this error:
```
dd: failed to open ‘directory/for/image’: Is a directory
```
So I found that the directory has to be unmounted. Trying the same command, but changing the directory to my `/home/user` directory got th... | 2016/01/13 | [
"https://raspberrypi.stackexchange.com/questions/41018",
"https://raspberrypi.stackexchange.com",
"https://raspberrypi.stackexchange.com/users/39783/"
] | Your `of` must be the disk image name you want to give it. So:
`sudo dd bs=1m if=/path/to/sdcard of=/path/to/image/backup.img` | Here are commands that can be used. Make sure you know the actual device name of the SD card. It is /dev/sdc on my system:
```
wget https://downloads.raspberrypi.org/raspbian_latest
unzip raspbian_latest
dd bs=4M if=2015-11-21-raspbian-jessie.img of=/dev/sdc
```
The rasbian\_latest version (2015-11021) will be diffe... |
68,812,153 | I would like to do the following:
```
from typing import Union, Literal
YES = 1
NO = 0
ValidResponse = Union[Literal[YES], Literal[NO]]
```
Of course, Python won't let me do this because `YES` and `NO` are considered to be variables, not literal numbers.
Obviously I can do `ValidResponse = Union[Literal[1], Literal... | 2021/08/17 | [
"https://Stackoverflow.com/questions/68812153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5049813/"
] | [The `enum` solution](https://stackoverflow.com/a/68812189/13990016) is often the cleaner solution in these situations, but note that it is *possible* to do this kind of thing with `typing.Literal`. You have to explicitly annotate your variables as being of a "literal" type. The `YesType` and `NoType` aliases that I've... | You should almost certainly just be using an `enum` instead:
```
import enum
class ValidResponse(enum.Enum):
YES = 1
NO = 0
```
Now you can use `ValidResponse` as an annotation:
```
def foo(response: ValidResponse) -> whatever:
# do something with response
``` |
5,000 | Let's say you are playing a game. Then suddenly, you make a bad move and e.g. blunder material. How should you react afterwards? What mind-set should you have? Can you even benefit from the blunder? | 2014/03/12 | [
"https://chess.stackexchange.com/questions/5000",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/2001/"
] | After a blunder, it helps to ***look objectively at the position*** once again and forget the history. You might have been better or worse; but that doesn't matter now after the blunder. What matters is how you go from here.
There could be many possibilities of salvaging a draw or even snatching a win by making the p... | I'd say play like the computers do, i.e. just look for the best move in the ensuing positions and continue to play tough. A little aggression wouldn't hurt either, as another respondent has indicated. Put the pressure on and give your opponent the chance to blunder in turn. It's happened. Don't by any means just trade ... |
18,273,278 | I have two separate types:
```
public class Person
{
public string Name { get; set; }
public bool IsActive { get; set; }
public Contact ContactDetails { get; set; }
}
public class Contact
{
[RequiredIfActive]
public string Email { get; set; }
}
```
What I need is to perform conditional declarat... | 2013/08/16 | [
"https://Stackoverflow.com/questions/18273278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/270315/"
] | **Swift Version**
```
func getMixedImg(image1: UIImage, image2: UIImage) -> UIImage {
var size = CGSizeMake(image1.size.width, image1.size.height + image2.size.height)
UIGraphicsBeginImageContext(size)
image1.drawInRect(CGRectMake(0,0,size.width, image1.size.height))
image2.drawInRect(CGRectMake(0,i... | This implementation works for variadic arguments, so you can pass an unlimited number of images to merge vertically:
```
public static func mergeVertically(images: UIImage...) -> UIImage? {
let maxWidth = images.reduce(0.0) { max($0, $1.size.width) }
let totalHeight = images.reduce(0.0) { $0 + $1.size.height ... |
58,649,687 | I can't define webelement as it has dynamic id and name. There are iframe in another iframe. Attributes id and name for second iframe are dynamic. I need to define the second iframe to switch on it
<http://prntscr.com/pqshpr>
Please help me with defining this dynamic elements.
```
WebElement chartFrameFirst = driver.... | 2019/10/31 | [
"https://Stackoverflow.com/questions/58649687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12304846/"
] | Did you try ,
Storage::get("app/public/uploads/myImageIsHere.jpeg");
<https://laravel.com/docs/5.8/filesystem> | use this instead
```
<img src="{{ URL::to("/images/abc.jpg") }}">
```
this will return an image namely abc.jpg inside "public/images" folder. |
89,495 | I am trying to understand what instantiation means, at the moment I believe it is the act of assigning a property to an object, is this correct?
If so, can a property be instantiated by another property? | 2022/02/11 | [
"https://philosophy.stackexchange.com/questions/89495",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/50018/"
] | It's not true. It is possible I kill my dog, but it's therefore not necessary to do. Even in the case of serial big bangs, where we are born again over and over, it's not necessary. A universe with infinite entropic time doe not exist. Only universes with a beginning a middle part, and an end exist.
On the other hand, ... | I do not think this is true, for example this just holds true for all the scientific possibilities in our world. But this does not encompass all the logically possible worlds. The existence of a nuclear fusion supporting star smaller than a red dwarf is not possible to the existing science, however it is logically poss... |
31,440 | When Vim is invoked on multiple files from the command line, then if any of those files have not been visited with `:next` or via buffer switching, the `:q` command pointlessly warns about the situation with a message like "43 files left to edit" and refuses to quit, even though nothing has been modified. Is there a wa... | 2021/05/31 | [
"https://vi.stackexchange.com/questions/31440",
"https://vi.stackexchange.com",
"https://vi.stackexchange.com/users/13611/"
] | The `:cabbrev`-answer has downsides because the abbreviation is active everywhere in the `:` command line, even if restricted to that type of command using the `<expr>` mechanism.
Ideally, Vim would have a command execution hook: a piece of code that could be executed each time a command is run, or at least an interac... | Yet another alternative is to `:set confirm`. Then `:q` will prompt in this case, and you hit `y` (or a localized equivalent) to continue. No new habits. |
24,331 | So I got an internship and we had the orientation and everything. I am going to my actual workplace tomorrow and thinking of taking a box of doughnuts for everybody. Would that be okay? | 2014/05/21 | [
"https://workplace.stackexchange.com/questions/24331",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/19636/"
] | There are some risks to bringing snacks for everyone:
* There may be a few people who don't eat certain things, whether it's for allergies, diabetes or religious reasons.
There may be an unspoken rule that no-one brings snacks for everyone in consideration of those who may not eat it.
Worse yet, there may be a spoke... | I think it would depend on how you bring the doughnuts. If there's a lunchroom that you could just leave them in, I doubt anybody could take exception to that.
However, if you bring them in to a meeting or pass them out to people in such a way that they are certain to know exactly who brought the doughnuts, it might g... |
60,767 | The following scenario has become the Most-FAQ in the trio of investigator (I), reviewer/editor (R, not related to CRAN) and me (M) as plot creator. We can assume that (R) is the typical medical big boss reviewer, who only knows that each plot must have error bar, otherwise it is wrong. When a statistical reviewer is i... | 2013/06/03 | [
"https://stats.stackexchange.com/questions/60767",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/8433/"
] | The question does not seem to be about error bars so much as about the best ways of plotting paired data.
In essence error bars here are at most a way of summarizing uncertainty: they do not, and they necessarily cannot, say much about any fine structure in the data.
Parallel coordinate plots -- sometimes called pr... | Why not just plot the difference\* for each patient? You could then use a histogram, a box plot or a normal probability plot and overlay a 95% confidence interval for the difference.
* In some scenarios it might be the difference of the logarithms. See, for example, Patterson & Jones, "Bioequivalence and Statistics in... |
5,771,075 | I need to **generate random single-source/single-sink flow networks** of different dimensions so that I can measure the performance of some algorithms such as the Ford-Fulkerson and Dinic.
Is the Kruskal algorithm a way to generate such graphs? | 2011/04/24 | [
"https://Stackoverflow.com/questions/5771075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466153/"
] | To create a generic flow network you just need to create an adjancency matrix.
adj[u][v] = capacity from node u to node v
So, you just have to randomly create this matrix.
For example, if n is the number of vertices that you want ( you could make that random too ):
```
for u in 0..n-1:
for v in 0..u-1:
... | Himadris answer is partly correct. I had to add some constraints to make sure that single-source/single-sink is satisfied.
For single source only one column has to be all 0 of the adjacency matrix as well as one row for single sink.
```py
import numpy
def random_dag(n):
adj = np.zeros((n, n))
sink = n-1
... |
17,999,067 | **CodePen: <http://codepen.io/leongaban/pen/hbHsk>**
I've found multiple answers to this question on stack [here](https://stackoverflow.com/questions/12533508/only-allow-numbers-in-input-tage-without-javascript) and [here](https://stackoverflow.com/questions/773843/iphone-uiwebview-how-to-force-a-numeric-keyboard-is-i... | 2013/08/01 | [
"https://Stackoverflow.com/questions/17999067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168738/"
] | Firstly, what browsers are you using? Not all browsers support the HTML5 input types, so if you need to support users who might use old browsers then you can't rely on the HTML5 input types working for all users.
Secondly the HTML5 input validation types aren't intended to do anything to stop you entering invalid valu... | Firstly, in your Codepen, your inputs are not fully formatted correctly in a form.... Try adding the `<form></form>` tags like this:
```html
<form>
<lable>input 1 </lable>
<input type='tel' pattern='[0-9]{10}' class='added_mobilephone' name='mobilephone' value='' autocomplete='off' maxlength='20' />
<br/>
<lable... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.