id stringlengths 3 6 | prompt stringlengths 100 55.1k | response_j stringlengths 30 18.4k |
|---|---|---|
55706 | Is it bad habit to use the same `ResultSet` object in Java? Why or why not? //It seems to be my only option here, as I am trying to query a table for its record count, and then query a view of that table; I don't know how to change the view.
In other words, is
```
ResultSet myResultSet = statement.executeQuery("SELE... | The code you have posted does not "reuse the same `ResultSet`", it simply discards one `ResultSet` object and then uses the same variable to hold a reference to a different `ResultSet` created by the second `executeQuery`. It would be good coding practice to call `close()` on the first result set before you overwrite t... |
55944 | I am trying to get the view position (Right upper corner position and left bottom corner position) and display custom dialog right or left side of view but i am not getting exact position of view. This is my code
```
int x=view.getLeft()+ (view.getHeight()*4);
int y= view.getBottom()+(view.getWidth()*2);
... | Check this:
```
int[] outLocation = new int[2];
view.getLocationOnScreen(outLocation);
Rect rect = new Rect(
outLocation[0],
outLocation[1],
outLocation[0] + view.getWidth(),
outLocation[1] + view.getHeight());
//right upper corner rect.right,rect.top
... |
56170 | I have a table with two timestamp fields. I simply defined them with a name and the type `TIMESTAMP`, yet for some reason MySQL automatically set one of them with a default value and the attribute `on update CURRENT_TIMESTAMP`. I was planning on having NO default value in either of the fields, but one of the fields is ... | You should specify **`DEFAULT CURRENT_TIMESTAMP`** (or `DEFAULT 0`)
```
ALTER TABLE pages CHANGE date_created date_created TIMESTAMP NOT NULL DEFAULT 0,
CHANGE `date_updated` `date_updated` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
``` |
56428 | *Source of the problem, 3b [here](http://tenttiarkisto.fi/exams/9745.1.pdf).*
>
> **Problem Question**
>
>
> Electricity density in cylinder coordinates is $\bar{J}=e^{-r^2}\bar{e}\_z$. Current creates magnetic field of the
> form $\bar{H}=H(r)\bar{e}\_{\phi}$ where $H(0)=0$. Define $H(r)$ from
> the maxwell equ... | This service blocked my original answer with stupid two days' ban so shortly
$$\nabla\times\bar{H}=
\begin{pmatrix}\partial\_x \\ \partial\_y \\ \partial\_y\end{pmatrix}\times\bar{H}\not =
\begin{pmatrix}\partial\_r \\ \partial\_\alpha \\ \partial\_\phi\end{pmatrix}\times\bar{H}$$
where I want to stress
$$\nabla... |
57081 | I'm building a location app where I display background locations from a Room database in my MainActivity. I can get a ViewModel by calling
```
locationViewModel = ViewModelProviders.of(this).get(LocationViewModel.class);
locationViewModel.getLocations().observe(this, this);
```
Periodic background locations should b... | >
> Question is how should I get the LocationViewModel instance in a
> non-activity class like this BroadcastReceiver?
>
>
>
You shouldn't do that. Its bad design practice.
>
> Is it correct to call locationViewModel =
> ViewModelProviders.of(context).get(LocationViewModel.class) where
> context is the contex... |
57203 | Trying to extend an custom element :
```js
class ABC extends HTMLDivElement {
connectedCallback() { console.log('ABC here') }
}
customElements.define("x-abc", ABC, {
extends: 'div'
})
class XYZ extends ABC {
connectedCallback() { console.log('XYZ here') }
}
customElements.define("x-xyz", XYZ, {
extends: 'x-... | The error may sound confusing at first, but actually it is very clear. The spec clearly defines that you can only extend built-ins using the `is` syntax. As it is currently designed, using `ABC` as a base class is definitely not the brightest idea (until you drop extending `HTMLDivElement` in favour of `HTMLElement`).
... |
57206 | I would like to update a field in a single feature class by a.) searching for a field where the values are not blank and b.) searching for a field where the values are blank.
A typical scenario of this update would occur if there are two service requests in one feature class with the same service request number with ... | Creating two cursors on the same feature class is going to be problematic. I'd create a dictionary of your matches first, and then iterate again and update.
Something like this (untested):
```
#SR field name
srField = "SR_FIELD_NAME"
vehNameDi = dict ([(sr, vehNam) for sr, vehName
in arcpy.da.Sear... |
57227 | Is it possible to use something like sessions like the ones in PHP in C++?
In PHP they're used like
```
$_SESSION['name'] = $value;
```
I really want to make the same application using C++ as PHP...requires a run-time parser.
My application written in PHP uses sessions so that i can fetch some stuff from a website... | This makes no sense, PHP sessions are a kludge because the process does not survive one HTTP request to the next. I really dunno what do you want to achieve here. Maybe <http://www.boost.org/doc/libs/1_46_1/doc/html/interprocess.html> this? |
57272 | I'm using VS to encrypt some data using this function:
```
public static byte[] AES_Encrypt(byte[] bytesToBeEncrypted, byte[] passwordBytes)
{
byte[] encryptedBytes = null;
// Set your salt here, change it to meet your flavor:
// The salt bytes must be at least 8 bytes.
byte[] saltBytes = new byte[] {... | After `onHide` didn't worked, I found a workaround using getter/setter like:
In my child component:
```
private _showDialog: boolean = false;
set showDialog(_show: boolean) {
let result: boolean = this._showDialog != _show;
if (result == true) {
this._showDialog = _show;
this.... |
57583 | I am using spring data JPA repository, my requirement is when i call repository class methods in service class it should show only custom methods like addUser(X,Y) instead of save().
* Few things i understand, implementation of spring repository is provided by spring framework at runtime, So we cannot provide out own ... | If you don't want the methods from `JpaRepository` or `CrudRepository`, don't extend those but just [`Repository`](https://docs.spring.io/spring-data/data-commons/docs/current/api/) instead. It is perfectly fine to have a repository interface like
```
MyVeryLimitedRepository extends Repository<User, Long> {
User ... |
57693 | I've now written a few applications using scala actors and I'm interested in how people have approached or dealt with some of the problems I've encountered.
**A plethora of Message classes or !?**
I have an actor which reacts to a user operation and must cause something to happen. Let's say it `react`s to a message `... | To me, your `ReportTrades` message is mixing two different concepts. One is a Request, the order is a Response. They might be named `GetTradesReport(Date)` and `SendTradesReport(List[Trade])`, for example. Or, maybe, `ReportTradesByDate(Date)` and `GenerateTradesReport(List[Trade])`. |
58137 | ```
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.nusecond.karun.suredeal"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
signingConfigs {
rel... | For me the issue was being caused by a circular reference in an xml file. Lint would usually flag the issue, unless instructed not too.
Check for:
```
tools:ignore="ResourceCycle"
``` |
58332 | **Snake Games**
```
Module[
{dir = {-1, 0}, x = -1., y = 0., snake = Table[{i, 0}, {i, 0, 4}],
gameover = False,
target = {RandomInteger[17] - 9, RandomInteger[17] - 9},
timecount = 0,
score = 0},
Manipulate[
If[
Mod[timecount, 5] == 0 && u != {-1, -1} && gameover == False,
x = u[[1]];
y = u[[2]];
dir = If[
y >= x,
... | I think you've actually done a good job considering you are only using `Manipulate`. Here's a simplified snake game using `Dynamic`:
```
snake = {{0, 0}, {0, 1}, {0, 2}};
dir = {0, -1};
directions = {
"UpArrowKeyDown" :> (dir = {0, 1}),
"DownArrowKeyDown" :> (dir = {0, -1}),
"LeftArrowKeyDown" :> (dir = {-1,... |
58477 | I am a sleep deprived mum of a 9 1/2 month old boy. He's otherwise a smiley, healthy and seems to be on the top percentile for both weight and height for his age. So he doesn't seem to be sleep deprived, grumpy and starving or obese.
He is also completely breastfed- fresh from the tap, not through choice but he simply... | Well there are a number of things.
Separation anxiety getting worse is normal, developmentally appropriate & something you just have to pass through. The age where you might see more improvement with that is past 18 months. All children have it to some degree, and some are much more than others. I saw no difference in... |
58598 | Recently I learned that in some Middle Eastern countries they add cardamom and cloves to their coffee to flavor it.
**Are there any other coffee flavorings found around the globe I might not have heard of?** | I prefer my coffee flavored just with water. However, it is common for people to flavor their coffee with many other ingredients with respect to their personal preference. As personal preference is closely related to culture, **yes, you may enlist some location-based flavoring ingredients for coffee**.
**In Turkey**, ... |
58749 | How can I make sure that Emacs opens files with extension `*.rec` as normal text files?
When I try to open a file with the extnsion `*.rec`, I get the error message `Running someFile.rec...done` without the file being opened.
[](https://i.stack.imgur.com/KYwU5.png)
I... | To tell Emacs that `*.rec` files should be opened in `text-mode`:
```el
(add-to-list 'auto-mode-alist '("\\.rec\\'" . text-mode))
``` |
58931 | I am working with Google Maps API V3 to calculate all the possible routes from a given Source to the specified Destination. For this I takes the Destination and Source as inputs from the user and pass these values in the request with option provideRouteAlternatives: true. I am successful in calculating different Routes... | Have you looked into [string formatting](http://www.mathworks.com/help/matlab/matlab_prog/formatting-strings.html)?
```
fid = fopen( 'myFile.txt', 'w' );
for ii=1:size(cloud,1)
fprintf( fid, '%.5g\t%.5g\r\n', cloud(ii,1), cloud(ii,2) );
end
fclose( fid ); % do not forget to close the file :-)
```
Have you consid... |
59390 | I'm creating split archives using the following code:
```
string filename = "FileName.pdf";
using (ZipFile zip = new ZipFile())
{
zip.UseZip64WhenSaving = Zip64Option.Default;
zip.CompressionLevel = Ionic.Zlib.CompressionLevel.Default;
using (FileStream stream = new FileStream(temp, FileMode.Open))
{
... | First thing you'd always want to do when searching for the reason why software fails is locating the source of the error message. You do that by [using Google first](https://www.google.com/search?q=%22the+same+volume+can+not+be+used+as+both+the+source+and+destination%22&ie=utf-8&oe=utf-8). Second hit (right now) is gol... |
59400 | ```
;WITH
cte_Date ( DateCode_FK ) AS (
SELECT DATEADD( DAY,
1 - ROW_NUMBER() OVER (
ORDER BY so1.object_id ),
GETDATE() )
FROM sys.objects so1
CROSS APPLY sys.objects so2 )
SELECT TOP 10 d.DateCode_FK
FROM cte_Date d
ORDER BY d.DateCode_FK D... | SQL Server does not guarantee the timing or number of evaluations for scalar expressions. This means that a query that *might* throw an error *depending on the order of operations* in an execution plan might (or might not) do so at runtime.
The script uses `CROSS APPLY` where `CROSS JOIN` was probably intended, but th... |
59528 | Is there some URL from which I can download a given package from npm (as a tarball or something)? I need the exact files that were originally uploaded to npm.
Using `npm install` gets a different, generated package.json for example. I want the exact original set of files that was published. | You can use [`npm view`](https://docs.npmjs.com/cli/view) to get the URL to the registry's tarball (in this example for the module `level`):
```
$ npm view level dist.tarball
```
And to download tarball, you can use [`npm pack`](https://docs.npmjs.com/cli/pack):
```
$ npm pack level
``` |
59651 | I need to load 100 images in cells. If I use this method in tableView cellForRowAt:
```
cell.cardImageView.image = UIImage(named: "\(indexPath.row + 1).jpg")
```
and start scrolling fast my `tableView` freezes.
I use this method to load the image data in background that fix freezes:
```
func loadImageAsync(image... | Your cells are being reused.
When cell goes out of screen it gets to internal `UITableView`s reuse pool, and when you `dequeueReusableCell(withIdentifier:for:)` in `tableView(_:cellForRowAt:)` you get this cell again (see, "reusable" in name). It is important to understand `UITableViewCell`'s life cycle. `UITableView... |
60601 | I want to create a HashMap to store data to firestore database. I want store the name and a boolean value based on the pressed button. But the **"put()"** in hashmap **replaces** the previous values, i.e the name and the boolean value. And i get only the last value in the database.
Here is the use of put to store data... | Try and identify what makes a number even. In your head, what could you do to the number to prove it is even? You divide it by 2 and see if the remainder is 0. In programming, we use the modulo operator (%) to get the remainder of an equation.
Try and think of a way that you can iterate over the items in your list an... |
60938 | So, here is my XML file for my user layout
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="... | I'll suggest unsing `ConstraintLayout` for this. It's easier! For `ConstraintLayout` you need to add this dependency into your `build.gradle` app file:
`implementation 'androidx.constraintlayout:constraintlayout:1.1.3'`
Then you can do it like this:
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintl... |
61301 | I installed pip using
`$ python get-pip.py`
and I set PATH
```
C:\Program Files\Python\Scripts
```
then I restarted the command prompt so that path would take effect. Then I run
`$ pip`
I get this
```
Traceback (most recent call last):
File "D:\obj\Windows-
Release\37amd64_Release\msi_python\zip_amd64\ru... | Did you try: `$ pip -V`? Or `$ pip help`? Just guessing, but trying checking the version since pip probably requires an argument. |
61310 | So I'm trying to put all numbered domains into on element of a hash doing this:
```
### Domanis ###
my $dom = $name;
$dom =~ /(\w+\.\w+)$/; #this regex get the domain names only
my $temp = $1;
if ($temp =~ /(^d+\.\d+)/) { # this regex will take out the domains with number
my $foo = $1;
$foo = "OTHER";
$d... | ```
if(mt_rand(0,1)) {
echo 3;
} else {
echo 5;
}
```
Or reverse it, your choice. |
61634 | I have `AViewController` which is a rootViewController in it's navigationController.
In `AViewController`, i have a `objectA`, i declare it like this:
```
@interface AViewController : ParentVC
@property (strong, nonatomic) ObjectA *objectA;
@end
```
I also have a `BViewController`, declared similar like this:
``... | You should set it to weak rather than strong in BViewController, BViewController does not own the object, AViewController does...
Is there a good reason to nil out AViewcontrollers pointer to this object? This is not safe object management IMHO
edit addition..
ok after reading your comments i really think you should... |
61885 | I have a kendo grid on Cordova app. Here on the grid, the scrolling is jagged due to the css rule 'k-grid tr:hover' in kendo css. If I disable this rule from developer tools, scrolling is smooth. Is there any way to disable this hover rule?
I don't want to override hover behaviour. I want to disable it.
Edit: The pro... | You can use pointer-events: none property on the DOM element.
<https://developer.mozilla.org/en/docs/Web/CSS/pointer-events>
```
.k-grid tr {
pointer-events: none;
}
```
With this property, the hover event on that element will be completely ignored. |
62152 | I know that the best way to upload to the blobstore is to use the blobstore API, so I tried to implement that, but I'm getting some weird errors that seem to suggest that I can't just embed a blobstore handler in my views.py file. Am I just going about this incorrectly?
ETA: I *am* using Django for all of my other vie... | It might be simpler to use the django toolkit to enable support for storing files in GCS by default in django.
In your settings.py:
```
APPENGINE_TOOLKIT = {
# ...,
'BUCKET_NAME': 'your-bucket-name',
}
DEFAULT_FILE_STORAGE = 'appengine_toolkit.storage.GoogleCloudStorage'
```
<https://github.com/masci/djang... |
62163 | I am an Android Developer.
Yesterday I opened my current project at Android Studio
and the project could not start.
An error was shown:
```
Gradle sync failed: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm o... | I resolved this by turning off Hotspot on my pc. Found the solution [here](https://www.programmersought.com/article/67033172684/) |
62787 | I'm trying to pull a string from my URL in WordPress, and create a function around it in the functions file.
The URL is:
"<https://made-up-domain.com/?page_id=2/?variables=78685,66752>"
My PHP is:
```
$string = $_GET("variables");
echo $string;
```
So I'm trying to return "78685,66752". Nothing happens. Is the fi... | `$_GET` should be in the form
```
$string = $_GET["variables"];
```
and not
```
$string = $_GET("variables");
``` |
63035 | I'm trying to add placeholder text to my ckeditor screen like for example `Type here ...` . You can do this with the [configuration helper plugin](http://ckeditor.com/addon/confighelper).
I've placed the ckeditor library in `sites/all/libries`. I've pasted the plugin in `sites/all/libraries/ckeditor/plugins`. Then I'... | A solution that avoids patching the wysiwyg module is the following:
You can use the hook `hook_wysiwyg_plugin($editor, $version)` that wysiwyg offers, in order to add the ckeditor plugin, as follows:
```
function custom_wysiwyg_plugin($editor, $version) {
$plugins = array();
switch ($editor) {
case 'ckeditor... |
63574 | I would like to take some JSON, convert it into a dictionary and then change some of the values in that dictionary.
I've tried a few things as shown below but I can't get it to work as intended.
My JSON is as follows:
```
{
"9":[
{
"09_000":{
"name":"Wyatt Feldt",
"1":"R",
... | If you have your JSON text in a string, say its name is `my_json`, then you can use Python's `json.loads` to convert it to a dictionary.
```
import json
register = json.loads(my_json)
```
In side your dictionary, you have keys "9", "10", "11". For each of those, you have a list of two items you can iterate through. ... |
63684 | As the question says, do I have to do in order to print Unicode characters to the output console? And what settings do I have to use? Right now I have this code:
```
wchar_t* text = L"the 来";
wprintf(L"Text is %s.\n", text);
return EXIT_SUCCESS;
```
and it prints:
`Text is the ?.`
I've tried to change the output c... | This is code that works for me (VS2017) - project with Unicode enabled
```
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
int main()
{
_setmode(_fileno(stdout), _O_U16TEXT);
wchar_t * test = L"the 来. Testing unicode -- English -- Ελληνικά -- Español." ;
wprintf(L"%s\n", test);
}
```
This is cons... |
64031 | I recently started developing my first serious project in PHP, a MVC completely build by myself, which is quite a challenge, when being new to OOP.
So the main struggle of the whole project has, and is, my router. It's really important, so I want to have a... great?... router, that just works - but without compromisin... | Unfortunately, this is a very large question to ask. So there will be gaps in my answer but i will answer it best i can using code where possible.
You do not want to couple your router with the controllers. They both do different things. If you do combine them, you end up with a mess (as you have found out).
```
clas... |
64557 | I am trying to copy a file into another folder, here is my code.
```cs
private static void CopyDirectory(DirectoryInfo source, DirectoryInfo target)
{
foreach (var sourceFilePath in Directory.GetFiles(source.FullName))
{
FileInfo file;
if(IsAccesable(sourceFilePath, out file))
{
... | ```
def product_index(request):
title = "My Products"
products = Product.objects.all()
order = get_cart(request)
cart = Order.objects.get(id=order.id, complete=False)
items = cart.orderitem_set.all()
# Changes
for product in products:
qty = 0
if items.filter(product=product... |
64770 | I have an array of complex objects, which may contain arrays of more objects. I want to convert these to a CSV file. Whenever there's a list of objects, the data is parsed as `[object Object]`. If a person has two emails, for example, I want to print these emails in two lines, and so on for each object. Addresses may b... | You can use [`setdefault()`](https://docs.python.org/3/library/stdtypes.html#dict.setdefault) to set the initial values. As you loop through just set the appropriate default or use `get` to get the inner values or zero:
```
d = {}
with open('data.txt') as table:
next(table)
for line in table:
(AAA, BBB... |
64813 | I'm interested what's the **average** line number per **method or class**. Programming language is **JAVA** and it's an **Android** project.
I know there is no specific number, but I'm interested what's the ***good programming practice***?
**EDIT:** For example in android I have 10 buttons *(3 for action bar, 7 for e... | Since we're talking Java we're implicitly discussing OOP.
Your primary concern is therefore creating highly cohesive classes with low coupling. The number of lines in a method or methods in a class is not an indicator of either. It is however a by-product of achieving both. Your classes is much more likely to have co... |
65135 | I am getting the below error in JMeter log while running via jenkins.
I am using JMeter version 2.11r.
```
The logs are:
2017/09/14 17:00:16 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US
2017/09/14 17:00:16 INFO - jmeter.JMeter: Loading user properties from: E:\J-Meter\bin\user.properties
2017/09/14 17:0... | Some Java developers are a little bit relaxed when it comes to handling edge situations (or they simply don't have enough qualification) as it's evidenced by [JENKINS-37013](https://issues.jenkins-ci.org/browse/JENKINS-37013) (even [Workspace Whitespace Replacement Plugin](https://wiki.jenkins.io/display/JENKINS/Worksp... |
65629 | I am preparing for GRE MATH SUBJECT TEST, I have reviewed many problems, some of these problems are not in GRE Math Practice books, but they are in some other books. I found the following problem, but not sure if it can be a GRE problem or no. And I do not even know how to start;
>
> Let $P$ be a polynomial with inte... | Yes, eigenvectors and eigenvalues are defined only for linear maps. And that map $f$ maps elements of $\Bbb R^2$ into elements of $\Bbb R^2$. In particular, it maps $(3,2)$ into $(4,3)$. Thinking about it as acting on vectors, by acting on their initial and final points, is misleading. |
65661 | Currently I have a table with schema as follows:
```
mData | CREATE TABLE `mData` (
`m1` mediumint(8) unsigned DEFAULT NULL,
`m2` smallint(5) unsigned DEFAULT NULL,
`m3` bigint(20) DEFAULT NULL,
`m4` tinyint(4) DEFAULT NULL,
`m5` date DEFAULT NULL,
KEY `m_m1` (`m1`) USING HASH,
KEY `m_date` (`m5`... | **DO** make relationships between tables explicit by declaring foreign key constraints.
I do not see any good reason for not doing this. Why are foreign key constraints a good idea?
* Foreign key constraints are a simple way to help safeguard data integrity/consistency.
* Constraints (not just foreign key ones) can a... |
65747 | consider the following code:
```
class A
{
friend class B;
friend class C;
};
class B: virtual private A
{
};
class C: private B
{
};
int main()
{
C x; //OK default constructor generated by compiler
C y = x; //compiler error: copy-constructor unavailable in C
y = x; //compiler error: assignment ... | Your code compiles fine with Comeau Online, and also with MinGW g++ 4.4.1.
I'm mentioning that just an "authority argument".
From a standards POV access is orthogonal to virtual inheritance. The only problem with virtual inheritance is that it's the most derived class that initializes the virtually-derived-from class... |
65826 | I use the function below to add CSS classes (blue, red, pink...) in a DIV `.container` from a select `#selcolor`. Is it possible to use the same function in other select tags with different IDs? In this case the classes (blue, red, pink...) would not be added to the DIV `.container` with it the variable "div\_action" f... | `event.currentTarget.id` is used to get the `id` of the current target. So you can use this function for other select box also.
>
> *Note: I have assumed the select box as a single select and simplified the code a bit.*
>
>
>
```
function select_changed(id) {
jQuery('select#'+id).each(function() {
var se... |
66011 | I do not see where `s` is defined. Guru will not tell me. All I get is "no object for identifier" but it knows about the `k` right beside it. Here is a snippet that is typical of the linked code:
```
func getIndexAndRemainder(k uint64) (uint64, uint64) {
return k / s, k % s
}
```
The one letter variable name def... | It is defined in `go-datastructures/bitarray/block.go`:
```
// s denotes the size of any element in the block array.
// For a block of uint64, s will be equal to 64
// For a block of uint32, s will be equal to 32
// and so on...
const s = uint64(unsafe.Sizeof(block(0)) * 8)
```
As the variable `s` was not defined in... |
66238 | Got four tables; `users`, `company`, `company_branch` and `users_branch`. Users are people belonging to company. A company has got branches and a user can belong to a single branch at any given time. However, the users\_branch table exists to keep track of the history of changing from one branch to another. E.g. To get... | The issue is that vba is very US-English centric. So either use `,` in place of `;` or use `.FormulaR1C1Local`:
```
Sub Call_Min()
Dim i As Integer
Dim limit As Integer
limit = Sheets("AUX").Range("B6").Value
Sheets("Sheet11").Activate
'ActiveSheet.Cells(6, 16).Select
'ActiveCell.Formula = "=SUM(Range("F6:I6"))"
For... |
66567 | I am scripting a ksh file where I am looking to return the file with the most number of lines in a directory. The script can only take one argument and must be a valid directory. I have the 2 error cases figured out but am having trouble with the files with max lines portion so far I have below:
```
#!/bin/ksh
#Script... | ```
> for "$1"
> do
> [wc -l | sort -rn | head -2 | tail -1]
```
The `for` loop has a minor syntax error, and the square brackets are completely misplaced. You don't need a loop anyway, because `wc` accepts a list of file name arguments.
```
wc -l "$1"/* | sort -rn | head -n 1
```
The top line, not the second l... |
66903 | I have found a basic URL structure for regular map tiles:
```
https://mts1.google.com/vt/lyrs=m@186112443&hl=x-local&src=app&x=1325&y=3143&z=13&s=Galile
```
What would be the URL structure to grab HYBRID map tiles from Google?
I don't know why I can't find this information; it seems like it should be easy to find.... | You need an instance from the google map js class and an anonymous function then you can set the map object to give hybrid tiles:[How to get your image URL tiles? (google maps)](https://stackoverflow.com/questions/8241268/how-to-get-your-image-url-tiles-google-maps). Or maybe it's lyrs=y:<http://www.neongeo.com/wiki/do... |
67357 | I am currently writing a script in Python to log in on facebook and I want to send message to a friend. The script logs in to my facebook, and it manages to find my friend, but the message is not sent. I'm not 100% sure, but I think the problem is in the div tag/CSS on the text area (I commented out that piece of code)... | I solved this problem on [RU SO](https://ru.stackoverflow.com/questions/919234/%D0%9D%D0%B5-%D0%BC%D0%BE%D0%B3%D1%83-%D0%BD%D0%B0%D0%B9%D1%82%D0%B8-%D1%8D%D0%BB%D0%B5%D0%BC%D0%B5%D0%BD%D1%82-xpath-selenium-facebook-%D0%92%D0%B2%D0%B5%D0%B4%D0%B8%D1%82%D0%B5-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5/919670#... |
67407 | I have a byte array:
```
private final static byte[][] ARRAY = {
{ (byte) 0xaa, (byte) 0xbb, (byte) 0xcc, (byte) 0xdd },
{ (byte) 0x11, (byte) 0x22, (byte) 0x33, (byte) 0x44 }
};
```
Given an arbitrary byte array:
```
byte[] check = { (byte) 0x11, (byte) 0x22, (byte) 0x33, (byte) 0x44) };
```
or
```
byte... | You can use `Arrays.equals()` to compare two arrays. From the [javadoc](http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#equals(byte[],%20byte[])):
>
> Returns true if the two specified arrays of bytes are equal to one
> another. Two arrays are considered equal if both arrays contain the
> same number... |
67589 | I am using Entity Framework in order to create my models, but when I try to access the database from the *data connections* in Server Explorer, it does not work. I know the models are being created in the SQL Server Express instance running on my local machine, as I navigated to
```
Computer -> Program Files -> Micro... | Print quotes around it?
```
System.out.println("\"" + i + "\"");
``` |
68247 | I have a table containing `positions`
This table is as follows:
```
user_id | current | started_at | finished_at
2 | false | 10-07-2016 | 02-08-2016
1 | false | 19-07-2016 | 27-07-2016
1 | true | 29-07-2016 | null
3 | true | 20-07-2016 | null
3 | false | 01-07-2016 | 18-... | This is an excellent opportunity to use a window function. You can use the window function to create a query that looks like this:
```
SELECT user_id, current, started_at, finished_at,
row_number() OVER (PARTITION BY user_id) AS row_number
FROM positions
ORDER BY CASE WHEN current = true
THEN start... |
68694 | I have a dataframe like this:
```
col1 col2 col3 col4
A W Z C
F W P F
E P Y C
B C B C
M A V C
D O X A
Y L Y D
Q V R A
```
I want to filter if multiple columns have a certain value. For instance I want to filter... | Here's a way you can do:
```
df[df.applymap(lambda x: x == 'A').any(1)]
col1 col2 col3 col4
0 A W Z C
4 M A V C
5 D O X A
7 Q V R A
```
For multiple cases, you can do like `A`, `B`:
```
df[df.applymap(lambda x: x in ['A','B']).any(1)]
``` |
69199 | I have a report I am doing with SSRS 2008 with some rows that have multiple elements inside them. On the preview the row automatically expands to support the extra elements but however when I export the report to Excel it appears only as a single row with just the one element displayed, although all the elements are th... | Came across this (again) recently and thought I'd share my take...
Whether Excel correctly renders the height has to do with merged columns. Take note of your column alignments throughout all objects on the page. Any objects not tied to the data table itself (or embedded inside the data table) must be aligned with the... |
69669 | I am trying to select some webelement on
"<http://www.espncricinfo.com/england-v-new-zealand-2015/engine/match/743953.html>". Here I want to select total runs scored by the player and extras on first table except total runs. I have made below xpath but it is also taking total runs. may i know how to avoid "Total Runs... | Total runs has class `total-wrap` in the `<tr>` tag. You can look for element without this class using `not`
```
//table[1][@class='batting-table innings']/tbody/tr[not(@class='total-wrap')]/td[4]
``` |
69990 | *Sorry for the long post, but I had to give as much info as possible to make this very vague question more specific.*
My project's aim is to let users search a (huge) database of variety of products.
* Each product is present under a category.
* Each product will have 10 to 100 'specs' or 'features' by which the user... | InnoDB and MyISAM each have their strengths and weaknesses.
* `May 03, 2012` : [Which is faster, InnoDB or MyISAM?](https://dba.stackexchange.com/questions/17431/which-is-faster-innodb-or-myisam/17434#17434)
* `Sep 20, 2011` : [Best of MyISAM and InnoDB](https://dba.stackexchange.com/questions/5974/best-of-myisam-and-... |
70042 | I have a String = `'["Id","Lender","Type","Aging","Override"]'`
from which I want to extract Id, Lender, Type and so on in an String array. I am trying to extract it using Regex but, the pattern is not removing the "[".
Can someone please guide me. Thanks!
Update: code I tried,
```
Pattern pattern = Pattern.compil... | I like @epascarello suggestion better, but if you want to use JavaScript, then just add the following line to your existing code:
```
function appendArrows() {
var myDiv = document.getElementById('searchResult');
var list = myDiv.getElementsByTagName('div');
for (var i = 0; i <= list.lengt... |
70357 | I'm new to IntraWeb and have a problem.
In order to implement a Login Form, i stored Datasets in the Usersession.
But when it comes to access the Datasets i get an Access Violation Error.
I figured out, that the Useresession is not created. Now i'm a bit confused, because in the Intraweb Documentary it is said, that th... | You could do something like this:
```
class DataSource {
static let sharedInstance = DataSource()
var data: [AnyObject] = []
}
```
Usage:
```
DataSource.sharedInstance.data
``` |
70409 | I am trying to upload a file, very much following the instructions on [Symfony's cookbook](https://symfony.com/doc/current/controller/upload_file.html), but it doesn't seem to work.
The specific error is as follows, but the background reason is that the file as such does not seem to be ( or remain ) uploaded.
>
> Ca... | Try setting the `precision` and `scale` properties of the @Column annotation.
See: <https://docs.jboss.org/hibernate/jpa/2.1/api/javax/persistence/Column.html> |
70789 | **My scenario:** My application is a Web Api 2 app using a business logic and repository layer for data access. The web application uses ASP.NET Impersonation to login to the database as the user accessing the website (authenticated via PKI). I have several async controller methods. However, when I `await` on the data ... | I don't believe there is a way to actually wrap a method in a using statement with an attribute, but you could essentially do the same thing by using the OnActionExecuting and OnResultExecuted methods in a custom ActionFilter.
```
public class IdentityImpersonateActionFilter : ActionFilterAttribute
{
IDisposable u... |
70831 | On our development servers, we allow multiple developers access to the server to `git pull` their changes. Normally this requires running `sudo systemctl reload php-fpm` (or sending `USR2`, etc.). However, we want to allow them to reload the changed code in PHP-FPM without needing `sudo`.
Way back when when I used to ... | You'll probably be there when whitelisting the command in your /etc/sudoers file:
Start by editing the sudoers file:
```
sudo visudo
```
Add the following config line:
```
user ALL=(root) NOPASSWD: systemctl reload php-fpm
```
>
> Replace *user* (at the beginning of the line) with the real username, for whom th... |
70877 | I have associative table movies and their categories.
```
movie_id catagory_id
1 1
1 2
1 3
2 1
2 2
2 4
3 1
3 5
3 6
```
How can i get movies that have category 1 and 2?
Result:
```
movie_id
1
2
``` | If you want have `catagory_id` 1 and 2 use this:
```sql
select movie_id from your_table
group by movie_id
having string_agg(catagory_id::text, ',' order by catagory_id) ~ '(1,)+(2)+'
```
If you want have `catagory_id` 1 or 2 use this:
```sql
select distinct(movie_id) from your_table
where catagory_id in (1, 2)
``` |
71143 | I would like to know what im doing wrong cos i need persistent data from a service and get that data on my artist and album component. I don´t paste the album component 'cos it's the same. Im trying to get artist, albums, tracks, etc... Im sorry if it's a basic question but im new on angular and typescript. Thanks for ... | Do this:
```
npm install rxjs@6 rxjs-compat@6 --save
``` |
71323 | I am trying to show a list of custom post types on a page template. When I view the page, instead of seeing the different posts, I see the actual page repeated. For example, If I have 5 posts, the actual page (head content footer) will be display five times. It seems like the query is working...in some way but I am not... | Refer to the Codex page for [`setup_postdata()`](https://codex.wordpress.org/Function_Reference/setup_postdata):
>
> Important: You must make use of the global $post variable to pass the post details into this function, otherwise functions like the\_title() don't work properly...
>
>
>
Also note that you can use ... |
71359 | I have an excel document that contains multiple sheets. When I run the loop Jumping after returning from the first sheet to the second sheet. But on the second sheet does not open a new dictionary and I get an error like "run time error 9" at ln 16. `MySeries(Cnt, 2) = Dt(j, 2)`
What can I do for each sheet in the ope... | ```
t_stamp = int(time.mktime(datetime.datetime.strptime(date, "%Y-%m-%d").timetuple()))
for h in range(24): 24 hours
for i in range(60): # 60 minutes
print t_stamp
t_stamp += 60 # one minute
``` |
71500 | In my system when users add a reservation to the database, a transaction ID will be automatically generated:
```
$insertID = mysql_insert_id() ;
$transactionID = "RESV2014CAI00". $insertID ;
$insertGoTo = "action.php?trans=" . $transact;
```
But it is very dangerous to pass the `$transactionID` via address bar. (GET... | Another approach would be to hash the id as shown below.
```
$salt = 'your secret key here';
$hash = sha1(md5($transactionID.$salt));
```
Now you can pass the hash along with the transaction id on the next page and check it match. If it matches then the id wasn't changed. If not then the id was changed. Something li... |
71502 | I have two tables "Category" and "Movie" with 1-M relationship ('CategoryID' is a Foreign Key in the table "Movie").
I'm using a ListView to list all Categories. Inside of my ListView is Repeater that loops through all movies within each category.
In my code-behind,I'm binding the ListView DataSource as follows:
```... | ```
((Category)Container.DataItem).CategoryItems.Where(p => p.Active == true).OrderBy(p => p.Name.StartsWith("The ") ? p.Name.Substring(4): p.Name)
``` |
71956 | I have a table:
```
T (Mon varchar(3));
INSERT INTO T VALUES ('Y');
```
Case 1:
```
DECLARE @day varchar(3) = 'Mon'
SELECT Mon
FROM T; --result : Y (no problem)
```
Case 2:
```
DECLARE @day VARCHAR(3) = 'Mon'
SELECT @day
FROM T; --result : Mon
```
If I want to get result `Y` in second case, how can I d... | ```
exec('select '+@day+' from #T;')
``` |
72930 | Is there an idiomatic way to apply a function to all items in a list ?
For example, in Python, say we wish to capitalize all strings in a list, we can use a loop :
```
regimentNames = ['Night Riflemen', 'Jungle Scouts', 'The Dragoons', 'Midnight Revengence', 'Wily Warriors']
# create a variable for the for loop resul... | The answer seems to be to use anonymous functions, or pass a function to a lists `forEach` method.
Passing a function:
```
void capitalise(var string) {
var foo = string.toUpperCase();
print(foo);
}
var list = ['apples', 'bananas', 'oranges'];
list.forEach(capitalise);
```
Using an anonymous function:
```
lis... |
72962 | In our angular 5.2 project, we keep getting the below errors in scss files,
[](https://i.stack.imgur.com/B9cED.png)
do we have a VS code plugin OR a Scss formatter which can take care these space issues in the scss?? | These errors seem to be from the `stylelint` linting tool. You'll have to either modify your `stylelint` config and turn off these rules or you have to fix them in your `scss` file.
To help you with detecting these errors on VS code as you code, you can use an extension.
1. Go to `View > Extensions`.
2. Search for a ... |
74377 | My admin URL redirecting to homepage, I have did lot of efforts to fix admin login link but still it migrating to homepage,
my website link <https://www.muzikhausberlin.de/index.php>
my admin link <https://www.muzikhausberlin.de/admin> | after hard hurdle i got it fixed. i replace htaccess file with this code and working perfect
```
############################################
## uncomment the line below to enable developer mode
# SetEnv MAGE_MODE developer
############################################
## uncomment these lines for CGI mode
## m... |
75091 | This is driving me crazy! measured layout is always 0 when i try to build layout programmatically using constraint layout and constraint set.
I tried `requestLayout`, `forceLayout`, `invalidate` on all child and parents. but width and height is 0 rendering whole view invisible.
here is my layout builder. my problem i... | I had to clone `ConstraintSet`. not only that, cloning must be done **after** views are added. after adding views and cloning `ConstraintSet`, it knows size of the views and can set constraints accordingly.
```
private FormViewBuilder(Context context) {
this.context = context;
formView = new FormView(context);... |
75121 | I've been researching this and I am trying to use a VF page method of invoking an Apex class through a custom button. The method I am attempting to use is this :
[Invoking Apex Code With a Custom Button Using a Visual Force Page](http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualfo... | ```
public class VFController {
// This is where you want to declare your public getter and private setter methods
// String theId = ApexPages.currentPage().getParameters().get('id');
// The above gets passed to you by reference. Its part of your getter method and is
// superfluous. You do the same below at Opportuni... |
75716 | Presently I have the following setup where the controller `ReminderViewController` has a container view which refers to a `UITableViewController` with the three static cells:
Beyond this [answer](https://stackoverflow.com/questions/8945728/how-to-visu... | From the action methods for your switches, you can access the ReminderViewController with self.parentViewController, and then call any method or set any property in that controller that you want to. |
75937 | I want to move an imageview along with finger using onTouchListener() in android......
I have created an xml -->
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="f... | Hey I would suggest you to not to play with the view. Its better to set an animation on the view and play with that animation object to performing all the actions. Just invisible the view on onTouchEvent and let the animation object work done for u. You can see the example of swipeToDismiss in list view <https://github... |
76373 | I need to find the ratio of one floating-point number to another, and the ratio needs to be two integers. For example:
* input: `1.5, 3.25`
* output: `"6:13"`
Does anyone know of one? Searching the internet, I found no such algorithm, nor an algorithm for the least common multiple or denominator of two floating-point... | This is a fairly non-trivial task. The best approach I know that gives reliable results for any two floating-point is to use [continued fractions](http://en.wikipedia.org/wiki/Continued_fraction).
First, divide the two numbers to get the ratio in floating-point. Then run the continued fraction algorithm until it termi... |
76953 | A Zabbix server I am currently started showing an alert like this:
```
/etc/passwd has been changed on Router
```
Now, on this Router machine I don't have a history of the passwd file so I cannot see exactly what changed, but what I know is that the time of the alert roughly coincided with this `Router` machine bein... | Move the second folder one step up, move the contents, then move the second folder back. Like so:
```
cd folder1
mv folder2 ..
mv * ../folder2/
mv ../folder2 .
``` |
76993 | [Array.prototype.splice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) allows to remove multiple elements from array but if and only if theese elements are siblings. But what if no?
Suppose, we need to remove 2th, 5th and 8th elements from array (cont from 0).
```js
... | You could use [filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), like this:
```js
const sample = ['a', 'b', 'c', 'd', 'e', 'f']
const idx = [1, 3, 5];
const result = sample.filter((x, i) => idx.includes(i));
console.log(result);
```
Or if you want to specify which... |
77154 | Two separate Flask applications, running on two different subdomains, however the login sessions are not persisting between the subdomains.
For example; logging into a.example.co.uk will result in the user being logged in. However, visiting b.example.co.uk - the user will not be logged in.
Running Apache, Flask (with... | Managed to solve it!
Turns out I was setting the Flask application secret keys in the wsgi files, like so;
```
from App import app as application
application.secret_key = 'xxxxxxx'
```
And both the applications had different secret keys in their wsgi files! Completely forgot I was setting the secret keys in both t... |
77658 | What are the unit elements of $R/I$ where $I$ = {all cont. functions on $[0,1]$ |$ f(0) = f(1) = 0$} where $I$ is an Ideal w.r.t pointwise addition and multiplication.[](https://i.stack.imgur.com/OiZv5.jpg)
I am little bit confused about it. Can you pl... | Here's another way to picture things.
$A=\{f\in R\mid f(0)=0\}$ and $B=\{f\in R\mid f(1)=0\}$ are both maximal ideals of $R$. For example, the first one is the kernel of the epimorphism $\phi:R\to \mathbb R$ which maps $f\mapsto f(0)$. Your ideal $I$ is equal to $A\cap B$.
By the Chinese remainder theorem, $\frac{R}{... |
77777 | I'm making a little linear PSU for my lab. Based on the good ol' LM338K. I fried one last night and I'm still trying to figure out why. I think it might be EMF from my transformer.
I have a transformer, a toroidal 220V to 12V 200W. I noticed it was built as two coils in parallel, so I figured i could connect the coils... | Switching an inductor may make it work like a boost converter, and thus temporarily generate a higher voltage.
One way of making sure that the input voltage to the LM338 converter is no higher than allowed, is to wire a high-wattage (between 600W and 5 kW) TVS diode with an appropriate clamping max voltage biased agai... |
77869 | is there any way to convert this to a recursion form?
how to find the unknown prime factors(in case it is a semiprime)?
```
semiPrime function:
bool Recursividad::semiPrimo(int x)
{
int valor = 0;
bool semiPrimo = false;
if(x < 4)
{
return semiPrimo;
}
else if(x % 2 == 0)
{
... | @porterhouse91, have you checked your csproj file to make sure it has been set up with the appropriate build target?
I haven't yet tried the new built-in Package Restore feature, but I'm assuming it works at least somewhat like the previous workflows out there on the interwebs. If that's the case, enabling Package R... |
77874 | I'm working with calendar application and basically idea behind this: I have a ListView of added events in particular date and what I would like to do is when I click on particular event of the day in ListView, onClick method would take that event's ID from database and start new activity with it. So I would need to pa... | Yes the method you have written in your model class will return you the id of the clicked object but for that you will need to get the object first,so what you can do is , inside your `onItemClick()` method get your object like below
```
Booking booking = mutableBookings.get(position); // This will return you the obje... |
77984 | I want to show / hide my dropdown field against each selection of my radio button:
HTML & PHP
```
<?php $Sr = 1; $FPSTopics = mysqli_query($con, "SELECT * FROM table");
for($i=0; $i< $FPSData = mysqli_fetch_array($FPSTopics); $i++){
?>
<tr>
<td style="min-width:50px;"><?php echo $Sr; ?></td>
<td><input type="text"... | IDs need to be unique
You likely will find this works more reliably since I navigate relative to the row
```js
$('[name^=Suitability]').on("click", function() { // any button that starts with Suitablility
$(this).closest('tr')
.find('.ShowPriority')
.toggle(this.value==="Y"); // show if "Y", Hide if not
})
... |
78329 | I am displaying some text in a JLabel. Basically I am generating that text dynamically, and then I apply some HTML tags (e.g., `BR` and `B`) to format the text. Finally I assign this formatted text to my JLabel.
Now I want my Jlabel to automatically wrap the text to the next line when it reaches the end of screen, lik... | Should work if you wrap the text in `<html>...</html>`
**UPDATE:**
You should probably set maximum size, too, then. |
78448 | I just play a little with Go to learn the handling.
I have a main go program.
I created a sub-folder for a database module, in that I want to do database operations.
For the parameters I have a struct type with credentials etc.
How can I pass the struct to the module?
I want all of the configuration and global varia... | I don't think the TypeScript compiler has enough support for higher order type analysis to do this for you. The problems I see:
* There's no good way for the compiler to infer that the function `const mapper = (v: 1 | 2) => v === 1 ? "aaa" : "bbb"` is of a conditional generic type like `<V extends 1 | 2>(v: V) => V ex... |
78655 | I'm looking for the EV3-G control block for the HiTechnic Color Sensor V2, previously distributed by HiTechnic (<https://www.hitechnic.com/cgi-bin/commerce.cgi?key=NCO1038&preadd=action>), apparently now distributed by Modern Robotics (<https://modernroboticsinc.com/product/hitechnic-nxt-color-sensor-v2/>).
Many websi... | Hitechnic.com now points to modernroboticsinc.com. You can find the Hitechnic EV3 color sensor block here:
<https://modernroboticsinc.com/download/hitechnic-ev3-color-sensor-block/>
All available downloads are available and searchable here:
<https://modernroboticsinc.com/downloads/> |
78720 | I am trying to delete the nodes that has a relationship to each other node if the relationship exist. If the relationship doesnt exist delete the first node. Example:
I am using UNWIND because that is the data provided by the user.
```
UNWIND [{name:'John'}] as rows
IF EXISTS(u:Person)-[r:OWNS]->(c:Car), THEN
MATCH (u... | I have faced the same issue. Don't pacnic. Open Windows `cmd` or Ubuntu/MacOS/Linux `terminal` and run `flutter upgrade -v` .
It takes time to download and sometimes if failed error doesn't appear in IDE.
In terminal/cmd you can see the progress.
Restart your IDE once the upgrade finishes. |
78757 | Running the following
```
poetry shell
```
returns the following error
```
/home/harshagoli/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads. ... | `poetry shell` is a really buggy command, and this is often talked about among the maintainers. A workaround for this specific issue is to activate the shell manually. It might be worth aliasing the following
```
source $(poetry env info --path)/bin/activate
```
so you need to paste this into your `.bash_aliases` or... |
78821 | I need to use collections as below, but want to print the output dynamically instead of specifying PL01, PL02, PL03...as this is going to be bigger list. If not possible using RECORD type, how can this be achieved using collections.
Business scenario : Having a item price list in an excel sheet as price list code in t... | One way is to create `TYPE` as objects and using a `TABLE` function to display by passing a `REFCURSOR`.
```
CREATE OR REPLACE TYPE RT AS OBJECT ( ITEM VARCHAR2(20),
PL01 NUMBER,
PL02 NUMBER,
PL03 NUMBER,
PL04 NUMBER,
... |
78904 | I'm working on an Objective-C app that is Mac OS X Lion only. I'm trying to accept drag & drops from Address Book. It looks like in Lion, Address Book vCard representations are not returning any data. Unfortunately I cannot test the code under a previous OS, though I had found sample code suggesting that it was possibl... | Sorry about this, I'm the culprit :)
Hopefully we will be able to push the next version soon. Not the time to mention this, but there is an upside to this accident: it means we can definitely kill the current serial form of BF and its related supporting code (which was an accident itself), which I'm trying to fix [for... |
79381 | >
> **Question 1**$\;\;\;$Let $(\Omega,\mathcal A,(\mathcal F\_t)\_{t\ge 0},\operatorname P)$ be a given filtered probability space. Can we prove that there is a Brownian motion on $(\Omega,\mathcal A,\mathcal F,\operatorname P)$?
>
>
>
All I know is that we can find some $(\Omega,\mathcal A,(\mathcal F\_t)\_{t\ge... | It is known that a probability space is atomless if and only if there exists a random variable with continuous distribution. Therefore, in particular, a probability space with atoms cannot have a normal random variable. Thus, the answer is no.
On the other hand, the Levy-Ciesielski construction of the Brownian motion ... |
79752 | I ran into an impasse trying to automate the creation of new git repositories using powershell.
As I understand one creates new repos using the POST Method on the url
```
/rest/api/1.0/projects/$ProjectKey/repos
```
<https://developer.atlassian.com/static/rest/stash/3.0.1/stash-rest.html#idp1178320>
Because yo... | The [REST API documentation](https://developer.atlassian.com/static/rest/stash/3.0.1/stash-rest.html#idp1178320) is a little vague around it, but I don't think you can set the repository slug based on [this section](https://developer.atlassian.com/static/rest/stash/3.0.1/stash-rest.html#idp1207472). Neither specificall... |
79893 | I am currently trying to solve a problem where the input should be as following
```
int hours(int rows, int columns, List<List<Integer> > grid)
```
Where list grid is a Matrix of 0 and 1 ( 0 means not complete , 1 means complete ) as following:
```
0 1 1 0 1
0 1 0 1 0
0 0 0 0 1
0 1 0 0 0
```
Each value repre... | If you're allowed to update `grid`, use `grid.get(y).get(x)` to check the grid and `grid.get(y).set(x, value)` to update the grid. If you're not allowed to update the grid, start by copying the values into a `int[][]` 2D array, then use that instead in the solution below.
Scan the grid for `0` values, and add the coor... |
79938 | I have a set of files. The path to the files are saved in a file., say `all_files.txt`. Using apache spark, I need to do an operation on all the files and club the results.
The steps that I want to do are:
* Create an RDD by reading `all_files.txt`
* For each line in `all_files.txt` (Each line is a path to some file... | Using `spark` inside `flatMap` or any transformation that occures on executors is not allowed (`spark` session is available on driver only). It is also not possible to create RDD of RDDs (see: [Is it possible to create nested RDDs in Apache Spark?](https://stackoverflow.com/questions/29760722/is-it-possible-to-create-n... |
80316 | 1. At least one lower case letter,
2. At least one upper case letter,
3. At least special character,
4. At least one number
5. At least 8 characters length
problem is showing error at "/d" in regx pattern
```
private void txtpassword_Leave(object sender, EventArgs e) {
Regex pattern = new Regex("/^(?=.*[a-z])(?=.... | Try this instead :
```
^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})
```
[Tests](https://regex101.com/r/3IHFOw/1) |
80442 | I have a location in my story, the design of which needs a reality check.
**City Description:**
>
> As my ship cut across the waves a blurred grey smudge appeared in the distance, as the hours passed it became more distinct and it's true scope came into view.
>
>
> As we neared the end of our voyage a great cliff ... | Granite Massifs are common
--------------------------
A granite block of the size you ask for is totally feasible. El Capitan in California is certainly taller.
Getting the living spaces you want without explosives or magic is going to be sufficiently expensive to be impossible. Cutting stone by hand takes a long lo... |
81015 | I have an application which is developed in MVC .net. All the content in the application must be optimized for SEO. I am wondering if the content on the web page like (title, meta tags) are normally rendered as static context, Google can easily index that page.
But if the site is developed in .net MVC where the main c... | Use like this:
```
@Override
protected void onDestroy()
{
super.onDestroy();
asyncTask.cancel(true);
}
``` |
81176 | ```
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{>{\arabic{iRow}}cc>{\alph{iRow}}cc}[first-row]
\multicolumn{1}{c}{}\Block{1-2}{Name} && \Block{1-2}{Country} & \\
& George && France \\
& John && Hellas \\
& Paul && England \\
& Nick && USA \\
\end{NiceTabular}... | The second `NiceTabular` reproduces the first without using `\multicolumn` or `first-row`.
[](https://i.stack.imgur.com/oh4pj.jpg)
`\NRow` will output the row number decremented by 1 from the second row forward. `\ARow` does the same with alphabetical output.
```
\documentcla... |
81206 | i'm creating a link sharing that on bind() events of a specific textarea ( where i paste links ) it does an `$.post` ajax callback with a preview (in case of youtube or vimeo link).
Basically, i would remove link into textarea each times that link is detected and preview is gotten.
this is the function that does the c... | I think this would be related to raw photo files, because DRIVE tries to [convert them to JPG](http://www.photographybay.com/2013/09/26/google-goes-raw-better-conversion-now-supports-over-70-cameras-look-out-adobe/) as is done in Google+, unless you specify convert=false. You should specify in your upload API to not co... |
81923 | I am trying to send an E-Mail using the gem 'mail' with Ruby 1.9.3. It contains an text/html and an text/plain part which should be embedded as alternative parts as well an attachment.
This is my current code:
```
require 'mail'
mail = Mail.new
mail.delivery_method :sendmail
mail.sender = "me@example.com"
mail.to = ... | I managed to fix it like so:
```rb
html_part = Mail::Part.new do
content_type 'text/html; charset=UTF-8'
body html
end
text_part = Mail::Part.new do
body text
end
mail.part :content_type => "multipart/alternative" do |p|
p.html_part = html_part
p.text_part = text_part
end
mail.attachmen... |
81997 | Hey i have an array an I need to separate each value so it would be something like this
```
$arry = array(a,b,c,d,e,f)
$point1 = (SELECT distance FROM Table WHERE Origin = a AND Destination = b);
$point2 = (SELECT distance FROM Table WHERE Origin = b AND Destination = c);
$point3 = (SELECT distance FROM Table WHERE Or... | Simple just use list();
```
list($point1,$point2,$point3,$point4,$point5) = $arry;
```
Then do your query like so....
```
$sql = "SELECT SUM(distance) FROM table WHERE (origin='$point1' AND destination='$point2') OR (origin='$point2' AND destination='$point3') OR (origin='$point3' AND destination='$point4') OR (ori... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.