qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
25,733,955
``` valid = {'Temp': [10, 55], 'rain_percent': [49, 100], 'humidity': [30,50]} data = {'Temp': 30.45, 'rain_percent': 80.56 } min_temp , max_temp = valid['Temp'] if not(min_temp <= data['Temp'] <= max_temp): print "Bad Temp" min_rain , max_rain = valid['rain_percent'] if not(min_rain <= data['rain_percent'] <= ma...
2014/09/08
[ "https://Stackoverflow.com/questions/25733955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4012241/" ]
This can be achieved by using the multiprocessing module in python, please find the code below ``` #!/usr/bin/python from multiprocessing import Process,Queue import random import time def printrand(): #Checks whether Queue is empty and runs while q.empty(): rand = random.choice(range(1,100)) time.s...
To wait for input and to display some random output at the same time, you could use a GUI ([something with an event loop](https://stackoverflow.com/a/14040516/4279)): ![screenshot](https://i.stack.imgur.com/1nBkg.png) ``` #!/usr/bin/env python3 import random from tkinter import E, END, N, S, scrolledtext, Tk, ttk, W ...
25,733,955
``` valid = {'Temp': [10, 55], 'rain_percent': [49, 100], 'humidity': [30,50]} data = {'Temp': 30.45, 'rain_percent': 80.56 } min_temp , max_temp = valid['Temp'] if not(min_temp <= data['Temp'] <= max_temp): print "Bad Temp" min_rain , max_rain = valid['rain_percent'] if not(min_rain <= data['rain_percent'] <= ma...
2014/09/08
[ "https://Stackoverflow.com/questions/25733955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4012241/" ]
This can be achieved by using the multiprocessing module in python, please find the code below ``` #!/usr/bin/python from multiprocessing import Process,Queue import random import time def printrand(): #Checks whether Queue is empty and runs while q.empty(): rand = random.choice(range(1,100)) time.s...
> > I want to be able to input words in the console while, at the same time, have random numbers appear in the console. > > > ``` #!/usr/bin/env python import random def print_random(n=10): print(random.randrange(n)) # print random number in the range(0, n) stop = call_repeatedly(1, print_random) # print ra...
25,733,955
``` valid = {'Temp': [10, 55], 'rain_percent': [49, 100], 'humidity': [30,50]} data = {'Temp': 30.45, 'rain_percent': 80.56 } min_temp , max_temp = valid['Temp'] if not(min_temp <= data['Temp'] <= max_temp): print "Bad Temp" min_rain , max_rain = valid['rain_percent'] if not(min_rain <= data['rain_percent'] <= ma...
2014/09/08
[ "https://Stackoverflow.com/questions/25733955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4012241/" ]
This can be achieved by using the multiprocessing module in python, please find the code below ``` #!/usr/bin/python from multiprocessing import Process,Queue import random import time def printrand(): #Checks whether Queue is empty and runs while q.empty(): rand = random.choice(range(1,100)) time.s...
you have to run two concurrent threads at the same time in order to get rid of such blocking. looks like there are two interpreters that run your code and each of them executes particular section of your project.
65,248,280
I have a list of strings `(["A", "B", ...])` and a list of sizes `([4,7,...])`. I would like to sample without replacement from the set of strings where initially string in position `i` appears `sizes[i]` times. I have to perform this operation `k` times. Clearly, if I pick string `i`, then `sizes[i]` decreases by 1. T...
2020/12/11
[ "https://Stackoverflow.com/questions/65248280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14677697/" ]
Assuming the bag doesn't have to be persistent or be used at all you could create a class that contains input and frequency, e.g. like this (simplified): ``` class SampleElement<T> { private T value; private int frequency; //constructors, getters, setters } ``` Then build a collection of those elements from t...
You can collect these two arrays into a map: ```java String[] elems = {"A", "B", "C", "D", "E"}; Integer[] sizes = {10, 5, 4, 7, 3}; Map<String, Integer> map = IntStream.range(0, elems.length).boxed() .collect(Collectors.toMap(i -> elems[i], i -> sizes[i])); System.out.println(map); // {A=10, B=5, C=4, D=7, ...
65,248,280
I have a list of strings `(["A", "B", ...])` and a list of sizes `([4,7,...])`. I would like to sample without replacement from the set of strings where initially string in position `i` appears `sizes[i]` times. I have to perform this operation `k` times. Clearly, if I pick string `i`, then `sizes[i]` decreases by 1. T...
2020/12/11
[ "https://Stackoverflow.com/questions/65248280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14677697/" ]
Assuming the bag doesn't have to be persistent or be used at all you could create a class that contains input and frequency, e.g. like this (simplified): ``` class SampleElement<T> { private T value; private int frequency; //constructors, getters, setters } ``` Then build a collection of those elements from t...
Assuming that the lengths of these two arrays are the same, you can create *a list of map entries* containing pairs of elements from these arrays, and shuffle this list: ```java String[] elems = {"A", "B", "C", "D", "E"}; Integer[] sizes = {10, 5, 4, 7, 3}; List<Map.Entry<String, Integer>> bag = IntStream .ra...
65,248,280
I have a list of strings `(["A", "B", ...])` and a list of sizes `([4,7,...])`. I would like to sample without replacement from the set of strings where initially string in position `i` appears `sizes[i]` times. I have to perform this operation `k` times. Clearly, if I pick string `i`, then `sizes[i]` decreases by 1. T...
2020/12/11
[ "https://Stackoverflow.com/questions/65248280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14677697/" ]
Assuming the bag doesn't have to be persistent or be used at all you could create a class that contains input and frequency, e.g. like this (simplified): ``` class SampleElement<T> { private T value; private int frequency; //constructors, getters, setters } ``` Then build a collection of those elements from t...
If all you want is get a random element from `bag`, you do not need to shuffle `bag`. You can use [`Random#nextInt(elems.length * sizes.length)`](https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#nextInt-int-) to get a random `int` from `0` to `elems.length * sizes.length - 1` and using this `int` as the ...
65,248,280
I have a list of strings `(["A", "B", ...])` and a list of sizes `([4,7,...])`. I would like to sample without replacement from the set of strings where initially string in position `i` appears `sizes[i]` times. I have to perform this operation `k` times. Clearly, if I pick string `i`, then `sizes[i]` decreases by 1. T...
2020/12/11
[ "https://Stackoverflow.com/questions/65248280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14677697/" ]
You can collect these two arrays into a map: ```java String[] elems = {"A", "B", "C", "D", "E"}; Integer[] sizes = {10, 5, 4, 7, 3}; Map<String, Integer> map = IntStream.range(0, elems.length).boxed() .collect(Collectors.toMap(i -> elems[i], i -> sizes[i])); System.out.println(map); // {A=10, B=5, C=4, D=7, ...
Assuming that the lengths of these two arrays are the same, you can create *a list of map entries* containing pairs of elements from these arrays, and shuffle this list: ```java String[] elems = {"A", "B", "C", "D", "E"}; Integer[] sizes = {10, 5, 4, 7, 3}; List<Map.Entry<String, Integer>> bag = IntStream .ra...
65,248,280
I have a list of strings `(["A", "B", ...])` and a list of sizes `([4,7,...])`. I would like to sample without replacement from the set of strings where initially string in position `i` appears `sizes[i]` times. I have to perform this operation `k` times. Clearly, if I pick string `i`, then `sizes[i]` decreases by 1. T...
2020/12/11
[ "https://Stackoverflow.com/questions/65248280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14677697/" ]
You can collect these two arrays into a map: ```java String[] elems = {"A", "B", "C", "D", "E"}; Integer[] sizes = {10, 5, 4, 7, 3}; Map<String, Integer> map = IntStream.range(0, elems.length).boxed() .collect(Collectors.toMap(i -> elems[i], i -> sizes[i])); System.out.println(map); // {A=10, B=5, C=4, D=7, ...
If all you want is get a random element from `bag`, you do not need to shuffle `bag`. You can use [`Random#nextInt(elems.length * sizes.length)`](https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#nextInt-int-) to get a random `int` from `0` to `elems.length * sizes.length - 1` and using this `int` as the ...
40,032,387
``` svm_node n=new svm_node(); for (String tk:instance.keySet()){ System.out.println(tk + " "+ instance.get(tk)); if(IndexDic.containsKey(tk)){ n.index=(IndexDic.get(tk)); n.value=instance.get(tk); nodes.add(n); } else{ System...
2016/10/13
[ "https://Stackoverflow.com/questions/40032387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You were adding the same `svm_node` object to the collection over and over again. To fix this, move the instantiation of the `svm_node` to inside the loop: ``` for (String tk:instance.keySet()) { svm_node n=new svm_node(); System.out.println(tk + " "+ instance.get(tk)); if (IndexDic.containsKey(tk)) { ...
You should call `svm_node n = new svm_node()` inside the for-Loop. Otherwise, the same Node will be overwritten!
5,823,141
Can anyone tell me if there's a Rail3 replacement for something like this: ``` <%= unless @page.new_record? || !@page.background_image? %> bla <% end %> ``` I'm trying to display a checkbox on a form only when a user edits. Not when they create.
2011/04/28
[ "https://Stackoverflow.com/questions/5823141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641439/" ]
I think the statement is ok, but should not be included in your view. Instead, create a model method, probably named is\_editable? or something, that includes this statement. Then get an instance variable in your controller and use that instead. Logic in views is a very bad idea :)
You can write it like this: ``` <%= "bla" unless @page.new_record? || !@page.background_image? %> ``` May be you should write separate method with more human-readable name and replace this condition with one method. Try to keep your view as much cleaner as possible
5,823,141
Can anyone tell me if there's a Rail3 replacement for something like this: ``` <%= unless @page.new_record? || !@page.background_image? %> bla <% end %> ``` I'm trying to display a checkbox on a form only when a user edits. Not when they create.
2011/04/28
[ "https://Stackoverflow.com/questions/5823141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641439/" ]
Your mistake is including the = in the ruby code. ``` <% unless @page.new_record? || !@page.background_image? %> bla <% end %> ``` However, as other users have stated, it is probably better to hide this logic in the model rather than in the view. Additionally it considered a best practice to only use unless if...
You can write it like this: ``` <%= "bla" unless @page.new_record? || !@page.background_image? %> ``` May be you should write separate method with more human-readable name and replace this condition with one method. Try to keep your view as much cleaner as possible
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
[Mint](http://haveamint.com/) by Shaun Inman had 'required' labels in the form: ![enter image description here](https://i.stack.imgur.com/dp9Ad.gif) Instead of 'Required' labels you could have 'Wildcard' labels
I often see option symbols in Pizza menus: ![enter image description here](https://i.stack.imgur.com/zKP4X.png) Pepper sign here means "extra spicy" (or even several signs with different number of peppers to visualize different stages), there also may be a "vegetarian" sign, etc. And at the end of the every page of t...
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
[Mint](http://haveamint.com/) by Shaun Inman had 'required' labels in the form: ![enter image description here](https://i.stack.imgur.com/dp9Ad.gif) Instead of 'Required' labels you could have 'Wildcard' labels
1. It looks like *all* your fields allow wildcards. Except Middle Initial, so why not make it support them as well? 2. Also, do your users **really** make use of wildcard capabilities? Have they demonstrated a need for such? In my experience, substring match is usually sufficient, and in fact people expect substring ma...
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
[Mint](http://haveamint.com/) by Shaun Inman had 'required' labels in the form: ![enter image description here](https://i.stack.imgur.com/dp9Ad.gif) Instead of 'Required' labels you could have 'Wildcard' labels
It's a good idea to keep the \* for required fields and if you don't want to clutter the UI you could add an extra label inside the 'wildcard' fields with example of accepted characters.
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
I often see option symbols in Pizza menus: ![enter image description here](https://i.stack.imgur.com/zKP4X.png) Pepper sign here means "extra spicy" (or even several signs with different number of peppers to visualize different stages), there also may be a "vegetarian" sign, etc. And at the end of the every page of t...
1. It looks like *all* your fields allow wildcards. Except Middle Initial, so why not make it support them as well? 2. Also, do your users **really** make use of wildcard capabilities? Have they demonstrated a need for such? In my experience, substring match is usually sufficient, and in fact people expect substring ma...
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
Putting a small label "wildcard" with a mouseover tooltip indicating that "this text box accepts wildcard characters" could be a solution. You can put this label above on the left of the text box or, if your text box title is to large, below.
1. It looks like *all* your fields allow wildcards. Except Middle Initial, so why not make it support them as well? 2. Also, do your users **really** make use of wildcard capabilities? Have they demonstrated a need for such? In my experience, substring match is usually sufficient, and in fact people expect substring ma...
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
icc97 beat me using the image I was going to use :) but considering the use case that some fields can be required and also support wild card charecters, I would recommmend using a combination of both the \* and the required tag as shown in the example used by icc97 ![enter image description here](https://i.stack.imgur...
1. It looks like *all* your fields allow wildcards. Except Middle Initial, so why not make it support them as well? 2. Also, do your users **really** make use of wildcard capabilities? Have they demonstrated a need for such? In my experience, substring match is usually sufficient, and in fact people expect substring ma...
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
[Mint](http://haveamint.com/) by Shaun Inman had 'required' labels in the form: ![enter image description here](https://i.stack.imgur.com/dp9Ad.gif) Instead of 'Required' labels you could have 'Wildcard' labels
icc97 beat me using the image I was going to use :) but considering the use case that some fields can be required and also support wild card charecters, I would recommmend using a combination of both the \* and the required tag as shown in the example used by icc97 ![enter image description here](https://i.stack.imgur...
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
I often see option symbols in Pizza menus: ![enter image description here](https://i.stack.imgur.com/zKP4X.png) Pepper sign here means "extra spicy" (or even several signs with different number of peppers to visualize different stages), there also may be a "vegetarian" sign, etc. And at the end of the every page of t...
It's a good idea to keep the \* for required fields and if you don't want to clutter the UI you could add an extra label inside the 'wildcard' fields with example of accepted characters.
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
Putting a small label "wildcard" with a mouseover tooltip indicating that "this text box accepts wildcard characters" could be a solution. You can put this label above on the left of the text box or, if your text box title is to large, below.
It's a good idea to keep the \* for required fields and if you don't want to clutter the UI you could add an extra label inside the 'wildcard' fields with example of accepted characters.
31,541
Everyone most web users understand that the asterisk (\*) indicates that the fields on a form are required. But what about non-standard symbols? Our UX team is currently working with an application dev group where there is a need to flag special functionality related to specific text boxes. In this particular case, th...
2013/01/08
[ "https://ux.stackexchange.com/questions/31541", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/7450/" ]
Why flag for where something is allowed, instead of flagging when something erroneous is entered: ![mockup](https://i.stack.imgur.com/mll0z.png) [download bmml source](/plugins/mockups/download?image=http%3a%2f%2fi.stack.imgur.com%2fmll0z.png) – Wireframes created with [Balsamiq Mockups](http://www.balsamiq.com/produ...
1. It looks like *all* your fields allow wildcards. Except Middle Initial, so why not make it support them as well? 2. Also, do your users **really** make use of wildcard capabilities? Have they demonstrated a need for such? In my experience, substring match is usually sufficient, and in fact people expect substring ma...
433,844
How can I save values (states) to be used on a second pass compilation? For example, look at this simple example: ``` \definecounter[foox] \setcounter[foox][1] \definestartstop [foo] [before={\textrule[top]{Foo: \rawcountervalue[foox]}}, after={\incrementcounter[foox]}] \starttext Total of Foos: \rawc...
2018/05/28
[ "https://tex.stackexchange.com/questions/433844", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/163632/" ]
All counters which are created with `\definecounter` are stored in the auxiliary file and ConTeXt already provides commands to access the last value it. If you just want to print the last value in your document you can use `type=last` in the second argument of `\convertedcounter`. ``` \definecounter [amadeus] \startb...
After the comment of @Metafox, and after I found these links: [Storing and retrieving data in tuc file](https://tex.stackexchange.com/questions/52067/storing-and-retrieving-data-in-tuc-file) and [System Macros/Key Value Assignments](http://wiki.contextgarden.net/System_Macros/Key_Value_Assignments#Multi-pass_data) I de...
30,438
I have a view that utilizes a node-reference field. I want users to be able to filter by this field using a search-box (or an autocomplete field), but when I set the exposed filter to the node-reference field, all I get is a drop-down. How can I force this to be either a text field or autocomplete? Thanks! views 3 dr...
2012/05/08
[ "https://drupal.stackexchange.com/questions/30438", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/7242/" ]
This might help you, <http://drupal.org/node/506654#comment-6412784> [Views autocomplete filters](http://drupal.org/project/views_autocomplete_filters)
You can also use entity reference instead of node reference. That module offers an autocomplete filter.
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
I do not know how to do what your are trying but I can suggest you "legal" solution. Implement convertor that has both old and new packages in classpath and does the following: reads data from DB, de-serializes it using the old package, converts old instances to new in java and then stores new data in DB again. This ...
If the data-to-be-refactored is being stored - in string form - in a database, one option is to use SQL to simply update that data, e.g., (in pseudo MySQL) ``` update mydata set serialized_data = replace(serialized_data, "com.oldpackage", "com.newpackage") ``` you would, of course, refactor your Java code before a...
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
I do not know how to do what your are trying but I can suggest you "legal" solution. Implement convertor that has both old and new packages in classpath and does the following: reads data from DB, de-serializes it using the old package, converts old instances to new in java and then stores new data in DB again. This ...
IIRC you can (with sufficient permissions) override `ObjectInputStream.resolveClass` (and `resolveProxyClass`) to return a `Class` with a different package names. Although, IIRC, you cannot change the simple class name.
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
I do not know how to do what your are trying but I can suggest you "legal" solution. Implement convertor that has both old and new packages in classpath and does the following: reads data from DB, de-serializes it using the old package, converts old instances to new in java and then stores new data in DB again. This ...
Can i suguest an alternative tack. The java serialisation format has some significant issues when being used for long term storage. Since you are refactoring and are most likely going to have to deserialise all the stored data one way or another, you may want to look at [Google Protocol Buffers](http://code.google.com...
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
IIRC you can (with sufficient permissions) override `ObjectInputStream.resolveClass` (and `resolveProxyClass`) to return a `Class` with a different package names. Although, IIRC, you cannot change the simple class name.
If the data-to-be-refactored is being stored - in string form - in a database, one option is to use SQL to simply update that data, e.g., (in pseudo MySQL) ``` update mydata set serialized_data = replace(serialized_data, "com.oldpackage", "com.newpackage") ``` you would, of course, refactor your Java code before a...
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
Can i suguest an alternative tack. The java serialisation format has some significant issues when being used for long term storage. Since you are refactoring and are most likely going to have to deserialise all the stored data one way or another, you may want to look at [Google Protocol Buffers](http://code.google.com...
If the data-to-be-refactored is being stored - in string form - in a database, one option is to use SQL to simply update that data, e.g., (in pseudo MySQL) ``` update mydata set serialized_data = replace(serialized_data, "com.oldpackage", "com.newpackage") ``` you would, of course, refactor your Java code before a...
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
To precise Tom Hawtin's reply, I have managed to implement it using the following code: ``` public static ObjectInputStream getSwapOIS( InputStream in ,String fromClass,String toClass) throws IOException ,ClassNotFoundException { final String from="^"+fromClass,fromArray="^\\[L"+fromClass,toArray="[L"+toClass;...
If the data-to-be-refactored is being stored - in string form - in a database, one option is to use SQL to simply update that data, e.g., (in pseudo MySQL) ``` update mydata set serialized_data = replace(serialized_data, "com.oldpackage", "com.newpackage") ``` you would, of course, refactor your Java code before a...
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
To precise Tom Hawtin's reply, I have managed to implement it using the following code: ``` public static ObjectInputStream getSwapOIS( InputStream in ,String fromClass,String toClass) throws IOException ,ClassNotFoundException { final String from="^"+fromClass,fromArray="^\\[L"+fromClass,toArray="[L"+toClass;...
IIRC you can (with sufficient permissions) override `ObjectInputStream.resolveClass` (and `resolveProxyClass`) to return a `Class` with a different package names. Although, IIRC, you cannot change the simple class name.
4,668,675
I want to replace the String "com.oldpackage.className" with "com.newPackage.className" in a stream of serialized data. This serialized data is read from the DB and updated after replacing the string. I am facing some problems while doing the same. If you already guessed it, this is part of a refactoring exercise. Are...
2011/01/12
[ "https://Stackoverflow.com/questions/4668675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567328/" ]
To precise Tom Hawtin's reply, I have managed to implement it using the following code: ``` public static ObjectInputStream getSwapOIS( InputStream in ,String fromClass,String toClass) throws IOException ,ClassNotFoundException { final String from="^"+fromClass,fromArray="^\\[L"+fromClass,toArray="[L"+toClass;...
Can i suguest an alternative tack. The java serialisation format has some significant issues when being used for long term storage. Since you are refactoring and are most likely going to have to deserialise all the stored data one way or another, you may want to look at [Google Protocol Buffers](http://code.google.com...
36,546,161
In my model I defined a few validation rules for date fields using `before` and `after`: ``` 'birth_date' => 'required|date|before:today|after:01-jan-1920', 'another_date' => 'required|date|before:tomorrow|after:01-jan-1990', ``` The validation works fine, however I can't figure out how to translate the strings `tod...
2016/04/11
[ "https://Stackoverflow.com/questions/36546161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369191/" ]
You can use custom validation messages per field, either on validation language file or in your code itself: <https://laravel.com/docs/5.2/validation#custom-error-messages> Let's simulate a controller validation to see how it works: ``` <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminat...
It probably makes more sense to make some custom validations but I think you should be able to do this simply with Carbon: ``` $dt = new Carbon\Carbon(); $today = $dt->today(); $tomorrow = $dt->tomorrow(); $rules = [ ... 'birth_date' => 'required|date|before:'.$today.'|after:01-jan-1920', ...
36,546,161
In my model I defined a few validation rules for date fields using `before` and `after`: ``` 'birth_date' => 'required|date|before:today|after:01-jan-1920', 'another_date' => 'required|date|before:tomorrow|after:01-jan-1990', ``` The validation works fine, however I can't figure out how to translate the strings `tod...
2016/04/11
[ "https://Stackoverflow.com/questions/36546161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369191/" ]
Use custom error messages. ``` $this->validate( $request, [ 'phone' => 'required|regex:/^(\d[\s-]?)?[\(\[\s-]{0,2}?\d{3}[\)\]\s-]{0,2}?\d{3}[\s-]?\d{4}$/i' ], [ 'regex' => 'You must enter a valid phone number.', 'required' ...
It probably makes more sense to make some custom validations but I think you should be able to do this simply with Carbon: ``` $dt = new Carbon\Carbon(); $today = $dt->today(); $tomorrow = $dt->tomorrow(); $rules = [ ... 'birth_date' => 'required|date|before:'.$today.'|after:01-jan-1920', ...
36,546,161
In my model I defined a few validation rules for date fields using `before` and `after`: ``` 'birth_date' => 'required|date|before:today|after:01-jan-1920', 'another_date' => 'required|date|before:tomorrow|after:01-jan-1990', ``` The validation works fine, however I can't figure out how to translate the strings `tod...
2016/04/11
[ "https://Stackoverflow.com/questions/36546161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369191/" ]
In short, add following code into `resources/lang/whichever/validation.php` ```php 'values' => [ // or whatever fields you wanna translate 'birth_date' => [ // or tomorrow 'today' => '今天' ] ] ``` Explained: <https://github.com/laravel/framework/blob/7.x/src/Illuminate/Validation/Concerns...
It probably makes more sense to make some custom validations but I think you should be able to do this simply with Carbon: ``` $dt = new Carbon\Carbon(); $today = $dt->today(); $tomorrow = $dt->tomorrow(); $rules = [ ... 'birth_date' => 'required|date|before:'.$today.'|after:01-jan-1920', ...
36,546,161
In my model I defined a few validation rules for date fields using `before` and `after`: ``` 'birth_date' => 'required|date|before:today|after:01-jan-1920', 'another_date' => 'required|date|before:tomorrow|after:01-jan-1990', ``` The validation works fine, however I can't figure out how to translate the strings `tod...
2016/04/11
[ "https://Stackoverflow.com/questions/36546161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369191/" ]
You can use custom validation messages per field, either on validation language file or in your code itself: <https://laravel.com/docs/5.2/validation#custom-error-messages> Let's simulate a controller validation to see how it works: ``` <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminat...
Use custom error messages. ``` $this->validate( $request, [ 'phone' => 'required|regex:/^(\d[\s-]?)?[\(\[\s-]{0,2}?\d{3}[\)\]\s-]{0,2}?\d{3}[\s-]?\d{4}$/i' ], [ 'regex' => 'You must enter a valid phone number.', 'required' ...
36,546,161
In my model I defined a few validation rules for date fields using `before` and `after`: ``` 'birth_date' => 'required|date|before:today|after:01-jan-1920', 'another_date' => 'required|date|before:tomorrow|after:01-jan-1990', ``` The validation works fine, however I can't figure out how to translate the strings `tod...
2016/04/11
[ "https://Stackoverflow.com/questions/36546161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369191/" ]
In short, add following code into `resources/lang/whichever/validation.php` ```php 'values' => [ // or whatever fields you wanna translate 'birth_date' => [ // or tomorrow 'today' => '今天' ] ] ``` Explained: <https://github.com/laravel/framework/blob/7.x/src/Illuminate/Validation/Concerns...
You can use custom validation messages per field, either on validation language file or in your code itself: <https://laravel.com/docs/5.2/validation#custom-error-messages> Let's simulate a controller validation to see how it works: ``` <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminat...
36,546,161
In my model I defined a few validation rules for date fields using `before` and `after`: ``` 'birth_date' => 'required|date|before:today|after:01-jan-1920', 'another_date' => 'required|date|before:tomorrow|after:01-jan-1990', ``` The validation works fine, however I can't figure out how to translate the strings `tod...
2016/04/11
[ "https://Stackoverflow.com/questions/36546161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1369191/" ]
In short, add following code into `resources/lang/whichever/validation.php` ```php 'values' => [ // or whatever fields you wanna translate 'birth_date' => [ // or tomorrow 'today' => '今天' ] ] ``` Explained: <https://github.com/laravel/framework/blob/7.x/src/Illuminate/Validation/Concerns...
Use custom error messages. ``` $this->validate( $request, [ 'phone' => 'required|regex:/^(\d[\s-]?)?[\(\[\s-]{0,2}?\d{3}[\)\]\s-]{0,2}?\d{3}[\s-]?\d{4}$/i' ], [ 'regex' => 'You must enter a valid phone number.', 'required' ...
29,544,441
I am very new to MatLab. I got a task for modelling non-linear regression using neural network in MatLab. I need to create a two-layer neural network where: 1. The first layer is N neurons with sigmoid activation function. 2. The second layer is layer with one neuron and a linear activation function. Here is how I...
2015/04/09
[ "https://Stackoverflow.com/questions/29544441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882829/" ]
This problem looks similar to this question. [Submit WatchKit Provisioning Error](https://stackoverflow.com/questions/29479139/submit-watchkit-provisioning-error) I had the same problem. Here is the solution that worked for me. Technical Q&A QA1830 The beta-reports-active Entitlement Q: How do I resolve the "beta-rep...
I needed to revoke my certificates (preferences -> accounts). After that XCode offered to recreate them. All fine now. Not sure whether this has unwanted side effects as previous certificates are now invalid.
29,544,441
I am very new to MatLab. I got a task for modelling non-linear regression using neural network in MatLab. I need to create a two-layer neural network where: 1. The first layer is N neurons with sigmoid activation function. 2. The second layer is layer with one neuron and a linear activation function. Here is how I...
2015/04/09
[ "https://Stackoverflow.com/questions/29544441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882829/" ]
This problem looks similar to this question. [Submit WatchKit Provisioning Error](https://stackoverflow.com/questions/29479139/submit-watchkit-provisioning-error) I had the same problem. Here is the solution that worked for me. Technical Q&A QA1830 The beta-reports-active Entitlement Q: How do I resolve the "beta-rep...
I had the same error message trying to submit an update to a Watch App that was previously rejected. Since i had previously uploaded, I did not see this error. I used a support incident to get help after exhausting all paths. I got a response in just 1 or 2 business days -- which at first annoyed me. They said i neede...
29,544,441
I am very new to MatLab. I got a task for modelling non-linear regression using neural network in MatLab. I need to create a two-layer neural network where: 1. The first layer is N neurons with sigmoid activation function. 2. The second layer is layer with one neuron and a linear activation function. Here is how I...
2015/04/09
[ "https://Stackoverflow.com/questions/29544441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882829/" ]
This problem looks similar to this question. [Submit WatchKit Provisioning Error](https://stackoverflow.com/questions/29479139/submit-watchkit-provisioning-error) I had the same problem. Here is the solution that worked for me. Technical Q&A QA1830 The beta-reports-active Entitlement Q: How do I resolve the "beta-rep...
Following steps help me out: 1.Make sure "App Groups" in Capabilities page in Container target and Extension target. 2.Goto Xcode > Preferences > Accounts > YOUR\_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash. 3.Open "App Groups" in Container target and Exte...
29,544,441
I am very new to MatLab. I got a task for modelling non-linear regression using neural network in MatLab. I need to create a two-layer neural network where: 1. The first layer is N neurons with sigmoid activation function. 2. The second layer is layer with one neuron and a linear activation function. Here is how I...
2015/04/09
[ "https://Stackoverflow.com/questions/29544441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882829/" ]
Following steps help me out: 1.Make sure "App Groups" in Capabilities page in Container target and Extension target. 2.Goto Xcode > Preferences > Accounts > YOUR\_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash. 3.Open "App Groups" in Container target and Exte...
I needed to revoke my certificates (preferences -> accounts). After that XCode offered to recreate them. All fine now. Not sure whether this has unwanted side effects as previous certificates are now invalid.
29,544,441
I am very new to MatLab. I got a task for modelling non-linear regression using neural network in MatLab. I need to create a two-layer neural network where: 1. The first layer is N neurons with sigmoid activation function. 2. The second layer is layer with one neuron and a linear activation function. Here is how I...
2015/04/09
[ "https://Stackoverflow.com/questions/29544441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882829/" ]
Following steps help me out: 1.Make sure "App Groups" in Capabilities page in Container target and Extension target. 2.Goto Xcode > Preferences > Accounts > YOUR\_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash. 3.Open "App Groups" in Container target and Exte...
I had the same error message trying to submit an update to a Watch App that was previously rejected. Since i had previously uploaded, I did not see this error. I used a support incident to get help after exhausting all paths. I got a response in just 1 or 2 business days -- which at first annoyed me. They said i neede...
68,937
We installed a wiring kit to the rear lights so we could plug in lights for towing a trailer. After testing the lights with a trailer, the brake lights stopped working and then the car wouldn't shift out of park. We removed the kit and put all the wires back where they were originally, and still, the car won't shift ou...
2019/07/15
[ "https://mechanics.stackexchange.com/questions/68937", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/35573/" ]
The issue was the brake light fuse burned out. This was frustrating us because there is a separate fuse labeled `TAIL` for the tail lights and a different fuse labeled `STOP` for the brake lights. Without Google, we wouldn't have thought about looking for the `STOP` fuse. Once the fuse was replaced, the car would shif...
I see 3 possibilities: 1. you made an error when connecting the "stop" wire. 2. the trailer kit (socket) has a fault on the stop pin. 3. The trailer you used for testing has a fault on the stop circuit (shorted wire or shorted bulb). You may not need a new trailer connection kit, just need to find what was wrong.
46,743,625
I have a column having over 800 rows shown below: ``` 0 ['Overgrow', 'Chlorophyll'] 1 ['Overgrow', 'Chlorophyll'] 2 ['Overgrow', 'Chlorophyll'] 3 ['Blaze', 'Solar Power'] 4 ['Bla...
2017/10/14
[ "https://Stackoverflow.com/questions/46743625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6885902/" ]
Since the values are strings you can use regex and split to convert them to list then use itertools just the way @JonClements mentioned in comment to count i.e ``` from collections import Counter count = pd.Series(df['abilities'].str.replace('[\[\]\']','').str.split(',').map(Counter).sum()) ``` Output: ``` Big ...
Use `value_counts` ``` In [1845]: counts = pd.Series(np.concatenate(df_pokemon.abilities)).value_counts() In [1846]: counts Out[1846]: Rain Dish 3 Keen Eye 3 Chlorophyll 3 Blaze 3 Solar Power 3 Overgrow 3 Big Pecks 3 Tangled Feet 3 Torrent 3 Shield Dust 2 She...
54,861,462
I have started learning cloud architecture and found out that they all are using columnar databases which claims to be more efficient as they are storing column rather than a row to reduce duplicate. From a data mart perspective (lets say for an organization a department only want to monitor internet sales growth and...
2019/02/25
[ "https://Stackoverflow.com/questions/54861462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298336/" ]
Business analysis queries do often involve computing aggregations for metrics, like the total sales amounts and the average discount that you exemplified. OLAP data structures are useful for these use cases because the aggregations can be precomputed and stored, thereby requiring less computation and I/O at query time...
Your sales growth SQL does not make sense. Sales growth is monitored over time but you did not define the time part in your SQL. For example If business wants to monitor weekly or monthly sales, then you create either a weekly Fact table or a monthly Fact table and you calculate weekly or monthly sales and save into th...
55,286,086
I understand *canonicalization* and *normalization* to mean removing any non-meaningful or ambiguous parts of of a data's presentation, turning *effectively* identical data into *actually* identical data. For example, if you want to get the hash of some input data and it's important that anyone else hashing the canoni...
2019/03/21
[ "https://Stackoverflow.com/questions/55286086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1489243/" ]
"Canonicalize" & "normalize" (from "canonical (form)" & "normal form") are two related general mathematical terms that also have particular uses in particular contexts per some exact meaning given there. It is reasonable to label a particular process by one of those terms when the general meaning applies. Your charact...
Consider a set of objects, each of which can have multiple representations. From your example, that would be the set of JSON objects and the fact that each object has multiple valid representations, e.g., each with different permutations of its members, less white spaces, etc. *Canonicalization* is the process of conv...
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
I can access ARP table without root. Here is my code: ``` string GetMACAddressviaIP(string ipAddr) { string result = ""; ostringstream ss; ss << "/proc/net/arp"; string loc = ss.str(); ifstream in(loc); if(!in) { printf("open %s failed\n",loc.c_str()); return result; } ...
I recommend something like the following for Java. This combines the answers for the other two. It's not tested, so it might need some tweaks, but you get the idea. ``` public String getMacAddressForIp(final String ipAddress) { try (BufferedReader br = new BufferedReader(new FileReader("/proc/net/arp"))) { ...
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
I can access ARP table without root. Here is my code: ``` string GetMACAddressviaIP(string ipAddr) { string result = ""; ostringstream ss; ss << "/proc/net/arp"; string loc = ss.str(); ifstream in(loc); if(!in) { printf("open %s failed\n",loc.c_str()); return result; } ...
As an alternative to previous answers a "no coding" solution is to install a linux terminal emulator on your device and use the arp -a command to view the arp table.
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
I can access ARP table without root. Here is my code: ``` string GetMACAddressviaIP(string ipAddr) { string result = ""; ostringstream ss; ss << "/proc/net/arp"; string loc = ss.str(); ifstream in(loc); if(!in) { printf("open %s failed\n",loc.c_str()); return result; } ...
It seems that an application has not been able to access the arp file since Android 10. [link](https://developer.android.com/about/versions/10/privacy/changes#proc-net-filesystem)
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
For better understanding, using Java language, you can retrieve the ARP table in android as: ``` BufferedReader br = null; ArrayList<ClientScanResult> result = new ArrayList<ClientScanResult>(); try { br = new BufferedReader(new FileReader("/proc/net/arp")); String line; while ((l...
I recommend something like the following for Java. This combines the answers for the other two. It's not tested, so it might need some tweaks, but you get the idea. ``` public String getMacAddressForIp(final String ipAddress) { try (BufferedReader br = new BufferedReader(new FileReader("/proc/net/arp"))) { ...
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
For better understanding, using Java language, you can retrieve the ARP table in android as: ``` BufferedReader br = null; ArrayList<ClientScanResult> result = new ArrayList<ClientScanResult>(); try { br = new BufferedReader(new FileReader("/proc/net/arp")); String line; while ((l...
As an alternative to previous answers a "no coding" solution is to install a linux terminal emulator on your device and use the arp -a command to view the arp table.
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
For better understanding, using Java language, you can retrieve the ARP table in android as: ``` BufferedReader br = null; ArrayList<ClientScanResult> result = new ArrayList<ClientScanResult>(); try { br = new BufferedReader(new FileReader("/proc/net/arp")); String line; while ((l...
It seems that an application has not been able to access the arp file since Android 10. [link](https://developer.android.com/about/versions/10/privacy/changes#proc-net-filesystem)
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
I recommend something like the following for Java. This combines the answers for the other two. It's not tested, so it might need some tweaks, but you get the idea. ``` public String getMacAddressForIp(final String ipAddress) { try (BufferedReader br = new BufferedReader(new FileReader("/proc/net/arp"))) { ...
It seems that an application has not been able to access the arp file since Android 10. [link](https://developer.android.com/about/versions/10/privacy/changes#proc-net-filesystem)
42,660,034
I am recently working on a Android project that requires to access the ARP table. One of the requirement is to avoid any methods that need a rooted device. So, my question is: is there any way to access the ARP table in android without rooting the device? Currently I have found that most of the approaches use the /p...
2017/03/07
[ "https://Stackoverflow.com/questions/42660034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4032889/" ]
As an alternative to previous answers a "no coding" solution is to install a linux terminal emulator on your device and use the arp -a command to view the arp table.
It seems that an application has not been able to access the arp file since Android 10. [link](https://developer.android.com/about/versions/10/privacy/changes#proc-net-filesystem)
34,235,068
[![enter image description here](https://i.stack.imgur.com/OOS4w.jpg)](https://i.stack.imgur.com/OOS4w.jpg) Is there a wat to make a indicator like this? it has some pointed arrow down like in the selected item?
2015/12/12
[ "https://Stackoverflow.com/questions/34235068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2104871/" ]
The only solution I could find is to grab the source code of the original `TabLayout` and customize it, according your needs. In fact, all you need to do to get this custom pointing arrow is to override `SlidingTabStrip`'s `void draw(Canvas canvas)` method. Unfortunately, `SlidingTabStrip` is `private` inner class ins...
now it doesn't work, tintmanager class is removed from support library 23.2.0 , I managed same functionality by changing background drawable at runtime inside for loop detecting clicked position , PS : check this question and answer I am using same library : <https://github.com/astuetz/PagerSlidingTabStrip/issues/141>
34,235,068
[![enter image description here](https://i.stack.imgur.com/OOS4w.jpg)](https://i.stack.imgur.com/OOS4w.jpg) Is there a wat to make a indicator like this? it has some pointed arrow down like in the selected item?
2015/12/12
[ "https://Stackoverflow.com/questions/34235068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2104871/" ]
The only solution I could find is to grab the source code of the original `TabLayout` and customize it, according your needs. In fact, all you need to do to get this custom pointing arrow is to override `SlidingTabStrip`'s `void draw(Canvas canvas)` method. Unfortunately, `SlidingTabStrip` is `private` inner class ins...
Here is the code for anyone requiring an upward triangle using @Konstantin Loginov code ``` private Path getTrianglePath(int arrowSize) { mSelectedIndicatorPaint.setStyle(Paint.Style.FILL_AND_STROKE); mSelectedIndicatorPaint.setAntiAlias(true); mSelectedIndicatorPaint.setColor(Color.WHITE); ...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
Try to add ``` window.open(url,'_blank'); ``` ### Edit Well, I don't think you can get around popup-blockers when opening a page that's not the immediate result of a user action (i.e. not async). You could try something like this though, it should look like a user action to a popup-blocker: ``` var $a = $('<a>',...
Try adding async: false. It should be working ``` $('#myButton').click(function() { $.ajax({ type: 'POST', async: false, url: '/echo/json/', data: {'json': JSON.stringify({ url:'http://google.com'})}, success: function(data) { window.open(data.url,'_blank'); } }); }); ```
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
Try to add ``` window.open(url,'_blank'); ``` ### Edit Well, I don't think you can get around popup-blockers when opening a page that's not the immediate result of a user action (i.e. not async). You could try something like this though, it should look like a user action to a popup-blocker: ``` var $a = $('<a>',...
What worked for me was: ``` var win = window.open('about:blank', '_blank'); myrepository.postmethod('myserviceurl', myArgs) .then(function(result) { win.location.href = 'http://yourtargetlocation.com/dir/page'; }); ``` You open the new window tab before the sync call while you're still in scope, grab the window...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
Try to add ``` window.open(url,'_blank'); ``` ### Edit Well, I don't think you can get around popup-blockers when opening a page that's not the immediate result of a user action (i.e. not async). You could try something like this though, it should look like a user action to a popup-blocker: ``` var $a = $('<a>',...
The answer posted by @pstenstrm above (Edit 2) mostly works, but I added just one line to it to make the solution more elegant. The ajax call in my case was taking more than a second and the user facing a blank page posed a problem. The good thing is that there is a way to put HTML content in the new window that we've ...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
Try to add ``` window.open(url,'_blank'); ``` ### Edit Well, I don't think you can get around popup-blockers when opening a page that's not the immediate result of a user action (i.e. not async). You could try something like this though, it should look like a user action to a popup-blocker: ``` var $a = $('<a>',...
There is no reliable way. If your tab/window has been blocked by a pop-blocker in FF and IE6 SP2 then window.open will return the value null. <https://developer.mozilla.org/en-US/docs/Web/API/Window/open#FAQ> > > How can I tell when my window was blocked by a popup blocker? With the > built-in popup blockers of Moz...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
Try adding async: false. It should be working ``` $('#myButton').click(function() { $.ajax({ type: 'POST', async: false, url: '/echo/json/', data: {'json': JSON.stringify({ url:'http://google.com'})}, success: function(data) { window.open(data.url,'_blank'); } }); }); ```
The answer posted by @pstenstrm above (Edit 2) mostly works, but I added just one line to it to make the solution more elegant. The ajax call in my case was taking more than a second and the user facing a blank page posed a problem. The good thing is that there is a way to put HTML content in the new window that we've ...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
Try adding async: false. It should be working ``` $('#myButton').click(function() { $.ajax({ type: 'POST', async: false, url: '/echo/json/', data: {'json': JSON.stringify({ url:'http://google.com'})}, success: function(data) { window.open(data.url,'_blank'); } }); }); ```
There is no reliable way. If your tab/window has been blocked by a pop-blocker in FF and IE6 SP2 then window.open will return the value null. <https://developer.mozilla.org/en-US/docs/Web/API/Window/open#FAQ> > > How can I tell when my window was blocked by a popup blocker? With the > built-in popup blockers of Moz...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
What worked for me was: ``` var win = window.open('about:blank', '_blank'); myrepository.postmethod('myserviceurl', myArgs) .then(function(result) { win.location.href = 'http://yourtargetlocation.com/dir/page'; }); ``` You open the new window tab before the sync call while you're still in scope, grab the window...
The answer posted by @pstenstrm above (Edit 2) mostly works, but I added just one line to it to make the solution more elegant. The ajax call in my case was taking more than a second and the user facing a blank page posed a problem. The good thing is that there is a way to put HTML content in the new window that we've ...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
What worked for me was: ``` var win = window.open('about:blank', '_blank'); myrepository.postmethod('myserviceurl', myArgs) .then(function(result) { win.location.href = 'http://yourtargetlocation.com/dir/page'; }); ``` You open the new window tab before the sync call while you're still in scope, grab the window...
There is no reliable way. If your tab/window has been blocked by a pop-blocker in FF and IE6 SP2 then window.open will return the value null. <https://developer.mozilla.org/en-US/docs/Web/API/Window/open#FAQ> > > How can I tell when my window was blocked by a popup blocker? With the > built-in popup blockers of Moz...
22,007,592
I have a situation where, when a user pushes a button I perform an ajax request, and then use the result of the ajax request to generate a URL which I want to open in a new tab. However, in chrome when I call window.open in the success handler for the ajax request, it opens in a new window like a popup (and is blocked ...
2014/02/25
[ "https://Stackoverflow.com/questions/22007592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543666/" ]
The answer posted by @pstenstrm above (Edit 2) mostly works, but I added just one line to it to make the solution more elegant. The ajax call in my case was taking more than a second and the user facing a blank page posed a problem. The good thing is that there is a way to put HTML content in the new window that we've ...
There is no reliable way. If your tab/window has been blocked by a pop-blocker in FF and IE6 SP2 then window.open will return the value null. <https://developer.mozilla.org/en-US/docs/Web/API/Window/open#FAQ> > > How can I tell when my window was blocked by a popup blocker? With the > built-in popup blockers of Moz...
318,777
I am using the unix `pr` command to combine multiple text files into one text file: ``` pr -F *files > newfile ``` Each file is a different length, a different number of lines. I am mostly happy with the result, I like that it includes the name of the original text file followed by the contents of that file. However...
2013/07/11
[ "https://askubuntu.com/questions/318777", "https://askubuntu.com", "https://askubuntu.com/users/148317/" ]
You can use the AWK utility: ``` awk 'FNR==1{print ""}{print}' *files > newfile ``` Source: <https://stackoverflow.com/questions/1653063/how-do-i-include-a-blank-line-between-files-im-concatenating-with-cat>
You can use `cat` to dump the text of files into one file with: ``` cat file1 file2 file3 > newfile ```
318,777
I am using the unix `pr` command to combine multiple text files into one text file: ``` pr -F *files > newfile ``` Each file is a different length, a different number of lines. I am mostly happy with the result, I like that it includes the name of the original text file followed by the contents of that file. However...
2013/07/11
[ "https://askubuntu.com/questions/318777", "https://askubuntu.com", "https://askubuntu.com/users/148317/" ]
To have empty lines betwen files: ``` cat file1 newline file2 newline file3 > newfile ``` Where 'newline' is file with empty line.
You can use `cat` to dump the text of files into one file with: ``` cat file1 file2 file3 > newfile ```
318,777
I am using the unix `pr` command to combine multiple text files into one text file: ``` pr -F *files > newfile ``` Each file is a different length, a different number of lines. I am mostly happy with the result, I like that it includes the name of the original text file followed by the contents of that file. However...
2013/07/11
[ "https://askubuntu.com/questions/318777", "https://askubuntu.com", "https://askubuntu.com/users/148317/" ]
``` for file in *.txt; do (cat "${file}"; echo) >> concatenated.txt; done ``` The above will append the contents of eacb txt file into concatenated.txt adding a new line between them.
You can use `cat` to dump the text of files into one file with: ``` cat file1 file2 file3 > newfile ```
318,777
I am using the unix `pr` command to combine multiple text files into one text file: ``` pr -F *files > newfile ``` Each file is a different length, a different number of lines. I am mostly happy with the result, I like that it includes the name of the original text file followed by the contents of that file. However...
2013/07/11
[ "https://askubuntu.com/questions/318777", "https://askubuntu.com", "https://askubuntu.com/users/148317/" ]
You can use the AWK utility: ``` awk 'FNR==1{print ""}{print}' *files > newfile ``` Source: <https://stackoverflow.com/questions/1653063/how-do-i-include-a-blank-line-between-files-im-concatenating-with-cat>
``` for file in *.txt; do (cat "${file}"; echo) >> concatenated.txt; done ``` The above will append the contents of eacb txt file into concatenated.txt adding a new line between them.
318,777
I am using the unix `pr` command to combine multiple text files into one text file: ``` pr -F *files > newfile ``` Each file is a different length, a different number of lines. I am mostly happy with the result, I like that it includes the name of the original text file followed by the contents of that file. However...
2013/07/11
[ "https://askubuntu.com/questions/318777", "https://askubuntu.com", "https://askubuntu.com/users/148317/" ]
To have empty lines betwen files: ``` cat file1 newline file2 newline file3 > newfile ``` Where 'newline' is file with empty line.
``` for file in *.txt; do (cat "${file}"; echo) >> concatenated.txt; done ``` The above will append the contents of eacb txt file into concatenated.txt adding a new line between them.
2,176,180
I want to get the dynamic contents from a particular url: I have used the code ``` echo $content=file_get_contents('http://www.punoftheday.com/cgi-bin/arandompun.pl'); ``` I am getting following results: ``` document.write('"Bakers have a great knead to make bread." ') document.write('© 1996-2007 Pun of the Day....
2010/02/01
[ "https://Stackoverflow.com/questions/2176180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146192/" ]
You are fetching a JavaScript snippet that is supposed to be built in directly into the document, not queried by a script. The code inside is JavaScript. You could pull out the code using a regular expression, but I would advise against it. First, it's probably not legal to do. Second, the format of the data they serv...
Pekka's answer is probably the best way of doing this. But anyway here's the regex you might want to use in case you find yourself doing something like this, and can't rely on RSS feeds etc. ``` document\.write\(' // start tag ([^)]*) // the data to match '\) // end tag ``` *...
2,176,180
I want to get the dynamic contents from a particular url: I have used the code ``` echo $content=file_get_contents('http://www.punoftheday.com/cgi-bin/arandompun.pl'); ``` I am getting following results: ``` document.write('"Bakers have a great knead to make bread." ') document.write('© 1996-2007 Pun of the Day....
2010/02/01
[ "https://Stackoverflow.com/questions/2176180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146192/" ]
You are fetching a JavaScript snippet that is supposed to be built in directly into the document, not queried by a script. The code inside is JavaScript. You could pull out the code using a regular expression, but I would advise against it. First, it's probably not legal to do. Second, the format of the data they serv...
1) **several local methods** ``` <?php echo readfile("http://example.com/"); //needs "Allow_url_include" enabled echo include("http://example.com/"); //needs "Allow_url_include" enabled echo file_get_contents("http://example.com/"); echo stream_get_contents(fopen('http://example.com/', "rb"))...
13,894,589
When I started `JUnit Plug-in Test`, I always have eclipse GUI launched. Can I change the setup to prevent this? I'm testing eclipse plugin - [Difference between `JUnit Plug-in Test` and `JUnit Test` in eclipse](https://stackoverflow.com/questions/13894287/difference-between-junit-plug-in-test-and-junit-test-in-eclip...
2012/12/15
[ "https://Stackoverflow.com/questions/13894589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/260127/" ]
Are you developing Eclipse plugins (or an RCP application)? **No**: You don't want to run a "JUnit Plugin test". Always run your tests as "Junit test". **Yes**: On the "Main" tab of your Junit Plugin test launch configuration, select the radio button "Run an application" and choose the application "No application - H...
In my opinion this is a problem of the Plug-in Development Environment (PDE) tooling of the Eclipse IDE. When you select “Run as > JUnit Plug-in Test”, Eclipse is starting all plug-ins in your workspace to run the tests. ![Run as > JUnit Plug-in Test](https://i.stack.imgur.com/BUbCE.png) You can check this by opening...
86,074
I want to be able to reference a table value in my text (this is because I often update my tables, and then list the specific values in the text). Here is an example table I would use: ``` % Example Table \documentclass{minimal} \begin{filecontents*}{scientists.csv} name,surname,age Albert,Einstein,133 Marie,Curie,145...
2012/12/08
[ "https://tex.stackexchange.com/questions/86074", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/21998/" ]
Another alternative without modifying the data is via `\pgfplotstablegetelem`...`\pgfplotsretval` pair. Note that the row index starts from 0 instead of 1. ``` \documentclass{article} \usepackage{pgfplotstable} \begin{filecontents*}{scientists.csv} name,surname,age Albert,Einstein,133 Marie,Curie,145 Thomas,Edison,165...
If it is an option to have your csv files suitably prepared, try this (here I bundled the filecontents thing and the table in one latex source) ``` \documentclass{article} \makeatletter \def\printandsetlabel#1#2#3{#2\setcounter{#1}{#2}% \protected@edef\@currentlabel {\csname p@#1\endcsname\csname the#1\endcsname}% ...
12,637,946
I have this common statement in my code ``` <body link="#FFFF00" vlink="#FFFF00" alink="#FFFF00"> ``` Web Expression 4 highlight the code with a message 'The World Wide Web Consortium now regards the attributes as outdated. Newer constructs are recommended.' Unfortunately it doesn't give me any more information. W...
2012/09/28
[ "https://Stackoverflow.com/questions/12637946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595577/" ]
You shouldn't embed styling within the structure of HTML - that's why you are getting the message. It's been quite a while that a separation between the document structure and how it looks has been accepted as a good thing - style goes into CSS. To resolve the issue, use CSS. For links you should style the `a` elemen...
The attributes still work the same way they used to. Replacing them with CSS would be trivial, but would not change anything (except in the relatively rare cases where CSS is disabled – then default link colors would be used). Using CSS would be useful if you wanted to use different colors for different links on a pag...
59,388,941
I want to achieve this requirement if vertical stack has two label than Text should be centre aligned to image [![enter image description here](https://i.stack.imgur.com/78wvS.png)](https://i.stack.imgur.com/78wvS.png) and if not than top aligned to Image [![enter image description here](https://i.stack.imgur.com/...
2019/12/18
[ "https://Stackoverflow.com/questions/59388941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2442383/" ]
One other solution besides dask is to use `chunksize` parameter in `pd.read_csv`, then `pd.concat` your chunks. A quick example: ```py chunksize = 1000 l = pd.read_csv('doc.csv', chunksize=chunksize, iterator=True) df = pd.concat(l, ignore_index=True) ``` Addition: To do something with the chunks one by one you can...
You could use [`dask`](https://dask.org/), which is specially built for this. ``` import dask.dataframe as dd dd.read_csv("doc.csv", sep = "\t").sum().compute() ```
59,388,941
I want to achieve this requirement if vertical stack has two label than Text should be centre aligned to image [![enter image description here](https://i.stack.imgur.com/78wvS.png)](https://i.stack.imgur.com/78wvS.png) and if not than top aligned to Image [![enter image description here](https://i.stack.imgur.com/...
2019/12/18
[ "https://Stackoverflow.com/questions/59388941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2442383/" ]
You could use [`dask`](https://dask.org/), which is specially built for this. ``` import dask.dataframe as dd dd.read_csv("doc.csv", sep = "\t").sum().compute() ```
u can use `pandas.Series.append` and `pandas.DataFrame.sum` along with `pandas.DataFrame.iloc`, while reading the data in chunks, ``` row_sum = pd.Series([]) for chunk in pd.read_csv('doc.csv',sep = "\t" ,chunksize=50000): row_sum = row_sum.append(chunk.iloc[:,3:].sum(axis = 1, skipna = True)) ```
59,388,941
I want to achieve this requirement if vertical stack has two label than Text should be centre aligned to image [![enter image description here](https://i.stack.imgur.com/78wvS.png)](https://i.stack.imgur.com/78wvS.png) and if not than top aligned to Image [![enter image description here](https://i.stack.imgur.com/...
2019/12/18
[ "https://Stackoverflow.com/questions/59388941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2442383/" ]
One other solution besides dask is to use `chunksize` parameter in `pd.read_csv`, then `pd.concat` your chunks. A quick example: ```py chunksize = 1000 l = pd.read_csv('doc.csv', chunksize=chunksize, iterator=True) df = pd.concat(l, ignore_index=True) ``` Addition: To do something with the chunks one by one you can...
u can use `pandas.Series.append` and `pandas.DataFrame.sum` along with `pandas.DataFrame.iloc`, while reading the data in chunks, ``` row_sum = pd.Series([]) for chunk in pd.read_csv('doc.csv',sep = "\t" ,chunksize=50000): row_sum = row_sum.append(chunk.iloc[:,3:].sum(axis = 1, skipna = True)) ```
16,454,252
I have a Maven project. I have converted it to eclipse project using the command. ``` mvn eclipse:eclipse ``` **I imported this project to eclipse. I am getting missing library error.** I have updated the maven repository details in Maven setting of eclipse. My current maven repository is `E:\myfolder\repository` ...
2013/05/09
[ "https://Stackoverflow.com/questions/16454252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1262477/" ]
In eclipse, go to `Preferences` > `Maven` > `Installations` Make sure that the **Global Settings** file is pointing to the right config and it is pointing to the right local repository.
Are you sure you did all the configurations and only then executed mvn eclipse:eclipse? Also is this mvn pointing to the same maven installation which you have configured? Before open the project in eclipse just check the generated .classpath file and see if it points to wrong location repo. Although I would suggest t...
16,454,252
I have a Maven project. I have converted it to eclipse project using the command. ``` mvn eclipse:eclipse ``` **I imported this project to eclipse. I am getting missing library error.** I have updated the maven repository details in Maven setting of eclipse. My current maven repository is `E:\myfolder\repository` ...
2013/05/09
[ "https://Stackoverflow.com/questions/16454252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1262477/" ]
This is what worked for me: In Eclipse, Windows->Preferences->Maven->User Settings Even if the settings.xml was updated as expected it was still pointing to default directory. So i did 'Restore Defaults' then 'Apply' And then i again changed the Global Settings and User Settings to point to correct settings.xml. Do Re...
Are you sure you did all the configurations and only then executed mvn eclipse:eclipse? Also is this mvn pointing to the same maven installation which you have configured? Before open the project in eclipse just check the generated .classpath file and see if it points to wrong location repo. Although I would suggest t...
16,454,252
I have a Maven project. I have converted it to eclipse project using the command. ``` mvn eclipse:eclipse ``` **I imported this project to eclipse. I am getting missing library error.** I have updated the maven repository details in Maven setting of eclipse. My current maven repository is `E:\myfolder\repository` ...
2013/05/09
[ "https://Stackoverflow.com/questions/16454252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1262477/" ]
In eclipse, go to `Preferences` > `Maven` > `Installations` Make sure that the **Global Settings** file is pointing to the right config and it is pointing to the right local repository.
This is what worked for me: In Eclipse, Windows->Preferences->Maven->User Settings Even if the settings.xml was updated as expected it was still pointing to default directory. So i did 'Restore Defaults' then 'Apply' And then i again changed the Global Settings and User Settings to point to correct settings.xml. Do Re...
8,487,843
My Java program that opens up a webcam stream and streams the captured video to a Swing component works, but when I launch it, it causes Windows to switch to the Basic theme. This is an excerpt from my code: ``` String str1 = "vfw:Logitech USB Video Camera:0"; String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";...
2011/12/13
[ "https://Stackoverflow.com/questions/8487843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230654/" ]
> > What is the technical name for them (ATL? ActiveX? ActiveX control? Automation? or...?) > > > Internet Explorer refers to both as *ActiveX controls* (see the *Type* column in the image below) ![](https://kb2.adobe.com/cps/194/tn_19482/images/manage_add.gif) * **ATL (Active Template Library)** refers to a lib...
This family of late-bound objects are most often referred to as COM (Common Object Model) Objects. The loosely applied term "COM" typically encompasses any OLE, OLE Automation, ActiveX, COM+, or DCOM object. Essentially, this is any object that provides a scriptable (IUnknown) interface through any number of technologi...
8,487,843
My Java program that opens up a webcam stream and streams the captured video to a Swing component works, but when I launch it, it causes Windows to switch to the Basic theme. This is an excerpt from my code: ``` String str1 = "vfw:Logitech USB Video Camera:0"; String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";...
2011/12/13
[ "https://Stackoverflow.com/questions/8487843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230654/" ]
From the documentation of ActiveXObject function in MSDN: An object that provides an interface to an **Automation object**. An automation object is a COM object whose class exposes IDispatch. ActiveX control, strictly speaking, is designed for a container. The OLE interfaces like IOleObject and IOleControl define ...
This family of late-bound objects are most often referred to as COM (Common Object Model) Objects. The loosely applied term "COM" typically encompasses any OLE, OLE Automation, ActiveX, COM+, or DCOM object. Essentially, this is any object that provides a scriptable (IUnknown) interface through any number of technologi...
8,487,843
My Java program that opens up a webcam stream and streams the captured video to a Swing component works, but when I launch it, it causes Windows to switch to the Basic theme. This is an excerpt from my code: ``` String str1 = "vfw:Logitech USB Video Camera:0"; String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";...
2011/12/13
[ "https://Stackoverflow.com/questions/8487843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230654/" ]
> > What is the technical name for them (ATL? ActiveX? ActiveX control? Automation? or...?) > > > Internet Explorer refers to both as *ActiveX controls* (see the *Type* column in the image below) ![](https://kb2.adobe.com/cps/194/tn_19482/images/manage_add.gif) * **ATL (Active Template Library)** refers to a lib...
From the documentation of ActiveXObject function in MSDN: An object that provides an interface to an **Automation object**. An automation object is a COM object whose class exposes IDispatch. ActiveX control, strictly speaking, is designed for a container. The OLE interfaces like IOleObject and IOleControl define ...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
There are three things which effect compatibility and performance when connecting external storage: 1. The physical connector and cable. The 2020 iMac has four USB Type A (USB-A) and two USB Type C (USB-C) connectors. 2. The data transfer protocol - USB 1, USB 2, USB 3 (and later variants 3.1 and 3.2) and Thunderbolt....
I have a 2018 Mac mini which has the same USB and Thunderbolt 3 capabilities as your Mac. I also have a Thunderbolt 3 [Samsung X5](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/x5/) SSD and a 10 Gb/s USB [Samsung T7](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/t7/) SSD. I w...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
The fastest port on your iMac is the Thunderbolt port. It can support data rates as high as 40Gbit/s, which is 5GB/s. Now most consumer SSDs are pretty fast but won't exceed that theoretical limit of 5GB/s. The fastet you can usually get is about 3GB/s, which you could do with [this enclosure](https://www.amazon.de/Nv...
Im keeping this fairly non-technical, so I'm sure someone will be along to quibble with the details. ;-) Thunderbolt is "lots of different things". It includes PCIe, which is the standard for connecting devices to computers' motherboards. So instead of having a slot on the board, you now have a cable. It also includes...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
There are three things which effect compatibility and performance when connecting external storage: 1. The physical connector and cable. The 2020 iMac has four USB Type A (USB-A) and two USB Type C (USB-C) connectors. 2. The data transfer protocol - USB 1, USB 2, USB 3 (and later variants 3.1 and 3.2) and Thunderbolt....
Im keeping this fairly non-technical, so I'm sure someone will be along to quibble with the details. ;-) Thunderbolt is "lots of different things". It includes PCIe, which is the standard for connecting devices to computers' motherboards. So instead of having a slot on the board, you now have a cable. It also includes...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
I have a 2018 Mac mini which has the same USB and Thunderbolt 3 capabilities as your Mac. I also have a Thunderbolt 3 [Samsung X5](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/x5/) SSD and a 10 Gb/s USB [Samsung T7](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/t7/) SSD. I w...
If you see Mactracker : <https://apps.apple.com/us/app/mactracker/id430255202?mt=12> your Mac have 2 Thunderbolt 3 port : ``` Thunderbolt 2 - Thunderbolt 3 (up to 40 Gbps) ``` So it's the fastest on your Mac. The externals enclosures SSD Thunderbolt 3 have inside a NVME SSD. For exemple you have the Samsung X5.
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
If you see Mactracker : <https://apps.apple.com/us/app/mactracker/id430255202?mt=12> your Mac have 2 Thunderbolt 3 port : ``` Thunderbolt 2 - Thunderbolt 3 (up to 40 Gbps) ``` So it's the fastest on your Mac. The externals enclosures SSD Thunderbolt 3 have inside a NVME SSD. For exemple you have the Samsung X5.
Im keeping this fairly non-technical, so I'm sure someone will be along to quibble with the details. ;-) Thunderbolt is "lots of different things". It includes PCIe, which is the standard for connecting devices to computers' motherboards. So instead of having a slot on the board, you now have a cable. It also includes...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
There are three things which effect compatibility and performance when connecting external storage: 1. The physical connector and cable. The 2020 iMac has four USB Type A (USB-A) and two USB Type C (USB-C) connectors. 2. The data transfer protocol - USB 1, USB 2, USB 3 (and later variants 3.1 and 3.2) and Thunderbolt....
If you see Mactracker : <https://apps.apple.com/us/app/mactracker/id430255202?mt=12> your Mac have 2 Thunderbolt 3 port : ``` Thunderbolt 2 - Thunderbolt 3 (up to 40 Gbps) ``` So it's the fastest on your Mac. The externals enclosures SSD Thunderbolt 3 have inside a NVME SSD. For exemple you have the Samsung X5.
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
There are three things which effect compatibility and performance when connecting external storage: 1. The physical connector and cable. The 2020 iMac has four USB Type A (USB-A) and two USB Type C (USB-C) connectors. 2. The data transfer protocol - USB 1, USB 2, USB 3 (and later variants 3.1 and 3.2) and Thunderbolt....
### If money is no object, an enterprise-grade PCIe SSD via Thunderbolt for >3.5GB/s sequential read or write, and over 1 million IOPS\* (IO ops / sec). Most likely a recent Intel Optane SSD using 3D XPoint memory, not flash, although there are fast enterprise SSDs from other vendors. Numbers in the title are a rough ...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
There are three things which effect compatibility and performance when connecting external storage: 1. The physical connector and cable. The 2020 iMac has four USB Type A (USB-A) and two USB Type C (USB-C) connectors. 2. The data transfer protocol - USB 1, USB 2, USB 3 (and later variants 3.1 and 3.2) and Thunderbolt....
The fastest port on your iMac is the Thunderbolt port. It can support data rates as high as 40Gbit/s, which is 5GB/s. Now most consumer SSDs are pretty fast but won't exceed that theoretical limit of 5GB/s. The fastet you can usually get is about 3GB/s, which you could do with [this enclosure](https://www.amazon.de/Nv...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
I have a 2018 Mac mini which has the same USB and Thunderbolt 3 capabilities as your Mac. I also have a Thunderbolt 3 [Samsung X5](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/x5/) SSD and a 10 Gb/s USB [Samsung T7](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/t7/) SSD. I w...
### If money is no object, an enterprise-grade PCIe SSD via Thunderbolt for >3.5GB/s sequential read or write, and over 1 million IOPS\* (IO ops / sec). Most likely a recent Intel Optane SSD using 3D XPoint memory, not flash, although there are fast enterprise SSDs from other vendors. Numbers in the title are a rough ...
424,473
I know modern Macs all have USB3 support, but now there's USB 3.1, USB 3.2, NVMe and of course thunderbolt (presumably multiple versions) and I am lost. What does the 2020 Intel iMac 27" support? What does that mean for data transfer speeds? When buying an external drive what do I need to look out for to make sure it ...
2021/07/23
[ "https://apple.stackexchange.com/questions/424473", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/38485/" ]
I have a 2018 Mac mini which has the same USB and Thunderbolt 3 capabilities as your Mac. I also have a Thunderbolt 3 [Samsung X5](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/x5/) SSD and a 10 Gb/s USB [Samsung T7](https://www.samsung.com/semiconductor/minisite/ssd/product/portable/t7/) SSD. I w...
The fastest port on your iMac is the Thunderbolt port. It can support data rates as high as 40Gbit/s, which is 5GB/s. Now most consumer SSDs are pretty fast but won't exceed that theoretical limit of 5GB/s. The fastet you can usually get is about 3GB/s, which you could do with [this enclosure](https://www.amazon.de/Nv...
572,564
I am in the middle of writing a paper, and I want to highlight the importance of "learning" in the following sentence. > > Nowadays, we use our mobile phones for different purposes: > communicating with friends and relatives, transportation, shopping, and > **learning**. > > > Is there any way to attract readers'...
2021/08/10
[ "https://english.stackexchange.com/questions/572564", "https://english.stackexchange.com", "https://english.stackexchange.com/users/420010/" ]
The expression "*not least*" is useful to single out the term that follow it as special, important, noteworthy. * Nowadays, we use our mobile phones for different purposes: communicating with friends and relatives, transportation, shopping, and *not least*, learning. > > ([FreeDictionary](https://idioms.thefreedicti...
You could set traditional use(s) apart from newer ones, and emphasize the last with an adverb, something like: > > Nowadays, we use our mobile phones **not only** for communicating with > friends and relatives, **but also** for transportation, shopping, and > **especially/particularly** learning. > > > (or *.... ...
572,564
I am in the middle of writing a paper, and I want to highlight the importance of "learning" in the following sentence. > > Nowadays, we use our mobile phones for different purposes: > communicating with friends and relatives, transportation, shopping, and > **learning**. > > > Is there any way to attract readers'...
2021/08/10
[ "https://english.stackexchange.com/questions/572564", "https://english.stackexchange.com", "https://english.stackexchange.com/users/420010/" ]
The expression "*not least*" is useful to single out the term that follow it as special, important, noteworthy. * Nowadays, we use our mobile phones for different purposes: communicating with friends and relatives, transportation, shopping, and *not least*, learning. > > ([FreeDictionary](https://idioms.thefreedicti...
In your particular case, since the element you wish to emphasise is the last on your list, it is common to use the expression ***last but not least***, which means: > > importantly, despite being mentioned after everyone else; despite being mentioned at the end: > > > * I would like to thank my publisher, my editor...
70,675,709
I would like to create a separation between the groups (D, E, F, G, H, I e J) of slashes inside ggplot. Using the diamonds database. ``` ggplot(diamonds, aes(x = color, y=depth, fill=factor(clarity ))) + geom_col(position = "dodge")+ scale_fill_manual(values = c("red4", "seagreen3", "grey", "yellow", "black", "bl...
2022/01/12
[ "https://Stackoverflow.com/questions/70675709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14212922/" ]
using `geom_vline` ``` ggplot(diamonds, aes(x = color, y=depth, fill=factor(clarity ))) + geom_col(position = "dodge")+ scale_fill_manual(values = c("red4", "seagreen3", "grey", "yellow", "black", "blue", "green", "sienna","tomato1", "tan2"), name="clarity") + theme_light() + geom_vline(xintercept = (0:7)+0.5)...
**EDIT: new answer - use `geom_rect`.** ``` ggplot(diamonds, aes(x = color, y = depth, fill = factor(clarity ))) + geom_col(position = "dodge") + geom_rect(aes(xmin = as.numeric(color) - 0.5, xmax = as.numeric(color) + 0.5), ymin = -0.5, ...
70,675,709
I would like to create a separation between the groups (D, E, F, G, H, I e J) of slashes inside ggplot. Using the diamonds database. ``` ggplot(diamonds, aes(x = color, y=depth, fill=factor(clarity ))) + geom_col(position = "dodge")+ scale_fill_manual(values = c("red4", "seagreen3", "grey", "yellow", "black", "bl...
2022/01/12
[ "https://Stackoverflow.com/questions/70675709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14212922/" ]
using `geom_vline` ``` ggplot(diamonds, aes(x = color, y=depth, fill=factor(clarity ))) + geom_col(position = "dodge")+ scale_fill_manual(values = c("red4", "seagreen3", "grey", "yellow", "black", "blue", "green", "sienna","tomato1", "tan2"), name="clarity") + theme_light() + geom_vline(xintercept = (0:7)+0.5)...
The `geom_vline()` method already posted in [this answer](https://stackoverflow.com/a/70675991/9664796) will answer your specific request quite well; however, it's probably not the best solution to your problem *graphically*. Even with lines drawn between the bars... it's super difficult to separate visually the sets o...
58,395,576
Given an application converting csv to parquet (from and to S3) with little transformation: ``` for table in tables: df_table = spark.read.format('csv') \ .option("header", "true") \ .option("escape", "\"") \ .load(path) df_one_seven_thirty_days = df_table \ .fi...
2019/10/15
[ "https://Stackoverflow.com/questions/58395576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2599698/" ]
I would recommend: ``` select r1.* from R1 where exists (select 1 from r2 where r1.a = r2.val) or exists (select 1 from r2 where r1.b = r2.val); ``` Then, you want an index on `r2(val)`. If `r2` is *really* small and `r1` is *really* big and there are separate indexes on `r1(a)` and `r1(b)`, then this might b...
And how about ``` select * from r1 join r2 on r1.a=r2.val union select * from r1 join r2 on r1.b=r2.val ``` ?
58,395,576
Given an application converting csv to parquet (from and to S3) with little transformation: ``` for table in tables: df_table = spark.read.format('csv') \ .option("header", "true") \ .option("escape", "\"") \ .load(path) df_one_seven_thirty_days = df_table \ .fi...
2019/10/15
[ "https://Stackoverflow.com/questions/58395576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2599698/" ]
It seems like in this specific case the first query I suggested in my main comment provides the best performance : ``` select * from R1 where R1.a in (select VAL from R2) or R1.b in (select VAL from R2); ``` @klin prepared a dbfiddle with all the execution plans if someone want to have a look : <https://dbfiddle.u...
And how about ``` select * from r1 join r2 on r1.a=r2.val union select * from r1 join r2 on r1.b=r2.val ``` ?