qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
58,709,871
I have an `ExampleView` class which should be singleton. Inside this class I have method `render` which I would like to call from another js file via object name 'ExampleView'. Here is the code: ``` import View from './view'; class ExampleView extends View { render() { return `<span>Test</span>`; } } ...
2019/11/05
[ "https://Stackoverflow.com/questions/58709871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1738861/" ]
Populating global scope is not the ES6 way. I think you can do it like this to your `export` ``` // // Class definition // window.ExampleView = new ExampleView(); export default window.ExampleView; ```
You just import the instance ``` import whateverYouWantToCallYourViewInstance from './ExampleView' // snip return whateverYouWantToCallYourViewInstance.render(); ``` It will be the same object. --- Worth noting: Singletons are evil. Using the ES module system to pass instances around is a bit of abuse.
878
Recently I invited one of my colleagues to CS.SE to improve her ideas while doing cognitive neuroscience research in the graduate school. I usually use **StackOverFlow** website more and get answers very quickly there. I also used Stats.SE and get good results. But I feel that the community here is not as lively as the...
2014/05/02
[ "https://cogsci.meta.stackexchange.com/questions/878", "https://cogsci.meta.stackexchange.com", "https://cogsci.meta.stackexchange.com/users/4075/" ]
"Bad" is a relative term. Duplicates should be ammended with a link to the supposed duplicates. I have often asked questions (here and especially on SO), that were rated to be duplicates, where the supposed duplicate had a decisively different angle and the answers did not help me, or where I simply did not find the d...
I have minimum rep and so have little "right" to respond here. But I do like and care about cognitive sciences and was excited to see that there was a SE site for it. On English Language and Usage, the site is what I consider appropriately moderated. Questions showing no research are down voted and bad questions close...
1,435,427
I am trying to creat a formula in excel and cant figure it out. I have 6 colums, they are as follows: ``` Column 1:Name Column 2: task performed Column 3: date performed Column 4: report number Column 5: date due Column 6: status ``` I would like Column 6 to show "overdue" in red when column 2 is blank. I am trying...
2019/05/10
[ "https://superuser.com/questions/1435427", "https://superuser.com", "https://superuser.com/users/1034535/" ]
Assume your column names are in cells A1 -> F1. Do the following in cell F2: 1. Set the following formula - =IF(B2="","Overdue","Completed") 2. Start a new conditional format, choose "Use a formula to determine which cells to format", and then type the formula - =COUNTIF($F2,"Completed"). 3. Click the format button an...
You can also use the ISBLANK(cell ref) formula to test and show the result you need. For example: In the Status column =IF(ISBLANK(B2), "Overdue", "Completed") In the Conditional Formatting rules, the formatting applies where the formula is true. So the rule for the red highlight =ISBLANK(B2) and the rule for the gre...
63,119,851
I'm trying to take a response and display the array on the page. There are no errors, but there also no list on the page. My list is: `{"id":4,"content":"Hello, World! "}` Here is my greeting-list.component.ts: ``` import { Component, OnInit } from '@angular/core'; import { GreetingService } from '../shared/greeting...
2020/07/27
[ "https://Stackoverflow.com/questions/63119851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9216629/" ]
You have to subscribe to the observable: ``` this.greetingService.getAll().pipe(map(data => { this.greetings = [data]; })).subscribe(); ``` Without subscribing the observable will never emit a value.
\*ngFor will only work with arrays (not objects or anything else) if you are trying too iterate over an object use object.keys(yourbobject) \*ngFor = "let greetingKey of Object.keys(greetings)" ``` <div *ngFor="let greeting of greetings"> {{greeting[greetingKey].name}} </div> ``` you will also need to add public ...
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
``` <script type="text/javascript" > alert("hello"); </script> ```
if you're having problems with alerts, it probably means your javascript is disabled in your browser, but if it isn't these methods should solve your issue. ``` <script type="text/javascript" > window.alert("Hello World!"); alert("Hello World!"); </script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
``` <script type="text/javascript" > alert("hello"); </script> ```
Just add parentheses and enclosed it within the script tag. ``` <script type="text/javascript" > alert("hello"); </script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
if you're having problems with alerts, it probably means your javascript is disabled in your browser, but if it isn't these methods should solve your issue. ``` <script type="text/javascript" > window.alert("Hello World!"); alert("Hello World!"); </script> ```
Just add parentheses and enclosed it within the script tag. ``` <script type="text/javascript" > alert("hello"); </script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
Unlike VBScript, JavaScript requires parentheses around function calls. Therefore, you need to write `alert("Hello!");` It's also preferable (but not required) to end every statement with a semicolon `;`. Finally, if you aren't already, you need to put it in a script block, like this: ``` <script type="text/javascr...
Just add parentheses and enclosed it within the script tag. ``` <script type="text/javascript" > alert("hello"); </script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
Unlike VBScript, JavaScript requires parentheses around function calls. Therefore, you need to write `alert("Hello!");` It's also preferable (but not required) to end every statement with a semicolon `;`. Finally, if you aren't already, you need to put it in a script block, like this: ``` <script type="text/javascr...
There are a few ways. 1. Use your web browser, type this code in address bar. `javascript:alert("Hello World!")` 2. Open web developer in your web browser, go to console and type: `alert("Hello World!")` 3. Type the code in .html or .js code as shown in other answers above.
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
Just add parantheses ``` alert("Hello"); ```
``` <html> <head> <script type="text/javascript"> function myFunction(){ alert("hello"); } </script> </head> <body> <input type="submit" onClick="myFunction()"> </body> </html> ``` Here is the JavaScript function which has an alert box. This function is called by clicking on the submit button.
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
You need to add parentheses: ``` alert("HELLO"); ```
Just add parentheses and enclosed it within the script tag. ``` <script type="text/javascript" > alert("hello"); </script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
Just add parantheses ``` alert("Hello"); ```
``` <script type="text/javascript">alert("Hello");</script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
There are a few ways. 1. Use your web browser, type this code in address bar. `javascript:alert("Hello World!")` 2. Open web developer in your web browser, go to console and type: `alert("Hello World!")` 3. Type the code in .html or .js code as shown in other answers above.
Just add parentheses and enclosed it within the script tag. ``` <script type="text/javascript" > alert("hello"); </script> ```
1,701,620
How do I pop up an alert in JavaScript? I tried `alert"HELLO"` but that didn't work. Can someone tell me the correct syntax?
2009/11/09
[ "https://Stackoverflow.com/questions/1701620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207020/" ]
if you're having problems with alerts, it probably means your javascript is disabled in your browser, but if it isn't these methods should solve your issue. ``` <script type="text/javascript" > window.alert("Hello World!"); alert("Hello World!"); </script> ```
``` <script type="text/javascript">alert("Hello");</script> ```
4,674,416
I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout. I want to do this to keep the same relative layout across different screen sizes. Currently, the buttons on my screen move up/down depending on the resolution of the screen. 320x480 puts the buttons higher on the scre...
2011/01/12
[ "https://Stackoverflow.com/questions/4674416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/566132/" ]
Are you using android:layout\_alignParent\* ? That should justify it to a side regardless of screen size. Where \* is Bottom or Top or Left or Right
On addition what AedonEtLIRA said you should make sure that the RelativeLayout you have always filled the whole display area. ie. that you don't have any size defined in any place in the view hierarchy but instead match\_parent is used. If you then used the layout definitions given by AedonEtLIRA you should get exactly...
4,674,416
I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout. I want to do this to keep the same relative layout across different screen sizes. Currently, the buttons on my screen move up/down depending on the resolution of the screen. 320x480 puts the buttons higher on the scre...
2011/01/12
[ "https://Stackoverflow.com/questions/4674416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/566132/" ]
I know this is an old thread but it shows up at the top of search results so I figure it can't hurt to confirm that ``` android:layout_alignParentBottom="true" ``` worked for me in RelativeLayout.
Are you using android:layout\_alignParent\* ? That should justify it to a side regardless of screen size. Where \* is Bottom or Top or Left or Right
4,674,416
I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout. I want to do this to keep the same relative layout across different screen sizes. Currently, the buttons on my screen move up/down depending on the resolution of the screen. 320x480 puts the buttons higher on the scre...
2011/01/12
[ "https://Stackoverflow.com/questions/4674416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/566132/" ]
Example: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:panel="http://schemas.android.com/apk/res/it.kronplatz" android:id="@+id/MainLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout android:id="@+id/Butto...
On addition what AedonEtLIRA said you should make sure that the RelativeLayout you have always filled the whole display area. ie. that you don't have any size defined in any place in the view hierarchy but instead match\_parent is used. If you then used the layout definitions given by AedonEtLIRA you should get exactly...
4,674,416
I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout. I want to do this to keep the same relative layout across different screen sizes. Currently, the buttons on my screen move up/down depending on the resolution of the screen. 320x480 puts the buttons higher on the scre...
2011/01/12
[ "https://Stackoverflow.com/questions/4674416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/566132/" ]
I know this is an old thread but it shows up at the top of search results so I figure it can't hurt to confirm that ``` android:layout_alignParentBottom="true" ``` worked for me in RelativeLayout.
On addition what AedonEtLIRA said you should make sure that the RelativeLayout you have always filled the whole display area. ie. that you don't have any size defined in any place in the view hierarchy but instead match\_parent is used. If you then used the layout definitions given by AedonEtLIRA you should get exactly...
4,674,416
I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout. I want to do this to keep the same relative layout across different screen sizes. Currently, the buttons on my screen move up/down depending on the resolution of the screen. 320x480 puts the buttons higher on the scre...
2011/01/12
[ "https://Stackoverflow.com/questions/4674416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/566132/" ]
I know this is an old thread but it shows up at the top of search results so I figure it can't hurt to confirm that ``` android:layout_alignParentBottom="true" ``` worked for me in RelativeLayout.
Example: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:panel="http://schemas.android.com/apk/res/it.kronplatz" android:id="@+id/MainLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout android:id="@+id/Butto...
7,227,962
I read about NEsper a lot & I tried the example code. I have some questions : 1. it is an event proccessor engine, how it gets the events? 2. Where it saves the data? 3. when it polls it? 4. Who polls it? 5. I downloaded a project for example, big project, If I want to use NEsper I have to use the project? I have to b...
2011/08/29
[ "https://Stackoverflow.com/questions/7227962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917461/" ]
I worked with the Java implementation of Esper last year. Nesper is the implementation for .NET of the same product. Basically, 1. It is in brief, a library for event processing, I would not call it engine though. Events can be passed to your implementation from any source you want, generally you encapsulate data (as...
extending above answer. > > Where it saves the data? > > > based on pattern (window) you use, Esper will keep some data in memory. What will happen if your machine/application will restart? Esper will lose state (in memory cache data). For that Esper provides license [EsperHA](http://www.espertech.com/esperha/),...
47,986,730
This is code for To find sum of two numbers without using any operator,here why they are used %c instead of %d ? What is the features of %c compare to %d ? ``` int add(int x, int y) { return printf("%*c%*c", x, ' ', y, ' '); } int main() { printf("Sum = %d", add(3, 4)); return 0; } ```
2017/12/27
[ "https://Stackoverflow.com/questions/47986730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8473737/" ]
The 74ALS138 is a 1-8 demultiplexer, this means it takes a number between 0 and 7 and activates one of its eight output lines (active low). The A, B and C input signals are the three bit encoding the input number (23 = 8) while G1, GA and GB are the enable signals. To enable the chip G1 must be high and GA and GB m...
The table in the data sheet seems quite clear: Y0 is active if A0, A1, A2, and A3 are low and A4, A5, A6, and A7 are high. Y1 is active under all the same conditions except A0 is high.
47,986,730
This is code for To find sum of two numbers without using any operator,here why they are used %c instead of %d ? What is the features of %c compare to %d ? ``` int add(int x, int y) { return printf("%*c%*c", x, ' ', y, ' '); } int main() { printf("Sum = %d", add(3, 4)); return 0; } ```
2017/12/27
[ "https://Stackoverflow.com/questions/47986730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8473737/" ]
The table in the data sheet seems quite clear: Y0 is active if A0, A1, A2, and A3 are low and A4, A5, A6, and A7 are high. Y1 is active under all the same conditions except A0 is high.
[![Thanks for the comments to help me connect the dots in figuring out how the address is map to the input address](https://i.stack.imgur.com/v84lK.jpg)](https://i.stack.imgur.com/v84lK.jpg) Thanks for the comments to help me connect the dots in figuring out how the address is map to the input address
47,986,730
This is code for To find sum of two numbers without using any operator,here why they are used %c instead of %d ? What is the features of %c compare to %d ? ``` int add(int x, int y) { return printf("%*c%*c", x, ' ', y, ' '); } int main() { printf("Sum = %d", add(3, 4)); return 0; } ```
2017/12/27
[ "https://Stackoverflow.com/questions/47986730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8473737/" ]
The 74ALS138 is a 1-8 demultiplexer, this means it takes a number between 0 and 7 and activates one of its eight output lines (active low). The A, B and C input signals are the three bit encoding the input number (23 = 8) while G1, GA and GB are the enable signals. To enable the chip G1 must be high and GA and GB m...
[![Thanks for the comments to help me connect the dots in figuring out how the address is map to the input address](https://i.stack.imgur.com/v84lK.jpg)](https://i.stack.imgur.com/v84lK.jpg) Thanks for the comments to help me connect the dots in figuring out how the address is map to the input address
17,752,907
**What is the workflow on devices when the Play Store updates an app? What happens if the user is using the app at the same time?** I ask because we have some crashes where a String ID cannot be found, and when we looked at the APKs the String resource is available in both versions - but the hex ID reported in the cra...
2013/07/19
[ "https://Stackoverflow.com/questions/17752907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/497400/" ]
From what I could find in researching this, it seems as though the App *needs* to be closed in order for the files to be reachable for update. Once closed, Google Play updates only the changed pieces of the apk to save time and cost. There are several forum posts I have found that teach you how to rollback app option...
If the user is using the app at the same time it's updating the app the linux filesystem allows for the behavior described above. A process holding a file open (think the app executable while the app is running) will keep the executable image in memory even if the executable on disk has been updated. What this allows i...
17,752,907
**What is the workflow on devices when the Play Store updates an app? What happens if the user is using the app at the same time?** I ask because we have some crashes where a String ID cannot be found, and when we looked at the APKs the String resource is available in both versions - but the hex ID reported in the cra...
2013/07/19
[ "https://Stackoverflow.com/questions/17752907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/497400/" ]
From what I could find in researching this, it seems as though the App *needs* to be closed in order for the files to be reachable for update. Once closed, Google Play updates only the changed pieces of the apk to save time and cost. There are several forum posts I have found that teach you how to rollback app option...
I remember encountering an issue like this one - the issue in my situation was that we were storing resource ids (and even serialized enumerated values) via user preferences. Once our app was updated (new enumerated values, new resources), old values were loaded from user preferences and passed into code, resulting in ...
411,964
I recently started using the adb command line utility tool and what I'm trying to do is to extract all of the images from a folder on my android device. I've tried the command below with no success. ``` adb pull /data/media/0/Pictures/Screenshots/*.png /root/Desktop ``` I've also tried a specific image ``` adb ...
2017/12/20
[ "https://unix.stackexchange.com/questions/411964", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
Let's modify your script slightly: ``` $ cat add.sh #!/bin/bash add() { sum=0 for num do sum=$((sum +num)) done } add "$@" echo "sum=$sum" ``` Now, let's run the script: ``` $ bash add.sh 4 -3 9 12 sum=22 ``` It works. The only change is that we called your function via `add "$@"` before echoi...
Just to include the *actual* simple way to do this: ``` #!/bin/bash IFS=+ bc <<< "$*" ``` And using it (when in a file called `add.sh` on which you have execute permissions): ``` $ ./add.sh 4 -3 9 12 22 $ ``` Or just define it as a function in your `~/.bashrc` or in the larger bash script you're writing: ``` ad...
28,081,413
I made a C do while loop that displays the minimum and maximum. The loop ends when the user inputs a 0. My problem is when I enter a set of numbers all greater than 0, my minimum is zero. For example when I enter ``` 19,16,8,12,9 ``` my **`max is 19`** ,but my **`min is 0`**. I need the `min` to be the `mi...
2015/01/22
[ "https://Stackoverflow.com/questions/28081413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4455698/" ]
Your variables `L` and `S` are uninitialized, so start with some unknown value. The min should start at INT\_MAX, the max should start at INT\_MIN.
First scan a value and store it in L and S and also adding a if to check if the first number itself is 0 ``` #include<stdio.h> main() { int L,S,X; printf("\ninput number:"); scanf("%d",&X); L=X; S=X; if(X!=0){ do{ printf("\ninput number:"); scanf("%d",&X); if (X>L){ L=X; } if (X<S){ S=X; } }while(X!=0);} print...
28,081,413
I made a C do while loop that displays the minimum and maximum. The loop ends when the user inputs a 0. My problem is when I enter a set of numbers all greater than 0, my minimum is zero. For example when I enter ``` 19,16,8,12,9 ``` my **`max is 19`** ,but my **`min is 0`**. I need the `min` to be the `mi...
2015/01/22
[ "https://Stackoverflow.com/questions/28081413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4455698/" ]
Your variables `L` and `S` are uninitialized, so start with some unknown value. The min should start at INT\_MAX, the max should start at INT\_MIN.
You have to initialise the `L` and `S` variables with the minimum and maximum values, respectively. As `L` and `S` both are integers, set the value of `L` as `INT_MIN` and `S` as `INT_MAX` (These constants are present in `<limits.h>`). Hence, your code would be: ``` #include <stdio.h> #include <limits.h> main() { ...
34,250,545
This code returns an error, but it works if I remove "arg" from line 4. What can I do to make n an argument and not get an error? ``` ( SynthDef("test", { arg n=8; f=Mix.fill(n, { arg index; var freq, amp; freq=440*((7/6)**index); //freq.postln; ...
2015/12/13
[ "https://Stackoverflow.com/questions/34250545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5674394/" ]
OK, the solution is simple (thanks @GordThompson for the help). While the transaction was being committed, I was not closing the EntityManager. So under some scenarios the transaction was being wound back. Note to self: Always close the EntityManager.
Note that you may have to close and re-open MS Access to see data persisted. UCanAccess uses [Jackcess](http://jackcess.sourceforge.net/) to update the Access database, and Jackcess directly modifies the database file without using the Access Database Engine. So, MS Access may not "see" the changes until it has been cl...
67,866,978
I am new to React Native. I have created a login page with it. I want to know how I can align the `Login` text on the left side instead of showing it in the center. [![enter image description here](https://i.stack.imgur.com/3b2Jd.png)](https://i.stack.imgur.com/3b2Jd.png) My code: **Login.js** ``` import React from...
2021/06/07
[ "https://Stackoverflow.com/questions/67866978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7780102/" ]
The second approach looks better to me. **Where to include assets and where to create the template?** Have all the Components (admin + user components)in the Components folder, and in App.js, while defining the routing, provide components to routes accordingly. For example: for **path="/"**, it should provide compone...
Both these are equally good. Would recommend method 2 if there is any common data or function between them
53,283,485
I am using the `tensorflow` `object detection api` on windows system and it has been working fine. I am using the pre-trained model as of now which is `ssd_mobilenet_v1_coco_11_06_2017`. It is easily detecting all the objects in a given input video. I wanted to record time of each object so lets say, if in a video a ca...
2018/11/13
[ "https://Stackoverflow.com/questions/53283485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6243129/" ]
That is because `doException` is throwing exception inline. If you want to use `Either`, you have to *return* `Future(Left(exception))` rather than throwing it. I think, you are kinda overthinking this. It does not look like you need `Either` here ... or `cats` for that matter. Why not do something simple, like thi...
I tend to agree that it seems a bit convoluted, but for the sake of the exercise, I believe there are a couple of things that don't quite click. The first one is the fact that you are throwing the Exception instead of capturing it as part of the semantics of Future. ie. You should change your method `doException` from...
60,394,253
i run the following function in (git-)bash under windows: ``` function config_get_container_values() { local project_name=$1 local container_name=$2 #local container_name="gitea" echo "###" buildcmd="jq -r \".containers[]." echo "$buildcmd" buildcmd="${buildcmd}${container_name}" echo "$buildcmd" buildcmd="${build...
2020/02/25
[ "https://Stackoverflow.com/questions/60394253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8478100/" ]
You should do with the following way: ``` public function Add_slider(Request $request) { $this->validate($request, [ 'select_image' => 'required' ]); $image = $request->file('select_image'); $extension = $image->getClientOriginalExtension(); Storage::disk('public')->put($ima...
This returns only the filename: ``` Storage::disk('')->putFile('slider', $request->select_image); ``` Use this instead: ``` Sliders::create([ 'slider_image' => $request->file('select_image')->get(), ]); ``` Make sure the column type from database is binary/blob.
31,269,384
I am using UIPickerViewController to capture photo, but I am getting layout as below: ![enter image description here](https://i.stack.imgur.com/bH8D1.png) As you can see in image - The Switch camera button is not showing properly. Below is my code ``` UIImagePickerController *imagePickerController = [[UIImage...
2015/07/07
[ "https://Stackoverflow.com/questions/31269384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1558332/" ]
You need to bind to that page's window's onload event and then print... ``` var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope, $window) { $scope.name = 'World'; $scope.print = function() { var w = $window.open($window.location.href + '#/?_=2323232'); console.log(w); a...
There are two ways to do it 1.$timeout():- it will run in next digest cycle after th html is rendered 2.$scope.$evalAsync():- it will run before angular get rendered on Html So you can use accordingly
69,373,486
I am using React Hook Form to set the value of `gender` autocomplete upon loading the data from API. But the autocomplete does not seem to set the data. My main component looks like this: ``` // this function is used to set the default form values. for now, its just gender value const setFormValues = () => { se...
2021/09/29
[ "https://Stackoverflow.com/questions/69373486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3212612/" ]
Idea with replace `NaN` to `NA`: ``` i = pd.MultiIndex.from_tuples([(0, 'o1'), (0, 'o2'), (0, 'o3'), (0, 'o4'), (0, 'o5'), (0, 'o6'), (0, np.nan)]) df = pd.DataFrame({'a':0}, index=i) df = df.rename(lambda x: 'NA' if pd.isna(x) else x, level=1)...
One "bad solution", that is not really solving the underlying issue but provide a working solution, would be by converting the indices to strings (the `str` constructor is capable of amazing results here). ``` df.index = [str(idx) for idx in df.index] df Out (0, 'o1') [0, 6] (0, 'o2') [1, 4] (0, 'o3') ...
69,373,486
I am using React Hook Form to set the value of `gender` autocomplete upon loading the data from API. But the autocomplete does not seem to set the data. My main component looks like this: ``` // this function is used to set the default form values. for now, its just gender value const setFormValues = () => { se...
2021/09/29
[ "https://Stackoverflow.com/questions/69373486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3212612/" ]
Update ------ I am able to reproduce your error after grouping and aggregating a data frame. ``` >>> import pandas as pd >>> data = pd.DataFrame({ ... "temp_playlist": [0] * 15, ... "objId": ['o1'] * 2 + ['o2'] * 2 + ['o3'] * 2 + ['o4'] * 3 + ['o5'] * 2 + ['o6'] * 2 + [pd.NA] * 2, ... "vals": [0, 6, 1, 4,...
One "bad solution", that is not really solving the underlying issue but provide a working solution, would be by converting the indices to strings (the `str` constructor is capable of amazing results here). ``` df.index = [str(idx) for idx in df.index] df Out (0, 'o1') [0, 6] (0, 'o2') [1, 4] (0, 'o3') ...
69,373,486
I am using React Hook Form to set the value of `gender` autocomplete upon loading the data from API. But the autocomplete does not seem to set the data. My main component looks like this: ``` // this function is used to set the default form values. for now, its just gender value const setFormValues = () => { se...
2021/09/29
[ "https://Stackoverflow.com/questions/69373486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3212612/" ]
Update ------ I am able to reproduce your error after grouping and aggregating a data frame. ``` >>> import pandas as pd >>> data = pd.DataFrame({ ... "temp_playlist": [0] * 15, ... "objId": ['o1'] * 2 + ['o2'] * 2 + ['o3'] * 2 + ['o4'] * 3 + ['o5'] * 2 + ['o6'] * 2 + [pd.NA] * 2, ... "vals": [0, 6, 1, 4,...
Idea with replace `NaN` to `NA`: ``` i = pd.MultiIndex.from_tuples([(0, 'o1'), (0, 'o2'), (0, 'o3'), (0, 'o4'), (0, 'o5'), (0, 'o6'), (0, np.nan)]) df = pd.DataFrame({'a':0}, index=i) df = df.rename(lambda x: 'NA' if pd.isna(x) else x, level=1)...
35,126
I am just getting started with adobe illustrator CS5 bulding logos. I often see people presenting it as mockups on walls, business cards or more than one logo which can be navigated through. How do it do that using Adobe illustrator or I need Photoshop ? Regards Vishy
2014/06/27
[ "https://graphicdesign.stackexchange.com/questions/35126", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/26456/" ]
They have pre made photoshop templates to create these super realistic mockups you see. Some you have to purchase but many are available for free. You will need both photoshop and illustrator. A great resource is www.graphicburger.com These are a great idea because it gives the client an idea of what the final produ...
its great that you are starting to use adobe Illustrator! for creating logos, you are already on the right track. If you want to use your logos to create business cards or mockup designs using your logos, it is best using Photoshop if you have it. You can first save you logo from illustrator either in an eps or pdf ...
17,719,423
I trying to create a simple jquery show and hide box, using one button. I want the user to be able to click any where around the screen and the opened div will close. has anyone created anything similar?
2013/07/18
[ "https://Stackoverflow.com/questions/17719423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2551411/" ]
I have added a fiddle on how to handle pop up of boxes and attaching close events to page clicks. You can figure out easily if u go through the comments in fiddle. **DEMO: <http://jsfiddle.net/ScriptShiva/zWXks/8/>** **HTML** 1. Create three blocks -1.1 One for parent (In your case u have a body) -1.2 One for mask...
Working Demo <http://jsfiddle.net/cse_tushar/5Ng49/> SHOW and HIDE **js** ====== ``` $(document).ready(function(){ $('*').click(function(){ $('#div1').toggle(); }); }); ``` HIDE **js** ====== ``` $(document).ready(function(){ $('*').click(function(){ $('#div1').hide(); ...
17,719,423
I trying to create a simple jquery show and hide box, using one button. I want the user to be able to click any where around the screen and the opened div will close. has anyone created anything similar?
2013/07/18
[ "https://Stackoverflow.com/questions/17719423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2551411/" ]
I have added a fiddle on how to handle pop up of boxes and attaching close events to page clicks. You can figure out easily if u go through the comments in fiddle. **DEMO: <http://jsfiddle.net/ScriptShiva/zWXks/8/>** **HTML** 1. Create three blocks -1.1 One for parent (In your case u have a body) -1.2 One for mask...
try this: $("#button").click(function(){ $("#show\_hide").show(1000,function(){ ``` $('body:not(#button)').click(function(){ $("#show_hide").hide(1000); $(this).unbind("click"); }); }); ``` });
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
The [Intel Core i7-4600U Processor](https://ark.intel.com/en/products/76616/Intel-Core-i7-4600U-Processor-4M-Cache-up-to-3_30-GHz) supports [Turbo Boost technology](https://www.intel.com/content/www/us/en/architecture-and-technology/turbo-boost/turbo-boost-technology.html?iid=tech_arch_nextgen+body_turboboost). It has ...
To get informations about your CPU type the following command: ``` dmidecode -t processor | grep -i mhz ```
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
For intel i3, i5 and i7 based cpus there is a dedicated tool called `i7z` that shows current speed for all cpu cores. From man page (description): > > i7z runs the i7z, ncurses based, program without any options. i7z will > print out the C-states and temperature for i3, i5 and i7 based Core > processors from Intel...
CPU frequencies are kept in the kernel but they can be a little "off". You can see them using: ``` $ cd /sys/devices/system/cpu $ paste <(cat cpu*/cpufreq/affected_cpus) <(cat cpu*/cpufreq/scaling_cur_freq) | column -s $'\t' -t 0 833914 1 800021 2 800086 3 800029 4 800036 5 800460 6 800118 7 800141 ``` If yo...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
To see the current speed of each core I do this: ``` watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo" ``` **Notes:** This does not work on server CPUs such as the Intel Xeon series. On such machines it will show the base frequency only. To show the turbo frequency, you'll need cpupower or turbostat. See @Maxim Egorus...
``` $ sudo apt-get install -y linux-tools-$(uname -r) $ sudo watch cpupower monitor ``` Output: ``` Every 2.0s: cpupower monitor | Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 0| 99.53| 0.47| 4390|| 0.00| 0.37 16| 98.73| 1.27| 4390|| 0.00| 1.21 1| 94.80| 5.20| 4390||...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
CPU frequencies are kept in the kernel but they can be a little "off". You can see them using: ``` $ cd /sys/devices/system/cpu $ paste <(cat cpu*/cpufreq/affected_cpus) <(cat cpu*/cpufreq/scaling_cur_freq) | column -s $'\t' -t 0 833914 1 800021 2 800086 3 800029 4 800036 5 800460 6 800118 7 800141 ``` If yo...
``` $ sudo apt-get install -y linux-tools-$(uname -r) $ sudo watch cpupower monitor ``` Output: ``` Every 2.0s: cpupower monitor | Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 0| 99.53| 0.47| 4390|| 0.00| 0.37 16| 98.73| 1.27| 4390|| 0.00| 1.21 1| 94.80| 5.20| 4390||...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
For intel i3, i5 and i7 based cpus there is a dedicated tool called `i7z` that shows current speed for all cpu cores. From man page (description): > > i7z runs the i7z, ncurses based, program without any options. i7z will > print out the C-states and temperature for i3, i5 and i7 based Core > processors from Intel...
``` $ sudo apt-get install -y linux-tools-$(uname -r) $ sudo watch cpupower monitor ``` Output: ``` Every 2.0s: cpupower monitor | Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 0| 99.53| 0.47| 4390|| 0.00| 0.37 16| 98.73| 1.27| 4390|| 0.00| 1.21 1| 94.80| 5.20| 4390||...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
To see the current speed of each core I do this: ``` watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo" ``` **Notes:** This does not work on server CPUs such as the Intel Xeon series. On such machines it will show the base frequency only. To show the turbo frequency, you'll need cpupower or turbostat. See @Maxim Egorus...
CPU frequencies are kept in the kernel but they can be a little "off". You can see them using: ``` $ cd /sys/devices/system/cpu $ paste <(cat cpu*/cpufreq/affected_cpus) <(cat cpu*/cpufreq/scaling_cur_freq) | column -s $'\t' -t 0 833914 1 800021 2 800086 3 800029 4 800036 5 800460 6 800118 7 800141 ``` If yo...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
To see the current speed of each core I do this: ``` watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo" ``` **Notes:** This does not work on server CPUs such as the Intel Xeon series. On such machines it will show the base frequency only. To show the turbo frequency, you'll need cpupower or turbostat. See @Maxim Egorus...
For intel i3, i5 and i7 based cpus there is a dedicated tool called `i7z` that shows current speed for all cpu cores. From man page (description): > > i7z runs the i7z, ncurses based, program without any options. i7z will > print out the C-states and temperature for i3, i5 and i7 based Core > processors from Intel...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
To get informations about your CPU type the following command: ``` dmidecode -t processor | grep -i mhz ```
``` $ sudo apt-get install -y linux-tools-$(uname -r) $ sudo watch cpupower monitor ``` Output: ``` Every 2.0s: cpupower monitor | Mperf || Idle_Stats CPU| C0 | Cx | Freq || POLL | C1 0| 99.53| 0.47| 4390|| 0.00| 0.37 16| 98.73| 1.27| 4390|| 0.00| 1.21 1| 94.80| 5.20| 4390||...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
To see the current speed of each core I do this: ``` watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo" ``` **Notes:** This does not work on server CPUs such as the Intel Xeon series. On such machines it will show the base frequency only. To show the turbo frequency, you'll need cpupower or turbostat. See @Maxim Egorus...
The [Intel Core i7-4600U Processor](https://ark.intel.com/en/products/76616/Intel-Core-i7-4600U-Processor-4M-Cache-up-to-3_30-GHz) supports [Turbo Boost technology](https://www.intel.com/content/www/us/en/architecture-and-technology/turbo-boost/turbo-boost-technology.html?iid=tech_arch_nextgen+body_turboboost). It has ...
264,632
I found two commands to output information about my CPU: `cat /proc/cpuinfo` and `lscpu`. `/proc/cpuinfo` shows that my CPU speed is 2.1 Ghz, whereas `lspcu` says it is 3167 Mhz. Which one is correct? This is my exact output from `cat /proc/cpuinfo` about my processor speed: ``` model name : Intel(R) Core(TM) i7-460...
2016/02/20
[ "https://unix.stackexchange.com/questions/264632", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/139098/" ]
For intel i3, i5 and i7 based cpus there is a dedicated tool called `i7z` that shows current speed for all cpu cores. From man page (description): > > i7z runs the i7z, ncurses based, program without any options. i7z will > print out the C-states and temperature for i3, i5 and i7 based Core > processors from Intel...
To get informations about your CPU type the following command: ``` dmidecode -t processor | grep -i mhz ```
31,744,401
I need help with how this works. Microsoft's site doesn't have an answer so I was hoping there is a way to deal with this. What would ``` stopwatch.ElapsedMilliseconds % 120000 == 0 ``` mean? It is in an if statement but I need to understand what is meant by that. Does it mean every 120 seconds (2 minutes), it wi...
2015/07/31
[ "https://Stackoverflow.com/questions/31744401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5177495/" ]
[The Modulus Operator (%) operator](https://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx) computes the remainder after dividing its first operand by its second. All numeric types have predefined remainder operators. `stopwatch.ElapsedMilliseconds % 120000 == 0` means, ElapsedMilliseconds is multiplications of 120000...
``` stopwatch.ElapsedMilliseconds % 120000 == 0 ``` this statement is checking condition on milisecond elapsed in stopwatch and is it completely divisible by 120000, if it is then ok else there might be some other condition also
31,744,401
I need help with how this works. Microsoft's site doesn't have an answer so I was hoping there is a way to deal with this. What would ``` stopwatch.ElapsedMilliseconds % 120000 == 0 ``` mean? It is in an if statement but I need to understand what is meant by that. Does it mean every 120 seconds (2 minutes), it wi...
2015/07/31
[ "https://Stackoverflow.com/questions/31744401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5177495/" ]
`1000 milliseconds = 1 second` and therefore `120 000 milliseconds = 2 minutes` `%` ([Mod operator](https://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx)), means it returns the **remainder** of `stopwatch.ElapsedMilliseconds` divided by `120000`. `== 0` means you're checking for a remainder of zero. So therefor yo...
``` stopwatch.ElapsedMilliseconds % 120000 == 0 ``` this statement is checking condition on milisecond elapsed in stopwatch and is it completely divisible by 120000, if it is then ok else there might be some other condition also
48,411,141
i'm seeking for help in solving one problem... Let's assume i got a list: ``` list1 =[[1, 0, 2.83], [3, 1, 1.0], [5, 4, 2.83], [7, 0, 4.47], [6, 5, 4.24], [3, 2, 'x'], [4, 6, 'asd'] ``` What i want to do is based on type of third element of inner lists, get filtered minimum value from these values, only if these a...
2018/01/23
[ "https://Stackoverflow.com/questions/48411141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9258995/" ]
``` something = min((x for x in list1 if isinstance(x[2], float)), key=lambda x: x[2]) ``` By the way, IMHO the most suitable data structure for this kind of situation would be a `list` of `tuple`s, since they constitute heterogeneous collections of fixed size (in this case triples), like this: ``` list1 = [(1, 0, 2...
You are using `min` function wrong - it is sorting using whole tuples (and the first value in the tuple rules sorting order of the list). I suggest using a key that extracts the last element from the tuple: ``` min(..., key=lambda b: b[2]) ```
48,411,141
i'm seeking for help in solving one problem... Let's assume i got a list: ``` list1 =[[1, 0, 2.83], [3, 1, 1.0], [5, 4, 2.83], [7, 0, 4.47], [6, 5, 4.24], [3, 2, 'x'], [4, 6, 'asd'] ``` What i want to do is based on type of third element of inner lists, get filtered minimum value from these values, only if these a...
2018/01/23
[ "https://Stackoverflow.com/questions/48411141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9258995/" ]
``` something = min((x for x in list1 if isinstance(x[2], float)), key=lambda x: x[2]) ``` By the way, IMHO the most suitable data structure for this kind of situation would be a `list` of `tuple`s, since they constitute heterogeneous collections of fixed size (in this case triples), like this: ``` list1 = [(1, 0, 2...
You can try this: ``` list1 =[[1, 0, 2.83], [3, 1, 1.0], [5, 4, 2.83], [7, 0, 4.47], [6, 5, 4.24], [3, 2, 'x'], [4, 6, 'asd']] min_val = min(filter(lambda x:not isinstance(x[-1], str), list1), key=lambda x:x[-1]) ``` Output: ``` [3, 1, 1.0] ```
48,411,141
i'm seeking for help in solving one problem... Let's assume i got a list: ``` list1 =[[1, 0, 2.83], [3, 1, 1.0], [5, 4, 2.83], [7, 0, 4.47], [6, 5, 4.24], [3, 2, 'x'], [4, 6, 'asd'] ``` What i want to do is based on type of third element of inner lists, get filtered minimum value from these values, only if these a...
2018/01/23
[ "https://Stackoverflow.com/questions/48411141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9258995/" ]
``` something = min((x for x in list1 if isinstance(x[2], float)), key=lambda x: x[2]) ``` By the way, IMHO the most suitable data structure for this kind of situation would be a `list` of `tuple`s, since they constitute heterogeneous collections of fixed size (in this case triples), like this: ``` list1 = [(1, 0, 2...
Also this option: ``` >>> from operator import itemgetter >>> list1 =[[1, 0, 2.83], [3, 1, 1.0], [5, 4, 2.83], [7, 0, 4.47], [6, 5, 4.24], [3, 2, 'x'], [4, 6, 'asd']] >>> min((x for x in list1 if isinstance(x[-1], float)), key = itemgetter(-1)) [3, 1, 1.0] ```
17,204
I have read about convergence in terms of MC simulation for derivative pricing, but I am not clear on what it exactly means. Let us suppose I price an option 100,000 paths twice and both result in the same option price. Does that mean 100,000 paths has resulted in convergence? Also, in determining the number of paths ...
2015/04/01
[ "https://quant.stackexchange.com/questions/17204", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/13648/" ]
To keep things simple let's assume you have a perfect random number generator (i.e. I will discuss only the statistics not the numerics of the problem). I will also focus on the practical matter and gloss over some mathematical details. From a practical perspective "convergence" means that you will never get an exact...
the output of an MC simulation depends on the random numbers used and if the distribution used is not too weird, after 10,000 runs you will get an answer that is distributed $$ \mu + \frac{\sigma}{\sqrt{n}} Z, $$ with $Z$ a standard normal. Here $n=10,000.$ With $\mu$ the quantity you want and $\sigma$ the standard de...
17,204
I have read about convergence in terms of MC simulation for derivative pricing, but I am not clear on what it exactly means. Let us suppose I price an option 100,000 paths twice and both result in the same option price. Does that mean 100,000 paths has resulted in convergence? Also, in determining the number of paths ...
2015/04/01
[ "https://quant.stackexchange.com/questions/17204", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/13648/" ]
the output of an MC simulation depends on the random numbers used and if the distribution used is not too weird, after 10,000 runs you will get an answer that is distributed $$ \mu + \frac{\sigma}{\sqrt{n}} Z, $$ with $Z$ a standard normal. Here $n=10,000.$ With $\mu$ the quantity you want and $\sigma$ the standard de...
"Monte Carlo convergence" means that you've sampled enough individuals to represent (and understand) a general population. If the probability models behind your Monte Carlo simulation are accurate, then your results will match reality as you increase your sampling size. Monte Carlo convergence becomes difficult when y...
17,204
I have read about convergence in terms of MC simulation for derivative pricing, but I am not clear on what it exactly means. Let us suppose I price an option 100,000 paths twice and both result in the same option price. Does that mean 100,000 paths has resulted in convergence? Also, in determining the number of paths ...
2015/04/01
[ "https://quant.stackexchange.com/questions/17204", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/13648/" ]
the output of an MC simulation depends on the random numbers used and if the distribution used is not too weird, after 10,000 runs you will get an answer that is distributed $$ \mu + \frac{\sigma}{\sqrt{n}} Z, $$ with $Z$ a standard normal. Here $n=10,000.$ With $\mu$ the quantity you want and $\sigma$ the standard de...
With Monte Carlo, which is nothing more than a numerical method to approximate a definite integral, convergence to K significant digits using N samples means that you will obtain the same K significant digits regardless of the random number sequence used for the N samples. When you say that you obtained the same optio...
17,204
I have read about convergence in terms of MC simulation for derivative pricing, but I am not clear on what it exactly means. Let us suppose I price an option 100,000 paths twice and both result in the same option price. Does that mean 100,000 paths has resulted in convergence? Also, in determining the number of paths ...
2015/04/01
[ "https://quant.stackexchange.com/questions/17204", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/13648/" ]
To keep things simple let's assume you have a perfect random number generator (i.e. I will discuss only the statistics not the numerics of the problem). I will also focus on the practical matter and gloss over some mathematical details. From a practical perspective "convergence" means that you will never get an exact...
"Monte Carlo convergence" means that you've sampled enough individuals to represent (and understand) a general population. If the probability models behind your Monte Carlo simulation are accurate, then your results will match reality as you increase your sampling size. Monte Carlo convergence becomes difficult when y...
17,204
I have read about convergence in terms of MC simulation for derivative pricing, but I am not clear on what it exactly means. Let us suppose I price an option 100,000 paths twice and both result in the same option price. Does that mean 100,000 paths has resulted in convergence? Also, in determining the number of paths ...
2015/04/01
[ "https://quant.stackexchange.com/questions/17204", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/13648/" ]
To keep things simple let's assume you have a perfect random number generator (i.e. I will discuss only the statistics not the numerics of the problem). I will also focus on the practical matter and gloss over some mathematical details. From a practical perspective "convergence" means that you will never get an exact...
With Monte Carlo, which is nothing more than a numerical method to approximate a definite integral, convergence to K significant digits using N samples means that you will obtain the same K significant digits regardless of the random number sequence used for the N samples. When you say that you obtained the same optio...
55,238,225
There are many topics in Stackoverflow on AutoSklearn errors. but each error is different and each environment is different I have windows 10 64-bit I installed Anaconda3 When I try to follow these steps <https://automl.github.io/auto-sklearn/stable/installation.html> Step 1 : ``` curl https://raw.githubusercon...
2019/03/19
[ "https://Stackoverflow.com/questions/55238225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1492229/" ]
AutoSklearn is built for unix systems only. If you see first line in System requirement [here](https://automl.github.io/auto-sklearn/stable/installation.html), it is Linux operating system. The reason is resource module is only available in linux system. Find details about it on <https://automl.github.io/auto-sklearn/...
Perhaps you can use the following: 1. Google Colab ([link](https://colab.research.google.com/)) 2. Kaggle Notebook ([link](https://kaggle.com/)) 3. Docker - Creating Python image in it! ([link](https://www.docker.com/products/docker-desktop/))
2,267,171
My program consists of 2 parts - A server socket running on a different thread, and a client to test the server. I'm 99.9% sure that the server is correctly written (because I have tested it with a client socket), and all it does is returns "hello world" as a response. The server sits on port 3490. Now what I tried t...
2010/02/15
[ "https://Stackoverflow.com/questions/2267171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171911/" ]
First, you almost certainly want to be using `+[NSURL URLWithString:]` instead of `+[NSURL fileURLWithPath:]`. Second, since `-[NSData initWithContentsOfURL:]` hides so much of what's going on to make the connection, you might consider switching to an `NSURLConnection` you manage yourself, at least temporarily. The de...
It is possible that localhost resolves to an IPv6 address. Try using `http://127.0.0.1:3490/` instead first before turning to `NSURLConnection`.
367,970
I am trying to make a circuit that slowly discharges a multi cell lithium battery to storage voltage. I already have a comparator circuit that can turn on or off discharging. I want to support 2s to 6s batteries so we are talking about voltages ranging anywhere from 7.6v to 25.2v. I am shooting for 500mw of power dissi...
2018/04/11
[ "https://electronics.stackexchange.com/questions/367970", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/185435/" ]
The type of PTC you need is a ceramic one, I don't think the polymer "polyfuse" type are suitable. PTC ceramics [were commonly used](http://www.extra.research.philips.com/hera/people/aarts/_Philips%20Bound%20Archive/PTechReview/PTechReview-30-1969-170.pdf) as fairly constant temperature heaters, and probably still are ...
I'd use a LM239 or any other cheap dual comparator with open collector outputs. Comparator #1 with a cheap voltage reference/LDO and a resistor divider to set the discharge voltage. Comparator #2 with a thermistor as temperature sensor makes a thermostat. Open collector outputs are joined together, creating a logic ...
17,828,263
I have very simple bash script: ``` #!/bin/bash echo -n "A: "; grep -v ">" | grep -o "A" $1 | wc -l; ``` I type ``` ./script.sh 1.fasta ``` I got ``` A: 131 ``` But the curcor is still blicking and my script is not finishing. What's wrong here? Thank you.
2013/07/24
[ "https://Stackoverflow.com/questions/17828263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/995372/" ]
Your first `grep` does not have a file argument so it will read from standard input: ``` grep -v ">" | grep -o "A" $1 | wc -l; (read stdin) (read $1) ``` The reason why you get the `131` is because your second `grep` *does* have a file argument so it's getting all lines in `$1` that have an `A`. However it's *s...
This is the problem command: ``` grep -v ">" | grep -o "A" $1 | wc -l; ``` Since first command `grep -v ">"` is waiting for the input from STDIN as you haven't supplied any file to be searched by `grep`. **PS:** Even `grep -o "A" $1` is also problem since piped command will take input from output of the previous c...
23,193
`man 5 shadow` gives the following description of the third field in each line: > > The date of the last password change, expressed as the number of days since Jan 1, 1970. > > > The value 0 has a special meaning, which is that the user should change her pasword the next time she will log in the system. > > > An ...
2011/10/24
[ "https://unix.stackexchange.com/questions/23193", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/2134/" ]
The "seconds since 1970" timestamp is specifically defined as UTC in most usages. In particular, you may notice that `date +%s` gives the same result as `date -u +%s`. The relevant line where this is set in the shadow password utilities is" ``` nsp->sp_lstchg = (long) time ((time_t *) 0) / SCALE; ``` Which would ma...
By "days" it means 86,400 second intervals. By "January 1, 1970", it means 00:00:00 UTC. This is basically standard [UNIX time](http://en.wikipedia.org/wiki/Unix_time), also known as POSIX time.
4,028,463
I'm attempting to detect if my capture camera gets unplugged. My assumption was that a call to `cvQueryFrame` would return `NULL`, however it continues to return the last valid frame. Does anyone know of how to detect camera plug/unplug events with OpenCV? This seems so rudimentary...what am I missing?
2010/10/26
[ "https://Stackoverflow.com/questions/4028463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311207/" ]
There is no API function to do that, unfortunately. However, my suggestion is that you **create another thread** that simply calls cvCaptureFromCAM() and check it's result (inside a loop). If the camera get's disconnected then it should return NULL. I'll paste some code just to illustrate my idea: ``` // This code s...
Thanks @karlphillip for pointing me in the right direction. Running calls to `cvCaptureFromCAM` in a separate thread works. When the camera gets unplugged, the return value is `NULL`. However, it appears that this function is not thread-safe. **But a simple mutex to lock simultaneous calls to `cvCaptureFromCAM` seems ...
4,028,463
I'm attempting to detect if my capture camera gets unplugged. My assumption was that a call to `cvQueryFrame` would return `NULL`, however it continues to return the last valid frame. Does anyone know of how to detect camera plug/unplug events with OpenCV? This seems so rudimentary...what am I missing?
2010/10/26
[ "https://Stackoverflow.com/questions/4028463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311207/" ]
There is no API function to do that, unfortunately. However, my suggestion is that you **create another thread** that simply calls cvCaptureFromCAM() and check it's result (inside a loop). If the camera get's disconnected then it should return NULL. I'll paste some code just to illustrate my idea: ``` // This code s...
This still seems to be an issue. Another solution would be to compare the returned data with the previous one. For a working camera there should always be flickering. if the data is identical you can be sure, the cam was unplugged. Martin
4,028,463
I'm attempting to detect if my capture camera gets unplugged. My assumption was that a call to `cvQueryFrame` would return `NULL`, however it continues to return the last valid frame. Does anyone know of how to detect camera plug/unplug events with OpenCV? This seems so rudimentary...what am I missing?
2010/10/26
[ "https://Stackoverflow.com/questions/4028463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311207/" ]
There is no API function to do that, unfortunately. However, my suggestion is that you **create another thread** that simply calls cvCaptureFromCAM() and check it's result (inside a loop). If the camera get's disconnected then it should return NULL. I'll paste some code just to illustrate my idea: ``` // This code s...
I think that I have a good workaround for this problem. I create an auxiliary Mat array with zeros with the same resolution like the output from camera. I assign it to Mat array to which just after is assign the frame captured from camera and at the end I check the norm of this array. If it is equal zero it means that ...
4,028,463
I'm attempting to detect if my capture camera gets unplugged. My assumption was that a call to `cvQueryFrame` would return `NULL`, however it continues to return the last valid frame. Does anyone know of how to detect camera plug/unplug events with OpenCV? This seems so rudimentary...what am I missing?
2010/10/26
[ "https://Stackoverflow.com/questions/4028463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311207/" ]
Thanks @karlphillip for pointing me in the right direction. Running calls to `cvCaptureFromCAM` in a separate thread works. When the camera gets unplugged, the return value is `NULL`. However, it appears that this function is not thread-safe. **But a simple mutex to lock simultaneous calls to `cvCaptureFromCAM` seems ...
This still seems to be an issue. Another solution would be to compare the returned data with the previous one. For a working camera there should always be flickering. if the data is identical you can be sure, the cam was unplugged. Martin
4,028,463
I'm attempting to detect if my capture camera gets unplugged. My assumption was that a call to `cvQueryFrame` would return `NULL`, however it continues to return the last valid frame. Does anyone know of how to detect camera plug/unplug events with OpenCV? This seems so rudimentary...what am I missing?
2010/10/26
[ "https://Stackoverflow.com/questions/4028463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311207/" ]
Thanks @karlphillip for pointing me in the right direction. Running calls to `cvCaptureFromCAM` in a separate thread works. When the camera gets unplugged, the return value is `NULL`. However, it appears that this function is not thread-safe. **But a simple mutex to lock simultaneous calls to `cvCaptureFromCAM` seems ...
I think that I have a good workaround for this problem. I create an auxiliary Mat array with zeros with the same resolution like the output from camera. I assign it to Mat array to which just after is assign the frame captured from camera and at the end I check the norm of this array. If it is equal zero it means that ...
4,028,463
I'm attempting to detect if my capture camera gets unplugged. My assumption was that a call to `cvQueryFrame` would return `NULL`, however it continues to return the last valid frame. Does anyone know of how to detect camera plug/unplug events with OpenCV? This seems so rudimentary...what am I missing?
2010/10/26
[ "https://Stackoverflow.com/questions/4028463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311207/" ]
This still seems to be an issue. Another solution would be to compare the returned data with the previous one. For a working camera there should always be flickering. if the data is identical you can be sure, the cam was unplugged. Martin
I think that I have a good workaround for this problem. I create an auxiliary Mat array with zeros with the same resolution like the output from camera. I assign it to Mat array to which just after is assign the frame captured from camera and at the end I check the norm of this array. If it is equal zero it means that ...
69,310,529
Having this simplified document: ``` { "_id" : "test_id", "name" : "customname", "timestamp" : "2010-10-10 10:00:01", "customarray" : [ { "my_id" : 1, "value": 23 }, { "my_id" : 2, "value": 16 } ] } ``` I want to return just the `...
2021/09/24
[ "https://Stackoverflow.com/questions/69310529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/742269/" ]
You likely aren't requesting permission first ``` import SwiftUI //struct and class should start with an uppercase struct NotificationView: View { //Central location for Notification code including the delegate // A call to the notificationManager just like the one below has to be included in // applic...
I have gone through your code , It's very clear you are adding calendar trigger properly and you have mentioned in one of the comments that you have got necessary permission as well while adding. To me it feels like some datetime issue. Check if the datetime to datetime components converstion takes place properly. If...
8,603,063
I need an advice from someone who already faced my problem. I have an over 10 mil. records \*.txt file to import into a new table. First, I was looking to find some "expert advices" regarding the best choice for the table Engine. Unfortunately I've found 50% opinions for InnoDB and 50% opinions for MyISAM. From your...
2011/12/22
[ "https://Stackoverflow.com/questions/8603063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1076504/" ]
Go SQlite, and investigate Apple's [CoreData](http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/coredata/cdprogrammingguide.html) as an option as it's backed by sqlite and a very complete package for database storage within an iOS app. If you want to interact with the sqlite database directly che...
Without a doubt, use SQLite. Its performance will always beat simple JSON reading.
44,910,906
There is an error handling procedure that I need to write up in a module that will be called from other programs bound to the module when there is a program error. This needs to include the statement to take a DUMP. My question is suppose the call to this procedure goes from program A to Module B (to which A is bound t...
2017/07/04
[ "https://Stackoverflow.com/questions/44910906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The DUMP opcode dumps the values for the variables in automatic storage for all the procedures in the module, but the values listed in the dump are only valid if the procedure is active. So if you want the dump to show the correct values for the automatic variables in the called procedure, you should do the DUMP from ...
From [the manual](https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzasd/zzdump.htm) > > The DUMP operation provides a dump (all fields, all files, indicators, data structures, arrays, and tables > defined) of the module. > > > So you'd want the DUMP op-code and related error handling in each module invo...
63,416
I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that $$\Delta S\geq0$$ via [Clausius' theorem](http://en.wikipedia.org/wiki/Clausius_theorem). My question is, how can I prove this in a mathematical way?
2013/05/05
[ "https://physics.stackexchange.com/questions/63416", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/15672/" ]
In the context of quantum mechanics, the entropy of a system whose initial state is given by a [density matrix](http://en.wikipedia.org/wiki/Density_matrix) $\rho(0)$ is given by the so-called [von Neumann entropy](http://en.wikipedia.org/wiki/Von_Neumann_entropy); $$ S\_\mathrm{vn}(\rho) = -k\,\mathrm{tr}(\rho\ln\rho...
Here's an enlightening special case: Take $n$ bodies with temperatures $T\_1,\ldots T\_n$ and bring them together until they reach a final temperature $T$. The first law of thermodynamics tells you that $T$ is the arithmetic mean of the $T\_i$. The second law of thermodynamics tells you that the change in entropy is $n...
63,416
I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that $$\Delta S\geq0$$ via [Clausius' theorem](http://en.wikipedia.org/wiki/Clausius_theorem). My question is, how can I prove this in a mathematical way?
2013/05/05
[ "https://physics.stackexchange.com/questions/63416", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/15672/" ]
In the context of quantum mechanics, the entropy of a system whose initial state is given by a [density matrix](http://en.wikipedia.org/wiki/Density_matrix) $\rho(0)$ is given by the so-called [von Neumann entropy](http://en.wikipedia.org/wiki/Von_Neumann_entropy); $$ S\_\mathrm{vn}(\rho) = -k\,\mathrm{tr}(\rho\ln\rho...
> > I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that > ΔS≥0 > via Clausius' theorem. My question is, how can I prove this in a mathematical way? > > > The Clausius theorem says that when the system undergoes general cyclic process during which it ...
63,416
I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that $$\Delta S\geq0$$ via [Clausius' theorem](http://en.wikipedia.org/wiki/Clausius_theorem). My question is, how can I prove this in a mathematical way?
2013/05/05
[ "https://physics.stackexchange.com/questions/63416", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/15672/" ]
Here's an enlightening special case: Take $n$ bodies with temperatures $T\_1,\ldots T\_n$ and bring them together until they reach a final temperature $T$. The first law of thermodynamics tells you that $T$ is the arithmetic mean of the $T\_i$. The second law of thermodynamics tells you that the change in entropy is $n...
> > I understand that we can prove that for any process that occurs in an isolated and closed system it must hold that > ΔS≥0 > via Clausius' theorem. My question is, how can I prove this in a mathematical way? > > > The Clausius theorem says that when the system undergoes general cyclic process during which it ...
37,510,247
I am wondering if GWT supports types conversion? I know that the Vaadin have such support. I mean something like Vaadin StringToIntegerConverter and all this stuff mentioned here: <https://vaadin.com/docs/-/part/framework/datamodel/datamodel-properties.html> I am totally new in GWT, but I haven't found even a word ab...
2016/05/29
[ "https://Stackoverflow.com/questions/37510247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3187296/" ]
Though Vaadin converters you're referring to serve the specific purpose of binding models to presenters, if you're looking for a way to, for example, initialize an integer from a string, GWT [emulates](http://www.gwtproject.org/doc/latest/RefJreEmulation.html) classes wrapping java primitives (Integer, Double, etc.). M...
GWT has a [JRE Emulation](http://www.gwtproject.org/doc/latest/RefJreEmulation.html) and provide a lot of Classes and methods. You can call `Integer.valueOf("666")` to get a `666`
17,336,048
I am just starting to learn Foundation (from previous messy css experience). I am trying to do a full screen block grid of 4 col images per row. I have this to make the row full width: ``` .row max-width: 100% ``` Here is the code: ``` <nav class='top-bar'> <ul class='title-area'> <li class='name'> <h...
2013/06/27
[ "https://Stackoverflow.com/questions/17336048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149367/" ]
If you look at the docs explaining [the Foundation grid they already use the `box-sizing: border-box` star hack](http://foundation.zurb.com/docs/components/grid.html) Since the `.row` containing your `block-grid`has a set max-width of 100% it's overflowing the screen width. Typically, elements in the grid would be nes...
take a look of this [demo by Paul Irish](http://www.paulirish.com/2012/box-sizing-border-box-ftw/) ``` * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } ``` this might be helpful else can you provide a fiddle?
17,336,048
I am just starting to learn Foundation (from previous messy css experience). I am trying to do a full screen block grid of 4 col images per row. I have this to make the row full width: ``` .row max-width: 100% ``` Here is the code: ``` <nav class='top-bar'> <ul class='title-area'> <li class='name'> <h...
2013/06/27
[ "https://Stackoverflow.com/questions/17336048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149367/" ]
If you look at the docs explaining [the Foundation grid they already use the `box-sizing: border-box` star hack](http://foundation.zurb.com/docs/components/grid.html) Since the `.row` containing your `block-grid`has a set max-width of 100% it's overflowing the screen width. Typically, elements in the grid would be nes...
For those who do not want to wrap their block grid within the standard row/column grid, simply hide the overflow on your block grid's parent element. Here's a superfluous code demonstration. ``` (html) <div class="block-grid-parent"> <ul class="block-grid"> ... (css) .block-grid-parent { overflow: hidden; } ...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
10.14 Mojave and above ---------------------- Mojave still uses `timed`, but `ntpdate` and the helpers `ntpq` are removed. To check and update your system time, you can call `sntp` directly. ``` $ sudo sntp -sS pool.ntp.org Password: sntp 4.2.8p10@1.3728-o Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533) 2018-09-29 19:4...
Starting with High Sierra the ntpd system daemon was replaced with the timed system daemon which invokes /usr/libexec/timed. The best exec I've found to get details is `systemsetup` (run as root) with its various flags: ``` [-getusingnetworktime] [-setusingnetworktime on | off] [-getnetworktimeserver] [-setnetworktim...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
Starting with High Sierra the ntpd system daemon was replaced with the timed system daemon which invokes /usr/libexec/timed. The best exec I've found to get details is `systemsetup` (run as root) with its various flags: ``` [-getusingnetworktime] [-setusingnetworktime on | off] [-getnetworktimeserver] [-setnetworktim...
To get a reliable answer on how well your clock is set, run ntpdate in debug mode: ``` ntpdate -d pool.ntp.org ``` This will gyrate for a while and end in a line such as ``` 1 Apr 17:38:16 ntpdate[4711]: adjust time server 123.45.67.89 offset 0.000810 sec ``` In this case, this meant to say my local clock was of...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
This answer applies only to 10.12 Sierra and lower. --------------------------------------------------- The details may be helpful for reference, but another answer covers newer macOS timekeeping details excellently. --- The first step is to see if your time is set up. ``` Mac:~ me$ ntpq -p remote re...
To get a reliable answer on how well your clock is set, run ntpdate in debug mode: ``` ntpdate -d pool.ntp.org ``` This will gyrate for a while and end in a line such as ``` 1 Apr 17:38:16 ntpdate[4711]: adjust time server 123.45.67.89 offset 0.000810 sec ``` In this case, this meant to say my local clock was of...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
If you go to <http://time.gov> you can see the official time (up to the second) and use that to verify if your system time is correct or not. Note that this is the official NIST time, and does its own synchronization in the browser, independently of the system time (as an example, you can see [here](https://www.dropbox...
To get a reliable answer on how well your clock is set, run ntpdate in debug mode: ``` ntpdate -d pool.ntp.org ``` This will gyrate for a while and end in a line such as ``` 1 Apr 17:38:16 ntpdate[4711]: adjust time server 123.45.67.89 offset 0.000810 sec ``` In this case, this meant to say my local clock was of...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
10.14 Mojave and above ---------------------- Mojave still uses `timed`, but `ntpdate` and the helpers `ntpq` are removed. To check and update your system time, you can call `sntp` directly. ``` $ sudo sntp -sS pool.ntp.org Password: sntp 4.2.8p10@1.3728-o Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533) 2018-09-29 19:4...
To check clock sync, similar to the answer which suggests to run `ntpdate` in debug mode, you can also run it in Query mode for less verbose output. ``` $ ntpdate -q pool.ntp.org server 85.199.214.102, stratum 1, offset 0.006256, delay 0.05470 server 95.215.175.2, stratum 3, offset 0.005234, delay 0.05624 server 217.1...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
If you go to <http://time.gov> you can see the official time (up to the second) and use that to verify if your system time is correct or not. Note that this is the official NIST time, and does its own synchronization in the browser, independently of the system time (as an example, you can see [here](https://www.dropbox...
To check clock sync, similar to the answer which suggests to run `ntpdate` in debug mode, you can also run it in Query mode for less verbose output. ``` $ ntpdate -q pool.ntp.org server 85.199.214.102, stratum 1, offset 0.006256, delay 0.05470 server 95.215.175.2, stratum 3, offset 0.005234, delay 0.05624 server 217.1...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
This answer applies only to 10.12 Sierra and lower. --------------------------------------------------- The details may be helpful for reference, but another answer covers newer macOS timekeeping details excellently. --- The first step is to see if your time is set up. ``` Mac:~ me$ ntpq -p remote re...
To check clock sync, similar to the answer which suggests to run `ntpdate` in debug mode, you can also run it in Query mode for less verbose output. ``` $ ntpdate -q pool.ntp.org server 85.199.214.102, stratum 1, offset 0.006256, delay 0.05470 server 95.215.175.2, stratum 3, offset 0.005234, delay 0.05624 server 217.1...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
Starting with High Sierra the ntpd system daemon was replaced with the timed system daemon which invokes /usr/libexec/timed. The best exec I've found to get details is `systemsetup` (run as root) with its various flags: ``` [-getusingnetworktime] [-setusingnetworktime on | off] [-getnetworktimeserver] [-setnetworktim...
To check clock sync, similar to the answer which suggests to run `ntpdate` in debug mode, you can also run it in Query mode for less verbose output. ``` $ ntpdate -q pool.ntp.org server 85.199.214.102, stratum 1, offset 0.006256, delay 0.05470 server 95.215.175.2, stratum 3, offset 0.005234, delay 0.05624 server 217.1...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
10.14 Mojave and above ---------------------- Mojave still uses `timed`, but `ntpdate` and the helpers `ntpq` are removed. To check and update your system time, you can call `sntp` directly. ``` $ sudo sntp -sS pool.ntp.org Password: sntp 4.2.8p10@1.3728-o Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533) 2018-09-29 19:4...
This answer applies only to 10.12 Sierra and lower. --------------------------------------------------- The details may be helpful for reference, but another answer covers newer macOS timekeeping details excellently. --- The first step is to see if your time is set up. ``` Mac:~ me$ ntpq -p remote re...
117,864
I would like to know what the default settings for OS X are in terms of keeping the clock adjusted when I enable automatic time sync in the Date & Time preference. I do know that the venerable `ntpd` daemon on Mavericks (10.9) and Yosemite (10.10) is no longer responsible for adjusting the time and instead a new progr...
2014/01/19
[ "https://apple.stackexchange.com/questions/117864", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/5472/" ]
To get a reliable answer on how well your clock is set, run ntpdate in debug mode: ``` ntpdate -d pool.ntp.org ``` This will gyrate for a while and end in a line such as ``` 1 Apr 17:38:16 ntpdate[4711]: adjust time server 123.45.67.89 offset 0.000810 sec ``` In this case, this meant to say my local clock was of...
To check clock sync, similar to the answer which suggests to run `ntpdate` in debug mode, you can also run it in Query mode for less verbose output. ``` $ ntpdate -q pool.ntp.org server 85.199.214.102, stratum 1, offset 0.006256, delay 0.05470 server 95.215.175.2, stratum 3, offset 0.005234, delay 0.05624 server 217.1...
7,441,249
I am quite new to android development please enlighten me on this how to move widgets like button, textviews etc at a specific position in graphical screen via drag and drop.. Thanks in advance Akshat
2011/09/16
[ "https://Stackoverflow.com/questions/7441249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/869373/" ]
Try Following Code:- ``` int x_cord, y_cord; RelativeLayout.LayoutParams layoutParams1; @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub if (v == mImageViewEye1) { System.out.println("Eye1 is Clicked..."); layoutParams1 = ...
You would detect drag movement in View.onTouchEvent. Then you may interpret movement and apply it to widget. You can use View.setAnimation to change position where widget is drawn. But it probably won't change its real location, so touches will still occur on previous position. Or you can modify widget's LayoutParams...
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
You have two options: 1. Debug remotely iOS: Cmd + ctrl + z to open menu and select "Debug remotely" Android: Cmd + M to open menu and select "Debug remotely" 2. Or run one of these commands: ``` react-native log-ios react-native log-android ```
There are little hack in here for IOS. In XCode open AppDelegate.m from project folder, comment the line with jsCodeLocation declaration and add near it something like this: ``` jsCodeLocation = [NSURL URLWithString:@"http://%YOUR_PC_IP%:8081/index.ios.bundle?platform=ios&dev=true"]; ``` , where %YOUR\_PC\_IP% is IP...
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
You have two options: 1. Debug remotely iOS: Cmd + ctrl + z to open menu and select "Debug remotely" Android: Cmd + M to open menu and select "Debug remotely" 2. Or run one of these commands: ``` react-native log-ios react-native log-android ```
If you are working on **Visual Studio Code** then you can install `React Native Tools` extension (provided by `Microsoft`) and debug your app like any other IDE. Read all steps in detail in my [this answer](https://stackoverflow.com/a/56233781/1055241).
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
You have two options: 1. Debug remotely iOS: Cmd + ctrl + z to open menu and select "Debug remotely" Android: Cmd + M to open menu and select "Debug remotely" 2. Or run one of these commands: ``` react-native log-ios react-native log-android ```
***2*** options exist: **Remote debug:** this would go over network, so it can be laggy. ----------------------------------------------------------------- 1. Run app on device (install it whilst its plugged in) 2. Shake device (Android devices need to be **vigorously shaken**) 3. Press `settings` on the dev menu, and...
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
Figured our React Native debugging for Android. Steps to for someone struggling with this - 1. Launch your RN App 2. Shake device 3. Select "Dev Settings" 4. Select "Debug server host & port for device" Put in your system's IP address. 5. Shake device 6. Select "Debug JS remotely" 7. Chrome will open a new tab with th...
There are little hack in here for IOS. In XCode open AppDelegate.m from project folder, comment the line with jsCodeLocation declaration and add near it something like this: ``` jsCodeLocation = [NSURL URLWithString:@"http://%YOUR_PC_IP%:8081/index.ios.bundle?platform=ios&dev=true"]; ``` , where %YOUR\_PC\_IP% is IP...
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
There are little hack in here for IOS. In XCode open AppDelegate.m from project folder, comment the line with jsCodeLocation declaration and add near it something like this: ``` jsCodeLocation = [NSURL URLWithString:@"http://%YOUR_PC_IP%:8081/index.ios.bundle?platform=ios&dev=true"]; ``` , where %YOUR\_PC\_IP% is IP...
If you are working on **Visual Studio Code** then you can install `React Native Tools` extension (provided by `Microsoft`) and debug your app like any other IDE. Read all steps in detail in my [this answer](https://stackoverflow.com/a/56233781/1055241).
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
There are little hack in here for IOS. In XCode open AppDelegate.m from project folder, comment the line with jsCodeLocation declaration and add near it something like this: ``` jsCodeLocation = [NSURL URLWithString:@"http://%YOUR_PC_IP%:8081/index.ios.bundle?platform=ios&dev=true"]; ``` , where %YOUR\_PC\_IP% is IP...
***2*** options exist: **Remote debug:** this would go over network, so it can be laggy. ----------------------------------------------------------------- 1. Run app on device (install it whilst its plugged in) 2. Shake device (Android devices need to be **vigorously shaken**) 3. Press `settings` on the dev menu, and...
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
Figured our React Native debugging for Android. Steps to for someone struggling with this - 1. Launch your RN App 2. Shake device 3. Select "Dev Settings" 4. Select "Debug server host & port for device" Put in your system's IP address. 5. Shake device 6. Select "Debug JS remotely" 7. Chrome will open a new tab with th...
If you are working on **Visual Studio Code** then you can install `React Native Tools` extension (provided by `Microsoft`) and debug your app like any other IDE. Read all steps in detail in my [this answer](https://stackoverflow.com/a/56233781/1055241).
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
Figured our React Native debugging for Android. Steps to for someone struggling with this - 1. Launch your RN App 2. Shake device 3. Select "Dev Settings" 4. Select "Debug server host & port for device" Put in your system's IP address. 5. Shake device 6. Select "Debug JS remotely" 7. Chrome will open a new tab with th...
***2*** options exist: **Remote debug:** this would go over network, so it can be laggy. ----------------------------------------------------------------- 1. Run app on device (install it whilst its plugged in) 2. Shake device (Android devices need to be **vigorously shaken**) 3. Press `settings` on the dev menu, and...
43,415,884
How do you debug react-native when it is running on device ?
2017/04/14
[ "https://Stackoverflow.com/questions/43415884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752193/" ]
***2*** options exist: **Remote debug:** this would go over network, so it can be laggy. ----------------------------------------------------------------- 1. Run app on device (install it whilst its plugged in) 2. Shake device (Android devices need to be **vigorously shaken**) 3. Press `settings` on the dev menu, and...
If you are working on **Visual Studio Code** then you can install `React Native Tools` extension (provided by `Microsoft`) and debug your app like any other IDE. Read all steps in detail in my [this answer](https://stackoverflow.com/a/56233781/1055241).
8,625,151
I'm trying to compare two dates that are in two different formats: ``` var messages = (from m in db.ChatMessages where m.RoomID == roomID && m.MessageID > messageID && m.MessageTime > timeUserJoined.AddSeconds(1) ord...
2011/12/24
[ "https://Stackoverflow.com/questions/8625151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1112150/" ]
You state they are DateTime fields... Then good news; DateTime in .NET and TSQL **does not have** any format - it is just a number. Any particular format you are seeing exists only in the imagination of your IDE or other tools (SSMS etc). As long as it is DateTime you won't have a problem here.
First, I believe you should be using DateTime.CompareTo() to compare your timestamps. Second, how are you consuming the messages collection? Are you aware that it's a collection of anonymous, untyped objects? (I'd comment, but I don't have the rep)