qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
621,136
I'm a new Ubuntu user and am learning as I go. The question I have is different from the other login loop problems posted here: * [ubuntu 14.04 login loop problem](https://askubuntu.com/questions/590561/ubuntu-14-04-login-loop-problem) * [Ubuntu 14.04 Login Loop Issue](https://askubuntu.com/questions/588721/ubuntu-14-...
2015/05/08
[ "https://askubuntu.com/questions/621136", "https://askubuntu.com", "https://askubuntu.com/users/408249/" ]
I have noticed if you click the third party software installed on the installation of ubuntu. Ubuntu will try to install Nvidia drivers. Nvidia drivers mess around with the GUI a bit. Thus causing it to not load. I recommend re-installing Ubuntu and install all of the drivers yourself.
I had a similar issue, I was able to login through tty terminal (`Ctrl+Alt+f6`) but when tried to login via Login Screen I always got stuck in a loop. I tried to find `.xsession-errors` and `.Xauthority` files but both files didn't exist in my computer. After some digging I found that my home directory was encrypted an...
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
You will have to group each column individually since each column uses a different grouping scheme. If you want a cleaner version, I would recommend a list comprehension over the column names, and call `pd.concat` on the resultant series: ``` pd.concat([df1[c].groupby(df2[c]).transform('sum') for c in df1.columns], a...
Try using `apply` to apply a lambda function to each column of your dataframe, then use the name of that pd.Series to group by the second dataframe: ``` df1.apply(lambda x: x.groupby(df2[x.name]).transform('sum')) ``` Output: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
Try using `apply` to apply a lambda function to each column of your dataframe, then use the name of that pd.Series to group by the second dataframe: ``` df1.apply(lambda x: x.groupby(df2[x.name]).transform('sum')) ``` Output: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
You could do something like the following: ``` res = df1.assign(a_sum=lambda df: df['a'].groupby(df2['a']).transform('sum'))\ .assign(b_sum=lambda df: df['b'].groupby(df2['b']).transform('sum')) ``` Results: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
Try using `apply` to apply a lambda function to each column of your dataframe, then use the name of that pd.Series to group by the second dataframe: ``` df1.apply(lambda x: x.groupby(df2[x.name]).transform('sum')) ``` Output: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
Using `stack` and `unstack` ``` df1.stack().groupby([df2.stack().index.get_level_values(level=1),df2.stack()]).transform('sum').unstack() Out[291]: a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
Try using `apply` to apply a lambda function to each column of your dataframe, then use the name of that pd.Series to group by the second dataframe: ``` df1.apply(lambda x: x.groupby(df2[x.name]).transform('sum')) ``` Output: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
I'm going to propose a (mostly) numpythonic solution that uses a `scipy.sparse_matrix` to perform a vectorized `groupby` on the entire DataFrame at once, rather than column by column. --- The key to performing this operation efficiently is finding a performant way to factorize the entire DataFrame, while avoiding dup...
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
You will have to group each column individually since each column uses a different grouping scheme. If you want a cleaner version, I would recommend a list comprehension over the column names, and call `pd.concat` on the resultant series: ``` pd.concat([df1[c].groupby(df2[c]).transform('sum') for c in df1.columns], a...
You could do something like the following: ``` res = df1.assign(a_sum=lambda df: df['a'].groupby(df2['a']).transform('sum'))\ .assign(b_sum=lambda df: df['b'].groupby(df2['b']).transform('sum')) ``` Results: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
You will have to group each column individually since each column uses a different grouping scheme. If you want a cleaner version, I would recommend a list comprehension over the column names, and call `pd.concat` on the resultant series: ``` pd.concat([df1[c].groupby(df2[c]).transform('sum') for c in df1.columns], a...
Using `stack` and `unstack` ``` df1.stack().groupby([df2.stack().index.get_level_values(level=1),df2.stack()]).transform('sum').unstack() Out[291]: a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
You will have to group each column individually since each column uses a different grouping scheme. If you want a cleaner version, I would recommend a list comprehension over the column names, and call `pd.concat` on the resultant series: ``` pd.concat([df1[c].groupby(df2[c]).transform('sum') for c in df1.columns], a...
I'm going to propose a (mostly) numpythonic solution that uses a `scipy.sparse_matrix` to perform a vectorized `groupby` on the entire DataFrame at once, rather than column by column. --- The key to performing this operation efficiently is finding a performant way to factorize the entire DataFrame, while avoiding dup...
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
Using `stack` and `unstack` ``` df1.stack().groupby([df2.stack().index.get_level_values(level=1),df2.stack()]).transform('sum').unstack() Out[291]: a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
You could do something like the following: ``` res = df1.assign(a_sum=lambda df: df['a'].groupby(df2['a']).transform('sum'))\ .assign(b_sum=lambda df: df['b'].groupby(df2['b']).transform('sum')) ``` Results: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
54,202,615
How could I use a multidimensional Grouper, in this case another dataframe, as a Grouper for another dataframe? Can it be done in one step? My question is essentially regarding how to perform an actual grouping under these circumstances, but to make it more specific, say I want to then `transform` and take the `sum`. ...
2019/01/15
[ "https://Stackoverflow.com/questions/54202615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9698684/" ]
I'm going to propose a (mostly) numpythonic solution that uses a `scipy.sparse_matrix` to perform a vectorized `groupby` on the entire DataFrame at once, rather than column by column. --- The key to performing this operation efficiently is finding a performant way to factorize the entire DataFrame, while avoiding dup...
You could do something like the following: ``` res = df1.assign(a_sum=lambda df: df['a'].groupby(df2['a']).transform('sum'))\ .assign(b_sum=lambda df: df['b'].groupby(df2['b']).transform('sum')) ``` Results: ``` a b 0 4 11 1 6 11 2 4 15 3 6 15 ```
72,695,897
``` def main(): # TODO: Check for command-line usage if len(sys.argv) != 3: print("Usage : python dna.py (DNA) (SEQUENCE)") exit (1) file = open(sys.argv[2], "r") system = file.read() csvfile = open(sys.argv[1], "r") truecsv = csv.reader(csvfile) dictreader = csv.DictReader...
2022/06/21
[ "https://Stackoverflow.com/questions/72695897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19219628/" ]
I got mine to work using their [intro guide](https://playwright.dev/docs/intro) for me since the installer installs additional components, i had to build and install, then supply the path to the exe in my package.json i have. ``` "playwright": "^1.25.0", "@playwright/test": "^1.25.0", "eslint-plugin-playwright": "^0....
I'm just finishing a series of e2e tests using the same as you, Electron with React. What you don't see? Does it at least load the application? Share the code of one test and how you launch using .launch method.
20,084
I have a menu local task callback in `hook_menu()`: ``` $items['leg/add'] = array( 'title' => t('Create a new leg'), 'page callback' => 'mymodule_leg_node_form', 'access arguments' => array('create leg content'), 'file' => 'node.pages.inc', 'file path'=> drupal_get_path('module', 'node'), ...
2012/01/19
[ "https://drupal.stackexchange.com/questions/20084", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/2792/" ]
Solved this issue when I upgraded to drupal 7.10, but I had to create a node object in the page callback function. ``` function mymodule_leg_node_form(){ global $user; global $language; $node = new stdClass(); $node->uid = $user->uid; $node->type = 'leg'; $node->language = $language->language;...
My first guess is that your form is not being built correctly. Some field is not valid. If it's not that in your code 'leg/add' seems risky, I don't know, but maybe 'leg\_add' would not throw the error? This is just guessing since there is a lot of code you did not post (like your form).
20,084
I have a menu local task callback in `hook_menu()`: ``` $items['leg/add'] = array( 'title' => t('Create a new leg'), 'page callback' => 'mymodule_leg_node_form', 'access arguments' => array('create leg content'), 'file' => 'node.pages.inc', 'file path'=> drupal_get_path('module', 'node'), ...
2012/01/19
[ "https://drupal.stackexchange.com/questions/20084", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/2792/" ]
Solved this issue when I upgraded to drupal 7.10, but I had to create a node object in the page callback function. ``` function mymodule_leg_node_form(){ global $user; global $language; $node = new stdClass(); $node->uid = $user->uid; $node->type = 'leg'; $node->language = $language->language;...
Do I get you right, that you have content type "let" with two (or more fields)? There's no need to code anything with forms or menu. Fields (or CCK in D6) does everything for you. Simply go to node/add/leg (after removing your hook\_menu stuff) and you will see your form.
20,084
I have a menu local task callback in `hook_menu()`: ``` $items['leg/add'] = array( 'title' => t('Create a new leg'), 'page callback' => 'mymodule_leg_node_form', 'access arguments' => array('create leg content'), 'file' => 'node.pages.inc', 'file path'=> drupal_get_path('module', 'node'), ...
2012/01/19
[ "https://drupal.stackexchange.com/questions/20084", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/2792/" ]
Solved this issue when I upgraded to drupal 7.10, but I had to create a node object in the page callback function. ``` function mymodule_leg_node_form(){ global $user; global $language; $node = new stdClass(); $node->uid = $user->uid; $node->type = 'leg'; $node->language = $language->language;...
Node is not saved when the add node form is implemented in a menu local task. Finally, I solved this by calling `node_save()` explicitly in my extra\_submit function attached to `$form['#submit']`. ``` function mymodule_leg_node_submit($form, &$form_state){ global $user; $values = $form_state['values']; ...
15,225,701
I am working on a code to rename number of files in java. I have a list of the files in a `.txt`. File in which my program retreives the name of the document and its new name. It currently does not work.. It compiles and run but it wont rename my files. Here's my code: ``` public static void rename(String ol, String ...
2013/03/05
[ "https://Stackoverflow.com/questions/15225701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134768/" ]
You can use the [File.html#renameTo(java.io.File)](http://docs.oracle.com/javase/6/docs/api/java/io/File.html#renameTo%28java.io.File%29) to accomplish this. Heres a quick sample program i wrote. hope this puts you in right direction ``` public class FileMain { static int i = 1; public static void main(Stri...
You need a ! ``` if (newfile.exists()) ``` to ``` if (!newfile.exists()) ``` You also need to [follow conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html). And [Unit Test](http://junit.sourceforge.net/).
45,017,238
I have a data.frame like this: ``` user_id item_id serie_a 100 36 Blood_honor 100 81 Dungeon_dragon 100 90 Blue_witch 100 34 Scorpion_Valley 100 45 the_nob_hideout 100 56 ruins_of_meroeden 100 33 ...
2017/07/10
[ "https://Stackoverflow.com/questions/45017238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7646352/" ]
First of all, it is important to note that there are a couple different "levels" of Python usage in ParaView. Your first example is from the high level Python interface to ParaView. Most things you can do in the user interface can be done in ParaView at this level through the Python Console or by running a script throu...
**Please give credit to @CoryQuammen because it is really his solution** For future reference the full script, including some cell and point data ``` from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() # create a new 'Programmable Source' mesh = ProgrammableSource() mesh.OutputDataSetType...
12,966,907
My app keeps track of restaurant servers' shift sales to help them budget. In the activity that displays past shifts, I've created a RadioGroup under the ListView so the user can choose to display lunch, dinner, or both. I've implemented in the activity RadioGroup.onCheckedChangeListener, but onCheckedChanged never g...
2012/10/19
[ "https://Stackoverflow.com/questions/12966907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758088/" ]
You are already getting `checkedId` as a parameter, the unique identifier of the newly checked radio button. ``` public void onCheckedChanged(RadioGroup group, int checkedId) { rbLunchOnly.setText("Click!"); Toast.makeText(getApplicationContext(), "Lunch Only", Toast.LENGTH_LONG).show(); switch(checkedId)...
you should use this method: ``` public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(isChecked == true) { if(buttonView == radioA) tvInfo.setText("A"); else if(buttonView == radioB) tvInfo.setText("B"); ...
12,966,907
My app keeps track of restaurant servers' shift sales to help them budget. In the activity that displays past shifts, I've created a RadioGroup under the ListView so the user can choose to display lunch, dinner, or both. I've implemented in the activity RadioGroup.onCheckedChangeListener, but onCheckedChanged never g...
2012/10/19
[ "https://Stackoverflow.com/questions/12966907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758088/" ]
Found the problem, and the answer wasn't visible from the info I gave in my question. The problem was cruft. This started as my first project, and in a ham-handed attempt to solve a database problem months ago, I had extraneously overridden onStart() and onRestart() with pretty much the same code in onCreate(). onCrea...
you should use this method: ``` public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(isChecked == true) { if(buttonView == radioA) tvInfo.setText("A"); else if(buttonView == radioB) tvInfo.setText("B"); ...
12,966,907
My app keeps track of restaurant servers' shift sales to help them budget. In the activity that displays past shifts, I've created a RadioGroup under the ListView so the user can choose to display lunch, dinner, or both. I've implemented in the activity RadioGroup.onCheckedChangeListener, but onCheckedChanged never g...
2012/10/19
[ "https://Stackoverflow.com/questions/12966907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758088/" ]
You are already getting `checkedId` as a parameter, the unique identifier of the newly checked radio button. ``` public void onCheckedChanged(RadioGroup group, int checkedId) { rbLunchOnly.setText("Click!"); Toast.makeText(getApplicationContext(), "Lunch Only", Toast.LENGTH_LONG).show(); switch(checkedId)...
it should work.. in ur xml. u can give that clickable option for radiobuttons by `android:clickable="true"` in java.. ``` public void onCheckedChanged(RadioGroup group, int checkedId) { switch(checkedId){ case R.id.RadioBoth : populateAllShifts(); break; case R.id.RadioDinnerOnly: popu...
12,966,907
My app keeps track of restaurant servers' shift sales to help them budget. In the activity that displays past shifts, I've created a RadioGroup under the ListView so the user can choose to display lunch, dinner, or both. I've implemented in the activity RadioGroup.onCheckedChangeListener, but onCheckedChanged never g...
2012/10/19
[ "https://Stackoverflow.com/questions/12966907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758088/" ]
Found the problem, and the answer wasn't visible from the info I gave in my question. The problem was cruft. This started as my first project, and in a ham-handed attempt to solve a database problem months ago, I had extraneously overridden onStart() and onRestart() with pretty much the same code in onCreate(). onCrea...
You are already getting `checkedId` as a parameter, the unique identifier of the newly checked radio button. ``` public void onCheckedChanged(RadioGroup group, int checkedId) { rbLunchOnly.setText("Click!"); Toast.makeText(getApplicationContext(), "Lunch Only", Toast.LENGTH_LONG).show(); switch(checkedId)...
12,966,907
My app keeps track of restaurant servers' shift sales to help them budget. In the activity that displays past shifts, I've created a RadioGroup under the ListView so the user can choose to display lunch, dinner, or both. I've implemented in the activity RadioGroup.onCheckedChangeListener, but onCheckedChanged never g...
2012/10/19
[ "https://Stackoverflow.com/questions/12966907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1758088/" ]
Found the problem, and the answer wasn't visible from the info I gave in my question. The problem was cruft. This started as my first project, and in a ham-handed attempt to solve a database problem months ago, I had extraneously overridden onStart() and onRestart() with pretty much the same code in onCreate(). onCrea...
it should work.. in ur xml. u can give that clickable option for radiobuttons by `android:clickable="true"` in java.. ``` public void onCheckedChanged(RadioGroup group, int checkedId) { switch(checkedId){ case R.id.RadioBoth : populateAllShifts(); break; case R.id.RadioDinnerOnly: popu...
9,952,699
In C++, whose responsibility is it to delete members of a class: the class, or the creator of an instance of that class? For example, in the following code: ``` class B { public: B(int x) { num = x; } int num; }; class A { public: A(B* o) { obj = o; } B* obj; }; int main(void) { A myA(new B(...
2012/03/31
[ "https://Stackoverflow.com/questions/9952699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/346814/" ]
This is a basic question of ownership. If every `A` should own a `B` (as in, there should be a new `B` created when the `A` is created, that should also be destroyed be the `A` is destroyed, then you'd normally make `A` responsible for creating and destroying the instance of B: ``` class B { int num; public: ...
Almost always `A` should manage it's members as this is what RAII is based off of. Use `unique_ptr` when you can. If it doesn't manage it's data then it should use a different smart pointer, specifically `shared_ptr`. This shifts the responsibility to the `shared_ptr`, which is much less error prone than a vanilla poi...
9,888,740
I'm using the code below, but I don't want to have to have the #my\_id element exist in the page, I just want to run .load(), like this $.load(), etc... I hope my code explains what I want to do... ``` $("#my_id").load('/code.php', {'code': code}, function(response, status, xhr){ if(response == "test")...
2012/03/27
[ "https://Stackoverflow.com/questions/9888740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290847/" ]
If I'm reading your relations correctly, this should work. ``` $res = Place::model()->with('movies')->findAll(array('condition'=>'movies.state =1')); ``` In any case, consult the documentation for more advanced query options :) <http://www.yiiframework.com/doc/api/1.1/CActiveRecord#find-detail>
If it's a conditional state: ``` $state = $_POST['state']; $res = Place::model()->with('movies')->findAll(array('condition'=>'movies.state=:m_state', 'params'=>array(':m_state'=>$state))); ``` Depending on version of Yii, you can remove the ':' in the array keys of params. Read up about them and mark the previous an...
115,932
In *Squid Game*, Gi-hun (Player 456) and Sang-woo (Player 218) are both identified as being from Ssangmun-dong. Ali (Player 199) initially thought that Gi-hun's name was "Ssangmun-dong" since Gi-hun introduced himself as being from that area. While Gi-hun proudly identifies as being from Ssangmun-dong, Deok-su (Player ...
2021/10/02
[ "https://movies.stackexchange.com/questions/115932", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/1006/" ]
They both being from the same neighbourhood helps build Sang-woo's backstory and adds a certain mystery (initially) to his character. We're shown Gi-hun first, he lives in this poor neighbourhood where they both grew up. Both Gi-hun and Sang-woo's mother are shown to be proud of his life achievements: they believe he'...
It adds to the duality of the two characters. They have been brought up in similar circumstances and one of them appears to be the loser in life, while the other seems to be the winner. One of them needs the money, while the other one seems to already have more than enough success in life. It makes the moral choices...
46,725,840
I faced with a problem during try to use uib-tabset plugin, Ok that plugin working correctly, but i need use it in specific thing. Question: How can I separate Tabs header from the tab content. ```js angular.module('ui.bootstrap.demo', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']); angular.module('ui.bootstrap.demo')....
2017/10/13
[ "https://Stackoverflow.com/questions/46725840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2725235/" ]
You can do it by attaching `select` event handler for every tab and use `ng-if` directive in order to show the `tab` content based on the value of `$scope.activeTab` ```js angular.module('ui.bootstrap.demo', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', f...
* Set the `index` of the selected tab using `ng-click="setActiveTab(0)"`. * Show the tab content div based on value of `$scope.activeTab` using `ng-if` ```js angular.module('ui.bootstrap.demo', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function($scope...
617,262
I'm using Ubuntu 14.04 (updated), in terminal, auto complete works well but when I'm using adb command in terminal, auto complete does not work anymore..
2015/05/02
[ "https://askubuntu.com/questions/617262", "https://askubuntu.com", "https://askubuntu.com/users/206501/" ]
Just perform the following simple steps: 1. Copy and paste the **adb bash completion** from [here on github](https://github.com/mbrubeck/android-completion/blob/master/android) by mbrubeck and save in a file named **adb.txt** or the name you prefer. 2. Store the file somewhere safe. Anywhere you want in your $PATH. I ...
1. Download this [script](https://github.com/mbrubeck/android-completion). 2. Install `bash-completion` if you haven't already by running: `sudo apt-get install bash-completion` 3. Copy the downloaded file from step 1 into the `/etc/bash_completion.d` folder 4. Restart your shell.
34,053,267
I have a class like so: ``` public class OverDueClass { public int CustomerID { get; set; } public int Question_ID { get; set; } public string Department { get; set; } public DateTime DueDate { get; set; } } ``` And I am populating this class and passing it to another method: ``` while (dataRead...
2015/12/02
[ "https://Stackoverflow.com/questions/34053267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979331/" ]
If the `overDue` is the `OverDueCell` then change `string` to `OverDueClass` in `foreach` like this: ``` foreach(OverDueClass item in overDue) { } ``` Or use [`var`](https://msdn.microsoft.com/en-us/library/bb383973.aspx) keyword: ``` foreach(var item in overDue) { } ```
If you are attempting to iterate thru the collection of OverDueItems: ``` foreach(var item in overDueItemsCollection) { ... } ``` If you are trying to iterate thru properties of OverDueItem: ``` PropertyInfo[] properties = typeof(overDueItem).GetProperties(); foreach (PropertyInfo property in properties) { ...
154,507
I have a custom field called "website\_url". It should be unique. Ex: If a author set "<https://wordpress.stackexchange.com/questions/ask>" as the custom field value as a post, "<https://wordpress.stackexchange.com/questions/ask>" can't be used any other post. How to do it?
2014/07/14
[ "https://wordpress.stackexchange.com/questions/154507", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/56546/" ]
You can use the filter hooks `'add_post_metadata'` and `'update_post_meta'`, when a function hooked there return anything but `NULL` the process of adding/updating metadata is stopped. The two hooks passes almost same args: 1. NULL 2. post id 3. the meta key 4. the meta value being added/updated Only last argument i...
You can add custom error message with the following code ``` if ( ! empty( $exists ) ) { $post_id = get_post_meta_by_id($exists[0])->post_id; wp_die( __( $key.' - '. $value .' already exists for Post ID:'.$post_id)); return FALSE; } ```
5,510,292
Is there a way to code into the signature of a method, whether the object owner-ship changes or not? In Getter() and Setter() which take or return pointers, you never know if the object ownership changes or not. What do you think about: ``` // Uses pConfiguration or creates its own copy - the ownership is un-touched ...
2011/04/01
[ "https://Stackoverflow.com/questions/5510292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/494725/" ]
The best way of identifying in an interface that ownership is not changed is by not using pointers. Prefer references to pointers: ``` // Does not take ownership void ContainerClass::SetConfiguration( const Configuration& config ) {} // Does not release ownership const Configuration& ContainerClass::getConfiguration(...
1. Write good documentation and comments (you can use doxygen) 2. In Qt where functions often play with ownership methods called for example `itemAt` and `takeAt` and `addXXX` always transfer ownership which is reflected in documentation. So you can use `get()` / `take()` and `set()` / `put()`. Anyway, good docs is alw...
5,510,292
Is there a way to code into the signature of a method, whether the object owner-ship changes or not? In Getter() and Setter() which take or return pointers, you never know if the object ownership changes or not. What do you think about: ``` // Uses pConfiguration or creates its own copy - the ownership is un-touched ...
2011/04/01
[ "https://Stackoverflow.com/questions/5510292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/494725/" ]
1. Write good documentation and comments (you can use doxygen) 2. In Qt where functions often play with ownership methods called for example `itemAt` and `takeAt` and `addXXX` always transfer ownership which is reflected in documentation. So you can use `get()` / `take()` and `set()` / `put()`. Anyway, good docs is alw...
Most of the time, when using pointers, there is no "ownership" to begin with, so there's no issue of it changing. But design is the key; the role of the class should make clear its relationship with the object pointed to. At a higher level than ownership or whatever. And that relationship, in turn, determines what it w...
5,510,292
Is there a way to code into the signature of a method, whether the object owner-ship changes or not? In Getter() and Setter() which take or return pointers, you never know if the object ownership changes or not. What do you think about: ``` // Uses pConfiguration or creates its own copy - the ownership is un-touched ...
2011/04/01
[ "https://Stackoverflow.com/questions/5510292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/494725/" ]
The best way of identifying in an interface that ownership is not changed is by not using pointers. Prefer references to pointers: ``` // Does not take ownership void ContainerClass::SetConfiguration( const Configuration& config ) {} // Does not release ownership const Configuration& ContainerClass::getConfiguration(...
Most of the time, when using pointers, there is no "ownership" to begin with, so there's no issue of it changing. But design is the key; the role of the class should make clear its relationship with the object pointed to. At a higher level than ownership or whatever. And that relationship, in turn, determines what it w...
43,649,789
In function g(), commenting line LABEL(default handler) results in same output as with it. Why do we have default catch? ``` #include <iostream> #include <exception> using namespace std; void h() { //throw 1; //A //throw 2.5; //B throw 'a'; //C //throw "add"; //D } void g() { try { h(); } catc...
2017/04/27
[ "https://Stackoverflow.com/questions/43649789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6443051/" ]
To me question is unclear and could be interpreted in two ways: Why does a default catch-mechanism exist at all: the other answers give meaningful answers). Why does `g` have a default `catch` with `throw;`, and I see two possibilities: it documents that other exceptions have been considered, and it is easier to debu...
The default catcher exists to catch every exception that are not explicitly handled. They are cases where you can be sure of which exceptions could be thrown, and default catcher is a little paranoid. But let's say you want to catch one exception type to do something specific and you want to execute the same handler ...
43,649,789
In function g(), commenting line LABEL(default handler) results in same output as with it. Why do we have default catch? ``` #include <iostream> #include <exception> using namespace std; void h() { //throw 1; //A //throw 2.5; //B throw 'a'; //C //throw "add"; //D } void g() { try { h(); } catc...
2017/04/27
[ "https://Stackoverflow.com/questions/43649789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6443051/" ]
To me question is unclear and could be interpreted in two ways: Why does a default catch-mechanism exist at all: the other answers give meaningful answers). Why does `g` have a default `catch` with `throw;`, and I see two possibilities: it documents that other exceptions have been considered, and it is easier to debu...
What you're doing here is you catch an exception which was not caught by the previous `catch` statements but you're throwing it further so that it can be caught elsewhere. It works the same as if the `catch(...)` statement wasn't there because if it is not, the exception not being caught by the proper `catch` goes high...
132,815
I have an end unit townhouse built in 1986. It's three stories including the garage level, and it's built on a slope. The garage level opens to the street in the back, but that level is below grade on the opposite side (front) of the house. To accommodate the grade change, there is a vertical jog in the foundation wal...
2018/02/12
[ "https://diy.stackexchange.com/questions/132815", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/81508/" ]
Since the soil should be 6" below (in my area code) I would verify building code and have association regrade the area as it is causing the rot from the violation. In a 3 story I would not want to try patch work on cement foundation without an engineering stamp of approval.
I like Ed Beal’s idea about regrading. It’s permanent and less expensive than adding a section of concrete wall. (There’s no guarantee that the concrete joint won’t leak either.) The joist visible in the picture seems to rest on the wall that is above the plate that needs to be replaced. This is an indication of the f...
132,815
I have an end unit townhouse built in 1986. It's three stories including the garage level, and it's built on a slope. The garage level opens to the street in the back, but that level is below grade on the opposite side (front) of the house. To accommodate the grade change, there is a vertical jog in the foundation wal...
2018/02/12
[ "https://diy.stackexchange.com/questions/132815", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/81508/" ]
Since the soil should be 6" below (in my area code) I would verify building code and have association regrade the area as it is causing the rot from the violation. In a 3 story I would not want to try patch work on cement foundation without an engineering stamp of approval.
1. Build a 2-3 course retaining wall to hold back the soil. Excavate the area, create a base, completely bury the first course, and go from there. It doesn't need to be a long wall, but I would make it 2-3 feet long, just long enough to look like it belongs there. You're right about a simple regrade job not working ove...
66,570,328
I am surprised that i wasn't able to find a clear answer on this with some google searches. I understand in java that you are not supposed to use System.out.println for several reasons. But I am wondering if this also means that you shouldn't log to standard out from a logger such as log4j or slf4j. I believe this is o...
2021/03/10
[ "https://Stackoverflow.com/questions/66570328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4415079/" ]
Especially if you are on unix, it's actually situationally a *GOOD* idea to log to standard out. That way, whoever invoked your application can see the stream and possibly save it, pipe it somewhere else, etc. ---- Edit ---- Re: why use designated log files... Servlet app servers are an example of good reasons to us...
From my experience, unless you are working on a local project or a in a POC, it is always better to use a Logger, saving log files and managing all this stuff related to log for you instead the System.out. Why? First depending where you application will be deployed, you don't know what exactly is the System.out. In you...
121,748
Expanding on [this question](https://stackoverflow.com/questions/7535/sql-server-2008-compatability-with-sql-server-2005), what is the best way to develop against both SQL Server 2005 and SQL Server 2008? I'd like to see if I could just use Orcas technology on my current Vista 64 machine and since SQL Server 2005 want...
2008/09/23
[ "https://Stackoverflow.com/questions/121748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
The safest practice is to code against the oldest database server you support. This version is the one that will be far more likely to give you trouble. By and large the new versions of the db will have backwards compatibility to support your TSQL and constructs. It is far to simple to introduce unsupported code into t...
The referenced question suggests changing the database compatibility level, this is a short term solution that would not be automated easily. Its important to have automated testing, and if your reading stackoverflow, you probably agree. I would say get both MS SQL Server 2005 and 2008 running. Then, assuming yo...
121,748
Expanding on [this question](https://stackoverflow.com/questions/7535/sql-server-2008-compatability-with-sql-server-2005), what is the best way to develop against both SQL Server 2005 and SQL Server 2008? I'd like to see if I could just use Orcas technology on my current Vista 64 machine and since SQL Server 2005 want...
2008/09/23
[ "https://Stackoverflow.com/questions/121748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
You need to code against the oldest version of SQL Server, so that you don't start using features not available until more recent versions. Although it is not necessarily true that the newer versions will continue to support older features, the best way to make sure is to run Microsoft's own SQL Server Best Practices A...
The referenced question suggests changing the database compatibility level, this is a short term solution that would not be automated easily. Its important to have automated testing, and if your reading stackoverflow, you probably agree. I would say get both MS SQL Server 2005 and 2008 running. Then, assuming yo...
121,748
Expanding on [this question](https://stackoverflow.com/questions/7535/sql-server-2008-compatability-with-sql-server-2005), what is the best way to develop against both SQL Server 2005 and SQL Server 2008? I'd like to see if I could just use Orcas technology on my current Vista 64 machine and since SQL Server 2005 want...
2008/09/23
[ "https://Stackoverflow.com/questions/121748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577/" ]
The safest practice is to code against the oldest database server you support. This version is the one that will be far more likely to give you trouble. By and large the new versions of the db will have backwards compatibility to support your TSQL and constructs. It is far to simple to introduce unsupported code into t...
You need to code against the oldest version of SQL Server, so that you don't start using features not available until more recent versions. Although it is not necessarily true that the newer versions will continue to support older features, the best way to make sure is to run Microsoft's own SQL Server Best Practices A...
3,829,558
**Definition** Let be $X$ a topological vector space. A subset $S$ of $X$ is said convex if the affine combination $$ A:=\{z\in X: z=(1-t)x+y, t\in[0,1]\} $$ is contained in $S$ for any $x, y\in S$. **Statement** If $S$ is convex then $\text{cl}(S)$ and $\text{int}(S)$ are convex too. So unfortunately I don't be ab...
2020/09/17
[ "https://math.stackexchange.com/questions/3829558", "https://math.stackexchange.com", "https://math.stackexchange.com/users/736008/" ]
Let $x,y$ be in in $\text{cl}(S)$, and $u \in [0,1]$. We want to show that $ux+(1-u)y \in \text{cl}(S)$ as well. So let $x\_i, y\_i, i \in I$ be nets with common domain $I$ such that $x\_i \to x$ and $y\_i \to y$ as nets, and such that $\forall i: x\_i \in S, y\_i \in S$, by standard theory on nets. Then as in TVS al...
Henno Brandsma has given a perfect answer. Here I shall give an alternative proof that $\operatorname{cl}(S)$ is convex (which does not use nets). The map $\phi : X \times X \times [0,1] \to X, \phi(x,y,t) = (1-t)x + ty$, is continuous. Let $x, y \in \operatorname{cl}(S)$. We have to show that $\phi(x,y,t) \in \operat...
35,806,515
I have a sequence in my Oracle database for example: ``` |Event code | Event time | |41164 | jan-20-2016 | |41165 | jan-21-2016 | |41164 | jan-27-2016 | |41164 | jan-30-2016 | |41164 | jan-31-2016 | |41165 | Feb-01-2016 | |41164 | Feb-0...
2016/03/04
[ "https://Stackoverflow.com/questions/35806515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1341512/" ]
**Oracle Setup**: ``` CREATE TABLE Events (Event_code, Event_time ) AS SELECT 41164, DATE '2016-01-20' FROM DUAL UNION ALL SELECT 41165, DATE '2016-01-21' FROM DUAL UNION ALL SELECT 41164, DATE '2016-01-27' FROM DUAL UNION ALL SELECT 41164, DATE '2016-01-30' FROM DUAL UNION ALL SELECT 41164, DATE '2016-01-31' FROM DUA...
As indicated, requirement is not clear (For example, what should happen if more than these 2 numbers are available? If on next date you have both numbers, how you need to treat it ? etc ) You can start with and adapt below SQL: ``` select event_code from ( select event_code, lead(event_code) over ( orde...
35,806,515
I have a sequence in my Oracle database for example: ``` |Event code | Event time | |41164 | jan-20-2016 | |41165 | jan-21-2016 | |41164 | jan-27-2016 | |41164 | jan-30-2016 | |41164 | jan-31-2016 | |41165 | Feb-01-2016 | |41164 | Feb-0...
2016/03/04
[ "https://Stackoverflow.com/questions/35806515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1341512/" ]
**Oracle Setup**: ``` CREATE TABLE Events (Event_code, Event_time ) AS SELECT 41164, DATE '2016-01-20' FROM DUAL UNION ALL SELECT 41165, DATE '2016-01-21' FROM DUAL UNION ALL SELECT 41164, DATE '2016-01-27' FROM DUAL UNION ALL SELECT 41164, DATE '2016-01-30' FROM DUAL UNION ALL SELECT 41164, DATE '2016-01-31' FROM DUA...
This has been tested on oracle DB, you can run it without the DB and check if that is what you are looking for. Used [lead](http://with%20seq%20as%20%20%20(select%20%20%20%20%20%2041164%20a,%20'jan-20-2016'%20b%20%20%20%20from%20dual%20%20%20%20union%20%20%20%20select%20%20%20%20%20%2041165%20a,%20'jan-21-2016'%20b%20%...
565,166
I've read a sentence from the *Economist*, as follows: > > THE LATEST monthly employment report, published on April 2nd, painted an impressive picture: over the previous month America created more than 900,000 jobs. That figure, the strongest since August, reflects the state of the economy in the first half of March,...
2021/04/16
[ "https://english.stackexchange.com/questions/565166", "https://english.stackexchange.com", "https://english.stackexchange.com/users/410291/" ]
You can use [constant](https://www.merriam-webster.com/dictionary/constant) > > something invariable or unchanging > > > So you get > > While ABC was a change, XYZ was a *constant*. > > >
"As usual" or "The same as ever"
6,272
Why are questions like "[Why does objects with zero acceleraton move?](https://physics.stackexchange.com/questions/146255/why-does-objects-with-zero-acceleraton-move/)" downvoted? To me it seems like a person genuinely wanting to understand a physical concept and coming here for help. It just bothers me that apparentl...
2014/11/12
[ "https://physics.meta.stackexchange.com/questions/6272", "https://physics.meta.stackexchange.com", "https://physics.meta.stackexchange.com/users/43574/" ]
As far as I've seen, simple questions are not downvoted. One of our most upvoted questions is [Don't heavier objects actually fall faster because they exert their own gravity?](https://physics.stackexchange.com/questions/3534/dont-heavier-objects-actually-fall-faster-because-they-exert-their-own-gravity) A simple quest...
> > I've seen remarks on meta like 'This site is for professionals', > suggesting that the question is too 'stupid' or low-level, but if that > is truly the case, homework questions should also not be allowed. > > > I do not follow how 'this site is for professionals' implies homework or homework-like questions ...
22,928,213
I'm a bit hesitant to put this broad question here but I just can't find the keywords I need to use to research this. I'm having a hard time finding a way to have a Custom Route in ASP.Net MVC 4 (or 5) to recreate what I've seen all over the place on the web. What I need is that if a user goes to `http://www.myApp....
2014/04/08
[ "https://Stackoverflow.com/questions/22928213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1244328/" ]
This is tricky because the username parameter could override your action methods that are in the same controller, and even implicit action methods in other controllers. **Example** Supposed you have an action method in your HomeController called "Profile" <http://www.myapp.com/profile/> All is fine until one of yo...
I always recommand <http://attributerouting.net/>, because it is so much easier to create nice and seo-friendly urls. With attribute routing it will look like this: ``` public class UserController : Controller { [GET("/users/{userName}")] public ActionResult UserRedirect(string userName) { ret...
54,882,350
I have updated the logging.properties file of tomcat to print the logs in json format. But, the issue is value of "message " has some escape characters, which makes my log invalid json. Please let me know how to escape these characters(:,[,],/) in json using default tomcat-juli.jar and used as a string. Below is my up...
2019/02/26
[ "https://Stackoverflow.com/questions/54882350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/948235/" ]
I would suggest you official way (without using middleware): 1. Download Elastic JUL formatter and logging core libraries: <https://mvnrepository.com/artifact/co.elastic.logging/jul-ecs-formatter> <https://mvnrepository.com/artifact/co.elastic.logging/ecs-logging-core> 2. Put them into tomcat/bin folder 3. List them i...
I would do the following: 1. Download and build [devatherock's jul json formatter](https://github.com/devatherock/jul-jsonformatter) 2. Download [json-simple](https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1) 3. Add both to your tomcat startup classpath in the $CATALINA\_BASE/bin/setenv....
59,034,663
I have a functional component with a react-router. Working fine when using `<Link ... />` but I want to redirect on some event. The problem is that `props.history` is undefined. ``` function App(props) { const onClick = () => { console.log(props.history); //props.history.push("/about"); }; return...
2019/11/25
[ "https://Stackoverflow.com/questions/59034663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936651/" ]
Wrap you `App` component in `withRouter` HOC and move `BrowserRouter` to `AppContainer` component. This should work. ``` import { Route, Link, BrowserRouter, withRouter } from "react-router-dom"; function App(props) { const onClick = () => { console.log(props.history); props.history.push("/about"); }; ...
The reason that `this.props.history` is `undefined` is because you can only acces this prop in a route that is set. The prop is passed to all the routes. If what you want is redirecting the user from the app component, then you should use the `Link` component. [![Edit react-router-demo](https://codesandbox.io/static/i...
245,082
My [SO rep history](https://stackoverflow.com/users/157247/t-j-crowder?tab=reputation) today shows a downvote on [this answer](https://stackoverflow.com/questions/2896626/switch-statement-for-string-matching-in-javascript/2896642#2896642), and yet the answer doesn't show any downvotes. I've waited a bit and refreshed a...
2014/12/13
[ "https://meta.stackexchange.com/questions/245082", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/134069/" ]
If you expand that reputation item in you reputation history, you can see that the −2 are coming from an unupvote: ![history expanded showing un-upvote](https://i.stack.imgur.com/ERSkC.png) While this would normally amount for –10, you received an upvote worth +2 for that answer the previous day which should be due t...
Took a look at the history - someone upvoted, downvoted then upvoted again. Probably a slip of the mouse followed by a corretion.
22,380,486
I have an Akka application with actors written in Scala and others in Java. In one case a Scala Actor writes an `Array[Byte]` and I need to deserialize this from a Java Actor. In this use-case I ultimately need a String representation in Java of the `Array[Byte]` so that would also solve my problem. Scala Actor: ``` ...
2014/03/13
[ "https://Stackoverflow.com/questions/22380486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1142881/" ]
Scala's `Array[Byte]` is already a Java's `byte[]`. Proof: ``` object ScalaSide extends Application { val a = Array[Byte](1, 2, 3) JavaSide.doSmth(a) } ``` -- ``` import java.util.Arrays; public class JavaSide { public static void doSmth(Object arr) { byte[] b = (byte[]) arr; System.out.pr...
I don't see that the tell method in Scala uses the stdout. It sends an Any and the onReceive in Java takes an Object. All you need to do is check in your Java onReceive like this: ``` public void onReceive(Object object) throws Exception { if (object instanceof byte[]) { doSomething(); } else if....
22,380,486
I have an Akka application with actors written in Scala and others in Java. In one case a Scala Actor writes an `Array[Byte]` and I need to deserialize this from a Java Actor. In this use-case I ultimately need a String representation in Java of the `Array[Byte]` so that would also solve my problem. Scala Actor: ``` ...
2014/03/13
[ "https://Stackoverflow.com/questions/22380486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1142881/" ]
Scala's `Array[Byte]` is already a Java's `byte[]`. Proof: ``` object ScalaSide extends Application { val a = Array[Byte](1, 2, 3) JavaSide.doSmth(a) } ``` -- ``` import java.util.Arrays; public class JavaSide { public static void doSmth(Object arr) { byte[] b = (byte[]) arr; System.out.pr...
Since what you said is valid (and considering all sources I checked - it is), this should work as well: Java call: ``` private byte[] loadFile() throws FileNotFoundException, IOException { return FileLoader.loadBytesFromFile(fileToLoad); } ``` of Scala method: ``` def loadBytesFromFile(fileToLoad: File): Array...
22,380,486
I have an Akka application with actors written in Scala and others in Java. In one case a Scala Actor writes an `Array[Byte]` and I need to deserialize this from a Java Actor. In this use-case I ultimately need a String representation in Java of the `Array[Byte]` so that would also solve my problem. Scala Actor: ``` ...
2014/03/13
[ "https://Stackoverflow.com/questions/22380486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1142881/" ]
I don't see that the tell method in Scala uses the stdout. It sends an Any and the onReceive in Java takes an Object. All you need to do is check in your Java onReceive like this: ``` public void onReceive(Object object) throws Exception { if (object instanceof byte[]) { doSomething(); } else if....
Since what you said is valid (and considering all sources I checked - it is), this should work as well: Java call: ``` private byte[] loadFile() throws FileNotFoundException, IOException { return FileLoader.loadBytesFromFile(fileToLoad); } ``` of Scala method: ``` def loadBytesFromFile(fileToLoad: File): Array...
45,222,050
I believe this is very similar to [this](https://stackoverflow.com/questions/36529725/c-sharp-update-a-list-from-another-list), however, I need this based on equal indexes. --- I have a list like this: ``` Time | Temp1 | Temp2 | Type 10:42:00 | 108 | 150 | Unkwon 10:44:00 | 107 | 160 | Test 10:46:00...
2017/07/20
[ "https://Stackoverflow.com/questions/45222050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8132934/" ]
No need to use Linq: ``` var n = Graph._listData.Count; for (var i = 0; i < n; i++) if (Graph._listData[i].Type != newData2[i].Type) { var temp = Graph._listData[i]; temp.Type = newData2[i].Type; Graph._listData[i] = temp; } ``` I edited accordingly to what [juharr](https://stackove...
Note: this works for reference types only. An alternative to using a `for` loop is `Zip` ``` var zipped = Graph._listData.Zip( newData2, (o,n) => new { Original = o, NewDate= n}) foreach(var pair in zipped) { pair.Original.Type = pair.NewData.Type; } ``` The nice thing about `Zip` is that it will stop ...
45,222,050
I believe this is very similar to [this](https://stackoverflow.com/questions/36529725/c-sharp-update-a-list-from-another-list), however, I need this based on equal indexes. --- I have a list like this: ``` Time | Temp1 | Temp2 | Type 10:42:00 | 108 | 150 | Unkwon 10:44:00 | 107 | 160 | Test 10:46:00...
2017/07/20
[ "https://Stackoverflow.com/questions/45222050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8132934/" ]
No need to use Linq: ``` var n = Graph._listData.Count; for (var i = 0; i < n; i++) if (Graph._listData[i].Type != newData2[i].Type) { var temp = Graph._listData[i]; temp.Type = newData2[i].Type; Graph._listData[i] = temp; } ``` I edited accordingly to what [juharr](https://stackove...
You can join the lists like this. It uses the overload of the Select method that uses a Func with an index. ``` var joined = from left in leftList.Select((s, i) => new { s, i }) join right in rightList.Select((s, i) => new { s, i }) on left.i equals right.i select new { left.s....
45,222,050
I believe this is very similar to [this](https://stackoverflow.com/questions/36529725/c-sharp-update-a-list-from-another-list), however, I need this based on equal indexes. --- I have a list like this: ``` Time | Temp1 | Temp2 | Type 10:42:00 | 108 | 150 | Unkwon 10:44:00 | 107 | 160 | Test 10:46:00...
2017/07/20
[ "https://Stackoverflow.com/questions/45222050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8132934/" ]
Note: this works for reference types only. An alternative to using a `for` loop is `Zip` ``` var zipped = Graph._listData.Zip( newData2, (o,n) => new { Original = o, NewDate= n}) foreach(var pair in zipped) { pair.Original.Type = pair.NewData.Type; } ``` The nice thing about `Zip` is that it will stop ...
You can join the lists like this. It uses the overload of the Select method that uses a Func with an index. ``` var joined = from left in leftList.Select((s, i) => new { s, i }) join right in rightList.Select((s, i) => new { s, i }) on left.i equals right.i select new { left.s....
7,566,702
hi friend i have to make date application i have groped tableview.i have one section and two row when my application start i am showing default date on both cell on first cell i was showing today day+1 and on nextcell i am showing today day+6 they i can see but ``` - (id)init { [super initWithStyle:UITableViewS...
2011/09/27
[ "https://Stackoverflow.com/questions/7566702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/431919/" ]
I wrote an [example project](http://dl.dropbox.com/u/585261/DateSetting.zip) for you that does this Basically - look at the delegate method of the picker view controller. It sends back a new date - and from that date you can calculate the second date and reload your table view.
This is the code to get date from datepicker. 1st select the date & then select the cell you need to update. ``` NSString *dateString = nil; -(void)DateChangeForFinalPayMent:(id)sender { NSLocale *usLocale = [[[NSLocale alloc]initWithLocaleIdentifier:@"en_US"] autorelease]; NSDate *pickerDate = [self.d...
11,091
Where we should put Tracking page tracking.aspx for Newsletter tracking? On multiple site or on a single site? As I have multiple sites. Please suggest me.
2015/02/11
[ "https://tridion.stackexchange.com/questions/11091", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1366/" ]
I will file a bug report to SDL Customer Support. Clearly this is an issue, but I hoped for a quick fix. In the meantime I found a workaround. Should somebody have any trouble with the Import / Export Service in Tridion 2013 sp1 (or higher), please use the legacy export (2013 or older option). That way, the import mi...
Given the "suboptimal" error handling (such a NullReferenceException should never happen and doesn't help to pinpoint the root cause), I would recommend to contact SDL Customer Support for this issue.
11,091
Where we should put Tracking page tracking.aspx for Newsletter tracking? On multiple site or on a single site? As I have multiple sites. Please suggest me.
2015/02/11
[ "https://tridion.stackexchange.com/questions/11091", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1366/" ]
This issue may have already been hot-fixed by CM\_2013.1.0.87921 - Described as: > > During partial import, to resolve circular dependencies, the > dependencies on an XML content are stripped to allow the import. > > > In some cases the order was incorrect leading to a situation when we > try to access data alrea...
Given the "suboptimal" error handling (such a NullReferenceException should never happen and doesn't help to pinpoint the root cause), I would recommend to contact SDL Customer Support for this issue.
11,091
Where we should put Tracking page tracking.aspx for Newsletter tracking? On multiple site or on a single site? As I have multiple sites. Please suggest me.
2015/02/11
[ "https://tridion.stackexchange.com/questions/11091", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1366/" ]
I will file a bug report to SDL Customer Support. Clearly this is an issue, but I hoped for a quick fix. In the meantime I found a workaround. Should somebody have any trouble with the Import / Export Service in Tridion 2013 sp1 (or higher), please use the legacy export (2013 or older option). That way, the import mi...
I've exact the same issue... and I've created a ticket about this by Tridion Support about 2 weeks ago. Still hoping for a fix on short notice. Thijs, I will check your work around. Hope it helps.
11,091
Where we should put Tracking page tracking.aspx for Newsletter tracking? On multiple site or on a single site? As I have multiple sites. Please suggest me.
2015/02/11
[ "https://tridion.stackexchange.com/questions/11091", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1366/" ]
I will file a bug report to SDL Customer Support. Clearly this is an issue, but I hoped for a quick fix. In the meantime I found a workaround. Should somebody have any trouble with the Import / Export Service in Tridion 2013 sp1 (or higher), please use the legacy export (2013 or older option). That way, the import mi...
As mentioned I had the same issue. In my case this issue is caused because of the following import setting: "Run import process in transaction" When I deselect this option, the import seems to run flawless. Hope this helps.
11,091
Where we should put Tracking page tracking.aspx for Newsletter tracking? On multiple site or on a single site? As I have multiple sites. Please suggest me.
2015/02/11
[ "https://tridion.stackexchange.com/questions/11091", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1366/" ]
This issue may have already been hot-fixed by CM\_2013.1.0.87921 - Described as: > > During partial import, to resolve circular dependencies, the > dependencies on an XML content are stripped to allow the import. > > > In some cases the order was incorrect leading to a situation when we > try to access data alrea...
I've exact the same issue... and I've created a ticket about this by Tridion Support about 2 weeks ago. Still hoping for a fix on short notice. Thijs, I will check your work around. Hope it helps.
11,091
Where we should put Tracking page tracking.aspx for Newsletter tracking? On multiple site or on a single site? As I have multiple sites. Please suggest me.
2015/02/11
[ "https://tridion.stackexchange.com/questions/11091", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1366/" ]
This issue may have already been hot-fixed by CM\_2013.1.0.87921 - Described as: > > During partial import, to resolve circular dependencies, the > dependencies on an XML content are stripped to allow the import. > > > In some cases the order was incorrect leading to a situation when we > try to access data alrea...
As mentioned I had the same issue. In my case this issue is caused because of the following import setting: "Run import process in transaction" When I deselect this option, the import seems to run flawless. Hope this helps.
55,527,291
Continuing from [RamdaJS groupBy and tranform object](https://stackoverflow.com/questions/55492066/ramdajs-groupby-and-tranform-object) ``` let children = [ { "name": "Bob", "age": 8, "father": "Mike" }, { "name": "David", "age": 10, "father": "Mike" }, { "name": "Amy", "age": 2, "father": "Mike" }, { "name": ...
2019/04/05
[ "https://Stackoverflow.com/questions/55527291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/429386/" ]
I won't help you complete the home-work. But I will guide you to think where this example of yours is headed. It is the first step of quick sort - Partitioning the array. ``` public class QuickSortImpl { private static void swap(int[] array, int l, int h) { int temp = array[h]; array[h] = array[l]...
@brent\_mb, take a look at this simple example for your cause: ``` public static void main(String[] args) { Integer[] listOfNumbers = {1,4,5,6,74,2,7,8,5,2,6,989,3}; //sort by number 6 FirstCustomComparator comparator = new FirstCustomComparator(6); Arrays.sort(listOfNumbers, 0, listOf...
2,004,089
If each invocation of va\_arg modifies the object declared with va\_list so that the object points to the next argument in the list, is there any way to step back so that it points to the previous one, jump back to the first one, jump to the end? Go three quarters of the way though the list and then... you get the idea...
2010/01/05
[ "https://Stackoverflow.com/questions/2004089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
You can "jump back" to the beginning by executing `va_start` again. There is no other supported operation other than going on to the next argument. However, most implementations use trivial pointer arithmetic. If you guarantee the code runs only on a particular architecture, then you can do the reverse of the arithmet...
You just need to be inventive. Variable argument list structure is platform dependent, however the elements are always stored in an array. On most x86 platforms va\_lists are arrays of 64-bit blocks. That means that you can take a pointer to the first element in a va\_list, cast it to a quad-word pointer and step throu...
2,004,089
If each invocation of va\_arg modifies the object declared with va\_list so that the object points to the next argument in the list, is there any way to step back so that it points to the previous one, jump back to the first one, jump to the end? Go three quarters of the way though the list and then... you get the idea...
2010/01/05
[ "https://Stackoverflow.com/questions/2004089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
You can "jump back" to the beginning by executing `va_start` again. There is no other supported operation other than going on to the next argument. However, most implementations use trivial pointer arithmetic. If you guarantee the code runs only on a particular architecture, then you can do the reverse of the arithmet...
What are you doing that requires variable length arguments? I personally find them beyond useless. Being limited to a few basic data types and also the way you use/access them. Instead it would probably be easier and safer to just pass a structure/class that contains the data you need.
2,004,089
If each invocation of va\_arg modifies the object declared with va\_list so that the object points to the next argument in the list, is there any way to step back so that it points to the previous one, jump back to the first one, jump to the end? Go three quarters of the way though the list and then... you get the idea...
2010/01/05
[ "https://Stackoverflow.com/questions/2004089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
With C99, you can save the state of a va\_list with va\_copy, allowing you to step through (part of) the list more than once.
You just need to be inventive. Variable argument list structure is platform dependent, however the elements are always stored in an array. On most x86 platforms va\_lists are arrays of 64-bit blocks. That means that you can take a pointer to the first element in a va\_list, cast it to a quad-word pointer and step throu...
2,004,089
If each invocation of va\_arg modifies the object declared with va\_list so that the object points to the next argument in the list, is there any way to step back so that it points to the previous one, jump back to the first one, jump to the end? Go three quarters of the way though the list and then... you get the idea...
2010/01/05
[ "https://Stackoverflow.com/questions/2004089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
With C99, you can save the state of a va\_list with va\_copy, allowing you to step through (part of) the list more than once.
What are you doing that requires variable length arguments? I personally find them beyond useless. Being limited to a few basic data types and also the way you use/access them. Instead it would probably be easier and safer to just pass a structure/class that contains the data you need.
2,004,089
If each invocation of va\_arg modifies the object declared with va\_list so that the object points to the next argument in the list, is there any way to step back so that it points to the previous one, jump back to the first one, jump to the end? Go three quarters of the way though the list and then... you get the idea...
2010/01/05
[ "https://Stackoverflow.com/questions/2004089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18309/" ]
You just need to be inventive. Variable argument list structure is platform dependent, however the elements are always stored in an array. On most x86 platforms va\_lists are arrays of 64-bit blocks. That means that you can take a pointer to the first element in a va\_list, cast it to a quad-word pointer and step throu...
What are you doing that requires variable length arguments? I personally find them beyond useless. Being limited to a few basic data types and also the way you use/access them. Instead it would probably be easier and safer to just pass a structure/class that contains the data you need.
29,595,615
I have a javascript function to count the number of clicks. I wish to post the variable storing the count to PHP. I'm unsure why when I submit the form, the count is not echoed out. Below is the HTML file. ``` <html> <head> <title> js php </title> <script> var cnt=0; function CountFun(){ cnt=parseInt(cnt)...
2015/04/12
[ "https://Stackoverflow.com/questions/29595615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4743015/" ]
``` <form action "submitClicks.php"id="form"> ``` Should be: ``` <form action="submitClicks.php" id="form" method="post"> ``` And shouldn't you have something like: In HTML: ``` <input id="count" type="hidden" name="cnt" value=""> ``` In your Javascript CountFun function: ``` document.getElementById('count')....
Try this code: ``` <html> <head> <title> js php </title> <script> var cnt=0; function CountFun(){ cnt=parseInt(cnt)+parseInt(1); var divData=document.getElementById("showCount"); divData.value=cnt;//this part has been edited document.getElementById("JustShow").inner...
849,415
Hey I'm trying to return a message when there are no results for the users current query! i know i need to tap into the keyup event, but it looks like the plugin is using it
2009/05/11
[ "https://Stackoverflow.com/questions/849415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104625/" ]
You could try supplying a parse option (function to handle data parsing) and do what you need when no results are returned to parse. This example assumes you're getting back an array of JSON objects that contain FullName and Address attributes. ``` $('#search').autocomplete( { dataType: "json", parse...
This question is really out of date, anyways I'm working with the new jQuery UI 1.8.16, autocomplete is now pretty different:<http://jqueryui.com/demos/autocomplete/#default> Anyways if you're trying to the do the same thing as the question asks, there is no more parse function, as far as I know there is no function t...
849,415
Hey I'm trying to return a message when there are no results for the users current query! i know i need to tap into the keyup event, but it looks like the plugin is using it
2009/05/11
[ "https://Stackoverflow.com/questions/849415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104625/" ]
You could try supplying a parse option (function to handle data parsing) and do what you need when no results are returned to parse. This example assumes you're getting back an array of JSON objects that contain FullName and Address attributes. ``` $('#search').autocomplete( { dataType: "json", parse...
I'm using the following code for the same purpose (the message is shown in the autocomplete list): ``` success: function(data, status, xhr){ if(!data.length){ var result = [ { label: 'There are no matches for your query: ' + response.term, ...
849,415
Hey I'm trying to return a message when there are no results for the users current query! i know i need to tap into the keyup event, but it looks like the plugin is using it
2009/05/11
[ "https://Stackoverflow.com/questions/849415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104625/" ]
You could try supplying a parse option (function to handle data parsing) and do what you need when no results are returned to parse. This example assumes you're getting back an array of JSON objects that contain FullName and Address attributes. ``` $('#search').autocomplete( { dataType: "json", parse...
You can also utilize the "response" event to examine this. Simple but powerful. <http://api.jqueryui.com/autocomplete/#event-response> ``` response: function (event, ui) { if (ui.content.length == 0) { //Display an alert or something similar since there are no results } ...
849,415
Hey I'm trying to return a message when there are no results for the users current query! i know i need to tap into the keyup event, but it looks like the plugin is using it
2009/05/11
[ "https://Stackoverflow.com/questions/849415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104625/" ]
This question is really out of date, anyways I'm working with the new jQuery UI 1.8.16, autocomplete is now pretty different:<http://jqueryui.com/demos/autocomplete/#default> Anyways if you're trying to the do the same thing as the question asks, there is no more parse function, as far as I know there is no function t...
I'm using the following code for the same purpose (the message is shown in the autocomplete list): ``` success: function(data, status, xhr){ if(!data.length){ var result = [ { label: 'There are no matches for your query: ' + response.term, ...
849,415
Hey I'm trying to return a message when there are no results for the users current query! i know i need to tap into the keyup event, but it looks like the plugin is using it
2009/05/11
[ "https://Stackoverflow.com/questions/849415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104625/" ]
This question is really out of date, anyways I'm working with the new jQuery UI 1.8.16, autocomplete is now pretty different:<http://jqueryui.com/demos/autocomplete/#default> Anyways if you're trying to the do the same thing as the question asks, there is no more parse function, as far as I know there is no function t...
You can also utilize the "response" event to examine this. Simple but powerful. <http://api.jqueryui.com/autocomplete/#event-response> ``` response: function (event, ui) { if (ui.content.length == 0) { //Display an alert or something similar since there are no results } ...
50,075,164
I have a field with `v-model="data.field"`, and computed property: ``` data: { get() { console.log("getting value") return this.$store.getters.data }, set(value) { console.log("set data " + value) this.$store.commit('SET_DATA', value) } ``` But this is not working, setter is never called. Ho...
2018/04/28
[ "https://Stackoverflow.com/questions/50075164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8851717/" ]
Setters are only executed when the variable changed, not when a field inside of them changes. Change your computed property to work directly on the field itself: ``` data: { get() { console.log("getting value") return this.$store.getters.data.field }, set(field) { const value = {......
That's because you're trying to modify the variable `store` when you should be modifying the `state` instead. Note: This is for your store `mutations` Change this: ``` SET_ITEM (state, item) { console.log("set item " + item) store.item = item } ``` to: ``` SET_ITEM (state, item) { console.log("set item " + ...
171,034
So there was [a Spanish question](https://stackoverflow.com/questions/15288452/web-application-o-windows-application-para-cargar-config) on Stack Overflow, which I edited and translated to English. Now, there's an answer on the question. The optimal thing to do would be to send the asker a message with the translation...
2013/03/09
[ "https://meta.stackexchange.com/questions/171034", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/161185/" ]
> > So, should I edit the answer and append a Spanish translation so the original author can understand it? > > > No, we're an English language site. The correct thing to do from the start would have been to just close the question. * [Is English required on Stack Overflow?](https://meta.stackexchange.com/q/1367...
As Bill said, the appropriate action would be to close it, *however*, there is currently an area 51 suggestion which is a little over 50% of the way to beta. If there are migration paths between them, questions such as the one in your example could be migrated to stack overflow in spanish: <http://area51.stackexchange...
171,034
So there was [a Spanish question](https://stackoverflow.com/questions/15288452/web-application-o-windows-application-para-cargar-config) on Stack Overflow, which I edited and translated to English. Now, there's an answer on the question. The optimal thing to do would be to send the asker a message with the translation...
2013/03/09
[ "https://meta.stackexchange.com/questions/171034", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/161185/" ]
> > So, should I edit the answer and append a Spanish translation so the original author can understand it? > > > No, we're an English language site. The correct thing to do from the start would have been to just close the question. * [Is English required on Stack Overflow?](https://meta.stackexchange.com/q/1367...
> > The reason I added the translation was because a reputable (>20K rep) user added a comment > that gained four upvotes. > > > As the user who suggested a translation, I did so because the question had detail and a sizable code sample. I ran it through Google translate and I could tell that it probably was a dec...
171,034
So there was [a Spanish question](https://stackoverflow.com/questions/15288452/web-application-o-windows-application-para-cargar-config) on Stack Overflow, which I edited and translated to English. Now, there's an answer on the question. The optimal thing to do would be to send the asker a message with the translation...
2013/03/09
[ "https://meta.stackexchange.com/questions/171034", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/161185/" ]
> > So, should I edit the answer and append a Spanish translation so the original author can understand it? > > > No, we're an English language site. The correct thing to do from the start would have been to just close the question. * [Is English required on Stack Overflow?](https://meta.stackexchange.com/q/1367...
I'm thinking two policies apply here: * SO is English only * Answers are not only for the OP but anyone who has the same problem If the poster's English skills are not good enough to understand the answer they can use Google Translate or ask a colleague for help. If the answer is good, translating the question to Eng...
171,034
So there was [a Spanish question](https://stackoverflow.com/questions/15288452/web-application-o-windows-application-para-cargar-config) on Stack Overflow, which I edited and translated to English. Now, there's an answer on the question. The optimal thing to do would be to send the asker a message with the translation...
2013/03/09
[ "https://meta.stackexchange.com/questions/171034", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/161185/" ]
> > The reason I added the translation was because a reputable (>20K rep) user added a comment > that gained four upvotes. > > > As the user who suggested a translation, I did so because the question had detail and a sizable code sample. I ran it through Google translate and I could tell that it probably was a dec...
As Bill said, the appropriate action would be to close it, *however*, there is currently an area 51 suggestion which is a little over 50% of the way to beta. If there are migration paths between them, questions such as the one in your example could be migrated to stack overflow in spanish: <http://area51.stackexchange...
171,034
So there was [a Spanish question](https://stackoverflow.com/questions/15288452/web-application-o-windows-application-para-cargar-config) on Stack Overflow, which I edited and translated to English. Now, there's an answer on the question. The optimal thing to do would be to send the asker a message with the translation...
2013/03/09
[ "https://meta.stackexchange.com/questions/171034", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/161185/" ]
> > The reason I added the translation was because a reputable (>20K rep) user added a comment > that gained four upvotes. > > > As the user who suggested a translation, I did so because the question had detail and a sizable code sample. I ran it through Google translate and I could tell that it probably was a dec...
I'm thinking two policies apply here: * SO is English only * Answers are not only for the OP but anyone who has the same problem If the poster's English skills are not good enough to understand the answer they can use Google Translate or ask a colleague for help. If the answer is good, translating the question to Eng...
67,916,622
I wish to get the exact date of first day of last month at `00:00:00Z`. So, here is my current solution: ```java public static String getStartingDateAndTimeOfLastMonth() { int dayOfCurrentMonth = ZonedDateTime.now().getDayOfMonth(); return ZonedDateTime.now() .minusDays(dayOfCurrentM...
2021/06/10
[ "https://Stackoverflow.com/questions/67916622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2380115/" ]
You can exclude a from the word characters until you have found it using a [negated character class](https://www.regular-expressions.info/charclass.html#negated) where `\W` matches any non word character. ``` [^\Wa]*a\w* ``` * `[^\Wa]*` Optionally repeat any word chars without a * `a\w*` Match `a` and optional word ...
I use `[^\W]*a[^\W]*`to match all words containing the letter `a`
67,916,622
I wish to get the exact date of first day of last month at `00:00:00Z`. So, here is my current solution: ```java public static String getStartingDateAndTimeOfLastMonth() { int dayOfCurrentMonth = ZonedDateTime.now().getDayOfMonth(); return ZonedDateTime.now() .minusDays(dayOfCurrentM...
2021/06/10
[ "https://Stackoverflow.com/questions/67916622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2380115/" ]
Or not use a regex, this is more readable ```js const letter = "a", arr = ["ent", "apple", "peter", "ark", "petal"]; console.log(arr.filter(word=>word.includes(letter))) ```
I use `[^\W]*a[^\W]*`to match all words containing the letter `a`
4,919,714
I have a CSV file which contains around 1200 rows. I was trying to insert it into sqlite db. Around 300 rows only got inserted. Rest didnt...Is there any max limit on no:of rows in a table while using sqlite?
2011/02/07
[ "https://Stackoverflow.com/questions/4919714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504162/" ]
I tried more than 10000 inserts it worked, also check in android market there is SQL performance check tool which makes more inserts. Rgds Balaji
Ya.. we can have more than 10000 inserts.. Please refer this [link](http://old.nabble.com/rows-limit-td23119629.html)
4,919,714
I have a CSV file which contains around 1200 rows. I was trying to insert it into sqlite db. Around 300 rows only got inserted. Rest didnt...Is there any max limit on no:of rows in a table while using sqlite?
2011/02/07
[ "https://Stackoverflow.com/questions/4919714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504162/" ]
I tried more than 10000 inserts it worked, also check in android market there is SQL performance check tool which makes more inserts. Rgds Balaji
There IS a max limit for creating rows in SQLite. > > If the table is initially empty, then a ROWID of 1 is used. If the > largest ROWID is equal to the largest possible integer > (9223372036854775807) then the database engine starts picking positive > candidate ROWIDs at random until it finds one that is not prev...
4,919,714
I have a CSV file which contains around 1200 rows. I was trying to insert it into sqlite db. Around 300 rows only got inserted. Rest didnt...Is there any max limit on no:of rows in a table while using sqlite?
2011/02/07
[ "https://Stackoverflow.com/questions/4919714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504162/" ]
Ya.. we can have more than 10000 inserts.. Please refer this [link](http://old.nabble.com/rows-limit-td23119629.html)
There IS a max limit for creating rows in SQLite. > > If the table is initially empty, then a ROWID of 1 is used. If the > largest ROWID is equal to the largest possible integer > (9223372036854775807) then the database engine starts picking positive > candidate ROWIDs at random until it finds one that is not prev...
61,526,922
Im new using sql, i tried to convert interval to minutes. Is there a developed function that did this. Thank you
2020/04/30
[ "https://Stackoverflow.com/questions/61526922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11256222/" ]
In case with multiple reducers just using different action types for every reducer correspondingly would be the easiest solution *The answer below was given with the assumption that 1 reducer was used with initalState `{Mac: {type: "", os: ""}, PC: {type: "", os:""}}`* If you want to specifically change type attribut...
Pass initialState.Mac into the reducer as the default state ``` export default (state = initialState.Mac, action) => { switch (action.type) { case "SET_DEVICE_TYPE": return { ...state, type: action.payload }; default: return state;...
52,244,877
I hope make text that always visible in screen, see my gif [![enter image description here](https://i.stack.imgur.com/C1Suj.gif)](https://i.stack.imgur.com/C1Suj.gif) I hope text in FloatingTextCanvs visible but it's covered by button, I find the later create ui object will cover previous objects, can i change text ob...
2018/09/09
[ "https://Stackoverflow.com/questions/52244877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6011193/" ]
To display one canvas in front of the other, you want to change the `Sort Order` property on the `Canvas` component to be higher than the other canvas.
If you are dealing with two separate canvases then you can set their sort order to determine which one appears on top. [![enter image description here](https://i.stack.imgur.com/i8b6k.png)](https://i.stack.imgur.com/i8b6k.png) If you are dealing with two UI elements that are children of the same canvas, then their ph...
68,874,775
iam using riverpod with dartz , nad iam facing a problem that when using a future provider with my function i can't get my hand on the either as well , how can i isolate what i want to retrieve from the function with error handling ! my provider code : ``` final activeCourseProvider = FutureProvider.autoDispose.f...
2021/08/21
[ "https://Stackoverflow.com/questions/68874775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708585/" ]
It seems that your Provider `activeCourseProvider` is supposed to return a `List<CourseModel>`, not an `Either<ApiFailures, List<CourseModel>>`. You could use `fold` the `Either` value as follows: ``` final activeCourseProvider = FutureProvider.autoDispose.family<List<CourseModel>, int>((ref, yearId) { final _cours...
This is because you declare the function will return a Either result: ``` Future<Either<ApiFailures, List<CourseModel>>> ``` but when you pass the Type: ``` FutureProvider.autoDispose.family<List<CourseModel> ``` the either is not handled, change this: ``` return _courseRepository.activeCourses(yearId); ``` to...
34,404,455
I am attempting to implement the knapsack algorithm to play fantasy basketball. I have written a tradition 0/1 knapsack solver that takes in pairs of values and weights (prices) for each player and outputs the most valuable combo of players whose combined salaries is less than the salary cap. However, the fantasy comp...
2015/12/21
[ "https://Stackoverflow.com/questions/34404455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3648981/" ]
I am working with EC keys and had to do just this, but it will not work for the general case. I am not even sure if it is correct to do it this way. I have two files, one with a private key and one with a public key. I load those files, retrieve and verify the `EC_KEY`, and attempt to get the private key and the public...
You can just check if the `EVP_PKEY` object has the necessary params, like private key exponent. ``` if (Key->pkey.rsa->d) printf("I have a private key"); ``` I'm not sure if a more universal method exists to handle other three algorithms in one line, but it's easy to write your own function based on this.
130,652
I'm a newbie to Linux and Ubuntu but I installed it as the second OS (after Win7) on my Sony Vaio netbook. Everything's working fine except for Ubuntu doesn't restart properly. Shutting down is working well but when doing a restart it looks like it is restarting but then it shows a black screen and fails to re-boot. Wh...
2012/05/03
[ "https://askubuntu.com/questions/130652", "https://askubuntu.com", "https://askubuntu.com/users/59911/" ]
1. Edit `/etc/default/locale`: ``` LANG="en_US" LANGUAGE="en_US:en" ``` 2. Edit `~/.pam_environment`: ``` LANG=en_US Language=en_US ``` Log out and log in, or reboot.
Run "*language support*" from dash and select "*English*" and click "*apply system wide*".This should work for you.
130,652
I'm a newbie to Linux and Ubuntu but I installed it as the second OS (after Win7) on my Sony Vaio netbook. Everything's working fine except for Ubuntu doesn't restart properly. Shutting down is working well but when doing a restart it looks like it is restarting but then it shows a black screen and fails to re-boot. Wh...
2012/05/03
[ "https://askubuntu.com/questions/130652", "https://askubuntu.com", "https://askubuntu.com/users/59911/" ]
1. Edit `/etc/default/locale`: ``` LANG="en_US" LANGUAGE="en_US:en" ``` 2. Edit `~/.pam_environment`: ``` LANG=en_US Language=en_US ``` Log out and log in, or reboot.
Okay, so i stumbled across the post as I had the same problem. Hopefully this will help a bit, as it worked for me: 1. open a terminal as your primary user. This can be done by menu or pressing Ctrl+Alt+t from the desktop. 2. Type 'sudo su' without the 's. (that is, type: sudo su) 3. When the terminal prompts for your...
52,682,337
I have created one interface which looks like below: ``` public interface CalculatorInterface { int x=10; int y=15; int z=x+y; public void add1(); } ``` Then i created one class which is implementing it. The class looks like below: ``` public class AdvClass2 implements CalculatorInterface { publ...
2018/10/06
[ "https://Stackoverflow.com/questions/52682337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9394954/" ]
Variables in interface are by default **static final** ( you can call it as **static constant** ) variables ,so you can assign value to it only once , it's value cant be changed afterwards. check this site for final keyword - <https://www.javatpoint.com/final-keyword>
Since an interface can not be instantiated directly, the interface variables are static and final by default. We are not allowed to change them. Interfaces can't contain any implementation. A Java interface can only contain method signatures and fields. I think you need a better design. So the interface should be l...
52,682,337
I have created one interface which looks like below: ``` public interface CalculatorInterface { int x=10; int y=15; int z=x+y; public void add1(); } ``` Then i created one class which is implementing it. The class looks like below: ``` public class AdvClass2 implements CalculatorInterface { publ...
2018/10/06
[ "https://Stackoverflow.com/questions/52682337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9394954/" ]
You are actually changing the local variable in the `main` function. This variable is different from the one you declared in the interface which is indeed `public, static and final` by default. But there are no such restrictions on local variables. Also if there is a variable with same name in the local scope then th...
Since an interface can not be instantiated directly, the interface variables are static and final by default. We are not allowed to change them. Interfaces can't contain any implementation. A Java interface can only contain method signatures and fields. I think you need a better design. So the interface should be l...
66,643,248
I've been researching and trying a couple functions to get what I want and I feel like I might be overthinking it. One version of my code is below. The sample image is [here](https://i.stack.imgur.com/FqsgK.jpg). My end goal is to find the angle (yellow) of the approximated line with respect to the frame (green line) ...
2021/03/15
[ "https://Stackoverflow.com/questions/66643248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14761090/" ]
You can fit a straight line to the first white pixel you encounter in each column, starting from the bottom. I had to trim your image because you shared a screen grab of it with a window decoration, title and frame rather than your actual image: [![enter image description here](https://i.stack.imgur.com/UK8hR.jpg)](h...
Your 'Closed' image seems to quite clearly segment the two regions, so I'd suggest you focus on turning that boundary into a line that you can do something with. Connected components analysis and contour detection don't really provide any useful information here, so aren't necessary. One quite simple approach to findi...
6,471,845
This might sound like a dumb question. But here goes..... I am using a C program called db\_access.c which interacts with MySQL (in Ubuntu 10.10 with MySQL Server version: 5.1.49-1ubuntu8.1 (Ubuntu)). Inside the program, I have: `include "mysql.h"` When I do the following, everything works out right: ``` gcc -I/usr/in...
2011/06/24
[ "https://Stackoverflow.com/questions/6471845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676987/" ]
the line ``` db_access.o: db_access.c map_registration.h mysql.h ``` tells make that `db_access.o` depends on `db_access.c`, `map_registration.h` and `mysql.h`. make complains because `mysql.h` cannot be found in the current directory (it's in `/usr/include/mysql`). see the question [Makefile updated library depend...
You put "mysql.h" as a dependency, but it's not in the current directory, so Make thinks it needs to build it, but doesn't know how.
6,471,845
This might sound like a dumb question. But here goes..... I am using a C program called db\_access.c which interacts with MySQL (in Ubuntu 10.10 with MySQL Server version: 5.1.49-1ubuntu8.1 (Ubuntu)). Inside the program, I have: `include "mysql.h"` When I do the following, everything works out right: ``` gcc -I/usr/in...
2011/06/24
[ "https://Stackoverflow.com/questions/6471845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676987/" ]
You put "mysql.h" as a dependency, but it's not in the current directory, so Make thinks it needs to build it, but doesn't know how.
try to remove all the lines like: ``` MappingServer.o: MappingServer.c map_registration.h ``` if the `map_registration.h` is included in the c file, make is smart enough to find it. The only thing to be noticed may be to set the search file path using: `-I`.
6,471,845
This might sound like a dumb question. But here goes..... I am using a C program called db\_access.c which interacts with MySQL (in Ubuntu 10.10 with MySQL Server version: 5.1.49-1ubuntu8.1 (Ubuntu)). Inside the program, I have: `include "mysql.h"` When I do the following, everything works out right: ``` gcc -I/usr/in...
2011/06/24
[ "https://Stackoverflow.com/questions/6471845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676987/" ]
the line ``` db_access.o: db_access.c map_registration.h mysql.h ``` tells make that `db_access.o` depends on `db_access.c`, `map_registration.h` and `mysql.h`. make complains because `mysql.h` cannot be found in the current directory (it's in `/usr/include/mysql`). see the question [Makefile updated library depend...
try to remove all the lines like: ``` MappingServer.o: MappingServer.c map_registration.h ``` if the `map_registration.h` is included in the c file, make is smart enough to find it. The only thing to be noticed may be to set the search file path using: `-I`.
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
I disagree with these answers that suggest firmly telling him to stop. The time to go to HR is now. Taking surreptitious pictures of colleagues in the office is something that's *never* OK. It's not something that's OK as long as no one objects. This is not behavior that he didn't realize was offensive. If he didn't ...
Pull him aside and ask him if he is taking pictures of you. Then politely tell him to stop doing that. That should be enough to make him ashamed and stop. But if he still continues after that, ask one more colleague to check if they also notice him taking pictures. Then go to HR with the two colleagues, and explain the...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
His behavior is similar to a predator stalking his pray. He's just trying to see what he can get away with and soon he might escalate and even become dangerous. In the end of the day, you didn't stop him so might even think you're enjoying the attention if he's being more and more obvious about it. This situation can ...
The simple fact that you feel uncomfortable to just tell him to stop makes me feel ashamed of my kind (the male kind). In France, his behaviour is simply illegal, you could press charges and he would at least have a veeeeery long chat with a police officer (plus, you have a independant witness, this is legal proof in ...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
You are in a bad situation, and it is *not your fault*. You note that "Jeremy" is "really nice", but in fact, his actual behavior shows that he is ***not nice at all***. He is acting predatory and inappropriately. He may or may not be self-aware enough to realize this, but "nice guy" is a mask covering this, no matter ...
As everyone else says: this is not okay, and has to stop! BUT, if you want to take a simple approach to simply make it stop, without starting a discussion, raising any problems for Jeremy (even though he would deserve it!), etc... you can wear a t-shirt like this: [![t-shirt saying "NO PHOTOS PLEASE"](https://i.stack....
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
That is a serious situation. I would ask a coworker who you aren't close with to have a look at Jeremy's behavior. This way you get a more objective witness than your high school friend. Pick someone you think can handle it professionally and doesn't turn it into office gossip. After you've got your second witness, I...
As others have been saying, go to HR immediately. You may consider stopping at your boss' desk to tell him where you are going and why, but don't put this in the hands of your boss. If you have an ally, take her/him with you so you have a witness of what you discussed with HR. In your conversation with HR tell them tha...