qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
6,604,459
Is there an NSNotification we can observe for when the device is on/off the phone?
2011/07/07
[ "https://Stackoverflow.com/questions/6604459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/212559/" ]
The `NotificationCenter` doesn't send out any notifications abou this, but take a look at the `CTCallCenter` class introduced in iOS 4. It has a `callEventHandler` property that you can assign a block of code to, and gets called with call state info. There is a limitation in that the handler only gets called when your...
There isn't one that I'm aware of, but if the issue is that you want to know about the change in status bar then you can observe `UIApplicationWillChangeStatusBarFrameNotification` (as documented towards the bottom of the [UIApplication documentation](http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Referenc...
71,032
I have a Ph.D. in pure math (interested in Harmonic analysis and operator theory). I am looking forward some proper references to lead me get the foundation of discrete/signal processing more and more. Actually, I had a review of the Heppenheim's books (both signal and digital ones) and (rather) got what he is saying i...
2020/10/23
[ "https://dsp.stackexchange.com/questions/71032", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/50574/" ]
You have already read those Oppenheim's Signals & Systems, and Discrete-Time Signal Processing books. I'm not sure what you mean by *foundations* but in some sense these two are also the foundations on signal processing. In other words, there are no (popular & successful) graduate level DSP books that discuss at an ad...
I found these books to be very good in their respective field: [J.R. Ohm - Multimedia Communication Technology](https://rads.stackoverflow.com/amzn/click/com/3540012494) This has focus on representation and transmission of signals. It follows a practical approach hands down and features very good, informative illustra...
15,431,025
I have published a successful app on play, but after upgrading the app when I sign and align the app and install it on an emulator/real device it force closes and gives me `ClassNotFound` Exception. ``` 03-15 16:09:08.280: E/AndroidRuntime(7122): java.lang.RuntimeException: Unable to instantiate application william.sh...
2013/03/15
[ "https://Stackoverflow.com/questions/15431025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129047/" ]
ClassNotFound exception means that in your manifest file you have miss the Activity or may be you have not give correct name of the Activity.
Did you use ProGuard? It might have obfuscated some classes that shoudn't be obfuscated because they are referenced in an xml file (`AndroidManifest.xml` for example) or something. More on ProGuard can be found [here](http://developer.android.com/tools/help/proguard.html).
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
Linked structures are possibly the worst structure to iterate with a cache miss on each element. On top of it they consume way more memory. If you need add/remove of the both ends, ArrayDeque is significantly better than a linked list. Random access each element is also O(1) for a cyclic queue. The only better opera...
All the people criticizing a `LinkedList`, think about every other guy that has been using `List` in Java probably uses `ArrayList` and an `LinkedList` most of the times because they have been before Java 6 and because those are the ones being taught as a start in most books. But, that doesn't mean, I would blindly ta...
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
[ArrayDeque](https://docs.oracle.com/javase/9/docs/api/java/util/ArrayDeque.html) and [LinkedList](https://docs.oracle.com/javase/9/docs/api/java/util/LinkedList.html) are implementing [Deque](https://docs.oracle.com/javase/9/docs/api/java/util/Deque.html) interface but implementation is different. Key differences: ...
I don't think `ArrayDeque` is better than `LinkedList`. They are different. `ArrayDeque` is faster than `LinkedList` on average. But for adding an element, `ArrayDeque` takes amortized constant time, and `LinkedList` takes constant time. For time-sensitive applications that require all operations to take constant tim...
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
I don't think `ArrayDeque` is better than `LinkedList`. They are different. `ArrayDeque` is faster than `LinkedList` on average. But for adding an element, `ArrayDeque` takes amortized constant time, and `LinkedList` takes constant time. For time-sensitive applications that require all operations to take constant tim...
Time complexity for ArrayDeque for accessing a element is O(1) and that for LinkList is is O(N) to access last element. ArrayDeque is not thread safe so manually synchronization is necessary so that you can access it through multiple threads and so they they are faster.
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
Linked structures are possibly the worst structure to iterate with a cache miss on each element. On top of it they consume way more memory. If you need add/remove of the both ends, ArrayDeque is significantly better than a linked list. Random access each element is also O(1) for a cyclic queue. The only better opera...
Time complexity for ArrayDeque for accessing a element is O(1) and that for LinkList is is O(N) to access last element. ArrayDeque is not thread safe so manually synchronization is necessary so that you can access it through multiple threads and so they they are faster.
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
[ArrayDeque](https://docs.oracle.com/javase/9/docs/api/java/util/ArrayDeque.html) and [LinkedList](https://docs.oracle.com/javase/9/docs/api/java/util/LinkedList.html) are implementing [Deque](https://docs.oracle.com/javase/9/docs/api/java/util/Deque.html) interface but implementation is different. Key differences: ...
Time complexity for ArrayDeque for accessing a element is O(1) and that for LinkList is is O(N) to access last element. ArrayDeque is not thread safe so manually synchronization is necessary so that you can access it through multiple threads and so they they are faster.
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
Linked structures are possibly the worst structure to iterate with a cache miss on each element. On top of it they consume way more memory. If you need add/remove of the both ends, ArrayDeque is significantly better than a linked list. Random access each element is also O(1) for a cyclic queue. The only better opera...
although **`ArrayDeque<E>`** and **`LinkedList<E>`** have both implemented **`Deque<E>`** Interface, but the ArrayDeque uses basically Object array **`E[]`** for keeping the elements inside its Object, so it generally uses index for locating the head and tail elements. In a word, it just works like Deque (with all De...
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
I believe that the main performance bottleneck in `LinkedList` is the fact that whenever you push to any end of the deque, behind the scene the implementation allocates a new linked list node, which essentially involves JVM/OS, and that's expensive. Also, whenever you pop from any end, the internal nodes of `LinkedList...
`ArrayDeque` is new with Java 6, which is why a lot of code (especially projects that try to be compatible with earlier Java versions) don't use it. It's "better" in some cases because you're not allocating a node for each item to insert; instead all elements are stored in a giant array, which is resized if it gets fu...
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
Linked structures are possibly the worst structure to iterate with a cache miss on each element. On top of it they consume way more memory. If you need add/remove of the both ends, ArrayDeque is significantly better than a linked list. Random access each element is also O(1) for a cyclic queue. The only better opera...
That's not always the case. For example, in the case below `linkedlist` has better performance than `ArrayDeque` according to leetcode 103. ``` /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */...
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
I believe that the main performance bottleneck in `LinkedList` is the fact that whenever you push to any end of the deque, behind the scene the implementation allocates a new linked list node, which essentially involves JVM/OS, and that's expensive. Also, whenever you pop from any end, the internal nodes of `LinkedList...
All the people criticizing a `LinkedList`, think about every other guy that has been using `List` in Java probably uses `ArrayList` and an `LinkedList` most of the times because they have been before Java 6 and because those are the ones being taught as a start in most books. But, that doesn't mean, I would blindly ta...
6,163,166
I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. If I understand it, I will be more confident using...
2011/05/28
[ "https://Stackoverflow.com/questions/6163166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774521/" ]
Linked structures are possibly the worst structure to iterate with a cache miss on each element. On top of it they consume way more memory. If you need add/remove of the both ends, ArrayDeque is significantly better than a linked list. Random access each element is also O(1) for a cyclic queue. The only better opera...
[ArrayDeque](https://docs.oracle.com/javase/9/docs/api/java/util/ArrayDeque.html) and [LinkedList](https://docs.oracle.com/javase/9/docs/api/java/util/LinkedList.html) are implementing [Deque](https://docs.oracle.com/javase/9/docs/api/java/util/Deque.html) interface but implementation is different. Key differences: ...
51,521,716
I have seen [this post](https://stackoverflow.com/questions/13258454/marking-specific-tiles-in-geom-tile-geom-raster), but I'm struggling to translate that to a logarithmic raster. For example: ``` library(tidyverse) a <- tibble(x = rep(10^seq(-2, 2), 5), y = rep(10^seq(-2, 2), each = 5), z =...
2018/07/25
[ "https://Stackoverflow.com/questions/51521716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1704801/" ]
Assuming for example that you want to mark tiles in the y = 0.1 row, for x < 10, adding `geom_tile()` like the following could work: ``` p1 <- a %>% ggplot(aes(x = x, y = y)) + geom_raster(aes(fill = z)) + scale_x_log10() + scale_y_log10() + geom_tile(data = . %>% filter(y == 0.1 & x < 10), # filter dataset ...
For the updated example, one just needs to add `height = 0.1` to `geom_tile` where the value of `height` needs to fit the `by` value in `n_y`. ``` n_x <- 10^seq(log10(6), log10(24*365), by = 0.1)/365 step_y <- 0.1 n_y <- 10^seq(-1, 3, by = step_y) a <- tibble(x = rep(n_x, length(n_y)), y = rep(n_y, each ...
49,290,741
We are designing a system for conducting a survey in which it askes user a about 72 questions (Multiple Choice questions) And when the user submits this will be posted to php page which will save the answer in a MySQL table. Its works fine and perfectly well when we doing the test with a small number of user But I obs...
2018/03/15
[ "https://Stackoverflow.com/questions/49290741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4941350/" ]
There is a limit on `POST` request size in PHP. You can adjust [`post_max_size`](http://php.net/ini.core.php#ini.post-max-size) in your `php.ini`. As for database, I don't know how you are saving them in the database, but there are character/storage limitation on the database as well. Whenever I'm dealing with large `...
You should use the ajax function for post the data.. Go through bellow link,it might help you <https://www.w3schools.com/jquery/ajax_ajax.asp>
49,290,741
We are designing a system for conducting a survey in which it askes user a about 72 questions (Multiple Choice questions) And when the user submits this will be posted to php page which will save the answer in a MySQL table. Its works fine and perfectly well when we doing the test with a small number of user But I obs...
2018/03/15
[ "https://Stackoverflow.com/questions/49290741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4941350/" ]
You need to Increase max\_input\_vars from php.ini OR you can set the following code in your .htaccess file. ``` php_value max_input_vars 3000 ```
You should use the ajax function for post the data.. Go through bellow link,it might help you <https://www.w3schools.com/jquery/ajax_ajax.asp>
49,290,741
We are designing a system for conducting a survey in which it askes user a about 72 questions (Multiple Choice questions) And when the user submits this will be posted to php page which will save the answer in a MySQL table. Its works fine and perfectly well when we doing the test with a small number of user But I obs...
2018/03/15
[ "https://Stackoverflow.com/questions/49290741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4941350/" ]
There is a limit on `POST` request size in PHP. You can adjust [`post_max_size`](http://php.net/ini.core.php#ini.post-max-size) in your `php.ini`. As for database, I don't know how you are saving them in the database, but there are character/storage limitation on the database as well. Whenever I'm dealing with large `...
You need to Increase max\_input\_vars from php.ini OR you can set the following code in your .htaccess file. ``` php_value max_input_vars 3000 ```
271,524
I'm building a mansion to impress my friends. I've seen pictures of armor stands with ARMS. I searched how to summon one but all of them were either 1.9 or beta. (?how?) What command do i use to summon one that works?
2016/06/27
[ "https://gaming.stackexchange.com/questions/271524", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/151855/" ]
You can watch [this tutorial](https://www.youtube.com/watch?v=LoLRLKyswTI) (by Sethbling) to see how to show arms and more But if you want to show arms, try: `/summon ArmorStand ~ ~ ~ {ShowArms:1}` If you already spawned a ArmorStand and want to add arms (show arms), you can do: `/entitydata @e[r=2,type=ArmorStand] {...
ArmorStands with the `ShowArms:1b` tag will have arms: ``` /summon ArmorStand ~ ~ ~ {ShowArms:1b} ``` You could also set this tag on the closest already-placed ArmorStands like so: ``` /entitydata @e[type=ArmorStand,c=1] {ShowArms:1b} ```
40,057,611
I'm trying to draw a set of rectangles, each with a fill color representing some value between 0 and 1. Ideally, I would like to use any standard colormap. Note that the rectangles are not placed in a nice grid, so using `imagesc`, `surf`, or similar seems unpractical. Also, the `scatter` function does not seem to all...
2016/10/15
[ "https://Stackoverflow.com/questions/40057611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7022877/" ]
You can use `complete` from package `tidyr` : ``` library("tidyr") data %>% complete(area, year, fill = list(population.served = 0)) # # A tibble: 16 × 3 # area year population.served # <fctr> <fctr> <dbl> # 1 Cambridge Year.1 200 # 2 Cambridge Year.2 202 # 3 ...
Here's one approach, using `expand.grid` from base R to fill out your table: ``` # make a dummy table with all time steps for all units DF <- with(data, expand.grid(area = unique(area), year = unique(year))) # merge the data with that table, using all.x = TRUE to keep the larger set DF <- merge(DF, data, all.x = TRUE...
40,057,611
I'm trying to draw a set of rectangles, each with a fill color representing some value between 0 and 1. Ideally, I would like to use any standard colormap. Note that the rectangles are not placed in a nice grid, so using `imagesc`, `surf`, or similar seems unpractical. Also, the `scatter` function does not seem to all...
2016/10/15
[ "https://Stackoverflow.com/questions/40057611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7022877/" ]
Here's one approach, using `expand.grid` from base R to fill out your table: ``` # make a dummy table with all time steps for all units DF <- with(data, expand.grid(area = unique(area), year = unique(year))) # merge the data with that table, using all.x = TRUE to keep the larger set DF <- merge(DF, data, all.x = TRUE...
An approach with the fast `data.table` package: ``` library(data.table) setDT(data)[CJ(area = area, year = year, unique = TRUE), on = c('area', 'year') ][is.na(population.served), population.served := 0][] ``` the result is then: ``` population.served area year 1: 200 Cambridge...
40,057,611
I'm trying to draw a set of rectangles, each with a fill color representing some value between 0 and 1. Ideally, I would like to use any standard colormap. Note that the rectangles are not placed in a nice grid, so using `imagesc`, `surf`, or similar seems unpractical. Also, the `scatter` function does not seem to all...
2016/10/15
[ "https://Stackoverflow.com/questions/40057611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7022877/" ]
You can use `complete` from package `tidyr` : ``` library("tidyr") data %>% complete(area, year, fill = list(population.served = 0)) # # A tibble: 16 × 3 # area year population.served # <fctr> <fctr> <dbl> # 1 Cambridge Year.1 200 # 2 Cambridge Year.2 202 # 3 ...
An approach with the fast `data.table` package: ``` library(data.table) setDT(data)[CJ(area = area, year = year, unique = TRUE), on = c('area', 'year') ][is.na(population.served), population.served := 0][] ``` the result is then: ``` population.served area year 1: 200 Cambridge...
34,523,149
I've developed app that takes screenshot. But it only takes snapshot of app. I want to take snapshot out of app. I've researched answers but I don't find answer yet. Here is my code. ``` View view = getWindow().getDecorView().getRootView(); view.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap(view.ge...
2015/12/30
[ "https://Stackoverflow.com/questions/34523149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5729314/" ]
To take screen shot of the device screen, **Only if you have root** call the screencap binary like: ``` Process sh = Runtime.getRuntime().exec("su", null,null); OutputStream os = sh.getOutputStream(); os.write(("/system/bin/screencap -p " + Environment.getExternalStorageDirectory()+ "/img.png").getBytes("ASCII")); os...
i don't know your code in saveImageToAppFolder is what but you can try this: Note: you need set background of your app/activity to transparent (100%). ``` //your code below is extractly View view = getWindow().getDecorView().getRootView(); view.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap(view.g...
16,878,544
Want search every word in a dictionary what has the same character exactly at the second and last positon, and one times somewhere middle. examples: ``` statement - has the "t" at the second, fourth and last place severe = has "e" at 2,4,last abbxb = "b" at 2,3,last ``` wrong ``` abab = "b" only 2 times not 3 abxx...
2013/06/02
[ "https://Stackoverflow.com/questions/16878544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/632407/" ]
This is the regex that should work for you: ``` ^.(.)(?=(?:.*?\1){2})(?!(?:.*?\1){3}).*?\1$ ``` ### Live Demo: <http://www.rubular.com/r/bEMgutE7t5>
Using lookahead: ``` /^.(.)(?!(?:.*\1){3}).*\1(.*)\1$/ ``` Meaning: ``` /^.(.)(?!(?:.*\1){3}) # capture the second character if it is not # repeated more than twice after the 2nd position .*\1(.*)\1$ # match captured char 2 times the last one at the end ```
16,878,544
Want search every word in a dictionary what has the same character exactly at the second and last positon, and one times somewhere middle. examples: ``` statement - has the "t" at the second, fourth and last place severe = has "e" at 2,4,last abbxb = "b" at 2,3,last ``` wrong ``` abab = "b" only 2 times not 3 abxx...
2013/06/02
[ "https://Stackoverflow.com/questions/16878544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/632407/" ]
This is the regex that should work for you: ``` ^.(.)(?=(?:.*?\1){2})(?!(?:.*?\1){3}).*?\1$ ``` ### Live Demo: <http://www.rubular.com/r/bEMgutE7t5>
``` my @ok = grep {/^.(\w)/; /^.$1[^$1]*?$1[^$1]*$1$/ } @wordlist; ```
16,878,544
Want search every word in a dictionary what has the same character exactly at the second and last positon, and one times somewhere middle. examples: ``` statement - has the "t" at the second, fourth and last place severe = has "e" at 2,4,last abbxb = "b" at 2,3,last ``` wrong ``` abab = "b" only 2 times not 3 abxx...
2013/06/02
[ "https://Stackoverflow.com/questions/16878544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/632407/" ]
`(?:(?!STRING).)*` is `STRING` as `[^CHAR]*` is to `CHAR`, so what you want is: ```none ^. # Ignore first char (.) # Capture second char (?:(?!\1).)* # Any number of chars that aren't the second char \1 # Second char (?:(?!\1).)* # Any number of chars that aren't the second char ...
Using lookahead: ``` /^.(.)(?!(?:.*\1){3}).*\1(.*)\1$/ ``` Meaning: ``` /^.(.)(?!(?:.*\1){3}) # capture the second character if it is not # repeated more than twice after the 2nd position .*\1(.*)\1$ # match captured char 2 times the last one at the end ```
16,878,544
Want search every word in a dictionary what has the same character exactly at the second and last positon, and one times somewhere middle. examples: ``` statement - has the "t" at the second, fourth and last place severe = has "e" at 2,4,last abbxb = "b" at 2,3,last ``` wrong ``` abab = "b" only 2 times not 3 abxx...
2013/06/02
[ "https://Stackoverflow.com/questions/16878544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/632407/" ]
`(?:(?!STRING).)*` is `STRING` as `[^CHAR]*` is to `CHAR`, so what you want is: ```none ^. # Ignore first char (.) # Capture second char (?:(?!\1).)* # Any number of chars that aren't the second char \1 # Second char (?:(?!\1).)* # Any number of chars that aren't the second char ...
``` my @ok = grep {/^.(\w)/; /^.$1[^$1]*?$1[^$1]*$1$/ } @wordlist; ```
56,804,266
We are using [KubeDB](https://kubedb.com/docs/0.10.0/guides/redis/) in our cluster to manage our DB's. So Redis is deployed via a [KubeDB Redis object](https://kubedb.com/docs/0.10.0/concepts/databases/redis/) and KubeDB attaches a PVC to the Redis pod. Unfortunately KubeDB doesn't support any restoring or backing up...
2019/06/28
[ "https://Stackoverflow.com/questions/56804266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2591194/" ]
Sooo, a few hours later, my teammate remembered that Redis executes a save to dump on [shutdown](https://redis.io/commands/shutdown). Instead of deleting the pod using `kubectl delete pod` I now changed the code to run a `SHUTDOWN NOSAVE` using the `redis-cli`. ``` kubectl exec <redis-pod> -- /bin/bash -c 'redis-cli ...
Restore Redis on Kubernetes AOF = yes: -------------------------------------- The first thing to do is remove redis deployment from kubernetes server: ``` kubectl delete -f ./redis.yaml ``` Attach to the redis persistent storage (PVC) on mounted file system it can be GlusterFS - Volume, Azure Storage - File Share, ...
38,138,478
I have a print table code fiddle [LINK](http://jsfiddle.net/9DbEP/1060/) Check my code: ``` function printData() { var divToPrint=document.getElementById("printTable"); console.log(divToPrint.outerHTML); newWin= window.open(""); newWin.document.write(divToPrint.outerHTML); newWin.print(); newWin.clo...
2016/07/01
[ "https://Stackoverflow.com/questions/38138478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4387657/" ]
Please find chrome driver here <https://sites.google.com/a/chromium.org/chromedriver/downloads>
Use this Selenium site you have drivers for all browsers even for phone's.. Check it <http://www.seleniumhq.org/download/> - You may find there chrome webdriver 2.22Version
38,138,478
I have a print table code fiddle [LINK](http://jsfiddle.net/9DbEP/1060/) Check my code: ``` function printData() { var divToPrint=document.getElementById("printTable"); console.log(divToPrint.outerHTML); newWin= window.open(""); newWin.document.write(divToPrint.outerHTML); newWin.print(); newWin.clo...
2016/07/01
[ "https://Stackoverflow.com/questions/38138478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4387657/" ]
The versions on [the chromedriver download page](http://chromedriver.storage.googleapis.com/index.html) are sorted alphabetically, not numerically or chronologically. That means that `2.9` appears at the bottom of the page, which might make it look like the "last" or "most recent" version. The actual most recent versio...
Use this Selenium site you have drivers for all browsers even for phone's.. Check it <http://www.seleniumhq.org/download/> - You may find there chrome webdriver 2.22Version
43,917
I am traveling from Stockholm to Dubai and Dubai to Nairobi using two different airlines. I have Kenyan nationality and can't go through Immigration because I don't have a Dubai visa. How I will get my luggage?
2015/02/27
[ "https://travel.stackexchange.com/questions/43917", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/27260/" ]
If your luggage is not checked through, then I am afraid you will have to collect it and to do that you'll need a visa as the baggage carousels are *after* the immigration counters. The sequence is: 1. De-plane. 2. Depending on the terminal, you'll have a long walk (and then go down a few flights of stairs) or a shor...
Do you plan to actually immigrate into Dubai (will you leave the airport)? Without a visa you will not be able to leave the transit area of the airport. It sounds like you are just passing through Dubai on a layover. You will be forced to go through arrival security check after you deplane no matter what your Nationa...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
Of course a method can return NSRange. But returning structures require special attention to the compiler because how the method is invoked is usually different (`objc_msgSend_stret` vs. `objc_msgSend`). Please make sure you declare `phrase` as ``` Phrase* phrase = ...; ``` so that the compiler knows `-rangeInStri...
> > Can a method return an NSRange? > > > Yes. > > This method is called within the Phrase object by other methods without problems. … When I call this method from outside the class I get a compile error. … The compiler says 'incompatible types in assignment'. > > > Remember to `#import` Phrase.h into the im...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
Of course a method can return NSRange. But returning structures require special attention to the compiler because how the method is invoked is usually different (`objc_msgSend_stret` vs. `objc_msgSend`). Please make sure you declare `phrase` as ``` Phrase* phrase = ...; ``` so that the compiler knows `-rangeInStri...
I don't think this is the answer, but NSRange.location is declared as NSUInteger. By comparing it to -1, you are comparing an unsigned value to a signed value. The only other answer I can think of is that the .m file you are making the call from has not imported the header Phrase.h. Now, I know you believe it has, but...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
Of course a method can return NSRange. But returning structures require special attention to the compiler because how the method is invoked is usually different (`objc_msgSend_stret` vs. `objc_msgSend`). Please make sure you declare `phrase` as ``` Phrase* phrase = ...; ``` so that the compiler knows `-rangeInStri...
Yes, you can return C structs in methods. That is not the problem. Also, location is an NSUInteger and will never be -1. Use NSNotFound to test for that. How is the instance of your Phrase object typed? Did you use `id` instead of `Phrase *`? Have you properly imported the Phrase header? You should give us more infor...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
Of course a method can return NSRange. But returning structures require special attention to the compiler because how the method is invoked is usually different (`objc_msgSend_stret` vs. `objc_msgSend`). Please make sure you declare `phrase` as ``` Phrase* phrase = ...; ``` so that the compiler knows `-rangeInStri...
In response to some questions that are coming up: ``` #import <Foundation/Foundation.h> #import "OverlayView.h" #import "Phrase.h" #import "TimerPaneView.h" ``` Is the header in the MainPane.h, the class header for where the call is being made. In the header for MainPane.h, phrase is declared: ``` Phrase ...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
> > Can a method return an NSRange? > > > Yes. > > This method is called within the Phrase object by other methods without problems. … When I call this method from outside the class I get a compile error. … The compiler says 'incompatible types in assignment'. > > > Remember to `#import` Phrase.h into the im...
I don't think this is the answer, but NSRange.location is declared as NSUInteger. By comparing it to -1, you are comparing an unsigned value to a signed value. The only other answer I can think of is that the .m file you are making the call from has not imported the header Phrase.h. Now, I know you believe it has, but...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
> > Can a method return an NSRange? > > > Yes. > > This method is called within the Phrase object by other methods without problems. … When I call this method from outside the class I get a compile error. … The compiler says 'incompatible types in assignment'. > > > Remember to `#import` Phrase.h into the im...
Yes, you can return C structs in methods. That is not the problem. Also, location is an NSUInteger and will never be -1. Use NSNotFound to test for that. How is the instance of your Phrase object typed? Did you use `id` instead of `Phrase *`? Have you properly imported the Phrase header? You should give us more infor...
2,595,871
Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too. **Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView. Link: [Javascript text...
2010/04/07
[ "https://Stackoverflow.com/questions/2595871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173781/" ]
> > Can a method return an NSRange? > > > Yes. > > This method is called within the Phrase object by other methods without problems. … When I call this method from outside the class I get a compile error. … The compiler says 'incompatible types in assignment'. > > > Remember to `#import` Phrase.h into the im...
In response to some questions that are coming up: ``` #import <Foundation/Foundation.h> #import "OverlayView.h" #import "Phrase.h" #import "TimerPaneView.h" ``` Is the header in the MainPane.h, the class header for where the call is being made. In the header for MainPane.h, phrase is declared: ``` Phrase ...
57,546,243
I have this data's is there a way to get all of these? already tried `this._data.forEach` but it is not working thanks! ``` data() { return { childData: '', credit: '', company: '', email: '', first_name: '', middle_name: '', terms: '', last_name: '', phone: '', mobile: '', ...
2019/08/18
[ "https://Stackoverflow.com/questions/57546243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10022569/" ]
try this perhaps: ``` =QUERY(IMPORTXML(B4, "//*[@id='historical-data']/div/div[2]/table/tbody/tr/td[2]"), "limit 100", 0) ```
The `[1:100]` syntax does not work. Try `[position()<=100]` instead: ``` =importxml(B4,"//*[@id='historical-data']/div/div[2]/table/tbody/tr[position()<=100]/td[2]") ```
57,546,243
I have this data's is there a way to get all of these? already tried `this._data.forEach` but it is not working thanks! ``` data() { return { childData: '', credit: '', company: '', email: '', first_name: '', middle_name: '', terms: '', last_name: '', phone: '', mobile: '', ...
2019/08/18
[ "https://Stackoverflow.com/questions/57546243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10022569/" ]
try this perhaps: ``` =QUERY(IMPORTXML(B4, "//*[@id='historical-data']/div/div[2]/table/tbody/tr/td[2]"), "limit 100", 0) ```
I switched IMPORTXML for IMPORTHTML to give quite an elegant solution: ``` =query(importhtml(B4,"table",1),"select Col2 limit 110 offset 1",0) ``` Shoutout to @player0 for getting me 90% there.
45,589,463
i've read a lot of blogs, tutorials & co but i don't get something about the dynamic binding in java. When i create the object called "myspecialcar" it's creates an object from the class "car" as type of the class vehicle as a dynamic binding right? So java know that when i execute the method *myspecialcar.getType()* ...
2017/08/09
[ "https://Stackoverflow.com/questions/45589463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5747959/" ]
You faced the [fields hiding](http://docs.oracle.com/javase/tutorial/java/IandI/hidevariables.html). > > Within a class, a field that has the same name as a field in the > superclass hides the superclass's field, even if their types are > different. Within the subclass, the field in the superclass cannot be > refe...
There is a difference between `hiding` and `overriding`. You can not override class fields, but rather class methods. This means in your concrete example that ``` Vehicle mySpecialCar = new Car() // use upperCase and lowerUpperCase pls ``` You have a type of `Vehicle` which is an instance of `Car`. The over riden me...
45,589,463
i've read a lot of blogs, tutorials & co but i don't get something about the dynamic binding in java. When i create the object called "myspecialcar" it's creates an object from the class "car" as type of the class vehicle as a dynamic binding right? So java know that when i execute the method *myspecialcar.getType()* ...
2017/08/09
[ "https://Stackoverflow.com/questions/45589463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5747959/" ]
You do not override class variables in Java you hide them. Overriding is for instance methods. Hiding is different from overriding. In your case you are hiding the member variable of super class. But after creating the object you can access the hidden member of the super class.
There is a difference between `hiding` and `overriding`. You can not override class fields, but rather class methods. This means in your concrete example that ``` Vehicle mySpecialCar = new Car() // use upperCase and lowerUpperCase pls ``` You have a type of `Vehicle` which is an instance of `Car`. The over riden me...
45,589,463
i've read a lot of blogs, tutorials & co but i don't get something about the dynamic binding in java. When i create the object called "myspecialcar" it's creates an object from the class "car" as type of the class vehicle as a dynamic binding right? So java know that when i execute the method *myspecialcar.getType()* ...
2017/08/09
[ "https://Stackoverflow.com/questions/45589463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5747959/" ]
Instance Method Rule -------------------- When an instance method is invoked on an object using a reference, it is the *class* of the current object denoted by the reference, not the *type* of the reference, that determines which method implementation will be executed. Instance Property/Field Rule -------------------...
There is a difference between `hiding` and `overriding`. You can not override class fields, but rather class methods. This means in your concrete example that ``` Vehicle mySpecialCar = new Car() // use upperCase and lowerUpperCase pls ``` You have a type of `Vehicle` which is an instance of `Car`. The over riden me...
23,434
A friend of a friend has on multiple occasions aggressively asked how my self-study for software engineering interviews is going. Most recently I answered very briefly, because I find it too nosy and the person to be arrogant and presumptuous. I don't like for example that he's convinced that I seem too calm about the ...
2019/11/11
[ "https://interpersonal.stackexchange.com/questions/23434", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4886/" ]
It sounds like you have already figured out this person's *motivation* for asking you questions - they want to give you advice. "Advice-giver" is a [recognised personality trait](https://www.psychologytoday.com/gb/blog/evolution-the-self/201308/what-you-should-know-about-advice-givers), and many do it for their own ego...
From the way you describe it in your question, it sounds to me like you're already dealing with the situation perfectly well. As you yourself have said: you let them ramble on, you were honest with them when asked for feedback, then later you distanced yourself from them. It sounds like you have already "convey[ed] t...
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
In case, if you are getting the same error in latest environment (VS 2017/.NET Framework 4.6.x) and with entityframeworks like 6.1 or 6.2, here is the solution; Downgrade your entityframework to 6.0. It'll work.
This question is now the top SO answer for this question so I figured I would answer it generally here. The `The type 'BLAH' exists in both` error often pops up in the following occassions: **1. DUPLICATE FILES** - (often very simple) This is notoriously the case with .dll files. In most cases of duplication, deletio...
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Use using at the top of your code: ``` using MaxLength = System.ComponentModel.DataAnnotations ```
This question is now the top SO answer for this question so I figured I would answer it generally here. The `The type 'BLAH' exists in both` error often pops up in the following occassions: **1. DUPLICATE FILES** - (often very simple) This is notoriously the case with .dll files. In most cases of duplication, deletio...
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
In case, if you are getting the same error in latest environment (VS 2017/.NET Framework 4.6.x) and with entityframeworks like 6.1 or 6.2, here is the solution; Downgrade your entityframework to 6.0. It'll work.
MaxLength is not a function, it's an Attribute. You can use the using directive in each file to specify the current correct context. Or just type the full namespace, e.g. `System.ComponentModel.DataAnnotations.MaxLength`
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Just Uninstall EntityFramework from packages and reinstall it(EntityFramework). It works for me. Just follow the steps mentioned below: [![1.Right click on reference 2.Click on manage nugetpackages](https://i.stack.imgur.com/cfYdB.png)](https://i.stack.imgur.com/cfYdB.png) 1.Right click on reference 2.Click on manage...
MaxLength is not a function, it's an Attribute. You can use the using directive in each file to specify the current correct context. Or just type the full namespace, e.g. `System.ComponentModel.DataAnnotations.MaxLength`
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Qualify the attribute with the desired namespace ``` [System.ComponentModel.DataAnnotations.MaxLength(50)] public string LastName { get; set; } ```
This question is now the top SO answer for this question so I figured I would answer it generally here. The `The type 'BLAH' exists in both` error often pops up in the following occassions: **1. DUPLICATE FILES** - (often very simple) This is notoriously the case with .dll files. In most cases of duplication, deletio...
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Use using at the top of your code: ``` using MaxLength = System.ComponentModel.DataAnnotations ```
Try using extern alias <http://msdn.microsoft.com/en-us/library/ms173212.aspx> to differentiate between the two assemblies Also check out <http://bartdesmet.net/blogs/bart/archive/2006/10/07/4502.aspx> near the bottom of the page is an example
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Qualify the attribute with the desired namespace ``` [System.ComponentModel.DataAnnotations.MaxLength(50)] public string LastName { get; set; } ```
MaxLength is not a function, it's an Attribute. You can use the using directive in each file to specify the current correct context. Or just type the full namespace, e.g. `System.ComponentModel.DataAnnotations.MaxLength`
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Just Uninstall EntityFramework from packages and reinstall it(EntityFramework). It works for me. Just follow the steps mentioned below: [![1.Right click on reference 2.Click on manage nugetpackages](https://i.stack.imgur.com/cfYdB.png)](https://i.stack.imgur.com/cfYdB.png) 1.Right click on reference 2.Click on manage...
In case, if you are getting the same error in latest environment (VS 2017/.NET Framework 4.6.x) and with entityframeworks like 6.1 or 6.2, here is the solution; Downgrade your entityframework to 6.0. It'll work.
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Qualify the attribute with the desired namespace ``` [System.ComponentModel.DataAnnotations.MaxLength(50)] public string LastName { get; set; } ```
Try using extern alias <http://msdn.microsoft.com/en-us/library/ms173212.aspx> to differentiate between the two assemblies Also check out <http://bartdesmet.net/blogs/bart/archive/2006/10/07/4502.aspx> near the bottom of the page is an example
10,840,872
I am currently going through a tutorial using Visual Studio 11 beta. When trying to set the max length of a field value in one of my classes: ``` [MaxLength(50)] public string LastName { get; set; } ``` It errors out and wont let me compile because the `MaxLength()` function exists in two places: > > Error 4 The t...
2012/05/31
[ "https://Stackoverflow.com/questions/10840872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1022305/" ]
Use using at the top of your code: ``` using MaxLength = System.ComponentModel.DataAnnotations ```
MaxLength is not a function, it's an Attribute. You can use the using directive in each file to specify the current correct context. Or just type the full namespace, e.g. `System.ComponentModel.DataAnnotations.MaxLength`
609,275
I administer a large number of ESXi hosts, and in order to do that efficiently, I pretty much need to have SSH allowed into the hosts at all times, as it's just far too burdensome to enable and disable SSH access through vCenter/vSphere on every host every time I need to log into a host and view the CLI or SCP files be...
2014/07/01
[ "https://serverfault.com/questions/609275", "https://serverfault.com", "https://serverfault.com/users/118258/" ]
This particular alert can be controlled in the `Advanced Settings` under the `Configuration` tab for the host in question. Once there, go to the `UserVars` category and scroll down to `UserVars.SuppressShellWarning`. Change the value from `0` to `1`, and you will no longer be warned that the host in question is allowin...
In vSphere 5.5 and greater, this is easily accomplished from the vSphere Web Client interface by clicking the **Suppress Warning** link to the right of the warning text... [![enter image description here](https://i.stack.imgur.com/IdLp5.png)](https://i.stack.imgur.com/IdLp5.png) ![enter image description here](https:...
609,275
I administer a large number of ESXi hosts, and in order to do that efficiently, I pretty much need to have SSH allowed into the hosts at all times, as it's just far too burdensome to enable and disable SSH access through vCenter/vSphere on every host every time I need to log into a host and view the CLI or SCP files be...
2014/07/01
[ "https://serverfault.com/questions/609275", "https://serverfault.com", "https://serverfault.com/users/118258/" ]
There are different ways to change this option. All these solutions are listed in the `VMware KB 2003637`. About SSH, you might find useful the `esxcli` way with : `vim-cmd hostsvc/advopt/update UserVars.SuppressShellWarning long 1` The full documentation : [Cluster warning for ESXi Shell and SSH appear on an ESXi...
In vSphere 5.5 and greater, this is easily accomplished from the vSphere Web Client interface by clicking the **Suppress Warning** link to the right of the warning text... [![enter image description here](https://i.stack.imgur.com/IdLp5.png)](https://i.stack.imgur.com/IdLp5.png) ![enter image description here](https:...
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
What do you mean to check ports on hosts remotely? Do you just want to connect to the port to see if it is open? The check\_tcp plugin will do that, if, that's what you want to do. Not quite sure what you mean.
i really like nagios. have been using it for years. i even do some oracle database management with it, but what nagios really is is an availability monitoring tool. i think what you are asking for is better fulfilled by another software like [openvas](http://www.openvas.org/) or [snort](http://www.snort.org/).
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
What do you mean to check ports on hosts remotely? Do you just want to connect to the port to see if it is open? The check\_tcp plugin will do that, if, that's what you want to do. Not quite sure what you mean.
I suppose what you want is to make sure that there is no "positive" response on any port apart from a short whitelist. I can see how you would prefer not to have 65000 check\_tcp:s on each host :) Mind you, I'm not sure nagios is really your best bet for this. Partly, it risks being a test that is always red and also,...
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
What do you mean to check ports on hosts remotely? Do you just want to connect to the port to see if it is open? The check\_tcp plugin will do that, if, that's what you want to do. Not quite sure what you mean.
It sounds like you need a nagios check for changes/alerts in [pbnj](http://pbnj.sourceforge.net/) Use nagios to monitor the tool that tracks the changes, don't try to shim Nagios to track the changes.
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
I suppose what you want is to make sure that there is no "positive" response on any port apart from a short whitelist. I can see how you would prefer not to have 65000 check\_tcp:s on each host :) Mind you, I'm not sure nagios is really your best bet for this. Partly, it risks being a test that is always red and also,...
i really like nagios. have been using it for years. i even do some oracle database management with it, but what nagios really is is an availability monitoring tool. i think what you are asking for is better fulfilled by another software like [openvas](http://www.openvas.org/) or [snort](http://www.snort.org/).
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
It sounds like you need a nagios check for changes/alerts in [pbnj](http://pbnj.sourceforge.net/) Use nagios to monitor the tool that tracks the changes, don't try to shim Nagios to track the changes.
i really like nagios. have been using it for years. i even do some oracle database management with it, but what nagios really is is an availability monitoring tool. i think what you are asking for is better fulfilled by another software like [openvas](http://www.openvas.org/) or [snort](http://www.snort.org/).
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
This guy has developed a nagios script for linux that does exactly what you are asking: <http://www.altsec.info/check_scan.html> I'm trying now to find a Windows equivalent Miguel
i really like nagios. have been using it for years. i even do some oracle database management with it, but what nagios really is is an availability monitoring tool. i think what you are asking for is better fulfilled by another software like [openvas](http://www.openvas.org/) or [snort](http://www.snort.org/).
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
This guy has developed a nagios script for linux that does exactly what you are asking: <http://www.altsec.info/check_scan.html> I'm trying now to find a Windows equivalent Miguel
I suppose what you want is to make sure that there is no "positive" response on any port apart from a short whitelist. I can see how you would prefer not to have 65000 check\_tcp:s on each host :) Mind you, I'm not sure nagios is really your best bet for this. Partly, it risks being a test that is always red and also,...
127,635
I need to monitor open and closed ports on dozens of hosts. I've found a [Nagios](http://en.wikipedia.org/wiki/Nagios) plugin that does what I need, but I would have to use this script through [NRPE](http://en.wikipedia.org/wiki/Nagios#Nagios_Remote_Plugin_Executor). Some of the hosts are powered by Linux and they all...
2010/03/30
[ "https://serverfault.com/questions/127635", "https://serverfault.com", "https://serverfault.com/users/14850/" ]
This guy has developed a nagios script for linux that does exactly what you are asking: <http://www.altsec.info/check_scan.html> I'm trying now to find a Windows equivalent Miguel
It sounds like you need a nagios check for changes/alerts in [pbnj](http://pbnj.sourceforge.net/) Use nagios to monitor the tool that tracks the changes, don't try to shim Nagios to track the changes.
29,442,424
The following is code that I have put together with some help from SO. I am trying to be able to implement the `$select` statement, as well as the `$search` statement on the same page. The `$select` statement works fine, but I do not know how to call the `$search` statement to execute when the user searches using the f...
2015/04/04
[ "https://Stackoverflow.com/questions/29442424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4564055/" ]
You can you `touchesBegan` for that. Here is example code for you: ``` override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { for touch: AnyObject in touches{ let location = touch.locationInNode(self) if self.nodeAtPoint(location) == self.playButton{ //your code ...
You should add the `UIButton` programatically, instead of in IB, to the `SKScene`'s `SKView` (in `didMoveToView` for example). You can then set the target for the button with `button.addTarget:action:forControlEvents:`. Just remember to call `button.removeFromSuperview()` in `willMoveFromView` otherwise you'll see the ...
29,442,424
The following is code that I have put together with some help from SO. I am trying to be able to implement the `$select` statement, as well as the `$search` statement on the same page. The `$select` statement works fine, but I do not know how to call the `$search` statement to execute when the user searches using the f...
2015/04/04
[ "https://Stackoverflow.com/questions/29442424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4564055/" ]
You appear to be mixing UIKit and SpriteKit here. I would personally advise against using UIButtons in conjunction with Sprite Kit. Is there a specific reason for doing so? There are two ways you can implement button behavior within a Sprite Kit scene: 1. have the SKScene object handle the touches 2. have the button...
You should add the `UIButton` programatically, instead of in IB, to the `SKScene`'s `SKView` (in `didMoveToView` for example). You can then set the target for the button with `button.addTarget:action:forControlEvents:`. Just remember to call `button.removeFromSuperview()` in `willMoveFromView` otherwise you'll see the ...
967,261
Why isn't this script working? ``` $(function() { var isbn = $('input').val(); $('button').click(function() { $("#data").html('<iframe height="500" width="1000" src="http://books.google.com/books?vid=ISBN' + isbn + '" />'); }); }); ``` As you can see, I'm trying to do an extremely simple ISBN lo...
2009/06/08
[ "https://Stackoverflow.com/questions/967261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97939/" ]
It's not clear when your code gets called, but is this line: ``` var isbn = $('input').val(); ``` only called once at page-load time, whereas it should be within the click handler: ``` $('button').click(function() { var isbn = $('input').val(); $("#data").html('<iframe height="500" width="1000" src="http://...
Why not load the page you wanted to view through the ajax load technique, so fetching the html and displaying it within the element: ``` $(function() { var isbn = $('input').val(); $('button').click(function() { $("#data").load('http://books.google.com/books?vid=ISBN' + isbn); }); }); ```
967,261
Why isn't this script working? ``` $(function() { var isbn = $('input').val(); $('button').click(function() { $("#data").html('<iframe height="500" width="1000" src="http://books.google.com/books?vid=ISBN' + isbn + '" />'); }); }); ``` As you can see, I'm trying to do an extremely simple ISBN lo...
2009/06/08
[ "https://Stackoverflow.com/questions/967261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/97939/" ]
It's not clear when your code gets called, but is this line: ``` var isbn = $('input').val(); ``` only called once at page-load time, whereas it should be within the click handler: ``` $('button').click(function() { var isbn = $('input').val(); $("#data").html('<iframe height="500" width="1000" src="http://...
the problem is not your code but its the query string you have. please amend as follows and it should work: ``` var isbn = "1603038159"; $("#data").html('<iframe height="500" width="600" src="http://books.google.com/books?as_isbn=' + isbn); ```
55,710,561
i need some help to validate a jwt signature with a ECDSA public key. I'm reading the key from a .pem file with bouncy castle and using jjwt to do the validation. I'm getting an error while validating the signature. ``` Security.addProvider(new BouncyCastleProvider()); String jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ...
2019/04/16
[ "https://Stackoverflow.com/questions/55710561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2343794/" ]
This will work as well without mentioning any algorithm. ``` public boolean isTokenValid(String token) { try { String certificate = "GET_YOUR_PUBLIC_CERTIFICATE_HERE"; //Either from REST call or reading from a cert file. getPublicKeyAndParseToken(token, certificate); return true; } catc...
Problem found, i was using an old jjwt lib (0.6). Changed to 0.9 with the same code and it works as expected. Thanks
19,243,837
I am new to use Autolayouts, even this is my first try. Whatever I do with it, I end with a white screen as result. Here is my attempt. I have a `UIView`, let me say a `parentView` of frame `(60, 154, 200, 200)`. It is a subview to `self.view`. Then I have a dynamic view, say `dynamicView` of frame `(0, 0, 260, 100)`...
2013/10/08
[ "https://Stackoverflow.com/questions/19243837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/500625/" ]
i'll just address the dyanmicView being part of the parentView issue, then let you go from there **first**: if you are creating the view dynamically, then you're good to go, but if you've created it from storyboard, you'd have to detach it from it's parent then reattach it.. that's how you get rid of it's previous NSC...
Auto Layout Constraints is the best approach to what you are trying to achieve. Auto layout constraints are added automatically when you check the Use Autolayout option in the IB. Check out this tutorial which tells more about auto layouts in iOS6 <http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2> ...
441,419
I’m curious if I have a legitimate concern or if I’m just being overly paranoid. I have a rechargeable Lithium-Polymer battery (prismatic shaped) rated for a max charging temperature of 45 °C. The battery rests against a circuit board that I know can generate some heat when charging the battery (500 mA current via an...
2019/06/01
[ "https://electronics.stackexchange.com/questions/441419", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/77406/" ]
Lithium-Polymer service life is seriously degraded at high temperatures, especially when fully charged. The cooler you can keep the battery the better. I suggest using a more efficient switch-mode charging IC such as the TP5000.
Now, the question is: How much of it do the powerful chips that generate a lot of heat ("heat" is thermal energy) transfer into the battery; that's a question of considering where the heat goes. First thing to realize is that if you have a perfectly sealed, perfectly thermally isolated box, it's going to heat up forev...
472,937
When running msbuild.exe with ANT's exec task, errors in the .net code do not result in the build process failing. Why would this be?
2009/01/23
[ "https://Stackoverflow.com/questions/472937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I use Nant to run some MSBuild tasks. Every time I use the `failonbuild` attribute of that task, it fails for me. Looking at Apache's documentation for Ant, it would appear the same attribute is there as well. Are you using this attribute?
I arrived at a solution and used `Exec`'s `failonerror`, works like a charm.
472,937
When running msbuild.exe with ANT's exec task, errors in the .net code do not result in the build process failing. Why would this be?
2009/01/23
[ "https://Stackoverflow.com/questions/472937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I use Nant to run some MSBuild tasks. Every time I use the `failonbuild` attribute of that task, it fails for me. Looking at Apache's documentation for Ant, it would appear the same attribute is there as well. Are you using this attribute?
What do you let the msbuild task do ? When I used NAnt previously, I used the task to build a VS.NET solution. Right now, I'm not using NAnt anymore, I use msbuild instead. :)
472,937
When running msbuild.exe with ANT's exec task, errors in the .net code do not result in the build process failing. Why would this be?
2009/01/23
[ "https://Stackoverflow.com/questions/472937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I arrived at a solution and used `Exec`'s `failonerror`, works like a charm.
What do you let the msbuild task do ? When I used NAnt previously, I used the task to build a VS.NET solution. Right now, I'm not using NAnt anymore, I use msbuild instead. :)
40,049,978
I'm trying to get the currently displayed `ViewController` using the following: ``` let currentViewController = UIApplication.sharedApplication().keyWindow!.rootViewController?.presentedViewController ``` This property gives me the `TabBarController`. The only property after `presentedViewController` is "`childViewC...
2016/10/14
[ "https://Stackoverflow.com/questions/40049978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6758725/" ]
I would use a computed property instead of a filter and a method. I'd go through each cast member and if any of their groups is in `selected_groups` I'd allow it through the filter. I'd so this using `Array.some`. ``` results: function() { var self = this return self.cast.filter(function(person) { return pers...
Since filters are deprecated (in `v-for`, see Bill's comment), you should get into the habit of making computeds to do filtery things. (If you're on IE, you can't use [`includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) without a polyfill; you can use `indexOf.....
40,049,978
I'm trying to get the currently displayed `ViewController` using the following: ``` let currentViewController = UIApplication.sharedApplication().keyWindow!.rootViewController?.presentedViewController ``` This property gives me the `TabBarController`. The only property after `presentedViewController` is "`childViewC...
2016/10/14
[ "https://Stackoverflow.com/questions/40049978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6758725/" ]
I would use a computed property instead of a filter and a method. I'd go through each cast member and if any of their groups is in `selected_groups` I'd allow it through the filter. I'd so this using `Array.some`. ``` results: function() { var self = this return self.cast.filter(function(person) { return pers...
```js var demo = new Vue({ el: '#demo', data: { search: 're', people: [ {name: 'Koos', age: 30, eyes:'red'}, {name: 'Gert', age: 20, eyes:'blue'}, {name: 'Pieter', age: 12, eyes:'green'}, {name: 'Dawid', age: 67, eyes:'dark green'}, {name: 'Joha...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
JavaScript: 169 158 148 141 127 125 123 122 Characters ------------------------------------------------------ **Minified and Golfed:** ``` function g(n,s){for(l=s.split('\n'),n*=2;k=l.shift();)for(j=3;j;)n+=k[n-3]==(c=--j-1?'=':'-')?-2:k[n-1]==c?2:0;return n/2} ``` **Readable Version:** ``` function g(n, str) { ...
**VB.Net: 290 chars (320 bytes)** Requires Option Strict Off, Option Explicit Off ``` Function G(i,P) i=i*2-1 F=0 M="-" Q="=" Z=P.Split(Chr(10)) While E<Z.Length L=(" "& Z(E))(i-1) R=(Z(E)&" ")(i) J=L & R=" "&" " E-=(F=2Or J) i+=If(F=1,2*((L=M)-(R=M)),If(F=2,2*((L=Q)-(R=Q)),If(J,0,2+4*(L=Q Or(L=M And R<>Q))))) F=If(F...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
JavaScript: 169 158 148 141 127 125 123 122 Characters ------------------------------------------------------ **Minified and Golfed:** ``` function g(n,s){for(l=s.split('\n'),n*=2;k=l.shift();)for(j=3;j;)n+=k[n-3]==(c=--j-1?'=':'-')?-2:k[n-1]==c?2:0;return n/2} ``` **Readable Version:** ``` function g(n, str) { ...
Daniel's answer in C# - 173 chars ================================= After seeing Daniel Vassallo's solution, I was too ashamed of mine to post it. But here's Daniel's answer ported to C# for the heck of it. One major drawback in C# was having to do bounds checking, which cost 20 characters. ``` int G(string s,int n){...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
JavaScript: 169 158 148 141 127 125 123 122 Characters ------------------------------------------------------ **Minified and Golfed:** ``` function g(n,s){for(l=s.split('\n'),n*=2;k=l.shift();)for(j=3;j;)n+=k[n-3]==(c=--j-1?'=':'-')?-2:k[n-1]==c?2:0;return n/2} ``` **Readable Version:** ``` function g(n, str) { ...
Perl, ~~92~~ 91 chars ===================== ``` sub g{for$s(pop=~/.+/g){map$_[0]-=1-abs(index substr(" $s",$_[0]*2-2,3),$_),qw[= - =]}pop} ``` Another approach, ~~98~~ ~~97~~ ~~95~~ ~~94~~ ~~93~~ 92 chars ------------------------------------------------------------- ``` sub g{map{for$s(qw[= - =]){pos=$_[0]*2-2;$_[0...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
AWK - 68 77 79 chars -------------------- Pretty much a translation of Daniel's solution (we love ya man ;) ``` {for(i=0;i<3;){s=++i-2?"=":"-";if(s==$x)x--;else if(s!=$++x)x--}}END{print x} ``` But we can do away with `if/else` and replace it with `?:` ``` {for(i=0;i<3;){s=++i-2?"=":"-";s==$x?x--:s!=$++x?x--:x}}EN...
**VB.Net: 290 chars (320 bytes)** Requires Option Strict Off, Option Explicit Off ``` Function G(i,P) i=i*2-1 F=0 M="-" Q="=" Z=P.Split(Chr(10)) While E<Z.Length L=(" "& Z(E))(i-1) R=(Z(E)&" ")(i) J=L & R=" "&" " E-=(F=2Or J) i+=If(F=1,2*((L=M)-(R=M)),If(F=2,2*((L=Q)-(R=Q)),If(J,0,2+4*(L=Q Or(L=M And R<>Q))))) F=If(F...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
Ruby - 66 95 92 83 chars ======================== (Alternating rows idea from Daniel's answer) -------------------------------------------- ``` def f s,m m.each_line{|r|%w{= - =}.map{|i|s+=i==r[2*s-3]?-1:i==r[2*s-1]?1:0}} s end ``` 92 chars ``` def f s,m s=s*2-2 m.each_line{|r|%w{= - =}.each{|i|s+=i==r[s-1]?-2...
Daniel's answer in C# - 173 chars ================================= After seeing Daniel Vassallo's solution, I was too ashamed of mine to post it. But here's Daniel's answer ported to C# for the heck of it. One major drawback in C# was having to do bounds checking, which cost 20 characters. ``` int G(string s,int n){...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
AWK - 68 77 79 chars -------------------- Pretty much a translation of Daniel's solution (we love ya man ;) ``` {for(i=0;i<3;){s=++i-2?"=":"-";if(s==$x)x--;else if(s!=$++x)x--}}END{print x} ``` But we can do away with `if/else` and replace it with `?:` ``` {for(i=0;i<3;){s=++i-2?"=":"-";s==$x?x--:s!=$++x?x--:x}}EN...
Perl, ~~92~~ 91 chars ===================== ``` sub g{for$s(pop=~/.+/g){map$_[0]-=1-abs(index substr(" $s",$_[0]*2-2,3),$_),qw[= - =]}pop} ``` Another approach, ~~98~~ ~~97~~ ~~95~~ ~~94~~ ~~93~~ 92 chars ------------------------------------------------------------- ``` sub g{map{for$s(qw[= - =]){pos=$_[0]*2-2;$_[0...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
Ruby - 66 95 92 83 chars ======================== (Alternating rows idea from Daniel's answer) -------------------------------------------- ``` def f s,m m.each_line{|r|%w{= - =}.map{|i|s+=i==r[2*s-3]?-1:i==r[2*s-1]?1:0}} s end ``` 92 chars ``` def f s,m s=s*2-2 m.each_line{|r|%w{= - =}.each{|i|s+=i==r[s-1]?-2...
Perl, ~~92~~ 91 chars ===================== ``` sub g{for$s(pop=~/.+/g){map$_[0]-=1-abs(index substr(" $s",$_[0]*2-2,3),$_),qw[= - =]}pop} ``` Another approach, ~~98~~ ~~97~~ ~~95~~ ~~94~~ ~~93~~ 92 chars ------------------------------------------------------------- ``` sub g{map{for$s(qw[= - =]){pos=$_[0]*2-2;$_[0...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
JavaScript: 169 158 148 141 127 125 123 122 Characters ------------------------------------------------------ **Minified and Golfed:** ``` function g(n,s){for(l=s.split('\n'),n*=2;k=l.shift();)for(j=3;j;)n+=k[n-3]==(c=--j-1?'=':'-')?-2:k[n-1]==c?2:0;return n/2} ``` **Readable Version:** ``` function g(n, str) { ...
AWK - 68 77 79 chars -------------------- Pretty much a translation of Daniel's solution (we love ya man ;) ``` {for(i=0;i<3;){s=++i-2?"=":"-";if(s==$x)x--;else if(s!=$++x)x--}}END{print x} ``` But we can do away with `if/else` and replace it with `?:` ``` {for(i=0;i<3;){s=++i-2?"=":"-";s==$x?x--:s!=$++x?x--:x}}EN...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
Ruby - 66 95 92 83 chars ======================== (Alternating rows idea from Daniel's answer) -------------------------------------------- ``` def f s,m m.each_line{|r|%w{= - =}.map{|i|s+=i==r[2*s-3]?-1:i==r[2*s-1]?1:0}} s end ``` 92 chars ``` def f s,m s=s*2-2 m.each_line{|r|%w{= - =}.each{|i|s+=i==r[s-1]?-2...
**VB.Net: 290 chars (320 bytes)** Requires Option Strict Off, Option Explicit Off ``` Function G(i,P) i=i*2-1 F=0 M="-" Q="=" Z=P.Split(Chr(10)) While E<Z.Length L=(" "& Z(E))(i-1) R=(Z(E)&" ")(i) J=L & R=" "&" " E-=(F=2Or J) i+=If(F=1,2*((L=M)-(R=M)),If(F=2,2*((L=Q)-(R=Q)),If(J,0,2+4*(L=Q Or(L=M And R<>Q))))) F=If(F...
2,721,502
The challenge ------------- The shortest code by character count that will output the numeric solution, given a number and a valid string pattern, using the [Ghost Leg](http://en.wikipedia.org/wiki/Ghost_Leg) method. Examples -------- ``` Input: 3, "| | | | | | | | |-| |=| | | | | |-| | |-| |=| | | |-| |-| | |-|...
2010/04/27
[ "https://Stackoverflow.com/questions/2721502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180243/" ]
JavaScript: 169 158 148 141 127 125 123 122 Characters ------------------------------------------------------ **Minified and Golfed:** ``` function g(n,s){for(l=s.split('\n'),n*=2;k=l.shift();)for(j=3;j;)n+=k[n-3]==(c=--j-1?'=':'-')?-2:k[n-1]==c?2:0;return n/2} ``` **Readable Version:** ``` function g(n, str) { ...
Ruby - 66 95 92 83 chars ======================== (Alternating rows idea from Daniel's answer) -------------------------------------------- ``` def f s,m m.each_line{|r|%w{= - =}.map{|i|s+=i==r[2*s-3]?-1:i==r[2*s-1]?1:0}} s end ``` 92 chars ``` def f s,m s=s*2-2 m.each_line{|r|%w{= - =}.each{|i|s+=i==r[s-1]?-2...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
Seems like the answer is NO. While others here have helpfully suggested workarounds to try, the answer as to whether the piece of hardware I asked about exists in a single piece is NO.
The emulator that you want does exist. You are looking for an emulator that emulates a USB Floppy Drive. So the emulator connects to the computer via a USB cable, and the storage media is a USB Flash Drive. Do a Google search on "UFA1M44-100" and you will find one model of emulator that emulates a USB Floppy Drive. Yo...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
There's no way a USB anything can transparently emulate a floppy drive without a driver being preinstalled. The traditional PC floppy drive was an ISA device and appeared on specific I/O ports (0x3F0 to 0x3F6 IIRC). Reading and writing to these ports was how you talked to the floppy drive. USB peripherals talk to a ...
You can install XP in IDE mode and install the AHCI drivers afterwards, I did this on my netbook several times. I think it goes something like: * Set disk controller to IDE mode in bios, and install XP. * In device manager go to the disk controller and manually change the driver to the AHCI one. * Reboot into bios and...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
I don't think anyone sells something like that in one piece. There are, however, components on the market that should allow you to build that from scratch: 1. A GoTek or HxC that behaves like a "real" floppy 2. An *old* Floppy-to-USB adapter that was used to connect "real" floppies over USB. I don't think they're sti...
You can install XP in IDE mode and install the AHCI drivers afterwards, I did this on my netbook several times. I think it goes something like: * Set disk controller to IDE mode in bios, and install XP. * In device manager go to the disk controller and manually change the driver to the AHCI one. * Reboot into bios and...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
I don't think anyone sells something like that in one piece. There are, however, components on the market that should allow you to build that from scratch: 1. A GoTek or HxC that behaves like a "real" floppy 2. An *old* Floppy-to-USB adapter that was used to connect "real" floppies over USB. I don't think they're sti...
The emulator that you want does exist. You are looking for an emulator that emulates a USB Floppy Drive. So the emulator connects to the computer via a USB cable, and the storage media is a USB Flash Drive. Do a Google search on "UFA1M44-100" and you will find one model of emulator that emulates a USB Floppy Drive. Yo...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
Seems like the answer is NO. While others here have helpfully suggested workarounds to try, the answer as to whether the piece of hardware I asked about exists in a single piece is NO.
You can install XP in IDE mode and install the AHCI drivers afterwards, I did this on my netbook several times. I think it goes something like: * Set disk controller to IDE mode in bios, and install XP. * In device manager go to the disk controller and manually change the driver to the AHCI one. * Reboot into bios and...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
There's no way a USB anything can transparently emulate a floppy drive without a driver being preinstalled. The traditional PC floppy drive was an ISA device and appeared on specific I/O ports (0x3F0 to 0x3F6 IIRC). Reading and writing to these ports was how you talked to the floppy drive. USB peripherals talk to a ...
The emulator that you want does exist. You are looking for an emulator that emulates a USB Floppy Drive. So the emulator connects to the computer via a USB cable, and the storage media is a USB Flash Drive. Do a Google search on "UFA1M44-100" and you will find one model of emulator that emulates a USB Floppy Drive. Yo...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
There's no way a USB anything can transparently emulate a floppy drive without a driver being preinstalled. The traditional PC floppy drive was an ISA device and appeared on specific I/O ports (0x3F0 to 0x3F6 IIRC). Reading and writing to these ports was how you talked to the floppy drive. USB peripherals talk to a ...
To boil down what others are saying: A USB device itself is incapable of *making itself appear* as a traditional floppy drive, because USB devices don't have that kind of access. However, if you're lucky, your BIOS will have support for USB floppy drives and *it* can apply the same virtualization trick that it uses t...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
I don't think anyone sells something like that in one piece. There are, however, components on the market that should allow you to build that from scratch: 1. A GoTek or HxC that behaves like a "real" floppy 2. An *old* Floppy-to-USB adapter that was used to connect "real" floppies over USB. I don't think they're sti...
To boil down what others are saying: A USB device itself is incapable of *making itself appear* as a traditional floppy drive, because USB devices don't have that kind of access. However, if you're lucky, your BIOS will have support for USB floppy drives and *it* can apply the same virtualization trick that it uses t...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
You can install XP in IDE mode and install the AHCI drivers afterwards, I did this on my netbook several times. I think it goes something like: * Set disk controller to IDE mode in bios, and install XP. * In device manager go to the disk controller and manually change the driver to the AHCI one. * Reboot into bios and...
To boil down what others are saying: A USB device itself is incapable of *making itself appear* as a traditional floppy drive, because USB devices don't have that kind of access. However, if you're lucky, your BIOS will have support for USB floppy drives and *it* can apply the same virtualization trick that it uses t...
5,533
I'm aware there are floppy emulators that are installed to 3.5″ bays where disk images are stored on a flash drive. But what I need now is the opposite: essentially a USB dongle that emulates the floppy drive hardware with a disk inside. Something that older OS installers would recognize. The need came up when I tried...
2018/01/20
[ "https://retrocomputing.stackexchange.com/questions/5533", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/7758/" ]
Seems like the answer is NO. While others here have helpfully suggested workarounds to try, the answer as to whether the piece of hardware I asked about exists in a single piece is NO.
To boil down what others are saying: A USB device itself is incapable of *making itself appear* as a traditional floppy drive, because USB devices don't have that kind of access. However, if you're lucky, your BIOS will have support for USB floppy drives and *it* can apply the same virtualization trick that it uses t...
519,832
I want to write the following sentence in a compact way: "The difference between the old scheme and the new scheme lies in..." Which one of the following is correct? 1. The difference between the old and **new scheme** lies in... 2. The difference between the old and **new schemes** lies in... 3. The difference betw...
2019/12/04
[ "https://english.stackexchange.com/questions/519832", "https://english.stackexchange.com", "https://english.stackexchange.com/users/368826/" ]
All are variations of parallelism, with two distinct wrinkles: * Whether the determiner or article must be repeated or not * Whether the head noun is singular or plural All four constructions are valid, but produce slight differences in emphasis. --- > > The difference between **the old and new** scheme lies in......
Replacing the premodifiers with less esoteric ones (and assuming that that does not affect the analysis too greatly): > > 0' *The difference between the old model and the new model* ... > > > is the undeleted (part-) sentence, obviously correct for a single new model. ..............................................
519,832
I want to write the following sentence in a compact way: "The difference between the old scheme and the new scheme lies in..." Which one of the following is correct? 1. The difference between the old and **new scheme** lies in... 2. The difference between the old and **new schemes** lies in... 3. The difference betw...
2019/12/04
[ "https://english.stackexchange.com/questions/519832", "https://english.stackexchange.com", "https://english.stackexchange.com/users/368826/" ]
I would say that you do not require the last two articles, as neither is the focus of identification. What is being identified is 'the' difference : > > The difference between old and new schemes lies in ... > > > --- It could be argued that this is an example of the zero article, that is to say the absent arti...
Replacing the premodifiers with less esoteric ones (and assuming that that does not affect the analysis too greatly): > > 0' *The difference between the old model and the new model* ... > > > is the undeleted (part-) sentence, obviously correct for a single new model. ..............................................
519,832
I want to write the following sentence in a compact way: "The difference between the old scheme and the new scheme lies in..." Which one of the following is correct? 1. The difference between the old and **new scheme** lies in... 2. The difference between the old and **new schemes** lies in... 3. The difference betw...
2019/12/04
[ "https://english.stackexchange.com/questions/519832", "https://english.stackexchange.com", "https://english.stackexchange.com/users/368826/" ]
All are variations of parallelism, with two distinct wrinkles: * Whether the determiner or article must be repeated or not * Whether the head noun is singular or plural All four constructions are valid, but produce slight differences in emphasis. --- > > The difference between **the old and new** scheme lies in......
I would argue for one of the following forms, my preference being for the first. > > 1) ... the old scheme and the new scheme ... > > > 2) ... the old and the new schemes ... > > > 3) ... the two schemes, old and new, ... > > > This is because the difference is between a scheme and a scheme, not between "an ...
519,832
I want to write the following sentence in a compact way: "The difference between the old scheme and the new scheme lies in..." Which one of the following is correct? 1. The difference between the old and **new scheme** lies in... 2. The difference between the old and **new schemes** lies in... 3. The difference betw...
2019/12/04
[ "https://english.stackexchange.com/questions/519832", "https://english.stackexchange.com", "https://english.stackexchange.com/users/368826/" ]
I would say that you do not require the last two articles, as neither is the focus of identification. What is being identified is 'the' difference : > > The difference between old and new schemes lies in ... > > > --- It could be argued that this is an example of the zero article, that is to say the absent arti...
I would argue for one of the following forms, my preference being for the first. > > 1) ... the old scheme and the new scheme ... > > > 2) ... the old and the new schemes ... > > > 3) ... the two schemes, old and new, ... > > > This is because the difference is between a scheme and a scheme, not between "an ...
62,006,211
Having worked through a course on Pluralsight (.NET Logging Done Right: An Opinionated Approach Using Serilog by Erik Dahl) I began implementing a similar solution in my own ASP.Net Core 3.1 MVC project. As an initial proof of concept I downloaded his complete sample code from the course and integrated his logger class...
2020/05/25
[ "https://Stackoverflow.com/questions/62006211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7801941/" ]
You can use `trackBy` on **\*ngFor** to deal with changes. It allows you to check each element and rerenders only the ones that are new. You can use an id or another unique elements to check them. Template : ```js <tr *ngFor="let element of objects$ | async; trackBy: trackByFunction"> </tr ``` Component : ```js tr...
It is an **observable** element. So you could **subscribe** to that object and Angular do check for changes and will update your variable without reloads. Something like this: ```js this.yourWebSocketService.yourObservableObject.subscribe( data=> { this.objects$ = data } ```