qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
39,278,139
I made the below code to learn Angular. It uses the input entered by user to make an ajax request for a json file that contains a list of object, then print that list to the user. ``` <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script> <script type="text/j...
2016/09/01
[ "https://Stackoverflow.com/questions/39278139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1628708/" ]
Your `responses` object is binded to `this` and not to `$scope` as you are using [controller as](https://docs.angularjs.org/api/ng/directive/ngController) You should use `mc.responses` instead of `responses` ``` <li ng-repeat="res in mc.responses"> <span>{{res.key1}}, {{res.key2}}</span> </li> ``` You can read...
Above solution is right but as i checked the complete code and found that there is one mistake. In script code `ctlr.response = data; // data -> [{key1: value1,...},...]` should be `ctlr.responses = data; // data -> [{key1: value1,...},...]`
63,132,593
I have created a solution based on Azure Functions and Azure Service Bus, where clients can retrieve information from multiple back-end systems using a single API. The API is implemented in Azure Functions, and based on the payload of the request it is relayed to a Service Bus Queue, picked up by a client application r...
2020/07/28
[ "https://Stackoverflow.com/questions/63132593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1643570/" ]
In Asp.Net core app, i was referencing some libraries and it caused an issue when i tried use those libraries. I had to add System.Runtime.Caching, because my libraries were unable to find them, which is not available by default in asp.netcore web api project. Hope this will help someone. You can install them from nug...
Uninstall System.Runtime.Caching package with NuGet package manager and close your visual studio. Than install this package again. If it's not fixed the problem , check your csproj file and references in your project for version conflict or mismatch.
37,730,318
I have the following simple code in IntelliJ IDEA on my Mac: ``` import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.SparkConf object SparkGrep { def main(args: Array[String]) { if (args.length < 3) { System.err.println("Usage: SparkGrep <host> <input_file> ...
2016/06/09
[ "https://Stackoverflow.com/questions/37730318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518012/" ]
InetlliJ IDEA + MAC + SPARK =========================== After ever step let intelliJ be ready since pulls from maven can be slow sometime ### IntelliJ Setup 1. Install Scala plugin from `Preferences > Plugins > Scala` 2. `File > New > Project`, Select `Scala` on the left pane, select `SBT` on the right pane 3. Right...
you should try following line val sc = new SparkContext(conf=conf)
53,575,080
I'm learning Kotlin and trying to use LiveData with it. Since LiveData library is written in Java, Kotlin should support SAM conversions. [`LiveData`](https://developer.android.com/reference/android/arch/lifecycle/LiveData) class has method [`observe`](https://developer.android.com/reference/android/arch/lifecycle/Liv...
2018/12/01
[ "https://Stackoverflow.com/questions/53575080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034031/" ]
This is <https://youtrack.jetbrains.com/issue/KT-14984>. And according to that, it should finally be fixed in Kotlin 1.3, but the type inference changes required are opt-in for now and need to be enabled explicitly: <https://discuss.kotlinlang.org/t/new-type-inference-in-kotlin-1-3-0-rc-190/9914/2>
Your observation seems to be correct, but I won't be able to answer you why. [![options](https://i.stack.imgur.com/Lfdga.png)](https://i.stack.imgur.com/Lfdga.png) We see that Kotlin sees either `LifecycleOwner, Observer` or `() -> Lifecycle, (Int?) -> Unit`. As for why you don't see one with *each combination*, only...
53,575,080
I'm learning Kotlin and trying to use LiveData with it. Since LiveData library is written in Java, Kotlin should support SAM conversions. [`LiveData`](https://developer.android.com/reference/android/arch/lifecycle/LiveData) class has method [`observe`](https://developer.android.com/reference/android/arch/lifecycle/Liv...
2018/12/01
[ "https://Stackoverflow.com/questions/53575080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034031/" ]
Your observation seems to be correct, but I won't be able to answer you why. [![options](https://i.stack.imgur.com/Lfdga.png)](https://i.stack.imgur.com/Lfdga.png) We see that Kotlin sees either `LifecycleOwner, Observer` or `() -> Lifecycle, (Int?) -> Unit`. As for why you don't see one with *each combination*, only...
the Good news is now kotlin properly handles SAM conversion for functions with multiple arguments. ``` observe(@NonNull LifecycleOwner owner, @NonNull Observer<? super T> observer) ``` Just update to latest live data version, they also [deprecated](https://android-review.googlesource.com/c/platform/frameworks/suppor...
53,575,080
I'm learning Kotlin and trying to use LiveData with it. Since LiveData library is written in Java, Kotlin should support SAM conversions. [`LiveData`](https://developer.android.com/reference/android/arch/lifecycle/LiveData) class has method [`observe`](https://developer.android.com/reference/android/arch/lifecycle/Liv...
2018/12/01
[ "https://Stackoverflow.com/questions/53575080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1034031/" ]
This is <https://youtrack.jetbrains.com/issue/KT-14984>. And according to that, it should finally be fixed in Kotlin 1.3, but the type inference changes required are opt-in for now and need to be enabled explicitly: <https://discuss.kotlinlang.org/t/new-type-inference-in-kotlin-1-3-0-rc-190/9914/2>
the Good news is now kotlin properly handles SAM conversion for functions with multiple arguments. ``` observe(@NonNull LifecycleOwner owner, @NonNull Observer<? super T> observer) ``` Just update to latest live data version, they also [deprecated](https://android-review.googlesource.com/c/platform/frameworks/suppor...
3,560
How can i make all my links in joomla including menu items and article links absolute links and not relative ones? and of course, without hacking the core files.
2014/07/08
[ "https://joomla.stackexchange.com/questions/3560", "https://joomla.stackexchange.com", "https://joomla.stackexchange.com/users/3885/" ]
The best way is probably to create a plug-in on the onContentPrepare event which does a search-and-replace on any links. What is the reason you are wanting to do this, though? You have tagged this SEO, but any argument I have seen for absolute links over relative links would be countered by Joomla's use of the base ta...
I know you said you do not want to 'hack the core files' but Joomla comes with all these great module/theme overrides that let you customise their output without loosing these changes each time you run Joomla updates. All you need is an FTP program and a text editor. It does involve customising your theme but the core ...
3,560
How can i make all my links in joomla including menu items and article links absolute links and not relative ones? and of course, without hacking the core files.
2014/07/08
[ "https://joomla.stackexchange.com/questions/3560", "https://joomla.stackexchange.com", "https://joomla.stackexchange.com/users/3885/" ]
The best way is probably to create a plug-in on the onContentPrepare event which does a search-and-replace on any links. What is the reason you are wanting to do this, though? You have tagged this SEO, but any argument I have seen for absolute links over relative links would be countered by Joomla's use of the base ta...
The answer to the question. **In each menu item under Metadata tag make secure on or off according to your needs. Now you have absolute url's.** No hacks, no fuss, no tedious. To everyone that thinks absolute URL's is not SEO. Google say they prefer it. Other younger search engines will add your relative url to the en...
3,560
How can i make all my links in joomla including menu items and article links absolute links and not relative ones? and of course, without hacking the core files.
2014/07/08
[ "https://joomla.stackexchange.com/questions/3560", "https://joomla.stackexchange.com", "https://joomla.stackexchange.com/users/3885/" ]
I know you said you do not want to 'hack the core files' but Joomla comes with all these great module/theme overrides that let you customise their output without loosing these changes each time you run Joomla updates. All you need is an FTP program and a text editor. It does involve customising your theme but the core ...
The answer to the question. **In each menu item under Metadata tag make secure on or off according to your needs. Now you have absolute url's.** No hacks, no fuss, no tedious. To everyone that thinks absolute URL's is not SEO. Google say they prefer it. Other younger search engines will add your relative url to the en...
61,293,350
I want to make a chat-bubble. The content should be a text, the date and a name (here TextBla). I want that the name is on the right side of the bubble. The time stays on the left side. When I add a Spacer to the HStack the bubble fills the complete screen, but I want that the bubble is as width as the text is. Here ...
2020/04/18
[ "https://Stackoverflow.com/questions/61293350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7130470/" ]
Here is possible approach. Tested with Xcode 11.4. / iOS 13.4 [![demo](https://i.stack.imgur.com/7KTRB.png)](https://i.stack.imgur.com/7KTRB.png) Bubble element is ``` struct BubbleView: View { let name: String let time: String let text: String var color: Color = Color.gray.opacity(0.4) var body...
try this: [![enter image description here](https://i.stack.imgur.com/38fI4.png)](https://i.stack.imgur.com/38fI4.png) ``` struct ContentView: View { var body: some View { VStack { HStack() { VStack(alignment: .leading) { HStack { Te...
27,792,415
``` public class ProjectOne { public static void main (String[] args) { int i, count1 = 0, count2 = 0, count3 = 0; int sum1 = 0, sum2 = 0, sum3 = 0, total; for(i=1; i<1000; ++i) //creates loop that will iterate for every number { if (i%3 == 0) count1...
2015/01/06
[ "https://Stackoverflow.com/questions/27792415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4422475/" ]
Use chan/goroutine ``` package main import ( "fmt" "time" ) // sleeps for `secs` seconds func f1(secs time.Duration) (result string) { fmt.Printf("waiting %v\n", secs) time.Sleep(secs * time.Second) result = fmt.Sprintf("waited for %v seconds", secs) return } // prints arg1, arg2 func f2(arg...
Another way you could do it is using `WaitGroup` I wrote this utility function to help parallelize a group of functions: ``` import "sync" // Parallelize parallelizes the function calls func Parallelize(functions ...func()) { var waitGroup sync.WaitGroup waitGroup.Add(len(functions)) defer waitGroup.Wai...
27,792,415
``` public class ProjectOne { public static void main (String[] args) { int i, count1 = 0, count2 = 0, count3 = 0; int sum1 = 0, sum2 = 0, sum3 = 0, total; for(i=1; i<1000; ++i) //creates loop that will iterate for every number { if (i%3 == 0) count1...
2015/01/06
[ "https://Stackoverflow.com/questions/27792415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4422475/" ]
Use chan/goroutine ``` package main import ( "fmt" "time" ) // sleeps for `secs` seconds func f1(secs time.Duration) (result string) { fmt.Printf("waiting %v\n", secs) time.Sleep(secs * time.Second) result = fmt.Sprintf("waited for %v seconds", secs) return } // prints arg1, arg2 func f2(arg...
here is a solution without channels but with the missing **f2** synchronization: ``` package main import ( "fmt" "sync" "time" ) // sleeps for `secs` seconds func f1(secs time.Duration, result *string, sg *sync.WaitGroup) () { fmt.Printf("waiting %v\n", secs) time.Sleep(secs * time.Second) *r...
27,792,415
``` public class ProjectOne { public static void main (String[] args) { int i, count1 = 0, count2 = 0, count3 = 0; int sum1 = 0, sum2 = 0, sum3 = 0, total; for(i=1; i<1000; ++i) //creates loop that will iterate for every number { if (i%3 == 0) count1...
2015/01/06
[ "https://Stackoverflow.com/questions/27792415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4422475/" ]
Use chan/goroutine ``` package main import ( "fmt" "time" ) // sleeps for `secs` seconds func f1(secs time.Duration) (result string) { fmt.Printf("waiting %v\n", secs) time.Sleep(secs * time.Second) result = fmt.Sprintf("waited for %v seconds", secs) return } // prints arg1, arg2 func f2(arg...
With go 1.18 supporting generics, the [channel solution](https://stackoverflow.com/a/27792477/444917) can be made even more readable. ``` func async[T any](f func() T) chan T { ch := make(chan T) go func() { ch <- f() }() return ch } func main() { startTime := time.Now().Local() out1 ...
27,792,415
``` public class ProjectOne { public static void main (String[] args) { int i, count1 = 0, count2 = 0, count3 = 0; int sum1 = 0, sum2 = 0, sum3 = 0, total; for(i=1; i<1000; ++i) //creates loop that will iterate for every number { if (i%3 == 0) count1...
2015/01/06
[ "https://Stackoverflow.com/questions/27792415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4422475/" ]
Another way you could do it is using `WaitGroup` I wrote this utility function to help parallelize a group of functions: ``` import "sync" // Parallelize parallelizes the function calls func Parallelize(functions ...func()) { var waitGroup sync.WaitGroup waitGroup.Add(len(functions)) defer waitGroup.Wai...
here is a solution without channels but with the missing **f2** synchronization: ``` package main import ( "fmt" "sync" "time" ) // sleeps for `secs` seconds func f1(secs time.Duration, result *string, sg *sync.WaitGroup) () { fmt.Printf("waiting %v\n", secs) time.Sleep(secs * time.Second) *r...
27,792,415
``` public class ProjectOne { public static void main (String[] args) { int i, count1 = 0, count2 = 0, count3 = 0; int sum1 = 0, sum2 = 0, sum3 = 0, total; for(i=1; i<1000; ++i) //creates loop that will iterate for every number { if (i%3 == 0) count1...
2015/01/06
[ "https://Stackoverflow.com/questions/27792415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4422475/" ]
Another way you could do it is using `WaitGroup` I wrote this utility function to help parallelize a group of functions: ``` import "sync" // Parallelize parallelizes the function calls func Parallelize(functions ...func()) { var waitGroup sync.WaitGroup waitGroup.Add(len(functions)) defer waitGroup.Wai...
With go 1.18 supporting generics, the [channel solution](https://stackoverflow.com/a/27792477/444917) can be made even more readable. ``` func async[T any](f func() T) chan T { ch := make(chan T) go func() { ch <- f() }() return ch } func main() { startTime := time.Now().Local() out1 ...
27,792,415
``` public class ProjectOne { public static void main (String[] args) { int i, count1 = 0, count2 = 0, count3 = 0; int sum1 = 0, sum2 = 0, sum3 = 0, total; for(i=1; i<1000; ++i) //creates loop that will iterate for every number { if (i%3 == 0) count1...
2015/01/06
[ "https://Stackoverflow.com/questions/27792415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4422475/" ]
here is a solution without channels but with the missing **f2** synchronization: ``` package main import ( "fmt" "sync" "time" ) // sleeps for `secs` seconds func f1(secs time.Duration, result *string, sg *sync.WaitGroup) () { fmt.Printf("waiting %v\n", secs) time.Sleep(secs * time.Second) *r...
With go 1.18 supporting generics, the [channel solution](https://stackoverflow.com/a/27792477/444917) can be made even more readable. ``` func async[T any](f func() T) chan T { ch := make(chan T) go func() { ch <- f() }() return ch } func main() { startTime := time.Now().Local() out1 ...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
**if you are using IOS react native platform** and want to debugging real android device you can use following code: ``` adb reverse tcp:8081 tcp:8081 npm start -- --reset-cache react-native run-android ```
I tried @Mr. Stark answer. It didn't work. It failed to install the drive. I have Samsung S8 plus. I enabled the debugging mode on device then installed Android USB Driver for Windows from Samsung [site](https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows), it works.
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
**To test an android apps in a real device with Android Studio, You must keep two things in mind** 1. You should enable **USB debugging** option on your android phone. 2. You must have **driver** installed on your computer. Now , let me tell you how you can **enable USB debugging** on your android phone: 1. Go to **...
For Android 7, Galaxy S6 Edge: 1. Settings > Developer Options > Turn the switch ON > Debugging Mode (Turn On) If *Developer Options* is not available then 2. Settings > About Device > Software Info > Build number (Tap It 7 time) Now perform step 1. Now it should work, if its still not working then perform [these]...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
I can run on my device at last, just I enabled the **"USB debugging"** and **"Allow mock location"** options from the Debug Menu of my device.
I tried @Mr. Stark answer. It didn't work. It failed to install the drive. I have Samsung S8 plus. I enabled the debugging mode on device then installed Android USB Driver for Windows from Samsung [site](https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows), it works.
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
* First we have to enable the USB debugging mode. for that go to **Settings** -> **Developer Options** ->**USB debugging** in your phone checked it and allow it. * After it open android studio, click on SDK manager , check mark the **Google USB Driver** and hit **install package**. * After Installing Google USB Driver,...
I tried @Mr. Stark answer. It didn't work. It failed to install the drive. I have Samsung S8 plus. I enabled the debugging mode on device then installed Android USB Driver for Windows from Samsung [site](https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows), it works.
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
**Step 1:** Firstly, Go to the Settings in your real device whose device are used to run android app. **Step 2:** After that go to the “About phone” if Developer Options is not shown in your device **Step 3:** Then Tap 7 times on Build number to create Developer Options. **Step 4:** After that go back and Developer ...
Other 2 step solution could be for Android Studio; 1. "After installing cellphone drivers" on your computer(if it is needed? and device is not detected already in windows, most cellphone are now a days plug and play or auto detected by the windows, u can use windows "settings->devices" or "settings->phone" or "control...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
I can run on my device at last, just I enabled the **"USB debugging"** and **"Allow mock location"** options from the Debug Menu of my device.
Other 2 step solution could be for Android Studio; 1. "After installing cellphone drivers" on your computer(if it is needed? and device is not detected already in windows, most cellphone are now a days plug and play or auto detected by the windows, u can use windows "settings->devices" or "settings->phone" or "control...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
* First we have to enable the USB debugging mode. for that go to **Settings** -> **Developer Options** ->**USB debugging** in your phone checked it and allow it. * After it open android studio, click on SDK manager , check mark the **Google USB Driver** and hit **install package**. * After Installing Google USB Driver,...
Other 2 step solution could be for Android Studio; 1. "After installing cellphone drivers" on your computer(if it is needed? and device is not detected already in windows, most cellphone are now a days plug and play or auto detected by the windows, u can use windows "settings->devices" or "settings->phone" or "control...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
* First we have to enable the USB debugging mode. for that go to **Settings** -> **Developer Options** ->**USB debugging** in your phone checked it and allow it. * After it open android studio, click on SDK manager , check mark the **Google USB Driver** and hit **install package**. * After Installing Google USB Driver,...
For Android 7, Galaxy S6 Edge: 1. Settings > Developer Options > Turn the switch ON > Debugging Mode (Turn On) If *Developer Options* is not available then 2. Settings > About Device > Software Info > Build number (Tap It 7 time) Now perform step 1. Now it should work, if its still not working then perform [these]...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
**To test an android apps in a real device with Android Studio, You must keep two things in mind** 1. You should enable **USB debugging** option on your android phone. 2. You must have **driver** installed on your computer. Now , let me tell you how you can **enable USB debugging** on your android phone: 1. Go to **...
If USB Debugging Mode is enabled and does not work, you should install your device driver. For Nexus Devices; * Install Google USB Drivers on SDK Tools. * Go to Control Panel > Device Manager and check drivers status. (Probably you can see warning icon on ADB Interface Driver.) Select ADB Interface driver and click u...
21,947,850
How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
2014/02/22
[ "https://Stackoverflow.com/questions/21947850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454780/" ]
I have a Nexus 4 and own a Thinkpad L430 Windows 8.1 My errors: "Waiting for device. USB device not found" I went to: Device Manager > View > Drop to "Acer Device" > Right click on Acer Composite ADB Interface > Update it Afterward, Reboot/Restart your computer. Once it turned on Plug Your USB Device onto the compu...
Other 2 step solution could be for Android Studio; 1. "After installing cellphone drivers" on your computer(if it is needed? and device is not detected already in windows, most cellphone are now a days plug and play or auto detected by the windows, u can use windows "settings->devices" or "settings->phone" or "control...
27,622
I am making my baby-steps using raspberrypi. I am stuck in something. I am building a device that combine arduinà with raspberrypi. There are some sensors connected to arduino and others to Raspa (mainly related to my budget). Let's say that I use temperature sensor+LED with arduino and camera with raspberrypi. My ...
2015/02/13
[ "https://raspberrypi.stackexchange.com/questions/27622", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/26950/" ]
In general, 'do things where the sensor is' .. so if the camera is on the PI, use the Pi to take and send photos. If the 'trigger' is on the Adruino, then have that 'ask' the Pi to take the photo ...
I would be inclined to use a plain old USB serial connection, and use the Raspberry PI as the master. By sending the serial temperature data *from* the Arduino *to* the PI, you can do the following: * Capture photos according to your own logic * Manage the captured photos * Log data stream to a file on the PI * expan...
27,622
I am making my baby-steps using raspberrypi. I am stuck in something. I am building a device that combine arduinà with raspberrypi. There are some sensors connected to arduino and others to Raspa (mainly related to my budget). Let's say that I use temperature sensor+LED with arduino and camera with raspberrypi. My ...
2015/02/13
[ "https://raspberrypi.stackexchange.com/questions/27622", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/26950/" ]
In general, 'do things where the sensor is' .. so if the camera is on the PI, use the Pi to take and send photos. If the 'trigger' is on the Adruino, then have that 'ask' the Pi to take the photo ...
I've done a lot of projects with both platforms, and "most" sensors now work on the Raspberry Pi and Arduino i.e. DHT temp sensors, GPS modules etc. One thing to be careful of if you're interfacing the voltage from an Arduino is the protection (or lack there of) on the Raspberry Pi GPIO. One new product I've been h...
27,622
I am making my baby-steps using raspberrypi. I am stuck in something. I am building a device that combine arduinà with raspberrypi. There are some sensors connected to arduino and others to Raspa (mainly related to my budget). Let's say that I use temperature sensor+LED with arduino and camera with raspberrypi. My ...
2015/02/13
[ "https://raspberrypi.stackexchange.com/questions/27622", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/26950/" ]
I would be inclined to use a plain old USB serial connection, and use the Raspberry PI as the master. By sending the serial temperature data *from* the Arduino *to* the PI, you can do the following: * Capture photos according to your own logic * Manage the captured photos * Log data stream to a file on the PI * expan...
I've done a lot of projects with both platforms, and "most" sensors now work on the Raspberry Pi and Arduino i.e. DHT temp sensors, GPS modules etc. One thing to be careful of if you're interfacing the voltage from an Arduino is the protection (or lack there of) on the Raspberry Pi GPIO. One new product I've been h...
4,756,736
I need to make use of additional jars during the execution of the program. I manually add the jars to the relative ./lib folder and then execute the program. How should I define the classpath in the manifest file?
2011/01/21
[ "https://Stackoverflow.com/questions/4756736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/584160/" ]
You can't use regular expressions or other wildcards in the `Class-Path` attribute of your manifest. There is only one supported wildcard in Java, and that only works on if specified on the commandline on a "manual" `java` invocation (i.e. not using `-jar`): [using `directoryname/*`](https://stackoverflow.com/question...
I'm not all too sure about what you want exactly, but you can add jars during runtime: * list (jar) files using File.list() on the directory containing the jars * do a regex on the filenames you retrieve * use an URLClassLoader to load the jar I don't know exactly how to register (if necessary) the URLClassLoaders to...
68,659,775
I have two related collections that contain documents as follows: ```json /* heroes */ { id: "HID_1", name: "A" } { id: "HID_2", name: "B" } ``` ```json /* weapons */ { name: "WHID_1", weapon: "Sword" } { name: "WHID_2", weapon: "Lance" } ``` How can I aggregate them so I get a single document where I know "A" use...
2021/08/05
[ "https://Stackoverflow.com/questions/68659775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10872833/" ]
There are a few problems with your code that need to be addressed: 1. After spawning a `std::thread` you need to synchronize it using [`std::thread::join()`](https://en.cppreference.com/w/cpp/thread/thread/join). 2. Remove the reference capture from the `sec` parameter in order to prevent [dangling of references](http...
You created a `std::thread` and destructed it without detaching it. ``` std::thread t([&sec, &f]() {sleep(sec); ``` Either call `join` to wait on it, or call `detach`. Note also the capture by reference issue in your comments.
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
How much precision / resolution do you need? If you can do with a precision / resolution of half a circle, 1 bit per value should be enough: that is, you can fit 8 values in a byte. ...
used a fixed point representation <http://en.wikipedia.org/wiki/Fixed-point_arithmetic>
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
How much precision / resolution do you need? If you can do with a precision / resolution of half a circle, 1 bit per value should be enough: that is, you can fit 8 values in a byte. ...
Compression? Can be a bit costly to implement but it may take even less space than tightly packed binary data. Plus, the uncompressed form can be pretty much anything, such as human-readable ASCII.
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
How much precision / resolution do you need? If you can do with a precision / resolution of half a circle, 1 bit per value should be enough: that is, you can fit 8 values in a byte. ...
There is a method from the Quake source code that writes them out as a byte like this: ``` ((int)radian*256/360) & 255 //radian is the angle ``` Then reads it in like this: ``` b * (360.0f/256) //b is the byte read in ``` Which I tested and it leaves about 2 decimal places of precision, which should be okay for m...
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
used a fixed point representation <http://en.wikipedia.org/wiki/Fixed-point_arithmetic>
There is a method from the Quake source code that writes them out as a byte like this: ``` ((int)radian*256/360) & 255 //radian is the angle ``` Then reads it in like this: ``` b * (360.0f/256) //b is the byte read in ``` Which I tested and it leaves about 2 decimal places of precision, which should be okay for m...
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
You have two things to worry about: range and precision. And you haven't given us enough information about either one. So I'll make some reasonable (I hope) assumptions. I'll assume that all the values are in the range 0 to 2π (0 to 360°). If you store such values as 32-bit `float`, you're using 1 bit for the sign (...
used a fixed point representation <http://en.wikipedia.org/wiki/Fixed-point_arithmetic>
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
Compression? Can be a bit costly to implement but it may take even less space than tightly packed binary data. Plus, the uncompressed form can be pretty much anything, such as human-readable ASCII.
There is a method from the Quake source code that writes them out as a byte like this: ``` ((int)radian*256/360) & 255 //radian is the angle ``` Then reads it in like this: ``` b * (360.0f/256) //b is the byte read in ``` Which I tested and it leaves about 2 decimal places of precision, which should be okay for m...
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
You have two things to worry about: range and precision. And you haven't given us enough information about either one. So I'll make some reasonable (I hope) assumptions. I'll assume that all the values are in the range 0 to 2π (0 to 360°). If you store such values as 32-bit `float`, you're using 1 bit for the sign (...
Compression? Can be a bit costly to implement but it may take even less space than tightly packed binary data. Plus, the uncompressed form can be pretty much anything, such as human-readable ASCII.
11,711,753
I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that wasn't going to work... Any ideas? EDIT: I only need 2 or 3 decimal po...
2012/07/29
[ "https://Stackoverflow.com/questions/11711753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840010/" ]
You have two things to worry about: range and precision. And you haven't given us enough information about either one. So I'll make some reasonable (I hope) assumptions. I'll assume that all the values are in the range 0 to 2π (0 to 360°). If you store such values as 32-bit `float`, you're using 1 bit for the sign (...
There is a method from the Quake source code that writes them out as a byte like this: ``` ((int)radian*256/360) & 255 //radian is the angle ``` Then reads it in like this: ``` b * (360.0f/256) //b is the byte read in ``` Which I tested and it leaves about 2 decimal places of precision, which should be okay for m...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
Insert this to the `head` section of your web page. ``` <meta name="google" content="notranslate"> ``` Source: [Meta tag that Google understand - Search Console Help](https://support.google.com/webmasters/answer/79812?hl=en)
If you add the following code ``` <meta name="google" value="notranslate"> ``` inside `<head></head>` it will disable the appearence of the translation bar, **but will also disable translation at [Google Translate](http://translate.google.com)**. For more info check <http://support.google.com/translate/?hl=en#2641...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
Insert this to the `head` section of your web page. ``` <meta name="google" content="notranslate"> ``` Source: [Meta tag that Google understand - Search Console Help](https://support.google.com/webmasters/answer/79812?hl=en)
The Meta Value should be "**content**", not "**value**" ``` <meta name="google" content="notranslate" /> ``` **Update:** I understand that normal meta tags use content to assign the value, however this is a rare case where "value" is actually the correct syntax. i.e. is confirmed to remove the translate bar.
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
Insert this to the `head` section of your web page. ``` <meta name="google" content="notranslate"> ``` Source: [Meta tag that Google understand - Search Console Help](https://support.google.com/webmasters/answer/79812?hl=en)
If you want to block a section (ie: for the original question just the chat window) you can use ``` class=notranslate ``` From: <http://support.google.com/translate/?hl=en#2641276>. *If you don't mind your web page being translated by Google Translate, except for a particular section (like an email address, for e...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
Insert this to the `head` section of your web page. ``` <meta name="google" content="notranslate"> ``` Source: [Meta tag that Google understand - Search Console Help](https://support.google.com/webmasters/answer/79812?hl=en)
Use the new global attribute. `translate`. in my case i used it straight into html `<html lang="en" translate="no">` but you can set it on a specific element. example ``` <footer> <small>© 2020 <span translate="no">BrandName</span></small> </footer> ``` [MDN ref](https://developer.mozilla.org/en-US/docs/Web/HT...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
The Meta Value should be "**content**", not "**value**" ``` <meta name="google" content="notranslate" /> ``` **Update:** I understand that normal meta tags use content to assign the value, however this is a rare case where "value" is actually the correct syntax. i.e. is confirmed to remove the translate bar.
If you add the following code ``` <meta name="google" value="notranslate"> ``` inside `<head></head>` it will disable the appearence of the translation bar, **but will also disable translation at [Google Translate](http://translate.google.com)**. For more info check <http://support.google.com/translate/?hl=en#2641...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
If you want to block a section (ie: for the original question just the chat window) you can use ``` class=notranslate ``` From: <http://support.google.com/translate/?hl=en#2641276>. *If you don't mind your web page being translated by Google Translate, except for a particular section (like an email address, for e...
If you add the following code ``` <meta name="google" value="notranslate"> ``` inside `<head></head>` it will disable the appearence of the translation bar, **but will also disable translation at [Google Translate](http://translate.google.com)**. For more info check <http://support.google.com/translate/?hl=en#2641...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
If you add the following code ``` <meta name="google" value="notranslate"> ``` inside `<head></head>` it will disable the appearence of the translation bar, **but will also disable translation at [Google Translate](http://translate.google.com)**. For more info check <http://support.google.com/translate/?hl=en#2641...
Use the new global attribute. `translate`. in my case i used it straight into html `<html lang="en" translate="no">` but you can set it on a specific element. example ``` <footer> <small>© 2020 <span translate="no">BrandName</span></small> </footer> ``` [MDN ref](https://developer.mozilla.org/en-US/docs/Web/HT...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
The Meta Value should be "**content**", not "**value**" ``` <meta name="google" content="notranslate" /> ``` **Update:** I understand that normal meta tags use content to assign the value, however this is a rare case where "value" is actually the correct syntax. i.e. is confirmed to remove the translate bar.
If you want to block a section (ie: for the original question just the chat window) you can use ``` class=notranslate ``` From: <http://support.google.com/translate/?hl=en#2641276>. *If you don't mind your web page being translated by Google Translate, except for a particular section (like an email address, for e...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
The Meta Value should be "**content**", not "**value**" ``` <meta name="google" content="notranslate" /> ``` **Update:** I understand that normal meta tags use content to assign the value, however this is a rare case where "value" is actually the correct syntax. i.e. is confirmed to remove the translate bar.
Use the new global attribute. `translate`. in my case i used it straight into html `<html lang="en" translate="no">` but you can set it on a specific element. example ``` <footer> <small>© 2020 <span translate="no">BrandName</span></small> </footer> ``` [MDN ref](https://developer.mozilla.org/en-US/docs/Web/HT...
7,228,972
I have a chat website that is highly dynamic and when visiting it with Google Chrome, the translation bar appears offering to translate the site. While the translation of dynamic content works better than I'd have expected, it doesn't work well enough for my purpose and doesn't even make much sense in a chat. Is there...
2011/08/29
[ "https://Stackoverflow.com/questions/7228972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917639/" ]
If you want to block a section (ie: for the original question just the chat window) you can use ``` class=notranslate ``` From: <http://support.google.com/translate/?hl=en#2641276>. *If you don't mind your web page being translated by Google Translate, except for a particular section (like an email address, for e...
Use the new global attribute. `translate`. in my case i used it straight into html `<html lang="en" translate="no">` but you can set it on a specific element. example ``` <footer> <small>© 2020 <span translate="no">BrandName</span></small> </footer> ``` [MDN ref](https://developer.mozilla.org/en-US/docs/Web/HT...
2,420
What are the causes of duplex mismatch other than misconfiguration? (power outage? improper cabling? auto negotiation implementation bugs?) Any thoughts on discovering duplex mismatch? NetMRI seems to use interface error rate. Is it sufficient to just poll all interface error rates on switches/servers? What if this fe...
2013/07/19
[ "https://networkengineering.stackexchange.com/questions/2420", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/34/" ]
By far the most common issue would be misconfiguration. Some people still hold on to old beliefs that auto negotation does not work reliably. If you have different vendors there can be issues but I don't see it very often. I would much rather rely on auto negotiation as my first solution and if that fails fall back to...
One of the symptoms of a duplex mismatch is late collisions. Having your NMS alert you on these collisions is a good way of finding them. At least some Cisco models/IOS versions can send SNMP traps for these collisions.
2,420
What are the causes of duplex mismatch other than misconfiguration? (power outage? improper cabling? auto negotiation implementation bugs?) Any thoughts on discovering duplex mismatch? NetMRI seems to use interface error rate. Is it sufficient to just poll all interface error rates on switches/servers? What if this fe...
2013/07/19
[ "https://networkengineering.stackexchange.com/questions/2420", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/34/" ]
By far the most common issue would be misconfiguration. Some people still hold on to old beliefs that auto negotation does not work reliably. If you have different vendors there can be issues but I don't see it very often. I would much rather rely on auto negotiation as my first solution and if that fails fall back to...
It is always misconfiguration because duplex mode is a L1 configuration issue. If there are L1 issues despite matching DM and a flawless cable, at least one NIC is broken. I suggest you consider two facts about auto-configuration: Neither does every device support auto-configuration, nor is there certainty that both in...
2,420
What are the causes of duplex mismatch other than misconfiguration? (power outage? improper cabling? auto negotiation implementation bugs?) Any thoughts on discovering duplex mismatch? NetMRI seems to use interface error rate. Is it sufficient to just poll all interface error rates on switches/servers? What if this fe...
2013/07/19
[ "https://networkengineering.stackexchange.com/questions/2420", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/34/" ]
By far the most common issue would be misconfiguration. Some people still hold on to old beliefs that auto negotation does not work reliably. If you have different vendors there can be issues but I don't see it very often. I would much rather rely on auto negotiation as my first solution and if that fails fall back to...
At a low level the big indicator of duplex mismatches is large numbers of "late collisions" reported on the half duplex end of the link. The full duplex end is unlikely to show errors. At a higher level a common indicator of duplex mismatch is that pings work but more complex stuff either fails completely or works wi...
2,420
What are the causes of duplex mismatch other than misconfiguration? (power outage? improper cabling? auto negotiation implementation bugs?) Any thoughts on discovering duplex mismatch? NetMRI seems to use interface error rate. Is it sufficient to just poll all interface error rates on switches/servers? What if this fe...
2013/07/19
[ "https://networkengineering.stackexchange.com/questions/2420", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/34/" ]
One of the symptoms of a duplex mismatch is late collisions. Having your NMS alert you on these collisions is a good way of finding them. At least some Cisco models/IOS versions can send SNMP traps for these collisions.
It is always misconfiguration because duplex mode is a L1 configuration issue. If there are L1 issues despite matching DM and a flawless cable, at least one NIC is broken. I suggest you consider two facts about auto-configuration: Neither does every device support auto-configuration, nor is there certainty that both in...
2,420
What are the causes of duplex mismatch other than misconfiguration? (power outage? improper cabling? auto negotiation implementation bugs?) Any thoughts on discovering duplex mismatch? NetMRI seems to use interface error rate. Is it sufficient to just poll all interface error rates on switches/servers? What if this fe...
2013/07/19
[ "https://networkengineering.stackexchange.com/questions/2420", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/34/" ]
One of the symptoms of a duplex mismatch is late collisions. Having your NMS alert you on these collisions is a good way of finding them. At least some Cisco models/IOS versions can send SNMP traps for these collisions.
At a low level the big indicator of duplex mismatches is large numbers of "late collisions" reported on the half duplex end of the link. The full duplex end is unlikely to show errors. At a higher level a common indicator of duplex mismatch is that pings work but more complex stuff either fails completely or works wi...
3,265,267
The argument that people use to prove that empty set is unique is that: Let $A$ and $B$ be two empty sets then $\forall z : z \in A \implies z \in B$ since there is no such $x\in A$ hence this statement is vacuously true. Also the converse is true therefore $A=B$. My objection is we could have equally stated $\forall z...
2019/06/17
[ "https://math.stackexchange.com/questions/3265267", "https://math.stackexchange.com", "https://math.stackexchange.com/users/678198/" ]
But that's not how you negate $A = B$. For two sets to be non-equal, you have to *actually find* an element which is in one of the two sets, and not the other. The negation of a statement beginning with $\forall$ is a statement beginning with $\exists$. And if you carefully state "$A\neq B$" with the correct quantifier...
Two sets are different if at least one of them has at least one element that the other one do not have. If there are two different empty sets then at least one of them has at least one element that the other one do not have, but that is not true since none of them has elements, so all empty sets are equal, so there is ...
3,265,267
The argument that people use to prove that empty set is unique is that: Let $A$ and $B$ be two empty sets then $\forall z : z \in A \implies z \in B$ since there is no such $x\in A$ hence this statement is vacuously true. Also the converse is true therefore $A=B$. My objection is we could have equally stated $\forall z...
2019/06/17
[ "https://math.stackexchange.com/questions/3265267", "https://math.stackexchange.com", "https://math.stackexchange.com/users/678198/" ]
But that's not how you negate $A = B$. For two sets to be non-equal, you have to *actually find* an element which is in one of the two sets, and not the other. The negation of a statement beginning with $\forall$ is a statement beginning with $\exists$. And if you carefully state "$A\neq B$" with the correct quantifier...
The objection raised here is interesting and allows, once answered, to express a paradoxical but true statement about empty sets: two empty sets are necessarily identical, *and disjoint*. Your reasoning is as follows : (1) A and B are empty sets (2) for any arbitrary object x, the statement "x belongs to A --> x ...
3,265,267
The argument that people use to prove that empty set is unique is that: Let $A$ and $B$ be two empty sets then $\forall z : z \in A \implies z \in B$ since there is no such $x\in A$ hence this statement is vacuously true. Also the converse is true therefore $A=B$. My objection is we could have equally stated $\forall z...
2019/06/17
[ "https://math.stackexchange.com/questions/3265267", "https://math.stackexchange.com", "https://math.stackexchange.com/users/678198/" ]
Indeed, $\forall z:z\in A\implies z\notin B$. And, by the same argument, $\forall z:z\in B\implies z\notin A$. But all that you deduce from this is that $A\cap B=\emptyset$. There is no contradiction here.
Two sets are different if at least one of them has at least one element that the other one do not have. If there are two different empty sets then at least one of them has at least one element that the other one do not have, but that is not true since none of them has elements, so all empty sets are equal, so there is ...
3,265,267
The argument that people use to prove that empty set is unique is that: Let $A$ and $B$ be two empty sets then $\forall z : z \in A \implies z \in B$ since there is no such $x\in A$ hence this statement is vacuously true. Also the converse is true therefore $A=B$. My objection is we could have equally stated $\forall z...
2019/06/17
[ "https://math.stackexchange.com/questions/3265267", "https://math.stackexchange.com", "https://math.stackexchange.com/users/678198/" ]
Indeed, $\forall z:z\in A\implies z\notin B$. And, by the same argument, $\forall z:z\in B\implies z\notin A$. But all that you deduce from this is that $A\cap B=\emptyset$. There is no contradiction here.
The objection raised here is interesting and allows, once answered, to express a paradoxical but true statement about empty sets: two empty sets are necessarily identical, *and disjoint*. Your reasoning is as follows : (1) A and B are empty sets (2) for any arbitrary object x, the statement "x belongs to A --> x ...
3,265,267
The argument that people use to prove that empty set is unique is that: Let $A$ and $B$ be two empty sets then $\forall z : z \in A \implies z \in B$ since there is no such $x\in A$ hence this statement is vacuously true. Also the converse is true therefore $A=B$. My objection is we could have equally stated $\forall z...
2019/06/17
[ "https://math.stackexchange.com/questions/3265267", "https://math.stackexchange.com", "https://math.stackexchange.com/users/678198/" ]
Two sets are different if at least one of them has at least one element that the other one do not have. If there are two different empty sets then at least one of them has at least one element that the other one do not have, but that is not true since none of them has elements, so all empty sets are equal, so there is ...
The objection raised here is interesting and allows, once answered, to express a paradoxical but true statement about empty sets: two empty sets are necessarily identical, *and disjoint*. Your reasoning is as follows : (1) A and B are empty sets (2) for any arbitrary object x, the statement "x belongs to A --> x ...
7,378,943
How can I check if the user has the current version of my app and also pop up a message to request them to update their app version? Something like what you would see below. ![enter image description here](https://i.stack.imgur.com/zHMZR.jpg)
2011/09/11
[ "https://Stackoverflow.com/questions/7378943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/683898/" ]
You need to have a WebService on your server (or something similar) that your app requests at startup, to know which is the latest version available. (If you don't have a WS yet and really don't want to implement one for that, you may also simply use an XML or text file that contains the version too) Then compare this...
To check to see if you have the latest version just query iTunes for app data using the following query (note: change the id to match your app's id from iTunesConnect): <http://itunes.apple.com/lookup?id=520604518> This returns a JSON dictionary which is very easy to convert to an NSDictionary to use directly within ...
69,027,200
I want to change the text inside span. But span doesn't have a class and parent div doesn't have an id. I can't change the html it is not in my hand. So how can I change text of span with js? ``` <div class="mobilMenuAcButton"> <span>MENU</span> <i class="fal fa-bars"></i> </div> ```
2021/09/02
[ "https://Stackoverflow.com/questions/69027200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13044659/" ]
Well there is no built in process for this directly. But you can count the rows and add that to the results. You could then even give the user the number of items or number of pages: ``` -- Item count with pc(cnt) as (select count(*) from post) select p.*, cnt from post p cross join pc limit 50 offset $1; ...
This method works well only in specific settings (SPA with caching of network requests and desire to make pagination feel faster with pre-fetching): One every page, you make two requests: one for the current page data and one for the next page's data. It works if you for example use a React Single-Page Application wi...
69,027,200
I want to change the text inside span. But span doesn't have a class and parent div doesn't have an id. I can't change the html it is not in my hand. So how can I change text of span with js? ``` <div class="mobilMenuAcButton"> <span>MENU</span> <i class="fal fa-bars"></i> </div> ```
2021/09/02
[ "https://Stackoverflow.com/questions/69027200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13044659/" ]
The simplest method with the lowest overhead I found: You can request `pageLimit+1` rows on every page request. In your controller you will check if `rowsCount > pageLimit` and will know that there is more data available. Of course, before returning the rows, you would need to remove the last element and send along th...
This method works well only in specific settings (SPA with caching of network requests and desire to make pagination feel faster with pre-fetching): One every page, you make two requests: one for the current page data and one for the next page's data. It works if you for example use a React Single-Page Application wi...
525,021
I'm using the following code to get the members of a group on my domain: ``` Dim de As New DirectoryEntry("LDAP://" & GroupDN) For Each user As String In CType(de.Properties("member"), IEnumerable) GroupCollection.Add(Username, Username) Next ``` My problem is that when GroupDN (the distinguishedn...
2009/02/08
[ "https://Stackoverflow.com/questions/525021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8114/" ]
Unless you change the primary group id of a user, the user is not stored in the member attribute of the Domain Users group, rather it uses the fact that the primary group id is set to the Domain Users RID to determine membership in Domain Users. The normal case is that the Domain Users member attribute is empty; it wou...
The [accepted answer](https://stackoverflow.com/q/525021/1574221) is absolutely correct. By default every (user) object has `513` set in the property [primarygroupid](https://learn.microsoft.com/en-us/windows/win32/adschema/a-primarygroupid), which is the fixed "tail" of the [Domain Users sid](https://learn.microsoft.c...
31,690,932
I want to use a simple struct with member variables named `start` and `end` in a function template: ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v1.end < v2.end) cout << "v1 < v2" << endl; } int ma...
2015/07/29
[ "https://Stackoverflow.com/questions/31690932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5167584/" ]
Actually it's the `<` which confuse the compiler, since it does not know whether it's the start of a template expression, or the comparator. Since @R Sahu asked for an official sources, here is the explanation : > > The paragraph that matters here is [basic.lookup.classref]p1: > > > "In a class member access expre...
It appears that g++ 4.8.4 also has problems when the member variable is `begin` or `end`. Using ``` struct st{ int begin; int end; }; template <typename T> void compare(const T& v1, const T& v2){ if(v1.begin < v2.begin) { cout << "v1.begin < v2.begin" << endl; } if(v1.end < v2.end) ...
31,690,932
I want to use a simple struct with member variables named `start` and `end` in a function template: ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v1.end < v2.end) cout << "v1 < v2" << endl; } int ma...
2015/07/29
[ "https://Stackoverflow.com/questions/31690932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5167584/" ]
This is clearly a gcc bug (specifically [10200](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10200) although there are several dupes with lots of different examples). [temp.names] states: > > When the name of a member template specialization appears after . or -> in a *postfix-expression* or after a > *nested-name-s...
It appears that g++ 4.8.4 also has problems when the member variable is `begin` or `end`. Using ``` struct st{ int begin; int end; }; template <typename T> void compare(const T& v1, const T& v2){ if(v1.begin < v2.begin) { cout << "v1.begin < v2.begin" << endl; } if(v1.end < v2.end) ...
31,690,932
I want to use a simple struct with member variables named `start` and `end` in a function template: ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v1.end < v2.end) cout << "v1 < v2" << endl; } int ma...
2015/07/29
[ "https://Stackoverflow.com/questions/31690932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5167584/" ]
This is clearly a gcc bug (specifically [10200](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10200) although there are several dupes with lots of different examples). [temp.names] states: > > When the name of a member template specialization appears after . or -> in a *postfix-expression* or after a > *nested-name-s...
Actually it's the `<` which confuse the compiler, since it does not know whether it's the start of a template expression, or the comparator. Since @R Sahu asked for an official sources, here is the explanation : > > The paragraph that matters here is [basic.lookup.classref]p1: > > > "In a class member access expre...
31,690,932
I want to use a simple struct with member variables named `start` and `end` in a function template: ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v1.end < v2.end) cout << "v1 < v2" << endl; } int ma...
2015/07/29
[ "https://Stackoverflow.com/questions/31690932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5167584/" ]
Actually it's the `<` which confuse the compiler, since it does not know whether it's the start of a template expression, or the comparator. Since @R Sahu asked for an official sources, here is the explanation : > > The paragraph that matters here is [basic.lookup.classref]p1: > > > "In a class member access expre...
I think, for the time being you can check the condition in reverse order. ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v2.end > v1.end) //changed the comparison order cout << "v1 < v2" << endl; }...
31,690,932
I want to use a simple struct with member variables named `start` and `end` in a function template: ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v1.end < v2.end) cout << "v1 < v2" << endl; } int ma...
2015/07/29
[ "https://Stackoverflow.com/questions/31690932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5167584/" ]
This is clearly a gcc bug (specifically [10200](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10200) although there are several dupes with lots of different examples). [temp.names] states: > > When the name of a member template specialization appears after . or -> in a *postfix-expression* or after a > *nested-name-s...
I think, for the time being you can check the condition in reverse order. ``` #include <iostream> using namespace std; struct st { int start; int end; }; template<typename T> void compare(const T& v1, const T& v2){ if(v2.end > v1.end) //changed the comparison order cout << "v1 < v2" << endl; }...
19,958,697
I am having a problem on a list with sencha touch 2.3 . I have set the PullRefresh plugin on my app but when I pull my list down and release it the refreshFn is never called. Here is my code: ``` plugins: [ { xclass: 'Ext.plugin.PullRefresh', pullText: '', autoSnapBack : false, ...
2013/11/13
[ "https://Stackoverflow.com/questions/19958697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2988508/" ]
You need to replace refreshFn: section with this: ``` listeners:{ latestfetched: function(eOpts) { console.log("Pulled"); } } ```
Use this Function for Using `PullRefresh` `plugin` in `Sencha`. ``` plugins: [{ xclass: 'Ext.plugin.PullRefresh', pullRefreshText: 'Getting Refresh...', refreshFn: function() { var store = Ext.getStore('Company'); store.getProxy().setExtraParam(Sencha App.util.Config.currentCompany); Ext.Viewport.setMasked...
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Use `::` instead of `.` `MyObject o = MyMath::calcSomething();` When you are calling the method without the object of the class you should use `::` notation. You may also call static method via class objects or pointers to them, in this case you should use usual `.` or `->` notation: ``` MyObject obj; MyObject* p = ...
> > What am I doing wrong? > > > You are simply using incorrect syntax... the `::` operator ([scope resolution operator](http://en.wikipedia.org/wiki/Scope_resolution_operator#C.2B.2B)) is how you would access classes or members in different namespaces: ``` int main() { MyObject o = MyMath::calcSomething(); ...
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > What am I doing wrong? > > > You are simply using incorrect syntax... the `::` operator ([scope resolution operator](http://en.wikipedia.org/wiki/Scope_resolution_operator#C.2B.2B)) is how you would access classes or members in different namespaces: ``` int main() { MyObject o = MyMath::calcSomething(); ...
For this case, you want MyMath::calcSomething(). The '.' syntax is for calling functions in objects. The :: syntax is for calling functions in a class or a namespace.
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > What am I doing wrong? > > > You are simply using incorrect syntax... the `::` operator ([scope resolution operator](http://en.wikipedia.org/wiki/Scope_resolution_operator#C.2B.2B)) is how you would access classes or members in different namespaces: ``` int main() { MyObject o = MyMath::calcSomething(); ...
Call `MyMath::calcSomething()`
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > What am I doing wrong? > > > You are simply using incorrect syntax... the `::` operator ([scope resolution operator](http://en.wikipedia.org/wiki/Scope_resolution_operator#C.2B.2B)) is how you would access classes or members in different namespaces: ``` int main() { MyObject o = MyMath::calcSomething(); ...
Try this way ``` #include <iostream> using namespace std; class MyMath { public: static MyMath* calcSomething(void); private: }; MyMath* MyMath::calcSomething() { MyMath *myMathObject=new MyMath; return myMathObject; } int main() { MyMath *myMathObject=MyMath::calcSomething(); /////Object crea...
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Use `::` instead of `.` `MyObject o = MyMath::calcSomething();` When you are calling the method without the object of the class you should use `::` notation. You may also call static method via class objects or pointers to them, in this case you should use usual `.` or `->` notation: ``` MyObject obj; MyObject* p = ...
For this case, you want MyMath::calcSomething(). The '.' syntax is for calling functions in objects. The :: syntax is for calling functions in a class or a namespace.
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Use `::` instead of `.` `MyObject o = MyMath::calcSomething();` When you are calling the method without the object of the class you should use `::` notation. You may also call static method via class objects or pointers to them, in this case you should use usual `.` or `->` notation: ``` MyObject obj; MyObject* p = ...
Call `MyMath::calcSomething()`
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Use `::` instead of `.` `MyObject o = MyMath::calcSomething();` When you are calling the method without the object of the class you should use `::` notation. You may also call static method via class objects or pointers to them, in this case you should use usual `.` or `->` notation: ``` MyObject obj; MyObject* p = ...
Try this way ``` #include <iostream> using namespace std; class MyMath { public: static MyMath* calcSomething(void); private: }; MyMath* MyMath::calcSomething() { MyMath *myMathObject=new MyMath; return myMathObject; } int main() { MyMath *myMathObject=MyMath::calcSomething(); /////Object crea...
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Call `MyMath::calcSomething()`
For this case, you want MyMath::calcSomething(). The '.' syntax is for calling functions in objects. The :: syntax is for calling functions in a class or a namespace.
1,208,853
Is it possible to return an object from a static method in C++ like there is in Java? I am doing this: ``` class MyMath { public: static MyObject calcSomething(void); private: }; ``` And I want to do this: ``` int main() { MyObject o = MyMath.calcSomething(); // error happens here } ``` There ...
2009/07/30
[ "https://Stackoverflow.com/questions/1208853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Call `MyMath::calcSomething()`
Try this way ``` #include <iostream> using namespace std; class MyMath { public: static MyMath* calcSomething(void); private: }; MyMath* MyMath::calcSomething() { MyMath *myMathObject=new MyMath; return myMathObject; } int main() { MyMath *myMathObject=MyMath::calcSomething(); /////Object crea...
10,139,770
I'm using jquery ajaxfileupload plugin <http://www.phpletter.com/Our-Projects/AjaxFileUpload/> to upload images with Django in server-side. I've also done the ajax setup which I saw here [Django CSRF check failing with an Ajax POST request](https://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-a...
2012/04/13
[ "https://Stackoverflow.com/questions/10139770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/615120/" ]
Make sure to use `RequestContext` in your views. See <https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it>
Attach the annotation `@csrf_protect` at the top of the view method!
58,802,720
fI have software running on the 72MHz STM32F303 with some real tight control loops and have come to realize that my loops aren't running fast enough. I need to port the code to the faster 216MHz STM32F765 but I'm finding that the F7 series doesn't support the F3's SPL, and only supports the newer HAL. There is a lower ...
2019/11/11
[ "https://Stackoverflow.com/questions/58802720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676310/" ]
Seems like you are going to need to do some work. Indeed the SPL is dead and HAL seems **for this use case** very unsuitable as you are talking about tight control loops. My suggestion is to switch to HAL and roll your own functions for controlling the peripherals you use. This allows you to still use typedefs such as...
I just received word from ST - there is an SPL to CUBE LL migration guide: [SPL2LL CONVERTER DOCUMENTATION](https://www.st.com/resource/en/data_brief/spl2ll-converter.pdf) [CONTENT TRANSLATIONS](https://www.st.com/content/ccc/resource/technical/document/application_note/group0/5e/65/b0/94/13/e4/42/ca/DM00405316/files...
17,212,081
``` String specificDate=2013+"-"+06+"-"+20; String day="Monday"; ``` How to find the next date where Monday comes that is after that `specificDate`?
2013/06/20
[ "https://Stackoverflow.com/questions/17212081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855654/" ]
You either want to look at [Java's Calendar](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) or [JodaTime](http://joda-time.sourceforge.net/), given you're looking at rules over dates, I'd recommend Joda.
``` Calendar now = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(formatString); now.setTime(sdf.parse(dateString)); int weekday = now.get(Calendar.DAY_OF_WEEK); if (weekday != Calendar.MONDAY) { int days = (Calendar.SATURDAY - weekday + 2) % 7; now.add(Calendar.DAY_OF_YE...
17,212,081
``` String specificDate=2013+"-"+06+"-"+20; String day="Monday"; ``` How to find the next date where Monday comes that is after that `specificDate`?
2013/06/20
[ "https://Stackoverflow.com/questions/17212081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855654/" ]
You either want to look at [Java's Calendar](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) or [JodaTime](http://joda-time.sourceforge.net/), given you're looking at rules over dates, I'd recommend Joda.
You should really use a higher level Date library to do that for you. Unfortunately, java's built in Date and Calendar class are far less than ideal. You can take a look at this library, which has come the de facto standard for date manipulation among Java developers, until the new JDK design is finalized. <http://jod...
17,212,081
``` String specificDate=2013+"-"+06+"-"+20; String day="Monday"; ``` How to find the next date where Monday comes that is after that `specificDate`?
2013/06/20
[ "https://Stackoverflow.com/questions/17212081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855654/" ]
You either want to look at [Java's Calendar](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) or [JodaTime](http://joda-time.sourceforge.net/), given you're looking at rules over dates, I'd recommend Joda.
You should use the Calendar class for that. ``` Calendar c1 = Calendar.getInstance(); c1.set(2013, Calendar.JUNE, 20); int weekday = now.get(Calendar.DAY_OF_WEEK); if (weekday != Calendar.MONDAY) { // calculate how much to add // the 2 is the difference between Saturday and Monday int days = (Calendar...
17,212,081
``` String specificDate=2013+"-"+06+"-"+20; String day="Monday"; ``` How to find the next date where Monday comes that is after that `specificDate`?
2013/06/20
[ "https://Stackoverflow.com/questions/17212081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855654/" ]
You either want to look at [Java's Calendar](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) or [JodaTime](http://joda-time.sourceforge.net/), given you're looking at rules over dates, I'd recommend Joda.
try this ``` Calendar c = new GregorianCalendar(2013, 5, 20); int diff = Calendar.MONDAY - c.get(Calendar.DAY_OF_WEEK); if (diff < 0) { diff = 7 + diff; } c.add(Calendar.DATE, diff); Date monday = c.getTime(); ```
17,212,081
``` String specificDate=2013+"-"+06+"-"+20; String day="Monday"; ``` How to find the next date where Monday comes that is after that `specificDate`?
2013/06/20
[ "https://Stackoverflow.com/questions/17212081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855654/" ]
You either want to look at [Java's Calendar](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) or [JodaTime](http://joda-time.sourceforge.net/), given you're looking at rules over dates, I'd recommend Joda.
The easiest way to do this with the standard API is setting the day of week to Monday and then advancing one week: ``` Calendar c = Calendar.getInstance(); c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); // Sets c to this week's Monday c.add(Calendar.DATE, 7); // Advances c to next week's Monday ``...
17,212,081
``` String specificDate=2013+"-"+06+"-"+20; String day="Monday"; ``` How to find the next date where Monday comes that is after that `specificDate`?
2013/06/20
[ "https://Stackoverflow.com/questions/17212081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1855654/" ]
You either want to look at [Java's Calendar](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html) or [JodaTime](http://joda-time.sourceforge.net/), given you're looking at rules over dates, I'd recommend Joda.
For Java 8, you could use something like... ``` LocalDate date = LocalDate.of(2013, Month.JUNE, 20); LocalDate nextWed2 = date.with(TemporalAdjusters.nextOrSame(DayOfWeek.MONDAY)); ``` or... ``` LocalDate date = LocalDate.of(2013, Month.JUNE, 20); LocalDate nextWed2 = date.with(TemporalAdjusters.next(DayOfWeek.MOND...
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
What if you do a linked list, like you said, but also store the current minimum value. When you add a new number it looks at the previous min and changes the current min to the current value if the current value is lower. E.g... Assume you have the data: 3, 6, 4, 2, 7, 1. Then this is what the list would look like va...
Let every node keep another reference to the previously smallest item. So, when you pop the smallest item, you can restore the previously smallest. Because you can only push and pop it will be the correct node.
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
What if you do a linked list, like you said, but also store the current minimum value. When you add a new number it looks at the previous min and changes the current min to the current value if the current value is lower. E.g... Assume you have the data: 3, 6, 4, 2, 7, 1. Then this is what the list would look like va...
Minimum stack question - <http://courses.csail.mit.edu/iap/interview/Hacking_a_Google_Interview_Practice_Questions_Person_A.pdf> From the PDF: **Question: Minimum Stack** Describe a stack data structure that supports "push", "pop", and "find minimum" operations. "Find minimum" returns the smallest element in the sta...
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
What if you do a linked list, like you said, but also store the current minimum value. When you add a new number it looks at the previous min and changes the current min to the current value if the current value is lower. E.g... Assume you have the data: 3, 6, 4, 2, 7, 1. Then this is what the list would look like va...
This will make you go wild - <http://algods-cracker.blogspot.in/2011/09/design-data-structure-which-supports.html>
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
What if you do a linked list, like you said, but also store the current minimum value. When you add a new number it looks at the previous min and changes the current min to the current value if the current value is lower. E.g... Assume you have the data: 3, 6, 4, 2, 7, 1. Then this is what the list would look like va...
Here is the C code which implements the above algorithm given by Bryce Siedschlaw: ``` #include<stdio.h> #include<stdlib.h> #define minimumOf(a,b) (a<b) ? a : b; struct node{ int data; struct node* next; int min; }; void push(struct node **head_ref, int new_data){ struct node* new_node = (struct nod...
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
Minimum stack question - <http://courses.csail.mit.edu/iap/interview/Hacking_a_Google_Interview_Practice_Questions_Person_A.pdf> From the PDF: **Question: Minimum Stack** Describe a stack data structure that supports "push", "pop", and "find minimum" operations. "Find minimum" returns the smallest element in the sta...
Let every node keep another reference to the previously smallest item. So, when you pop the smallest item, you can restore the previously smallest. Because you can only push and pop it will be the correct node.
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
Let every node keep another reference to the previously smallest item. So, when you pop the smallest item, you can restore the previously smallest. Because you can only push and pop it will be the correct node.
This will make you go wild - <http://algods-cracker.blogspot.in/2011/09/design-data-structure-which-supports.html>
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
Minimum stack question - <http://courses.csail.mit.edu/iap/interview/Hacking_a_Google_Interview_Practice_Questions_Person_A.pdf> From the PDF: **Question: Minimum Stack** Describe a stack data structure that supports "push", "pop", and "find minimum" operations. "Find minimum" returns the smallest element in the sta...
This will make you go wild - <http://algods-cracker.blogspot.in/2011/09/design-data-structure-which-supports.html>
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
Minimum stack question - <http://courses.csail.mit.edu/iap/interview/Hacking_a_Google_Interview_Practice_Questions_Person_A.pdf> From the PDF: **Question: Minimum Stack** Describe a stack data structure that supports "push", "pop", and "find minimum" operations. "Find minimum" returns the smallest element in the sta...
Here is the C code which implements the above algorithm given by Bryce Siedschlaw: ``` #include<stdio.h> #include<stdlib.h> #define minimumOf(a,b) (a<b) ? a : b; struct node{ int data; struct node* next; int min; }; void push(struct node **head_ref, int new_data){ struct node* new_node = (struct nod...
6,103,287
I was just asked an interview question with company A as follows: **Question :** *Design a data structure in which you have 3 operations, push, pop and find the minimum. You should be doing all the 3 operations in constant time.* **My Answer** : *I would use a linked list in which i can do insertion and removal in co...
2011/05/23
[ "https://Stackoverflow.com/questions/6103287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177883/" ]
Here is the C code which implements the above algorithm given by Bryce Siedschlaw: ``` #include<stdio.h> #include<stdlib.h> #define minimumOf(a,b) (a<b) ? a : b; struct node{ int data; struct node* next; int min; }; void push(struct node **head_ref, int new_data){ struct node* new_node = (struct nod...
This will make you go wild - <http://algods-cracker.blogspot.in/2011/09/design-data-structure-which-supports.html>
51,509,117
I have an application that will only output XML and my destination application can only read plain text files. I have a requirement to split the `<pending>` and `<results>` tag data it into two files and concatenate the output to a single line. I'm having trouble with that; any help would be appreciated. Yes I would li...
2018/07/25
[ "https://Stackoverflow.com/questions/51509117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10130471/" ]
I'm myself a novize in xml, but PowerShell makes it easy: ``` ## Q:\Test\2018\07\25\SO_51509117.ps1 [xml]$xml=Get-Content .\input.xml -encoding utf8 ($xml.game.pending.item|ForEach-Object{$_} ) -join '' |Set-Content .\pending.txt -Encoding utf8 ($xml.game.results.item|ForEach-Object{$_} ) -join '' |Set-Content .\resul...
If you really want to brute force this with a batch file, this may work for you. ``` @echo off set "results=" set "pending=" FOR /F "tokens=1* delims=<> " %%G IN (input.xml) do ( IF /I "%%G"=="/pending" set "pending=" IF DEFINED PENDING ( FOR /F "tokens=1 delims=<" %%I IN ("%%H") DO call set "pline...
213,355
When the computer loads up, it shows a list of what to boot from. Is there a way to hide this and automatically boot from Windows unless a key is pressed?
2012/11/05
[ "https://askubuntu.com/questions/213355", "https://askubuntu.com", "https://askubuntu.com/users/105791/" ]
You can use the [Grub-Customizer application](http://www.webupd8.org/2012/09/grub-customizer-30-released.html) to set the default boot option as follows: 1. [Follow this guide](http://www.omgubuntu.co.uk/how-to-add-a-ppa-to-software-sources-in-ubuntu) to add the following Source to your **Software Sources.** ppa:dani...
[Grub Customizer](http://www.webupd8.org/2012/09/grub-customizer-30-released.html) is a graphical settings manager for GRUB2 and BURG. You can set Windows as default. Among the other Grub Customizer features are: ``` - edit the menu entries (reorder, rename, add or remove entries) - change the default boot entry - ch...
1,283,488
Am I doing something wrong? The command I ran was `ffmpeg -i sample.mkv -acodec flac -vcodec copy flac.mkv` The original file had 16 bits DTS and the resulting FLAC 24 bits, and the file is +1 GB bigger, while everywhere I read says flac should be smaller than DTS. What is the correct command to convert proprietary...
2018/01/08
[ "https://superuser.com/questions/1283488", "https://superuser.com", "https://superuser.com/users/402733/" ]
At a guess, you have enabled tabs in an app that doesn't support them - the result appears as a double title bar. Sierra comes with a feature that allows compatible applications to create multiple tabs in one window, much like a web browser. On an incompatible application, accessing this - using `Cmd ⌘` `Shift ⇧` ...
Possibly you need to uncheck the media title display setting. For an old version of VLC (v2.0.3), the setting was located at: **Preferences > Show All > Video > uncheck "Show media title on video"** Source: [VideoLAN Forums](https://forum.videolan.org/viewtopic.php?f=12&t=102944)
9,635,072
following is my code: ``` QFile f("tql.dll"); //a file to be copied f.open(QFile::ReadOnly); QByteArray qba = f.readAll(); f.close(); QString hexstr = qba.toHex(); qba = QByteArray::fromHex(hexstr.toLatin1()); //i try this and it dose not change the original data QFile f2("tql3.dll"); f2.open(QIODevice::ReadWrite); QD...
2012/03/09
[ "https://Stackoverflow.com/questions/9635072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1256804/" ]
`QDatastream` is meant to portably stream Qt types, not plain binary data. When you output to QDataStream, for each variable there is a header with internal data (I assume type + length). see <http://qt-project.org/doc/qt-4.8/QDataStream.html#details>: > > Each item written to the stream is written in a predefined ...
[The data stream format page](http://qt-project.org/doc/qt-4.8/datastreamformat.html) states how `QByteArray`s are stored: > > If the byte array is null: 0xFFFFFFFF (quint32) > > Otherwise: the array size (quint32) followed by the array bytes, i.e. size bytes > > > Those four bytes (32 bit) you posted are thu...
9,635,072
following is my code: ``` QFile f("tql.dll"); //a file to be copied f.open(QFile::ReadOnly); QByteArray qba = f.readAll(); f.close(); QString hexstr = qba.toHex(); qba = QByteArray::fromHex(hexstr.toLatin1()); //i try this and it dose not change the original data QFile f2("tql3.dll"); f2.open(QIODevice::ReadWrite); QD...
2012/03/09
[ "https://Stackoverflow.com/questions/9635072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1256804/" ]
`QDatastream` is meant to portably stream Qt types, not plain binary data. When you output to QDataStream, for each variable there is a header with internal data (I assume type + length). see <http://qt-project.org/doc/qt-4.8/QDataStream.html#details>: > > Each item written to the stream is written in a predefined ...
.Actually... there is a way to do this. But first you must realize there are potential problems with your code: 1. if you are trying to convert to binary data using a hex string, this will not work at all! Remember that a string does not actually represent binary data. For example: 16 bit binary 'FF' is written in bin...