qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
58,223,934
So I'm trying to rename columns for a tibble that displays summary statistics in my R code. But for columns I add to the tibble I can't seem to change their names completely Here's the code to get the median minimum and maximum from the dataframe 'UScereal': ``` UScereal %>% #get median group_by(mfr) %>% summaris...
2019/10/03
[ "https://Stackoverflow.com/questions/58223934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12160479/" ]
In terms of sets, the items in `a` but not in `b` would be the set difference, therefore this would be ``` for i in set(a).difference(b): # statements ```
What you have is fine. If you object to the `continue` statement, you can iterate over a generator: ``` for i in (x for x in a if x not in b): ``` though that is arguably worse in terms of readability.
8,811,465
I've recently been assigned to a C++ project involving information being sent between computers via UDP. When a packet arrives, I have a program which accepts the data and can display it as a raw hexadecimal string. However, I'm struggling to grasp exactly how this whole process is supposed to work. The hex string supp...
2012/01/10
[ "https://Stackoverflow.com/questions/8811465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/529876/" ]
All types in C have a representation (which for most types is defined by a particular implementation). Most C implementations use [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754-2008) for representing the floating types (this may actually be a requirement for C and C++, but from memory it is not). The Wikipedia articl...
If you have a hex value: ``` 42 01 33 33 ``` It is the equivalent of ``` 0100 0010 0000 0001 0011 0011 0011 0011 ``` in binary code. Now, there is a floating point standard called [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754-2008) which tells you how to format a floating point number into binary or back. Th...
8,811,465
I've recently been assigned to a C++ project involving information being sent between computers via UDP. When a packet arrives, I have a program which accepts the data and can display it as a raw hexadecimal string. However, I'm struggling to grasp exactly how this whole process is supposed to work. The hex string supp...
2012/01/10
[ "https://Stackoverflow.com/questions/8811465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/529876/" ]
All types in C have a representation (which for most types is defined by a particular implementation). Most C implementations use [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754-2008) for representing the floating types (this may actually be a requirement for C and C++, but from memory it is not). The Wikipedia articl...
The exact data format is specified by the protocol used, but the common ways to represent numeric data are: Unsigned integer: This is actually the simplest. Its typical representation works in principle like our normal decimal system, except that the "digits" are bytes, and can have 256 different values. If you look ...
8,811,465
I've recently been assigned to a C++ project involving information being sent between computers via UDP. When a packet arrives, I have a program which accepts the data and can display it as a raw hexadecimal string. However, I'm struggling to grasp exactly how this whole process is supposed to work. The hex string supp...
2012/01/10
[ "https://Stackoverflow.com/questions/8811465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/529876/" ]
If you have a hex value: ``` 42 01 33 33 ``` It is the equivalent of ``` 0100 0010 0000 0001 0011 0011 0011 0011 ``` in binary code. Now, there is a floating point standard called [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754-2008) which tells you how to format a floating point number into binary or back. Th...
The exact data format is specified by the protocol used, but the common ways to represent numeric data are: Unsigned integer: This is actually the simplest. Its typical representation works in principle like our normal decimal system, except that the "digits" are bytes, and can have 256 different values. If you look ...
68,697,579
I am creating a Xamarin Forms mobile app using VS 2019 latest version. Xamarin Forms and Essentials packages are also updated to latest. I have following viewmodel, but the LoadHouses() method is not called via ``` 24. LoadHousesCommand = new AsyncCommand(LoadHouses); ``` [![enter image description here](https://i....
2021/08/08
[ "https://Stackoverflow.com/questions/68697579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2568168/" ]
You can bind the Command with a button or something can execute to call the method, like: ``` <StackLayout> <Button Text="Load" Command="{Binding LoadHouseCommand}"/> <CollectionView x:Name="col"> <CollectionView.ItemTemplate> <DataTemplate> ...
If you don't want to bind your command to button or anything. You can simply execute your command from your xaml.cs file like below. From OnAppearing before your page load. It is the best way for web api. ``` protected override void OnAppearing() { base.OnAppearing(); var vm = BindingContext as H...
33,666,439
I Try to getting the text form same div on button click event. Here is my HTML Markup: ``` <div class="flights"> <div class="flight-box"> <div class="row"> <div class="col-sm-3"> <div class="flight-info"> <div class="left-i"> <img src=...
2015/11/12
[ "https://Stackoverflow.com/questions/33666439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2479903/" ]
The issue with your current code is that the `.flight-info` element is not a direct parent of `.btn-book`, it's a sibling of one of the parents. This is why the `.flight-info` selector on `closest()` returns nothing. The easiest way to achieve what you require is to use `closest()` to get the nearest common parent of ...
you need to use **.find()** with **.closest()** and **div.left-i** is children of **div.flight-info** not **parent()** use it like this ``` $('.btn-book').on('click', function(){ var flightNo = $(this).closest('.flight-box').find('div.left-i .flight-no').html(); alert(flightNo); }); ``` [**DEMO**](https://jsfiddl...
65,852,264
Following [this link](https://medium.com/swlh/using-xlnet-for-sentiment-classification-cfa948e65e85), I am trying to use my own data to do sentiment analysis. But I get this error: ``` --------------------------------------------------------------------------- RuntimeError Traceback (most ...
2021/01/22
[ "https://Stackoverflow.com/questions/65852264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12090782/" ]
Shape [4,64] in your example is actually [batch size, max\_sequence\_length] So maybe you could replace them with your values...
However you haven't posted your sample data but it is evident that how you are using your `reshape` [function](https://numpy.org/devdocs/reference/generated/numpy.reshape.html). With respect to your question to `reshape` `d["input_ids"]` into shape `(4,64)` then `d["input_ids"]` should be an array of size `256` but act...
40,134,955
I have a bot from Bot Libre connected to my Facebook page and Facebook Messenger. The bot has its own Facebook app, that has been approved, and has been running for several month without issues. But the last two days I suddenly get the error below any time I call a Facebook API, ``` message - (#32) Page request limit...
2016/10/19
[ "https://Stackoverflow.com/questions/40134955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/416206/" ]
Since July 11, 2016 Facebook has "improved" the Facebook Graph API rate limit **for page**. What's my current rate limit? ============================= --- Now your **current rate limit** (current 24-hour window) is calculated using last 24-hour window number of engaged users. Engagement includes **a click on the P...
I just faced similar problem with new desktop app, please look at [this](https://developers.facebook.com/blog/post/2016/06/16/page-level-rate-limits/). Also look at your app Page Level Rate Limiting regarding your page (select it in combobox).
5,850,982
simple question for this code in click function: ``` curSlide = $(this); alert( curSlide == $(this)); ``` how come it traces 'false'?
2011/05/01
[ "https://Stackoverflow.com/questions/5850982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/733616/" ]
It's because every time you call `$(...)` jQuery creates a new object. Hence although the contents of that object might be similar (if not identical), they're *not actually the same object*.
As @Alnitak says, it's because `$()` makes a new object. To compare jQuery objects, you can use [`.is()`](http://api.jquery.com/is/). ``` curSlide = $(this); alert(curSlide.is(this)); ```
243,914
I have a list view that after a double click, a record opens a new form to show the details, but the record in the list view lost the "selection".... How do I know which record was clicked ??? Thanks Maria João
2008/10/28
[ "https://Stackoverflow.com/questions/243914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32115/" ]
The listview control has a *HideSelection* property that defaults to True. Set this to False and the current row will remain highlighted even if the control loses focus.
Try setting the HideSelection property on the list view to false. It's enabled by default.
243,914
I have a list view that after a double click, a record opens a new form to show the details, but the record in the list view lost the "selection".... How do I know which record was clicked ??? Thanks Maria João
2008/10/28
[ "https://Stackoverflow.com/questions/243914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32115/" ]
The listview control has a *HideSelection* property that defaults to True. Set this to False and the current row will remain highlighted even if the control loses focus.
Note that the selection will turn "gray" when focus is lost, and "blue" when focused. Keeping it blue when the focus is lost is more difficult ... you'll have to override the ListView::DrawItem
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
Here is an example with CSS and inline `style` attributes: ```css td { height: 50px; width: 50px; } #cssTable td { text-align: center; vertical-align: middle; } ``` ```html <table border="1"> <tr> <td style="text-align: center; vertical-align: middle;">Text</td> <t...
If you are using Bootstrap, you can use inbuilt class ``` <table class="text-center align-middle"> ```
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
Here is an example with CSS and inline `style` attributes: ```css td { height: 50px; width: 50px; } #cssTable td { text-align: center; vertical-align: middle; } ``` ```html <table border="1"> <tr> <td style="text-align: center; vertical-align: middle;">Text</td> <t...
The following worked for me to vertically align content (multi-line) in a list-table ``` .. list-table:: :class: longtable :header-rows: 1 :stub-columns: 1 :align: left :widths: 20, 20, 20, 20, 20 * - Classification - Restricted - Company |br| Confidential - Internal Use Only - P...
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
The CSS to center text in your `td` elements is ```css td { text-align: center; vertical-align: middle; } ```
Selector > child: ```css .text-center-row>th, .text-center-row>td { text-align: center; } ``` ```html <table border="1" width='500px'> <tr class="text-center-row"> <th>Text</th> <th>Text</th> <th>Text</th> <th>Text</th> </tr> <tr> <td>Text</td> <td>Text</td> <td>Text</...
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
HTML in line styling example: ```html <td style='text-align:center; vertical-align:middle'></td> ``` CSS file example: ```css td { text-align: center; vertical-align: middle; } ```
Selector > child: ```css .text-center-row>th, .text-center-row>td { text-align: center; } ``` ```html <table border="1" width='500px'> <tr class="text-center-row"> <th>Text</th> <th>Text</th> <th>Text</th> <th>Text</th> </tr> <tr> <td>Text</td> <td>Text</td> <td>Text</...
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
HTML in line styling example: ```html <td style='text-align:center; vertical-align:middle'></td> ``` CSS file example: ```css td { text-align: center; vertical-align: middle; } ```
Try to put this in your CSS file. ```css td { text-align: center; vertical-align: middle; } ```
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
The CSS to center text in your `td` elements is ```css td { text-align: center; vertical-align: middle; } ```
If you are using Bootstrap, you can use inbuilt class ``` <table class="text-center align-middle"> ```
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
HTML in line styling example: ```html <td style='text-align:center; vertical-align:middle'></td> ``` CSS file example: ```css td { text-align: center; vertical-align: middle; } ```
```html <td align="center" valign="center">textgoeshere</td> ``` Is the only correct answer imho, since you're working with tables which is old functionality most common used for e-mail formatting. So your best bet is to not use just style but inline style and known table tags.
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
Here is an example with CSS and inline `style` attributes: ```css td { height: 50px; width: 50px; } #cssTable td { text-align: center; vertical-align: middle; } ``` ```html <table border="1"> <tr> <td style="text-align: center; vertical-align: middle;">Text</td> <t...
`<td align="center"valign="center">textgoeshere</td>` [more on valign](http://www.w3schools.com/tags/att_td_valign.asp)
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
Try to put this in your CSS file. ```css td { text-align: center; vertical-align: middle; } ```
`<td align="center"valign="center">textgoeshere</td>` [more on valign](http://www.w3schools.com/tags/att_td_valign.asp)
8,986,276
I'm constructing an area with selectable buttons that transition and appear every 10 frames. During these 10 frame transition periods I don't want the buttons to be selectable and if possible to disable the rollover. I've tried creating an If statement on the addEventListener so that it only works when currentFrame is...
2012/01/24
[ "https://Stackoverflow.com/questions/8986276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1071437/" ]
HTML in line styling example: ```html <td style='text-align:center; vertical-align:middle'></td> ``` CSS file example: ```css td { text-align: center; vertical-align: middle; } ```
If you are using Bootstrap, you can use inbuilt class ``` <table class="text-center align-middle"> ```
10,006,585
Whenever I use a for ... in loop, the index variable of the loop always seems to be in the variables scope. For example if I have a component with a method that uses this loop: ``` for(key in params){ writeOutput(key); } ``` The variable 'key' will be placed in the variables scope. If I already have decla...
2012/04/04
[ "https://Stackoverflow.com/questions/10006585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982122/" ]
The default scope inside CFCs is variables if you don't var beforehand. You have to var the index outside the loop like so:- ``` var key = ""; for(key in params){ writeOutput(key); } ``` An alternative approach, to avoid varring everything within your functions, is to declare your variables within a "local" s...
This syntax will work in ColdFusion 9 and higher: ``` for ( var key in params ){ writeOutput( key ); } ```
20,875,272
I am using camera Intent to take a photo and populate it to `ImageView`. I got an error whenever I take another photo from the camera Intent. It works well when I am only taking one photo but on second attempt without killing the application, the OutOfMemory Error pops up. This is the logcat ``` 01-02 09:51:39.930: E...
2014/01/02
[ "https://Stackoverflow.com/questions/20875272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1827089/" ]
**First** off the OOM might be caused by a large image, you should look at this documentation to see if you can load a downscaled image instead: [Loading Large Bitmaps Efficiently](http://developer.android.com/training/displaying-bitmaps/load-bitmap.html) **Secondly** is the `thumbnail` a instance reference? In that c...
check out following link that explains the issue you are facing. <http://tutorials-android.blogspot.co.il/2011/11/outofmemory-exception-when-decoding.html>
1,056,930
i have some files located in c:\MyApp\file.txt and current executing assenbly in in debud filder c:\MyApp\bin\Debug\ i want to get address of above "file.txt" at run time.. i tried this Assembly.GetExecutingAssembly().Location it gives me c:\MyApp\bin\Debug\MyApp.exe how can i get address of "file.txt"
2009/06/29
[ "https://Stackoverflow.com/questions/1056930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101314/" ]
You can't, since the file and the compiled application have no relation. What if you moved the MyApp.exe somewhere else? You have 2 options: 1. Include file.txt in your project as a content file (it will be included in the output and in the same folder as MyApp.exe) 2. Use configuration - allow a user option to defi...
Your executable folder path can be retrieved with : ``` AppDomain.CurrentDomain.BaseDirectory ``` In order to get what you want you could do the following ``` string fileTxtPath = AppDomain.CurrentDomain.BaseDirectory + "..\\file.txt"; ``` Of course if you have a file that is related to your project then you shou...
1,056,930
i have some files located in c:\MyApp\file.txt and current executing assenbly in in debud filder c:\MyApp\bin\Debug\ i want to get address of above "file.txt" at run time.. i tried this Assembly.GetExecutingAssembly().Location it gives me c:\MyApp\bin\Debug\MyApp.exe how can i get address of "file.txt"
2009/06/29
[ "https://Stackoverflow.com/questions/1056930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101314/" ]
The "Debug" folder (and the "Release" folder) are the actual output from your project's build. If you haven't included `file.txt` in the project and marked it as "Copy to Output Directory", then it doesn't count as part of the build output, and your app shouldn't try to load it. Basically, just set "Copy to Output Dir...
You can't, since the file and the compiled application have no relation. What if you moved the MyApp.exe somewhere else? You have 2 options: 1. Include file.txt in your project as a content file (it will be included in the output and in the same folder as MyApp.exe) 2. Use configuration - allow a user option to defi...
1,056,930
i have some files located in c:\MyApp\file.txt and current executing assenbly in in debud filder c:\MyApp\bin\Debug\ i want to get address of above "file.txt" at run time.. i tried this Assembly.GetExecutingAssembly().Location it gives me c:\MyApp\bin\Debug\MyApp.exe how can i get address of "file.txt"
2009/06/29
[ "https://Stackoverflow.com/questions/1056930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101314/" ]
The "Debug" folder (and the "Release" folder) are the actual output from your project's build. If you haven't included `file.txt` in the project and marked it as "Copy to Output Directory", then it doesn't count as part of the build output, and your app shouldn't try to load it. Basically, just set "Copy to Output Dir...
Your executable folder path can be retrieved with : ``` AppDomain.CurrentDomain.BaseDirectory ``` In order to get what you want you could do the following ``` string fileTxtPath = AppDomain.CurrentDomain.BaseDirectory + "..\\file.txt"; ``` Of course if you have a file that is related to your project then you shou...
3,371
What happens internally when ESP8266 goes to deep sleep mode. Is there any official documentation explaining that?
2018/09/07
[ "https://iot.stackexchange.com/questions/3371", "https://iot.stackexchange.com", "https://iot.stackexchange.com/users/6799/" ]
You can see this document <https://www.losant.com/blog/making-the-esp8266-low-powered-with-deep-sleep> In summary, ESP8266 supports 3 sleep modes: 1. Modem-sleep 2. Light-sleep 3. Deep-sleep [![enter image description here](https://i.stack.imgur.com/ejx8u.jpg)](https://i.stack.imgur.com/ejx8u.jpg) ### Modem-sleep M...
Have a look [here](https://en.wikipedia.org/wiki/Clock_gating) as well, it is about clock gating and what actually happens when a micro goes to sleep. In short, to greatly reduce power consumption, internal peripherals (such as its ADC and so) are disabled. Also, embedded.com has a neat explanation of [what happens und...
17,914,464
Hi I am using gdb version 7.5. Can someone tell me how I can get the vim keystrokes to work inside the gdb? The up and down arrow keys work for history but I want the k and j to work similar to when I am in a bash shell and have things set as set -o vi from the shell then my vim keystrokes work for command history. I u...
2013/07/29
[ "https://Stackoverflow.com/questions/17914464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/708803/" ]
gdb uses readline. So you just need to put the following command into `~/.inputrc` to turn the editing mode to vi. ``` set editing-mode vi ``` Note: all programs that use readline will be affected by this setting this includes bash.
Over in [this question about ndk-gdb](https://stackoverflow.com/questions/15770233/vi-bindings-in-ndk-gdb) I learned that `C-M-j` will cause gdb to enter vi mode. I tried that with gdb 7.4.1 and it worked, but I don't know about gdb 7.5. (Note: `C-M-j` means "Alt-Ctrl-j" for those not used to emacs nomenclature or "Esc...
29,241,070
I have a file-path that's been created from DateTime stamp: ``` "C:\\Logs\\Tests\\2015\\Mar\\24\\13_32_09\" ``` Now I am trying to convert my file-path back to DateTime object. With Regex I can easily remove `"C:\\Logs\\Tests\"`, but now I am assume I need to provide implementation of **IFormtProvider** to convert...
2015/03/24
[ "https://Stackoverflow.com/questions/29241070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1729349/" ]
You cannot do this directly via the Volusion API as you have already stated. You can however run a stored SQL query. The method to do this is explained here... <https://stackoverflow.com/a/29134928/357034> You just have to create your specific SQL query which returns the data you require.
For other who might come along later... I had the same error and I believe I solved the problem by switching the user to SuperAdmin rights.
20,482,940
I would like the user to enter a value into the `JTextField` and use a listener to listen to the textfield and print the value to the console straightaway without pressing a key. ``` textfield1.addChangeListener(new ChangeListener() { public void actionPerformed(ActionEvent e) { System.out....
2013/12/09
[ "https://Stackoverflow.com/questions/20482940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2994263/" ]
Put this private class *into* your public class. Just like a method. ``` private class textChangedListener implements KeyListener { public void keyPressed(KeyEvent e){} public void keyReleased(KeyEvent e){} public void keyTyped(KeyEvent e) { System.out.print(textField1.getText()); } } ...
Yes, just use the KeyListener class, see the example below: ``` import javax.swing.*; import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; public class Main extends JFrame { public Main() throws HeadlessException { setSize(200, 200); setDefaultCloseOperation(JFrame.EXIT_ON_CL...
20,482,940
I would like the user to enter a value into the `JTextField` and use a listener to listen to the textfield and print the value to the console straightaway without pressing a key. ``` textfield1.addChangeListener(new ChangeListener() { public void actionPerformed(ActionEvent e) { System.out....
2013/12/09
[ "https://Stackoverflow.com/questions/20482940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2994263/" ]
Yes, just use the KeyListener class, see the example below: ``` import javax.swing.*; import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; public class Main extends JFrame { public Main() throws HeadlessException { setSize(200, 200); setDefaultCloseOperation(JFrame.EXIT_ON_CL...
You can set a addlistener to textproperty of the text field. ``` textField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println("textfield chan...
20,482,940
I would like the user to enter a value into the `JTextField` and use a listener to listen to the textfield and print the value to the console straightaway without pressing a key. ``` textfield1.addChangeListener(new ChangeListener() { public void actionPerformed(ActionEvent e) { System.out....
2013/12/09
[ "https://Stackoverflow.com/questions/20482940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2994263/" ]
Put this private class *into* your public class. Just like a method. ``` private class textChangedListener implements KeyListener { public void keyPressed(KeyEvent e){} public void keyReleased(KeyEvent e){} public void keyTyped(KeyEvent e) { System.out.print(textField1.getText()); } } ...
You can set a addlistener to textproperty of the text field. ``` textField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println("textfield chan...
4,655
A project I'm working on involves wireless transmission of images from a camera to a host computer in real time. Can the Raspberry Pi be used as a [DSP](http://en.wikipedia.org/wiki/Digital_signal_processor) for the camera for image acquisition and pre-processing?
2013/01/25
[ "https://raspberrypi.stackexchange.com/questions/4655", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/5610/" ]
The [OpenMAX API](http://www.khronos.org/openmax/) is available on the Raspberry Pi. It handles audio and video encoding/decoding, [for example, JPEG](http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=15463&hilit=decoding%20image%20with%20openmax). The eLinux wiki lists other [APIs usable on the Raspberry Pi](htt...
It has a DSP for image postprocessing, but the drivers are closed, and you can't see the specification sheet unless you are [NDAed](http://en.wikipedia.org/wiki/Non-disclosure_agreement), etc... Which is a bit annoying. I think they use it for the new camera module.
4,655
A project I'm working on involves wireless transmission of images from a camera to a host computer in real time. Can the Raspberry Pi be used as a [DSP](http://en.wikipedia.org/wiki/Digital_signal_processor) for the camera for image acquisition and pre-processing?
2013/01/25
[ "https://raspberrypi.stackexchange.com/questions/4655", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/5610/" ]
The [OpenMAX API](http://www.khronos.org/openmax/) is available on the Raspberry Pi. It handles audio and video encoding/decoding, [for example, JPEG](http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=15463&hilit=decoding%20image%20with%20openmax). The eLinux wiki lists other [APIs usable on the Raspberry Pi](htt...
<http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/> Pierre has worked on image processing on Rpi. I think you will find the mentioned tutorials helpful iff you have a prior knowledge of languages. AYBABTU
47,796,710
I'm working on a vagrant machine (Homestead). In my Homestead.yml I have: ``` sites: - map: myproject.local to: /home/vagrant/projects/myproject/web type: symfony ``` I'm working with Symfony version 3.3 on PHP 7.1.2. The problem is when I try to execute the command `php bin/console cache:clear` I'm gett...
2017/12/13
[ "https://Stackoverflow.com/questions/47796710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1775531/" ]
This is a Virtual platform related issue.A simple workaround is to remove manually. ``` $ sudo rm -rf app/cache/* ``` Read more about this issue [app/console cache:clear problem](https://github.com/symfony/symfony/issues/19851)
Most prpbably it is a permission issue. Give permission like ``` sudo chmod -R 777 app/cache/ ``` This should solve your problem. If the problem still persist do :- ``` sudo rm -rf app/cache/ php bin/console cache:clear --env=prod sudo chmod -R 777 app/cache/ ```
66,550,651
I am running the event hub receiver implementation from: <https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-python-get-started-send#create-a-python-script-to-receive-events> and I haven't changed anything except the connection strings etc. After creating hundreds of events, I can see that the receiver crea...
2021/03/09
[ "https://Stackoverflow.com/questions/66550651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12571155/" ]
This might be a bug in the old sdk. Please try to install the latest version sdk: [azure-eventhub 5.3.1](https://pypi.org/project/azure-eventhub/) and [azure-eventhub-checkpointstoreblob-aio 1.1.3](https://pypi.org/project/azure-eventhub-checkpointstoreblob-aio/). I tested your code with these latest sdk, it works fi...
Updating the SDK solved the problem. Also @AdamLing clarified the metadata location for me in the comment.
214,583
The “not an answer” flag on answers is meant to be used when > > This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether. > > > The “very low quality” flag on answers is meant to be used when > > This answer ...
2014/01/02
[ "https://meta.stackexchange.com/questions/214583", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/149076/" ]
I rarely see any content that really is VLQ-flaggable anyway. There is a thin region between spam and OK (not good, just not deletable) answers that we term as "very low quality", and answers in that region are rarely found. A post is "very low quality" if it has problems that can't be fixed by others. I find that so...
No. "Not an answer" is more of a hint that a mod could convert the answer to a comment. This is not appropriate in the "low quality" case.
214,583
The “not an answer” flag on answers is meant to be used when > > This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether. > > > The “very low quality” flag on answers is meant to be used when > > This answer ...
2014/01/02
[ "https://meta.stackexchange.com/questions/214583", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/149076/" ]
I rarely see any content that really is VLQ-flaggable anyway. There is a thin region between spam and OK (not good, just not deletable) answers that we term as "very low quality", and answers in that region are rarely found. A post is "very low quality" if it has problems that can't be fixed by others. I find that so...
For rewording the "Looks OK" button, why don't we rename it "Shouldn't be Deleted", "Not Deleteable", or "Don't Delete"? That would make it clear that ALL of the following are "good" answers with respect to the Low Quality Posts queue (that is, they shouldn't be deleted): * Correct and useful answers * Incorrect answe...
539,202
I'm looking for a tool for displaying inline menus in the shell which can be navigated with arrow-keys and enter. By "inline", I mean that the menu is displayed within the normal flow of stdout text, *not* in a pop-up dialog on top of everything. I only found [that post](https://unix.stackexchange.com/questions/146570...
2019/09/05
[ "https://unix.stackexchange.com/questions/539202", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/370253/" ]
You could use `xargs` and start a small shell script: ``` jq -r '.href, .filename' file.json | xargs -n2 sh -c 'wget "$1" -O "$2"' sh ``` Note that `wget`'s `-o` option is for the logfile and `-O` is for the "output document".
Similar to `xargs` solution, but using `parallel`. It think it is more elegant as it does not need a pipe and extra `sh` call. ``` parallel -n2 wget {1} -O {2} ::: "$(jq -r '.href, .filename' file.json)" ```
539,202
I'm looking for a tool for displaying inline menus in the shell which can be navigated with arrow-keys and enter. By "inline", I mean that the menu is displayed within the normal flow of stdout text, *not* in a pop-up dialog on top of everything. I only found [that post](https://unix.stackexchange.com/questions/146570...
2019/09/05
[ "https://unix.stackexchange.com/questions/539202", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/370253/" ]
You could use `xargs` and start a small shell script: ``` jq -r '.href, .filename' file.json | xargs -n2 sh -c 'wget "$1" -O "$2"' sh ``` Note that `wget`'s `-o` option is for the logfile and `-O` is for the "output document".
I don't know about a jq-splitter on Linux, but you can use sed to split the fields, reading the output into variables and then run the wget thereafter. ``` $> read HREF FILENAME < <(sed -r 's/(.*href:[ ]*)([^, ]*)(.*filename:[ ]*)([^, ]*)(.*)$/\2 \4/' files.json);wget "${HREF}" -o "${FILENAME}.pdf" ``` The `sed` us...
539,202
I'm looking for a tool for displaying inline menus in the shell which can be navigated with arrow-keys and enter. By "inline", I mean that the menu is displayed within the normal flow of stdout text, *not* in a pop-up dialog on top of everything. I only found [that post](https://unix.stackexchange.com/questions/146570...
2019/09/05
[ "https://unix.stackexchange.com/questions/539202", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/370253/" ]
Similar to `xargs` solution, but using `parallel`. It think it is more elegant as it does not need a pipe and extra `sh` call. ``` parallel -n2 wget {1} -O {2} ::: "$(jq -r '.href, .filename' file.json)" ```
I don't know about a jq-splitter on Linux, but you can use sed to split the fields, reading the output into variables and then run the wget thereafter. ``` $> read HREF FILENAME < <(sed -r 's/(.*href:[ ]*)([^, ]*)(.*filename:[ ]*)([^, ]*)(.*)$/\2 \4/' files.json);wget "${HREF}" -o "${FILENAME}.pdf" ``` The `sed` us...
19,635,946
``` app.get("/server", function (req, res){ connection.query("SELECT * from serverdb", function(err, rows) { var data = rows; var reachabilityResultString=""; var serverCount = rows.length; var arrayWithReachabilityResultStrings = new Array(); var insertReachabilityResultStringIntoArray; ...
2013/10/28
[ "https://Stackoverflow.com/questions/19635946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2928133/" ]
You need to install the livereload browser plugin from <http://livereload.com/>
I am trying to use grunt livereload to reload css changes on my node.js pages. I am getting closer to solve my problem which is similar to yours. So from what i know so far and please correct me if i'm wrong you dont need to install "livereload browser plugin" right? I used grunt alone without node.js and i could just ...
39,794,465
I have the following code: ``` import ReactDom from 'react-dom'; import React from 'react'; import {render} from 'react-dom'; import $ from 'jquery'; class News extends React.Component { render () { var news = []; this.props.news.forEach(function(el, i){ news.push(<SingleNews key={i} img={el.img} />...
2016/09/30
[ "https://Stackoverflow.com/questions/39794465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1312785/" ]
The problem here is you are initially setting data as an empty string. In your `componentDidMount` you are making the ajax call and since it's async react will still render. Once it renders it's trying to access `this.state.data.messages` which `this.state.data` is an empty string so will have no property called messag...
You're going to be rendering before that async call returns. You need to handle the case before there's data. If nothing else you should change the initial state to better match the state you're expecting.
50,403,303
I'm facing a problem using Headers in PHP. `header('location: http:google.com');` is not working. This is my code: ``` if(!headers_sent()){ header("location: http://google.com"); exit; } HTML Data... ``` Script is exiting but `header()` is not working. * I've already checked in my php.ini for `output_buffe...
2018/05/18
[ "https://Stackoverflow.com/questions/50403303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4370137/" ]
Right, this is not so much as a fix to the problem but a work around to get redirects working client side while you're on your development server. I wrote up a middle ware function to generate the redirect headers for you, simply add it to your code then call `Redirect("URL");`. ``` <?php function Redirect($location,...
Try this. ``` header("Refresh: $seconds; URL=\"$location\""); ```
12,193,768
So I just started working with Apache's mod\_rewrite module and I've run into a problem I can't seem to figure out. What I want is to have the address bar display clean URLs either when a user manually types in the URL or when the page is linked to. Right now I get clean URLs when they're typed in but the query string ...
2012/08/30
[ "https://Stackoverflow.com/questions/12193768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249198/" ]
> > But, when clicking a link like href="index.php?url=first". The address > bar displays myDomain.com/index.php?url=first when I want it to > display myDomain.com/first. > > > You'll have to link to the "clean" URL. Remember, you're not redirecting here. You're rewriting! That mean's you'll have to change this:...
Look those two lines : ``` RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ``` It mean : *if url point on a real file or folder, don't try following rules.* When you use `myDomain.com/index.php?url=first`, it point on a real file : `index.php`. Then, your rules won't be tried. You **must** ...
20,139,081
I am trying to align mid of the screen of an item simply a `label` but it is aligning it horizontally not vertically. ``` var panel = new Ext.Panel({ layout:{ type: 'vbox', align: 'center' }, items:[ { xtype: 'label', html: 'My Label' } ], ful...
2013/11/22
[ "https://Stackoverflow.com/questions/20139081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1585750/" ]
Try using `pack: center` in the layout, like this: ``` var panel = new Ext.Panel({ layout: { type: 'hbox', align: 'center', pack: 'center' }, items:[ { xtype: 'label', html: 'My Label' } ] }); ```
For HBox layout preferable to use 'align: middle' config I suppose. Try this: ``` var panel = new Ext.Panel({ layout: { type: 'hbox', align: 'middle' }, items:[{ xtype:'label', html:'My Label' }] }); ```
2,798,113
I need to match phone numbers that : * start with 010 or 012 or 016 or 019 * Consist of 10 numbers exactly Can you please help me on how to match numbers using PHP and regex?
2010/05/09
[ "https://Stackoverflow.com/questions/2798113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/232388/" ]
``` return preg_match('/^01[0269]\\d{7}$/', $theStringToTest); ``` This will match 0, 1, one of (0, 2, 6, 9), and then any 7 numbers (3+7==10). The `^` means start of string and `$` means end of string.
I think I'd use `^01[0269][0-9]{7}$`
2,798,113
I need to match phone numbers that : * start with 010 or 012 or 016 or 019 * Consist of 10 numbers exactly Can you please help me on how to match numbers using PHP and regex?
2010/05/09
[ "https://Stackoverflow.com/questions/2798113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/232388/" ]
``` return preg_match('/^01[0269]\\d{7}$/', $theStringToTest); ``` This will match 0, 1, one of (0, 2, 6, 9), and then any 7 numbers (3+7==10). The `^` means start of string and `$` means end of string.
Use this Regex ``` /\b(010|012|016|019)[0-9]{7}\b/g ```
73,329,921
I am getting an error while building angular app. **HTML Template** ``` <mat-form-field *ngIf="requested"> <input matInput (input)="sendingAccesscode($event)" placeholder="{{ 'CODE_LABEL' | i18next }}" name="accesscode" formControlName="accesscode" minlength="6" require...
2022/08/12
[ "https://Stackoverflow.com/questions/73329921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3422011/" ]
How about setting it to the type `Event` this will fix your issue! you can also use `InputEvent` ``` sendingAccesscode(event: Event) { const value = (event.target as HTMLInputElement).value; if (value && value.length >= 6) { console.log(value); } } ``` [stackblitz](https://stackblitz.com/edit/an...
The error is due to [Angular strict mode](https://angular.io/guide/strict-mode) is enabled. In strict mode Angular make sure the typing on template types correctly infer on what have been called on TS side. Over here typescript cannot determine what is going on when the `target` object is evaluated in destructing `{ t...
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
Similar to what josh is saying, I would try and see if you hit this with some sort of network trace. What I recommend for easiest use is [Bonjour Browser](http://www.tildesoft.com/). This program lists all the bonjour services and who is advertising them, in this case we are talking AFP probably. I use this often at wo...
This may not be the answer, but I got rid of mine by going to the **System Preferences > Sharing** and unchecked **Remote Login**. I don't have a clue how I happened to enable that before!
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
The message "The server "otseeley-remote" is available on your computer. Access the volumes and files locally" means that what you're seeing in the sidebar is your own computer, not a different machine... *why* you're seeing it is the real question, and unfortunately I don't have any great answers for you. More troubl...
I tried all the tricks I could find without success, but eventually solved it with the clue here that the phantom names on the network were "stowaways" on the Airport network. I had about 8 variations on the name of the Mac Mini on our network: some were names I gave it, some were simply appended numbers to one of the...
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
You may have a stowaway computer on your AirPort network. Here are a few steps to check this possibilty: 1. activate your AirPort network; 2. open a `Terminal` 3. type `arp -i en1 -a` Check all the MAC addresses displayed by `arp`. They should all belong to your own Mac, PC, iPhone and Co.. If not, then you have iden...
I turned WiFi on and off and it got rid of the shared computer.
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
I've added a possible answer over on SuperUser <https://superuser.com/questions/268380/mysterious-shared-server-with-same-name-appearing-disappearing/338732> > > Sounds like you might have SMB (Windows) Sharing turned on. > > > To check, go to the System Preferences and click on Sharing. In the list on the left cl...
I tried all the tricks I could find without success, but eventually solved it with the clue here that the phantom names on the network were "stowaways" on the Airport network. I had about 8 variations on the name of the Mac Mini on our network: some were names I gave it, some were simply appended numbers to one of the...
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
This may not be the answer, but I got rid of mine by going to the **System Preferences > Sharing** and unchecked **Remote Login**. I don't have a clue how I happened to enable that before!
I turned WiFi on and off and it got rid of the shared computer.
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
Similar to what josh is saying, I would try and see if you hit this with some sort of network trace. What I recommend for easiest use is [Bonjour Browser](http://www.tildesoft.com/). This program lists all the bonjour services and who is advertising them, in this case we are talking AFP probably. I use this often at wo...
You may have a stowaway computer on your AirPort network. Here are a few steps to check this possibilty: 1. activate your AirPort network; 2. open a `Terminal` 3. type `arp -i en1 -a` Check all the MAC addresses displayed by `arp`. They should all belong to your own Mac, PC, iPhone and Co.. If not, then you have iden...
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
The message "The server "otseeley-remote" is available on your computer. Access the volumes and files locally" means that what you're seeing in the sidebar is your own computer, not a different machine... *why* you're seeing it is the real question, and unfortunately I don't have any great answers for you. More troubl...
This may not be the answer, but I got rid of mine by going to the **System Preferences > Sharing** and unchecked **Remote Login**. I don't have a clue how I happened to enable that before!
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
I've added a possible answer over on SuperUser <https://superuser.com/questions/268380/mysterious-shared-server-with-same-name-appearing-disappearing/338732> > > Sounds like you might have SMB (Windows) Sharing turned on. > > > To check, go to the System Preferences and click on Sharing. In the list on the left cl...
This may be meaningless to your situation, but I found this article educational -- about how a person's mac has two MAC addresses associated with it (one for its wifi identity and one for its non-wifi, ethernet identity.) One of those "jekyll and hyde" existences is likely the other mystery machine for SOME of the peop...
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
Similar to what josh is saying, I would try and see if you hit this with some sort of network trace. What I recommend for easiest use is [Bonjour Browser](http://www.tildesoft.com/). This program lists all the bonjour services and who is advertising them, in this case we are talking AFP probably. I use this often at wo...
In 10.7 removing the "shared" phantom computer can often be done by going to System Preferences>Sharing – then toggle on and off all the radio buttons that contain the word "sharing." This should reset the sidebar to default.
24,006
On my MacBook, in the Finder's sidebar there's a machine appearing under "Shared" that I don't recognize and definitely doesn't exist on our local network. When I attempt to connect to it, I get this message: > > The server "otseeley-remote" is available on your computer. Access the volumes and files locally. > > >...
2011/09/02
[ "https://apple.stackexchange.com/questions/24006", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/6873/" ]
I've added a possible answer over on SuperUser <https://superuser.com/questions/268380/mysterious-shared-server-with-same-name-appearing-disappearing/338732> > > Sounds like you might have SMB (Windows) Sharing turned on. > > > To check, go to the System Preferences and click on Sharing. In the list on the left cl...
Similar to what josh is saying, I would try and see if you hit this with some sort of network trace. What I recommend for easiest use is [Bonjour Browser](http://www.tildesoft.com/). This program lists all the bonjour services and who is advertising them, in this case we are talking AFP probably. I use this often at wo...
10,815,468
The following JSON feed contains orders. How can I retrieve each order, when it doesn't contain a key (can´t use objectForKey)? Between the opening bracket and the first curly bracket there is no key. ``` [ <----- { <----- "person": { "address": "My road", "city": "My City", ...
2012/05/30
[ "https://Stackoverflow.com/questions/10815468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454049/" ]
Plain old JSTL to your rescue! The beauty of Spring MVC is that it doesn't add tons of redundant tag libraries unlike other frameworks. You can always rely on JSTL for such checks which is part of the JSP spec now. ``` <c:if test="${not empty someList}"> </c:if> ```
[The JSTL](http://docs.oracle.com/javaee/1.4/tutorial/doc/JSTL3.html): ``` <c:if test="${!empty someForm.someProperty}"> </c:if> ```
10,815,468
The following JSON feed contains orders. How can I retrieve each order, when it doesn't contain a key (can´t use objectForKey)? Between the opening bracket and the first curly bracket there is no key. ``` [ <----- { <----- "person": { "address": "My road", "city": "My City", ...
2012/05/30
[ "https://Stackoverflow.com/questions/10815468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454049/" ]
Plain old JSTL to your rescue! The beauty of Spring MVC is that it doesn't add tons of redundant tag libraries unlike other frameworks. You can always rely on JSTL for such checks which is part of the JSP spec now. ``` <c:if test="${not empty someList}"> </c:if> ```
you could use the common JSP/JSTL taglibs ``` <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <c:choose> <c:when test="${condition}"> something </c:when> <c:otherwise> something else </c:otherwise> </c:choose> ``` alternatively ``` <c:if t...
10,267,546
I am a beginner in Ext library, I am trying to extend a grid panel and referencing its store from one of my new class records: ``` Ext.define('App.ui.CategoryGridPanel', { extend : 'Ext.grid.Panel', initComponent : function() { var storeToUse = this.store; if (storeToUse == null) { storeToUse = Ext.da...
2012/04/22
[ "https://Stackoverflow.com/questions/10267546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1349431/" ]
1. Check what you see as `this` in your insertNewCategory method. You will be surprised. My bet - it will be button you're pressing, because you didn't do anything about scope of this function. 2. Read Sencha guides and walk-through. From your code sample it's clear you are using it in a completely wrong way - you don'...
It would seem the creation of your category object is failing: ``` var category = Ext.create(ModelNames.Category, { description : '' }); ``` I would put a break after this line to ensure that your 'category' object has been correctly created. With regards to using 'this', I suggest you look up the dangers of it...
49,571,246
I want the **"Dont have an account?"** line to trigger the display of `.registrybox` class when clicked. I have written down some script and it does not function. Script specifies that when **Dont have an account?** is clicked, `.loginbox` should disappear and be replaced w/ the `.registrybox` class code. Those CSS `d...
2018/03/30
[ "https://Stackoverflow.com/questions/49571246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9273765/" ]
Actually `getElementsByClassName()` returns an ***[array-like](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName)*** object with matched class name, so you will need to get the element by using `[0]`...Also you don't need to use `.` period when using `getElementsByClassName()` ```js func...
You have some mistakes in your JS code. 1. document.getElementsByClassName() requires only the class name. You are adding '.' in front of the classname. This wrong. 2. document.getElementsByClassName() returns an array of elements. In your case, you need to select first element from this array. So you need to use [0] ...
49,571,246
I want the **"Dont have an account?"** line to trigger the display of `.registrybox` class when clicked. I have written down some script and it does not function. Script specifies that when **Dont have an account?** is clicked, `.loginbox` should disappear and be replaced w/ the `.registrybox` class code. Those CSS `d...
2018/03/30
[ "https://Stackoverflow.com/questions/49571246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9273765/" ]
Actually `getElementsByClassName()` returns an ***[array-like](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName)*** object with matched class name, so you will need to get the element by using `[0]`...Also you don't need to use `.` period when using `getElementsByClassName()` ```js func...
Try this. ```js function displayRegistry() { document.getElementsByClassName('registrybox')[0].style.display = "block"; document.getElementsByClassName('loginbox')[0].style.display = "none"; } ``` ```css .loginbox { width: 320px; height: 420px; background-color: ; color: #fff; top: 50%; left:...
49,571,246
I want the **"Dont have an account?"** line to trigger the display of `.registrybox` class when clicked. I have written down some script and it does not function. Script specifies that when **Dont have an account?** is clicked, `.loginbox` should disappear and be replaced w/ the `.registrybox` class code. Those CSS `d...
2018/03/30
[ "https://Stackoverflow.com/questions/49571246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9273765/" ]
Actually `getElementsByClassName()` returns an ***[array-like](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName)*** object with matched class name, so you will need to get the element by using `[0]`...Also you don't need to use `.` period when using `getElementsByClassName()` ```js func...
If you want to alternative with `jquery` u can use this i can't do it here because i can't add `jquery` [Fiddle Example](https://jsfiddle.net/c728xbvp/2/)
26,210,316
I am a beginner in python and am trying to copy a csv of 1 M records line by line to a new CSV using the Memory Map implementation. But going by the rule that the mmap [module](https://docs.python.org/2/library/mmap.html) has it doesn't map to an empty csv file. But the problem that I have right now requires me to cre...
2014/10/06
[ "https://Stackoverflow.com/questions/26210316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1696536/" ]
If I understand your question correctly (taken together with your additional comments), you are reading and parsing an input CSV file via mmap, and you have no problem with that aspect of your task. Your difficulty is in creating a new CSV file containing the input CSV data (possibly modified), i.e. writing the data ba...
If you only want to perform *per line parsing*, you can handle very large files in standard Python as long as you do it one line at the time. I'm a bit unsure if that is what you want, but this code works fine on gigabyte size files: ``` infile='input.csv' outfile='out.csv' with open(infile,'r') as in_f, open(outfile...
28,013,025
I have one hour measurement data for a whole year. The timespamp is in column A. I am trying to find a simple way to average the data by excluding all points at 6,7, and 8 AM. However, since these points pop up 365 times in the data, I am having problems with applying functions like averageifs etc. Is there another...
2015/01/18
[ "https://Stackoverflow.com/questions/28013025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2176132/" ]
You could do it with an array formula, but I would probably put this formula in column C: `=if(or(hour(A:A)<6,hour(A:A)>8),B:B,"")` Drag that formula all the way down, then put this formula in cell D1 `=average(C:C)` If you want to look at other times, just change the formula in column C.
An array formula like this will also work `=AVERAGE(IF((HOUR(A2:A1000)<6)+(HOUR(A2:A1000)>8),IF(A2:A1000<>"",B2:B1000)))` `CTRL`+`SHIFT`+`ENTER` adjust ranges as required but preferable not to use whole columns in this formula
28,013,025
I have one hour measurement data for a whole year. The timespamp is in column A. I am trying to find a simple way to average the data by excluding all points at 6,7, and 8 AM. However, since these points pop up 365 times in the data, I am having problems with applying functions like averageifs etc. Is there another...
2015/01/18
[ "https://Stackoverflow.com/questions/28013025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2176132/" ]
Try this: ``` =SUMPRODUCT((HOUR(A1:A8784)<>6)*(HOUR(A1:A8784)<>7)*(HOUR(A1:A8784)<>8)*B1:B8784)/SUMPRODUCT((HOUR(A1:A8784)<>6)*(HOUR(A1:A8784)<>7)*(HOUR(A1:A8784)<>8)*(B1:B8784<>"")) ``` The range references were chosen since a 366 day year has 8784 hours; you might need to change them if your data doesn't start in ...
An array formula like this will also work `=AVERAGE(IF((HOUR(A2:A1000)<6)+(HOUR(A2:A1000)>8),IF(A2:A1000<>"",B2:B1000)))` `CTRL`+`SHIFT`+`ENTER` adjust ranges as required but preferable not to use whole columns in this formula
64,520,889
Well, I have a dictionary that stores informations extracted from a PDF file. Like this: > > { 'B) NAME:': 'Jair', 'H) AGE: ': ' 25', 'J) Gender': 'Male'} > > > I'm trying to 'clean' this dictionary by excluding the strings "b)", "h)" "j)" that came from PDF using the following code: ``` for k in mydict: mydic...
2020/10/25
[ "https://Stackoverflow.com/questions/64520889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12113919/" ]
`user` is not an existing property on `req` object. You can make your own typings for `req` object by creating a `.d.ts` file on your project, for example, create a `express.d.ts` file and it will contains: ``` declare namespace Express { export interface Request { user: SomeType } } ``` Demo: <https://...
``` declare global { namespace Express { interface Request { user?: UserPayload; } } } ``` this is an example of UserPaylaod ``` interface UserPayload { id: string; email: string; } ```
8,072,368
I added a jQuery menu tab to my page and there is a clash in the CSS, as can be seen here: <http://newbie-cms.com/demo1>. I separated a page with only the jQuery tabs here: <http://newbie-cms.com/demo1/channeltabs> and that works fine. Also, the <http://newbie-cms.com/demo1/index.html> page works fine without the tabs...
2011/11/09
[ "https://Stackoverflow.com/questions/8072368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1033514/" ]
Addressing your second issue first, instead of `[[NSMutableDictionary alloc] initWithCapacity:[self count]]` you could use `[NSMutableDictionary dictionaryWithCapacity:[self count]]` which will return an autoreleased object and you will have to retain it yourself in the calling code. On the other hand, you could renam...
There are two problems here. First, as @David Brainer-Banker says, you need to release `oneCopy` at the end of each iteration by placing `[oneCopy release]; after you set`[ret setValue:oneCopy forKey:key];`. The incorrect reference count decrement is the second problem. This is because the `oneCopy` object may have a ...
51,979,150
I'm using CodeIgniter HMVC. I have an educational web application for different clients. I need a customized controllers for every client. We need to provide different views and functionalities for different clients but only the condition is that, call the same url. For example, I'm using modules,In my controller nam...
2018/08/23
[ "https://Stackoverflow.com/questions/51979150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4899166/" ]
It seems that your database username and password are not set with correct property names, as in spring-boot the name of the properties are predefined and only those should be used while giving configuration information. Just try below property keys for username and password : ``` spring.datasource.username = spring....
java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) It seems your user password is incorrect. Try to login MySQL with same credentials and it will display the same error.
17,353,920
TSQL question here. See source and desired output in image below. Code to build source table is also provided. ![enter image description here](https://i.stack.imgur.com/haIMB.jpg) --- ``` DECLARE @tablevar TABLE( record nvarchar(10), category nvarchar(50), value float) INSERT INTO @tablevar VALUES ('110-AL','credit...
2013/06/27
[ "https://Stackoverflow.com/questions/17353920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1552333/" ]
Since you want to PIVOT two columns of data, one way you can do this would be to apply both the UNPIVOT and the PIVOT functions. The UNPIVOT will convert the multiple columns `category` and `value` to multiple rows, then you can apply the PIVOT to get the final result: ``` select record, category1, value1, categ...
This being the first time I've used PIVOT, the code is probably pretty ugly. Here goes: ``` with ranked as ( select *, RANK() OVER (PARTITION by record ORDER by category) as r from @tablevar ), labeled as ( select record, category as content, 'category' + CAST(r as varchar(MAX)) as label from ranked ...
17,353,920
TSQL question here. See source and desired output in image below. Code to build source table is also provided. ![enter image description here](https://i.stack.imgur.com/haIMB.jpg) --- ``` DECLARE @tablevar TABLE( record nvarchar(10), category nvarchar(50), value float) INSERT INTO @tablevar VALUES ('110-AL','credit...
2013/06/27
[ "https://Stackoverflow.com/questions/17353920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1552333/" ]
Since you want to PIVOT two columns of data, one way you can do this would be to apply both the UNPIVOT and the PIVOT functions. The UNPIVOT will convert the multiple columns `category` and `value` to multiple rows, then you can apply the PIVOT to get the final result: ``` select record, category1, value1, categ...
Here's my stab at it ``` ;with Z as ( select record, category, value, ROW_NUMBER() over (partition by record order by category) as ranker from @tablevar ) select Z2.record, Z2.c1, Z3.v1, Z2.c2, Z3.v2, Z2.c3, Z3.v3 from ( select record, [1] c1, [2] c2, [3] c3 from (select record, category, ranker from Z) as Z0 piv...
28,044,687
I'm having this problem: I am trying to get a form with some sections to be hidden in a div, triggered by a button (image or input type button). The problem is, when the div expands, the user must click on the field to enter a value, however, clicking in the div hides it again :( Any ideas how I can fix this? I imagine...
2015/01/20
[ "https://Stackoverflow.com/questions/28044687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4417620/" ]
See this [jsfiddle](http://jsfiddle.net/williamtdavies/yczpex3z/1/). I have added a click event to the button and then it shows / hides it's parent ".text-container". ### JS ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('.hideshow').click(function() { var $parentC...
Try adding your click event to your button instead of your form. Edit: raduB beat me to it, but I'll post my solution as well. ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('.text_container > input[type="button"]').click(function() { var $this = $(this.parentElement...
28,044,687
I'm having this problem: I am trying to get a form with some sections to be hidden in a div, triggered by a button (image or input type button). The problem is, when the div expands, the user must click on the field to enter a value, however, clicking in the div hides it again :( Any ideas how I can fix this? I imagine...
2015/01/20
[ "https://Stackoverflow.com/questions/28044687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4417620/" ]
Try adding your click event to your button instead of your form. Edit: raduB beat me to it, but I'll post my solution as well. ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('.text_container > input[type="button"]').click(function() { var $this = $(this.parentElement...
i added the id for the button as "btn" $(document).ready(function(){ $('.text\_container').addClass("hidden"); ``` $('#btn1').click(function() { var $res = $(this).closest("div"); if ($res.hasClass("hidden")) { $($res).removeClass("hidden").addClass("visible"); } else { $($res).removeClass("...
28,044,687
I'm having this problem: I am trying to get a form with some sections to be hidden in a div, triggered by a button (image or input type button). The problem is, when the div expands, the user must click on the field to enter a value, however, clicking in the div hides it again :( Any ideas how I can fix this? I imagine...
2015/01/20
[ "https://Stackoverflow.com/questions/28044687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4417620/" ]
See this [jsfiddle](http://jsfiddle.net/williamtdavies/yczpex3z/1/). I have added a click event to the button and then it shows / hides it's parent ".text-container". ### JS ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('.hideshow').click(function() { var $parentC...
The problem is that you are putting the click event on the container, try this: ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('input[type="button"]').click(function() { var $this = $(this); if ($this.parent().hasClass("hidden")) { $this.parent().re...
28,044,687
I'm having this problem: I am trying to get a form with some sections to be hidden in a div, triggered by a button (image or input type button). The problem is, when the div expands, the user must click on the field to enter a value, however, clicking in the div hides it again :( Any ideas how I can fix this? I imagine...
2015/01/20
[ "https://Stackoverflow.com/questions/28044687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4417620/" ]
The problem is that you are putting the click event on the container, try this: ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('input[type="button"]').click(function() { var $this = $(this); if ($this.parent().hasClass("hidden")) { $this.parent().re...
i added the id for the button as "btn" $(document).ready(function(){ $('.text\_container').addClass("hidden"); ``` $('#btn1').click(function() { var $res = $(this).closest("div"); if ($res.hasClass("hidden")) { $($res).removeClass("hidden").addClass("visible"); } else { $($res).removeClass("...
28,044,687
I'm having this problem: I am trying to get a form with some sections to be hidden in a div, triggered by a button (image or input type button). The problem is, when the div expands, the user must click on the field to enter a value, however, clicking in the div hides it again :( Any ideas how I can fix this? I imagine...
2015/01/20
[ "https://Stackoverflow.com/questions/28044687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4417620/" ]
See this [jsfiddle](http://jsfiddle.net/williamtdavies/yczpex3z/1/). I have added a click event to the button and then it shows / hides it's parent ".text-container". ### JS ``` $(document).ready(function(){ $('.text_container').addClass("hidden"); $('.hideshow').click(function() { var $parentC...
i added the id for the button as "btn" $(document).ready(function(){ $('.text\_container').addClass("hidden"); ``` $('#btn1').click(function() { var $res = $(this).closest("div"); if ($res.hasClass("hidden")) { $($res).removeClass("hidden").addClass("visible"); } else { $($res).removeClass("...
17,026,465
I have iPad app with view and `uiwebview` in it. It is on the bottom with size smaller than keyboard (e.g. 300x200). In webview is page with form loaded. When I tap into some textfield, keyboard pops up and hides whole uiwebview. With iOS simulator and slow animation mode I can see, that webview is scrolled, but when ...
2013/06/10
[ "https://Stackoverflow.com/questions/17026465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2090217/" ]
You can hide the keyboard when the webView is scrolled, try this: ``` self.webView.scrollView.keyboardDismissMode =UIScrollViewKeyboardDismissModeOnDrag; ```
What i would do is Keyboard notifications. You can scroll the view upwards using the methods provided by the UIView class nad this link should help you out greatly. [Keyboard Hiding Screen](http://www.idev101.com/code/User_Interface/keyboard.html)
15,905,717
I need to serialize a JSON object that looks like this: ``` { "Documents": [ { "Title": "", "DatePublished": "", "DocumentURL": "", "ThumbnailURL": "", "Abstract": "", "Sector": "", "Country": [ "", "", "" ], "Docume...
2013/04/09
[ "https://Stackoverflow.com/questions/15905717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1530221/" ]
If you change `dataFrmDb` to be `Dictionary<string, object>` instead of a `Dictionary<string, string>`, then you can store the Countries list into it like the other values. Json.Net will then serialize it like you want. Here is an example program which demonstrates: ``` class Program { static void Main(string[] a...
Here is a different way to solve it with `DataContractJsonSerializer`. First create a class to represent the object: ``` [DataContract] public class DocumentHolder { [DataMember(Name = "Documents")] public Documents Document { get; set; } } [DataContract] public class Documents...
18,037,226
Ok, In 15 years of writing C code I have never seen code like this, and I don't know how it works. It centers around some C99 code where somehow multiple lines of code get resolved to an integer value. It comes from libplist, specifically [here](http://cgit.sukimashita.com/libplist.git/tree/src/bplist.c). Ok, it starts...
2013/08/03
[ "https://Stackoverflow.com/questions/18037226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/546532/" ]
This is called a statement expression, and it is a GNU extension. [Here's](http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html) some documentation you may want to read.
As was pointed out by others, the macro uses the GCC syntax of "statements in expressions". But the macro itself is not well formed. Be carefull. The code of that macros can be broken, because the presence of `{ }` inside. For example: ``` union plist_uint_ptr __up; __up.src = 3; UINT_TO_HOST(__up.src, 8); ``` ...
24,765,492
Is there a built-in method in .NET that validates csv files/strings? I would prefer something like [this online csv validator](http://csvlint.io) but in C#. I have done some research but all I have found are examples of people writing the code themselves (examples were all written a few years ago and might be outdated...
2014/07/15
[ "https://Stackoverflow.com/questions/24765492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3772119/" ]
There is! For some reason it's buried in the VB namespace, but it's part of the .NET Framework, you just need to add a reference to the Microsoft.VisualBasic assembly. The type you're looking for is [TextFieldParser](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx). Here is a...
That CSV Parser also seems promising (Not built-in, though): <http://www.codeproject.com/Articles/9258/A-Fast-CSV-Reader> Related thread: [CSV Parsing Options with .NET](https://stackoverflow.com/questions/9642055/csv-parsing-options-with-net)
24,765,492
Is there a built-in method in .NET that validates csv files/strings? I would prefer something like [this online csv validator](http://csvlint.io) but in C#. I have done some research but all I have found are examples of people writing the code themselves (examples were all written a few years ago and might be outdated...
2014/07/15
[ "https://Stackoverflow.com/questions/24765492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3772119/" ]
There is! For some reason it's buried in the VB namespace, but it's part of the .NET Framework, you just need to add a reference to the Microsoft.VisualBasic assembly. The type you're looking for is [TextFieldParser](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.fileio.textfieldparser.aspx). Here is a...
The best CSV reader I've found is this one from Lumenworks: <http://www.codeproject.com/Articles/9258/A-Fast-CSV-Reader> Very fast, very full-featured. Recommended.
24,765,492
Is there a built-in method in .NET that validates csv files/strings? I would prefer something like [this online csv validator](http://csvlint.io) but in C#. I have done some research but all I have found are examples of people writing the code themselves (examples were all written a few years ago and might be outdated...
2014/07/15
[ "https://Stackoverflow.com/questions/24765492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3772119/" ]
The best CSV reader I've found is this one from Lumenworks: <http://www.codeproject.com/Articles/9258/A-Fast-CSV-Reader> Very fast, very full-featured. Recommended.
That CSV Parser also seems promising (Not built-in, though): <http://www.codeproject.com/Articles/9258/A-Fast-CSV-Reader> Related thread: [CSV Parsing Options with .NET](https://stackoverflow.com/questions/9642055/csv-parsing-options-with-net)
4,675,501
I would like to implicitly convert between the Scala XML Elem object and another representation of an XML element, in my case dom4j Element. I wrote the following implicit conversions: ``` implicit def elemToElement(e: Elem): Element = ... do conversion here ... implicit def elementToElem(e: Element): Elem = ... do co...
2011/01/13
[ "https://Stackoverflow.com/questions/4675501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5144/" ]
This is non-trivial so in order get what you want I think you'll have to go a bit deeper. This article explains a lot about how the scala collections work (and interesting read it is too): <http://www.artima.com/scalazine/articles/scala_collections_architecture.html> You're basically trying to do the same as List.map(...
I think this might be taking implicits too far. Especially as you can just use the converter method in a map ``` val listOfElements = listOfElems map elemToElement(_) ``` I think that the level conciseness you're going for is getting into obfuscation. I would create a converter layer and work in only one of the repr...
5,379,356
I'm having a problem getting the user's location on one of my tester's phones. It always works fine for me so I don't know what the difference is. Here is the sequence: 1: Reboots his phone. 2. Checks to make sure location services are enabled (for both GPS and Network). 3. Starts my app. The OS never provides a va...
2011/03/21
[ "https://Stackoverflow.com/questions/5379356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178430/" ]
I presume that you have written this in a service.If thats the case try using a BroadCastReciever that listens for Boot events.For example ``` <receiver android:name="com.singulera.familysiren.receiver.BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"> </act...
try changing this code ``` locationManager.requestLocationUpdates( provider, 120 * 1000, 10000, locationListener ); ``` to ``` locationManager.requestLocationUpdates( provider, 120 * 1000, 0, locationListener ); ``` it may be because your are withing your 1000 meter
5,379,356
I'm having a problem getting the user's location on one of my tester's phones. It always works fine for me so I don't know what the difference is. Here is the sequence: 1: Reboots his phone. 2. Checks to make sure location services are enabled (for both GPS and Network). 3. Starts my app. The OS never provides a va...
2011/03/21
[ "https://Stackoverflow.com/questions/5379356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178430/" ]
Better solution is not trying get the best provider once (you cannot be sure it will be GPS or Network), but listen to both GPS and Network providers and decide which location to use judging by their accuracy and provider: ``` locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); locat...
try changing this code ``` locationManager.requestLocationUpdates( provider, 120 * 1000, 10000, locationListener ); ``` to ``` locationManager.requestLocationUpdates( provider, 120 * 1000, 0, locationListener ); ``` it may be because your are withing your 1000 meter
5,379,356
I'm having a problem getting the user's location on one of my tester's phones. It always works fine for me so I don't know what the difference is. Here is the sequence: 1: Reboots his phone. 2. Checks to make sure location services are enabled (for both GPS and Network). 3. Starts my app. The OS never provides a va...
2011/03/21
[ "https://Stackoverflow.com/questions/5379356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178430/" ]
I presume that you have written this in a service.If thats the case try using a BroadCastReciever that listens for Boot events.For example ``` <receiver android:name="com.singulera.familysiren.receiver.BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"> </act...
I had the same issue with Samsung Galaxy 3 and Nexus device using GPS\_PROVIDER, once I started using both GPS & Ntwork.. It picks up the location whichever being returned first and shows to the users. One thing, I have the distance specified is 300 meters and time interval is 10 secs
5,379,356
I'm having a problem getting the user's location on one of my tester's phones. It always works fine for me so I don't know what the difference is. Here is the sequence: 1: Reboots his phone. 2. Checks to make sure location services are enabled (for both GPS and Network). 3. Starts my app. The OS never provides a va...
2011/03/21
[ "https://Stackoverflow.com/questions/5379356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178430/" ]
I presume that you have written this in a service.If thats the case try using a BroadCastReciever that listens for Boot events.For example ``` <receiver android:name="com.singulera.familysiren.receiver.BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"> </act...
I had exactly this same problem myself. I'd forgotten to add the permissions to access the `ACCESS_COARSE_LOCATION` and `ACCESS_FINE_LOCATION` location/permissions in my manifest. After adding those and rebuilding, it started working as expected.
5,379,356
I'm having a problem getting the user's location on one of my tester's phones. It always works fine for me so I don't know what the difference is. Here is the sequence: 1: Reboots his phone. 2. Checks to make sure location services are enabled (for both GPS and Network). 3. Starts my app. The OS never provides a va...
2011/03/21
[ "https://Stackoverflow.com/questions/5379356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178430/" ]
Better solution is not trying get the best provider once (you cannot be sure it will be GPS or Network), but listen to both GPS and Network providers and decide which location to use judging by their accuracy and provider: ``` locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); locat...
I had the same issue with Samsung Galaxy 3 and Nexus device using GPS\_PROVIDER, once I started using both GPS & Ntwork.. It picks up the location whichever being returned first and shows to the users. One thing, I have the distance specified is 300 meters and time interval is 10 secs
5,379,356
I'm having a problem getting the user's location on one of my tester's phones. It always works fine for me so I don't know what the difference is. Here is the sequence: 1: Reboots his phone. 2. Checks to make sure location services are enabled (for both GPS and Network). 3. Starts my app. The OS never provides a va...
2011/03/21
[ "https://Stackoverflow.com/questions/5379356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/178430/" ]
Better solution is not trying get the best provider once (you cannot be sure it will be GPS or Network), but listen to both GPS and Network providers and decide which location to use judging by their accuracy and provider: ``` locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); locat...
I had exactly this same problem myself. I'd forgotten to add the permissions to access the `ACCESS_COARSE_LOCATION` and `ACCESS_FINE_LOCATION` location/permissions in my manifest. After adding those and rebuilding, it started working as expected.
7,892,345
Can you tell me with steps how can I do a like button in my site (php) to like a page photo on facebook? I know that I have to use the GRAPH API and have to do the POST via HTTP to /likes .. but I dont know how can I do it with PHP code. Somebody have an example? Thank you
2011/10/25
[ "https://Stackoverflow.com/questions/7892345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1013089/" ]
As long as you have obtained the `publish_stream` permission from the user you can like any photo you need to. If you are attempting to like the photo as a page be sure you have an `access_token` for the page (obtained via the `/accounts` connection on the user account). Once you have the access token the like is as s...
You can get permissions by building an array of perms for login url. below i am requesting read\_stream,publish\_stream,publish\_actions,offline\_access in the scope for permissions. NOTE: app access token needed for logout url. ``` <?php $url = (!empty($_SERVER['HTTPS'])) ? 'https://'.$_SERVER['SERVER_NAME']...
7,892,345
Can you tell me with steps how can I do a like button in my site (php) to like a page photo on facebook? I know that I have to use the GRAPH API and have to do the POST via HTTP to /likes .. but I dont know how can I do it with PHP code. Somebody have an example? Thank you
2011/10/25
[ "https://Stackoverflow.com/questions/7892345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1013089/" ]
Fabio here is the php post snippet that i was able to get working. Snippet includes a curl to get application access token and the api post to like an object, in this case a post on my app. * The Sample post is here: Shows the post to be liked <https://shawnsspace.com/plugins/TimeLinePost.php?pageid=135669679827333&p...
You can get permissions by building an array of perms for login url. below i am requesting read\_stream,publish\_stream,publish\_actions,offline\_access in the scope for permissions. NOTE: app access token needed for logout url. ``` <?php $url = (!empty($_SERVER['HTTPS'])) ? 'https://'.$_SERVER['SERVER_NAME']...
28,733,675
I'm making a single page app with Angular routes on the front end, but the backend is giving me grief. All the routes that involve interfacing with the database work, but when I add in a route (Copying the exact same structure) to send an html file, or just hello world, it returns a 404, not even registering on the no...
2015/02/26
[ "https://Stackoverflow.com/questions/28733675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3212514/" ]
check my sample. I hope it helps. ![enter image description here](https://i.stack.imgur.com/LzBZg.png) ``` using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; namespace GraphicsForm { public partial class Form1 : Form { public Form1() { ...
"Check out DrawString on the graphics object. <https://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawstring.aspx> – dbugger" Answered.
33,866,716
i use to get data from this url api.but i checked this in my console but it getting crash.It like get the movie list and to display in table view.Here i use to check whether i am doing in correct way or in wrong manner. Here my code: **EDITED:** ``` - (void)viewDidLoad { [super viewDidLoad]; // Do any additi...
2015/11/23
[ "https://Stackoverflow.com/questions/33866716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526561/" ]
``` DateTime src = ...; var target = new DateTime(src.Year, src.Month, src.Day, src.Hour, 0, 0) .AddHours(1.5); ```
This should work for you ``` var dateTime = DateTime.Now; //your original DateTime value var result = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour + 1, 30, dateTime.Second, dateTime.Kind); ``` Hour to next hour (+1) Minute to 30
33,866,716
i use to get data from this url api.but i checked this in my console but it getting crash.It like get the movie list and to display in table view.Here i use to check whether i am doing in correct way or in wrong manner. Here my code: **EDITED:** ``` - (void)viewDidLoad { [super viewDidLoad]; // Do any additi...
2015/11/23
[ "https://Stackoverflow.com/questions/33866716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526561/" ]
``` DateTime src = ...; var target = new DateTime(src.Year, src.Month, src.Day, src.Hour, 0, 0) .AddHours(1.5); ```
``` string yourstring = "10:05:00 am"; DateTime date1 = DateTime.Parse(yourstring); if (date1.Minute > 0) date1 = date1.AddMinutes(-date1.Minute); if (date1.Second > 0) date1 = date1.AddSeconds(-date1.Second); date1 = date1.AddMinutes(90); Console.WriteLine(date1); ```
33,866,716
i use to get data from this url api.but i checked this in my console but it getting crash.It like get the movie list and to display in table view.Here i use to check whether i am doing in correct way or in wrong manner. Here my code: **EDITED:** ``` - (void)viewDidLoad { [super viewDidLoad]; // Do any additi...
2015/11/23
[ "https://Stackoverflow.com/questions/33866716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526561/" ]
``` DateTime src = ...; var target = new DateTime(src.Year, src.Month, src.Day, src.Hour, 0, 0) .AddHours(1.5); ```
> > I have one column which contain time in HH:mm:ss PM/Am format > > > If I understand correctly from that sentence, I would assume you have a `DateTime` and you get it's string representation for your column with `hh:mm:ss tt` format. If so, you can parse it to `DateTime` first, check it's minutes is `0`, if it...
33,866,716
i use to get data from this url api.but i checked this in my console but it getting crash.It like get the movie list and to display in table view.Here i use to check whether i am doing in correct way or in wrong manner. Here my code: **EDITED:** ``` - (void)viewDidLoad { [super viewDidLoad]; // Do any additi...
2015/11/23
[ "https://Stackoverflow.com/questions/33866716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526561/" ]
``` string yourstring = "10:05:00 am"; DateTime date1 = DateTime.Parse(yourstring); if (date1.Minute > 0) date1 = date1.AddMinutes(-date1.Minute); if (date1.Second > 0) date1 = date1.AddSeconds(-date1.Second); date1 = date1.AddMinutes(90); Console.WriteLine(date1); ```
This should work for you ``` var dateTime = DateTime.Now; //your original DateTime value var result = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour + 1, 30, dateTime.Second, dateTime.Kind); ``` Hour to next hour (+1) Minute to 30
33,866,716
i use to get data from this url api.but i checked this in my console but it getting crash.It like get the movie list and to display in table view.Here i use to check whether i am doing in correct way or in wrong manner. Here my code: **EDITED:** ``` - (void)viewDidLoad { [super viewDidLoad]; // Do any additi...
2015/11/23
[ "https://Stackoverflow.com/questions/33866716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526561/" ]
> > I have one column which contain time in HH:mm:ss PM/Am format > > > If I understand correctly from that sentence, I would assume you have a `DateTime` and you get it's string representation for your column with `hh:mm:ss tt` format. If so, you can parse it to `DateTime` first, check it's minutes is `0`, if it...
This should work for you ``` var dateTime = DateTime.Now; //your original DateTime value var result = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour + 1, 30, dateTime.Second, dateTime.Kind); ``` Hour to next hour (+1) Minute to 30
19,339,464
Trying to create a table with a foreign key. I keep getting `ORA-00904` error. What am I doing wrong. Is it because table of the foreign key is not yet created ? ``` CREATE TABLE ingredients( ingredient_id number(2,0), ingredient VARCHAR2(55) NOT NULL, quantity_required VARCHAR2(15) NOT NULL...
2013/10/12
[ "https://Stackoverflow.com/questions/19339464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2199351/" ]
Take a look at the following line: ``` CONSTRAINT fk_ingredient_list FOREIGN KEY(id) REFERENCES ingredient_list(id) ``` Your table has no column named "id". I assume you meant to write ``` CONSTRAINT fk_ingredient_list FOREIGN KEY(ingredient_id) REFERENCES ingredient_list(id) ``` EDIT: Additionally, as you sus...
We never know but in my case I had this exception no matter what name I gave my column. I had a library with EF which pointed on the proper database. The entities were correct. But on the client part (a web application), the connection string pointed to another database! A stupid mistake, it was hard to pinpoint this ...