qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
39,871
I've started to teach myself how to play the piano, and one of the difficulties I've found is trying to get both hands to do things at once. I either forget one hand entirely, or have one hand trying to mimic the other. This reminded me of many years ago when I was taught to play the viola. For many weeks, we did not...
2015/12/01
[ "https://music.stackexchange.com/questions/39871", "https://music.stackexchange.com", "https://music.stackexchange.com/users/24978/" ]
When I was taking piano lessons I learned each piece three times: Once with the right hand, once with the left hand, and the third time putting both together. After a while, the third "learning" came a lot more quickly, and after a few years I would start to slowly sight read both parts together. Today I will still pr...
I have never heard of one-handed practice actually being *harmful* for any piece of music, nor that it might teach you something you would later have to unlearn. Slow practice and one-handed practice have both been essential to me on the piano, (although separating the limbs doesn't seem to help me on drums, interesti...
39,871
I've started to teach myself how to play the piano, and one of the difficulties I've found is trying to get both hands to do things at once. I either forget one hand entirely, or have one hand trying to mimic the other. This reminded me of many years ago when I was taught to play the viola. For many weeks, we did not...
2015/12/01
[ "https://music.stackexchange.com/questions/39871", "https://music.stackexchange.com", "https://music.stackexchange.com/users/24978/" ]
When I was taking piano lessons I learned each piece three times: Once with the right hand, once with the left hand, and the third time putting both together. After a while, the third "learning" came a lot more quickly, and after a few years I would start to slowly sight read both parts together. Today I will still pr...
I generally only practice certain passages one hand at a time, typically when I'm having trouble with something in one of the hands. The more general rule is to isolate technical difficulties and work on them, which sometimes means working only one hand. I especially do this when I'm working out what fingering to use o...
39,871
I've started to teach myself how to play the piano, and one of the difficulties I've found is trying to get both hands to do things at once. I either forget one hand entirely, or have one hand trying to mimic the other. This reminded me of many years ago when I was taught to play the viola. For many weeks, we did not...
2015/12/01
[ "https://music.stackexchange.com/questions/39871", "https://music.stackexchange.com", "https://music.stackexchange.com/users/24978/" ]
The mantra in learning piano is: "start slowly." How slow is slow? So slow you are unable to make mistakes, and then a little slower than that. Invariably when I have to choose a speed at which I think I can't make a mistake, at first I think: "come on, this is ridiculous!, of course I can't make a mistake"... and the...
I cannot gauge your piano level very well, but if you are having difficulties playing both hands at the same time, then the piece is may be too difficult for your level. For piano players that are beyond the elementary level, I believe most players usually start learning the song both hands at the same time. This doe...
39,871
I've started to teach myself how to play the piano, and one of the difficulties I've found is trying to get both hands to do things at once. I either forget one hand entirely, or have one hand trying to mimic the other. This reminded me of many years ago when I was taught to play the viola. For many weeks, we did not...
2015/12/01
[ "https://music.stackexchange.com/questions/39871", "https://music.stackexchange.com", "https://music.stackexchange.com/users/24978/" ]
When I first started learning piano I also used to practice one hand at a time. I think it is important because then in the end it's all about coordination and if you want your hands to be well coordinated you first need each hand to know what it has to do. Putting it all together is then a completely different story, ...
I have never heard of one-handed practice actually being *harmful* for any piece of music, nor that it might teach you something you would later have to unlearn. Slow practice and one-handed practice have both been essential to me on the piano, (although separating the limbs doesn't seem to help me on drums, interesti...
39,871
I've started to teach myself how to play the piano, and one of the difficulties I've found is trying to get both hands to do things at once. I either forget one hand entirely, or have one hand trying to mimic the other. This reminded me of many years ago when I was taught to play the viola. For many weeks, we did not...
2015/12/01
[ "https://music.stackexchange.com/questions/39871", "https://music.stackexchange.com", "https://music.stackexchange.com/users/24978/" ]
It's very normal to have issues playing with both hands at first, but if you're finding yourself completely unable to do so at all, then maybe you're attempting to play music that's too hard for you. This is a common problem for people that have significant experience on one instrument and then start another. It feels ...
Independence of both hands can be practiced by exercises of kinesiology e.g. cross-crawl. There are many helpful links: <https://www.holistic-reflexology.co.uk/cross-crawl.html> A good exercise will also be to tap with one hand on your head while drawing circles with the other hand on your breast. Every rhythm prac...
73,149,174
I'm running both my Jenkins & GitLab server on two difference EC2 instances. Is there away that I can grant GitLab access an integration with my Jenkins over my Jenkins private ip address?
2022/07/28
[ "https://Stackoverflow.com/questions/73149174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14608702/" ]
The **problem** is that you've forward declared class `C` in global namespace instead of class scope `A`. This means that there are two different class named `C` one of which is declared to be in the global namespace `::C` and the second one as an inner class `A::C`. To **solve** this, just move the forward declaratio...
``` class A { public: class C; class B { public: B(C* arg) { ptr = arg; } C* ptr; }; class C { public: ... }; }; ```
11,095,776
I have an application that supports several different combinations of viewable items. each view can be toggled on and of by clicking on its corresponding tree node. The problem is that I do not want to store each individual node.checked boolean in a seperate boolean in my .settings file. So I am currently attempting t...
2012/06/19
[ "https://Stackoverflow.com/questions/11095776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613483/" ]
An enum type is an Int32 behind the scenes - in fact variables of enum types can be assigned any integer values, even if those values are not in the original enum. If you used an integer type in the setting, you could cast it to your defined enum type to use it. There is no checking that the integer value is defined by...
You can use just `Int32` type. Bitmasks are sets of nonzero bits in a integer number (4 bytes) or other specified integer type (e.g. `Int16`)
11,095,776
I have an application that supports several different combinations of viewable items. each view can be toggled on and of by clicking on its corresponding tree node. The problem is that I do not want to store each individual node.checked boolean in a seperate boolean in my .settings file. So I am currently attempting t...
2012/06/19
[ "https://Stackoverflow.com/questions/11095776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613483/" ]
An enum type is an Int32 behind the scenes - in fact variables of enum types can be assigned any integer values, even if those values are not in the original enum. If you used an integer type in the setting, you could cast it to your defined enum type to use it. There is no checking that the integer value is defined by...
If you want your custom type to be *settable* in the winforms settings you have to define a [TypeConverter](http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter%28v=vs.100%29.aspx) to convert from and back to string.
10,504,243
I've been using the following jquery plugin to set my font sizes based on the width of the container divs: <http://www.zachleat.com/web/bigtext-makes-text-big/> I have been able to get it working with different fonts when I define the fonts in the css as ``` .bigtext{ font-family:Arial } ``` see <http://jsfiddle...
2012/05/08
[ "https://Stackoverflow.com/questions/10504243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387285/" ]
Not a 'true' solution but the work around I ended up discovering was that if I applied my theme class to the same div as the big text, I'd get the desired result. ``` .theme.bigtext{ font-family:Arial } ``` It feels really hack-y because in the project I'm working on, I need to do the class switching and what no...
well you can try this hack I did lol <http://jsfiddle.net/pF5bQ/4/> ``` .bigtext{ font-family:arial } .theme .bigtext{ font-family:arial; color:red; } ``` edit: so if you put the .theme line inside of your theme css or whatever way you implement it, I think it will work as long as you have the original...
69,370,494
Title poorly describes the issue, sorry. I have div's ("cards") in my website that contain a lot of content. One of the important thing's I wanted was to have an image covering the "cards", however every time I've attempted to fit them properly, they either don't change from their current setup or they take on massive ...
2021/09/29
[ "https://Stackoverflow.com/questions/69370494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17030146/" ]
You can use a intermediate `orders` dataframe, created from `df` dataframe and that contains only information about orders, which are columns `customer_id`, `order_id` and `order_date`. Then you first inner join `df_address` dataframe with this `orders` dataframe, to link each couple `(customer_id, address_id)` to orde...
I tried a `full outer` join with the `DataFrames` to get the missing `c_id` and `a_id` combination & further utilising **when** with **isNull** for `Null` column values coming from `df` and replacing when them values from `df_address` below are the results - ### Data Preparation ``` input_str1 = """ c1| a1| 1|...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
Let's think about this: **Either the company was shockingly incompetent in hiring you or intentionally misleading**. Despite having accountants, solicitors, and an HR department, they apparently did not figure out the cost of employing you before offering you a written contract? That is quite a mistake to make, but I ...
I am not a lawyer. **You need a lawyer.** The legalities in the UK of unilaterally changing a contract of employment are complex. The UK is not the US, and employment is not generally "at-will". Changing a contract you have agreed to on day one, with no notice at all, is certainly bad practice and [probably illegal in...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
> > they added a new clause where the company might sue me to hell and back if they find it appropriate > > > That's a contract that I might be disinclined to sign. For example as an employee I wouldn't expect to be *sued* if someone finds a fault in software that I've written (because I expect them to test it to...
At first sight it looks like there is a good legal case against the USA Company. However UK employment law gives very little protection to someone until they have been in a job for some time. Assuming the notice period on the employment offer was 1 month, the most you are likely to win from the company in a legal case ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
As you've already pushed back on the T&Cs for the consultant role, it sounds like what you've got is pretty much their final offer, so it's now up to you to decide what you want to do. You've got three options: * Take the consultant role, with the intention of staying in the role long-term. * Take the consultant role,...
* I would find it hard to work for that company after these events. So forcing yourself into it should probably not be what you want. * The issue is pretty clear; they stepped out of the contract on day 1. What does your contract say about how that works? Does it have a clause where they have to keep you on for at leas...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
Let's think about this: **Either the company was shockingly incompetent in hiring you or intentionally misleading**. Despite having accountants, solicitors, and an HR department, they apparently did not figure out the cost of employing you before offering you a written contract? That is quite a mistake to make, but I ...
You can start your one-man limited liability company in the UK and use it to maximise your income by being tax-efficient. Instead of a monthly salary, you would agree on a daily rate. I'd say that £100 gross daily rate (that is you pay all your cost, taxes, etc out of that rate) is equivalent to about £15,000 annual ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
As you've already pushed back on the T&Cs for the consultant role, it sounds like what you've got is pretty much their final offer, so it's now up to you to decide what you want to do. You've got three options: * Take the consultant role, with the intention of staying in the role long-term. * Take the consultant role,...
Have they increased the monetary value of their offer now they are asking you to be a contractor? Being self employed means that you lose the benefits of having an employer: you will need to pay your own employer's national insurance and you won't get holiday or sick pay, etc. etc. As a rule of thumb, as a contractor ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
I am not a lawyer. **You need a lawyer.** The legalities in the UK of unilaterally changing a contract of employment are complex. The UK is not the US, and employment is not generally "at-will". Changing a contract you have agreed to on day one, with no notice at all, is certainly bad practice and [probably illegal in...
So yes, they've broken your original contract and they're trying to make things even worse by strong-arming you into a situation that adds a ton of uncertainty. The natural answer here is **sue them for lost earnings, emotional damage, etc and go back to your last employer**. But there are a couple of separate issues: ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
Tell them that **this is not what you signed up for**. They have gone back on your agreement and violated your contract, before you've even started work. Say **you regretfully must decline to work with them**. And when they come back at you with nonsense about how you've signed a contract, remind them what that contra...
At first sight it looks like there is a good legal case against the USA Company. However UK employment law gives very little protection to someone until they have been in a job for some time. Assuming the notice period on the employment offer was 1 month, the most you are likely to win from the company in a legal case ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
Tell them that **this is not what you signed up for**. They have gone back on your agreement and violated your contract, before you've even started work. Say **you regretfully must decline to work with them**. And when they come back at you with nonsense about how you've signed a contract, remind them what that contra...
Have they increased the monetary value of their offer now they are asking you to be a contractor? Being self employed means that you lose the benefits of having an employer: you will need to pay your own employer's national insurance and you won't get holiday or sick pay, etc. etc. As a rule of thumb, as a contractor ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
You can start your one-man limited liability company in the UK and use it to maximise your income by being tax-efficient. Instead of a monthly salary, you would agree on a daily rate. I'd say that £100 gross daily rate (that is you pay all your cost, taxes, etc out of that rate) is equivalent to about £15,000 annual ...
Have they increased the monetary value of their offer now they are asking you to be a contractor? Being self employed means that you lose the benefits of having an employer: you will need to pay your own employer's national insurance and you won't get holiday or sick pay, etc. etc. As a rule of thumb, as a contractor ...
66,520
I was offered a job by a US software company. On my first day at work they told me they couldn't actually hire me for legal and technical reasons. So, now they want me to be a consultant and to become self-employed. I had plans to buy a house in UK soon, and now I won't be able to do it unless I provide at least 24 m...
2016/05/05
[ "https://workplace.stackexchange.com/questions/66520", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/49496/" ]
> > they added a new clause where the company might sue me to hell and back if they find it appropriate > > > That's a contract that I might be disinclined to sign. For example as an employee I wouldn't expect to be *sued* if someone finds a fault in software that I've written (because I expect them to test it to...
The contract appears to be a bait-and-switch, in that they tempted you away from your previous employment with a very generous sum, only to rescind said contract after you accepted, which I believe violates good faith in terms of legality, and certainly illegal. Now they have you in an unfavourable situation, they wil...
27,577,477
I am Developing a code using php . In which I am importing two files (header.php and footer.php) in another php file index.php. Now I want that header.php and footer.php should be fixed while scrolling horizontally. can you suggest me the code. I am using the following code ``` Header.php code here footer.php code...
2014/12/20
[ "https://Stackoverflow.com/questions/27577477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1960524/" ]
Try this ``` <?php $dir = 'apps/'; $result = array(); if (is_dir($dir)) { $iterator = new RecursiveDirectoryIterator($dir); foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) { if (!$file->isFile()...
You can use hash array for checking if path already in list ``` <?php $dir = 'apps/'; $result = array(); $hash=array(); if (is_dir($dir)) { $iterator = new RecursiveDirectoryIterator($dir); foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST...
27,577,477
I am Developing a code using php . In which I am importing two files (header.php and footer.php) in another php file index.php. Now I want that header.php and footer.php should be fixed while scrolling horizontally. can you suggest me the code. I am using the following code ``` Header.php code here footer.php code...
2014/12/20
[ "https://Stackoverflow.com/questions/27577477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1960524/" ]
Try this ``` <?php $dir = 'apps/'; $result = array(); if (is_dir($dir)) { $iterator = new RecursiveDirectoryIterator($dir); foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) { if (!$file->isFile()...
use `array_unique()` ``` <?php $dir = 'apps/'; $result = array(); if(is_dir($dir)){ $iterator = new RecursiveDirectoryIterator($dir); foreach(new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file){ if(!$file->isFile()){ $result[] = $file->getPath(); ...
38,366,233
This is my MySQL query. How can I run this query in Oracle? Right now it's not working. ``` SELECT * FROM mytable WHERE id IN (1,2,3,4) ORDER BY FIELD(id,3,2,1,4); ```
2016/07/14
[ "https://Stackoverflow.com/questions/38366233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1900658/" ]
Here is a stupid solution: (:-D) ``` SELECT * FROM mytable WHERE id IN (1,2,3,4) ORDER BY CASE id WHEN 3 THEN 1 WHEN 2 THEN 2 WHEN 1 THEN 3 WHEN 4 THEN 4 END; ``` Or use `DECODE` function: ``` SELECT * FROM mytable WHERE id IN (1,2,3,4) ORDER BY DECODE(id, 3, 1, 2,...
Oracle does not have a `FIELD` function but you can create your own instead ``` create TYPE T_VAR IS TABLE OF varchar2(4000); / create or replace function FIELD(p_val varchar2, p_var t_var) return number is begin for i in 1..p_var.count loop if p_val = p_var(i) then return i; ...
7,116,291
I am a new to C#, I need a small help on how can I pass multiple parameters between the classes? Below is a small example but my parameters will more than the 10. Is there another way to this? ``` public StreamStructure(String name, string id, string classname, int number) { this.name = name; this...
2011/08/19
[ "https://Stackoverflow.com/questions/7116291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834597/" ]
Sure, use DTO's (data transfer objects). That is, create a class that has all the fields you want to send and use an instance of it as a parameter. Added bonus is that your method signature won't change even if you change your DTO class.
You could pass a domain object that represents the item you are manipulating. ``` public class Widget { public string Name {get;set;} public int Id {get;set;} public string ClassName {get;set;} public int Number {get;set;} } var myWidget = new Widget(); myWidget.Nam...
7,116,291
I am a new to C#, I need a small help on how can I pass multiple parameters between the classes? Below is a small example but my parameters will more than the 10. Is there another way to this? ``` public StreamStructure(String name, string id, string classname, int number) { this.name = name; this...
2011/08/19
[ "https://Stackoverflow.com/questions/7116291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834597/" ]
You are probably better off using [C# Initializers](http://msdn.microsoft.com/en-us/library/bb384062.aspx) or a [Data Transfer Object](http://msdn.microsoft.com/en-us/library/ff649585.aspx) than a large number of constructor parameters. Or combine the two. ``` public class MyDTO { String Name { get; set; } Strin...
You could pass a domain object that represents the item you are manipulating. ``` public class Widget { public string Name {get;set;} public int Id {get;set;} public string ClassName {get;set;} public int Number {get;set;} } var myWidget = new Widget(); myWidget.Nam...
7,116,291
I am a new to C#, I need a small help on how can I pass multiple parameters between the classes? Below is a small example but my parameters will more than the 10. Is there another way to this? ``` public StreamStructure(String name, string id, string classname, int number) { this.name = name; this...
2011/08/19
[ "https://Stackoverflow.com/questions/7116291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834597/" ]
You could pass a domain object that represents the item you are manipulating. ``` public class Widget { public string Name {get;set;} public int Id {get;set;} public string ClassName {get;set;} public int Number {get;set;} } var myWidget = new Widget(); myWidget.Nam...
You should write a new class that contains the properties you want to pass to the method, and change your method to include just that new class. For your example, write a new class like this: ``` public class RequestObject { public string Name { get; set; } public string ID { get; set; } public string Cla...
7,116,291
I am a new to C#, I need a small help on how can I pass multiple parameters between the classes? Below is a small example but my parameters will more than the 10. Is there another way to this? ``` public StreamStructure(String name, string id, string classname, int number) { this.name = name; this...
2011/08/19
[ "https://Stackoverflow.com/questions/7116291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834597/" ]
Sure, use DTO's (data transfer objects). That is, create a class that has all the fields you want to send and use an instance of it as a parameter. Added bonus is that your method signature won't change even if you change your DTO class.
You should write a new class that contains the properties you want to pass to the method, and change your method to include just that new class. For your example, write a new class like this: ``` public class RequestObject { public string Name { get; set; } public string ID { get; set; } public string Cla...
7,116,291
I am a new to C#, I need a small help on how can I pass multiple parameters between the classes? Below is a small example but my parameters will more than the 10. Is there another way to this? ``` public StreamStructure(String name, string id, string classname, int number) { this.name = name; this...
2011/08/19
[ "https://Stackoverflow.com/questions/7116291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834597/" ]
You are probably better off using [C# Initializers](http://msdn.microsoft.com/en-us/library/bb384062.aspx) or a [Data Transfer Object](http://msdn.microsoft.com/en-us/library/ff649585.aspx) than a large number of constructor parameters. Or combine the two. ``` public class MyDTO { String Name { get; set; } Strin...
You should write a new class that contains the properties you want to pass to the method, and change your method to include just that new class. For your example, write a new class like this: ``` public class RequestObject { public string Name { get; set; } public string ID { get; set; } public string Cla...
24,904,060
Hi I am trying to set the size of JPanel in JFrame but I am unable to achieve this. How can I achieve my desired output? Here is my code: ``` import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Sample extends JFrame { private JPanel panel; private JLabel label1; public Sample() { ...
2014/07/23
[ "https://Stackoverflow.com/questions/24904060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3852674/" ]
I think that it doesn't matter if you have layout or don't. Not having layout wouldn't harm changing size of JPanel. Try to use this: ``` myPanel.setPreferredSize(new Dimension(500, 500)); ``` I hope it'll help ;)
Per the Oracle documentation: <http://docs.oracle.com/javase/tutorial/uiswing/layout/none.html> 1. Set the container's layout manager to null by calling setLayout(null). 2. Call the Component class's setbounds method for each of the container's children. 3. Call the Component class's repaint method. SUGGESTION: try ...
24,904,060
Hi I am trying to set the size of JPanel in JFrame but I am unable to achieve this. How can I achieve my desired output? Here is my code: ``` import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Sample extends JFrame { private JPanel panel; private JLabel label1; public Sample() { ...
2014/07/23
[ "https://Stackoverflow.com/questions/24904060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3852674/" ]
**i will advise not to re-size your panel** If you just use the layout managers correctly, they will take care of panel sizes. To avoid having your components stretched out all over the screen when the user increases the window size, have an outermost panel with a left-aligned FlowLayout and the rest of the UI as its...
Per the Oracle documentation: <http://docs.oracle.com/javase/tutorial/uiswing/layout/none.html> 1. Set the container's layout manager to null by calling setLayout(null). 2. Call the Component class's setbounds method for each of the container's children. 3. Call the Component class's repaint method. SUGGESTION: try ...
63,856,888
It's simply to remove duplicates in a list of immutable objects by simply keeping a memo of `seen` objects. ```py nums = [1, 1, 2, 3, 4, 4] duplicates_removed seen = dict() for n in nums: if n not in seen: duplicates_removed.append(n) seen[n] = True ``` But for mutable objects, you cannot hash th...
2020/09/12
[ "https://Stackoverflow.com/questions/63856888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10256611/" ]
You *can* store mutable objects in hash tables, you just probably *shouldn’t* because if you have a pointer to an object, you store the object in the hash table, you mutate the object, and then you attempt to look it up via the pointer, you (almost certainly) won’t find it because the hash has now changed. However, if ...
I don't know it it's *elegant*, but you can often convert non-hashable items to hashable object like a [`frozenset`](https://docs.python.org/3/library/stdtypes.html#frozenset) or tuple. For example, you can convert the items() of dict like this: ``` nums = [{'a':1}, {'a':1}, {'a':2, 'c':3}, {'a':3}, {'c':3, 'a':2}, {'...
63,856,888
It's simply to remove duplicates in a list of immutable objects by simply keeping a memo of `seen` objects. ```py nums = [1, 1, 2, 3, 4, 4] duplicates_removed seen = dict() for n in nums: if n not in seen: duplicates_removed.append(n) seen[n] = True ``` But for mutable objects, you cannot hash th...
2020/09/12
[ "https://Stackoverflow.com/questions/63856888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10256611/" ]
You *can* store mutable objects in hash tables, you just probably *shouldn’t* because if you have a pointer to an object, you store the object in the hash table, you mutate the object, and then you attempt to look it up via the pointer, you (almost certainly) won’t find it because the hash has now changed. However, if ...
We can compare each element with the previous one.If they are not same we add it to the new list containing unique values. ``` def remove_dups(nums): duplicates_removed = [] duplicates_removed.append(nums[0]) for i in range(1,len(nums)): if(nums[i]!=nums[i-1]): duplicates_removed.a...
63,856,888
It's simply to remove duplicates in a list of immutable objects by simply keeping a memo of `seen` objects. ```py nums = [1, 1, 2, 3, 4, 4] duplicates_removed seen = dict() for n in nums: if n not in seen: duplicates_removed.append(n) seen[n] = True ``` But for mutable objects, you cannot hash th...
2020/09/12
[ "https://Stackoverflow.com/questions/63856888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10256611/" ]
You *can* store mutable objects in hash tables, you just probably *shouldn’t* because if you have a pointer to an object, you store the object in the hash table, you mutate the object, and then you attempt to look it up via the pointer, you (almost certainly) won’t find it because the hash has now changed. However, if ...
You don't need a dict. ``` nums = [1, 1, 2, 3, 4, 4] duplicates_removed = [] for n in nums: if n not in duplicates_removed: duplicates_removed.append(n) ``` The same works for custom classes ``` class X: def __init__(self, n): self.n = n def __eq__(self, cmp): return cmp.n == se...
5,243,661
A WP user with the role "Author" can post articles. On the blog in question I have the requirement, that these users' articles have to be **live** immediately but **not publicly visible** (i.e., for anonymous visitors or Subscribers). We use WP 3.0.5. We already have a plugin running, that allows to **hide categories*...
2011/03/09
[ "https://Stackoverflow.com/questions/5243661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113195/" ]
What you probably want to do is write function to do this in your theme's `functions.php` file, and then use `add_action` to trigger that function when a post is saved. For example: ``` function update_category_on_save($post_id) { // Get post $post = wp_get_single_post($post_id) // Map author IDs to categ...
The following code will change posts made by an author to private automatically. ``` function change_author_posts_to_private( $post_status ) { // if the user is just saving a draft, we want to keep it a draft if ( $post_status == 'draft' ) return $post_status; $this_user = new WP_User( $_POST[ 'p...
1,570
While related to [an early discussion on retro gaming](https://gaming.meta.stackexchange.com/questions/433/what-defines-retro-gaming), this isn't the same. I noticed a question got retagged to [old-games](https://gaming.stackexchange.com/questions/tagged/old-games "show questions tagged 'old-games'"), which investigat...
2010/12/27
[ "https://gaming.meta.stackexchange.com/questions/1570", "https://gaming.meta.stackexchange.com", "https://gaming.meta.stackexchange.com/users/85/" ]
Personally I think the tag should be removed entirely, since I don't find it very useful to filter on anything and it would require extensive maintenance in the years to come. If we do manage to stick a definition on it, say "games that came out 15 years ago", then past a certain point in time we'll have to go back and...
I have always thought of this tag as "Games that no longer natively run on modern hardware/operative systems or need compatibility tweaking to run properly," for use in questions that deal with said compatibility settings and/or emulation techniques and/or future proofing.
49,705,192
I am developing an application which uses a chatbot. It will partly run on LUIS dataset that I have trained and partly on AIML, in case i don't have any relevant response. Here is a piece of code from the file. I am basically trying to fetch entity type from LUIS and if it returns nothing, then trying to run AIML. Bu...
2018/04/07
[ "https://Stackoverflow.com/questions/49705192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6877294/" ]
I followed the given link: <https://github.com/Gr8z/ChatBotProject> and downloaded the `AIMLBot.dll` file which has the implementation of the method `AimlBot.loadSettings();`. On personally DE-Compiling the file, I found the implementation which looks something like this: > > [![enter image description here](https:/...
As @Shivam Som has shown, the method needs one argument which specifies the location of settings. In order to solve this issue, you need to copy your `config` folder which contains AIML settings to the `Debug` folder where the C# application runs. In case you don't have the necessary files for AIML configuration, you...
414,471
I run AVG Antivirus (version 8.5, I believe). Now I want to install "Dragon Naturally Speaking", a speech recognition software. During installation I'm told that I need to temporarily disable my antivirus. How do I temporarily disable it?
2012/04/19
[ "https://superuser.com/questions/414471", "https://superuser.com", "https://superuser.com/users/129190/" ]
As @Eroen already said, this might not be necessary. Most programs install just fine with the antivirus enabled. If they don't, either the installer or the antivirus is poorly written. From [Disabling AVG temporarily | FAQ | AVG Worldwide](http://www.avg.com/ww-en/faq.num-3857): > > The AVG software protects your c...
1. Control Panel>Administrative Tools>System Configuration 2. Click on the Startup tab 3. Uncheck AVG 4. Click restart 5. do what you need to 6. repeat 1&2 7. recheck AVG, click restart again
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
Another unusual approach that just saved me in this situation and hence should be mentioned here, is, that GRUB2 can boot ISO images directly! The Ubuntu help describes it as such: 1. Install `grml-rescueboot`. 2. Place your ISO in `/boot/grml/`. 3. Run `sudo update-grub` This will automatically create a boot entry ...
You can make a bootable USB on Ubuntu from any (bootable) .ISO image using `dd` command: ``` dd if=./someisofile.iso of=/dev/sdb ``` however, I'd like to warn you that `dd` is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the `of` one. If...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
Another unusual approach that just saved me in this situation and hence should be mentioned here, is, that GRUB2 can boot ISO images directly! The Ubuntu help describes it as such: 1. Install `grml-rescueboot`. 2. Place your ISO in `/boot/grml/`. 3. Run `sudo update-grub` This will automatically create a boot entry ...
Grub 2 - Tutorial Format your USB-Stick with FAT32 and: 1. Open a terminal and type `sudo su` // or `su` to get root access 2. Type `fdisk -l` (and note which device is your USB) 3. Type `mkdir /mnt/USB && mount /dev/sdx1 /mnt/USB` (replacing **x** with your actual usb device) 4. Type `grub-install --force --removabl...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
There is a easy way of installing Hiren's Boot CD 15.2 on Linux (Ubuntu, Linuxmint, etc.). Download the Universal USB Installer <https://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/> and open in WINE. Choose Hirens Boot CD and everything is working like you would do it under Windows.
You can make a bootable USB on Ubuntu from any (bootable) .ISO image using `dd` command: ``` dd if=./someisofile.iso of=/dev/sdb ``` however, I'd like to warn you that `dd` is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the `of` one. If...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
Open the Software Center and install [UNetbootin ![](https://hostmar.co/software-small)](https://apps.ubuntu.com/cat/applications/unetbootin/). From there you just run it and the rest explains itself.
Ok I found a solution [here](http://www.linuxquestions.org/questions/linux-newbie-8/boot-hirens-boot-iso-from-grub2-4175452264/) This approach use grub2 and so it is very convenient if you want to do a multi boot usb 1. install grub 2 on the usb driver ( `grub-install --force --no-floppy --boot-directory=[PATH_TO_US...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
None of the below methods will work. Although you will get a bootable USB, it doesn't chainload anything out of the Grub Menu. This is especially true for the 'revised' edition of Hiren's Boot CD (the one with the mini-version of Windows XP) Here is the correct procedure: Insert your USB drive into your PC and start ...
You can make a bootable USB on Ubuntu from any (bootable) .ISO image using `dd` command: ``` dd if=./someisofile.iso of=/dev/sdb ``` however, I'd like to warn you that `dd` is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the `of` one. If...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
Unetbootin does the job of making a bootable USB, but for recent versions of Hiren's CD to work, [a small fix](https://www.raymond.cc/blog/how-to-put-hirens-bootcd-on-flash-memory/) must be made for the menu to work: * Open the Software Center and install [UNetbootin ![](https://hostmar.co/software-small)](https://app...
None of the below methods will work. Although you will get a bootable USB, it doesn't chainload anything out of the Grub Menu. This is especially true for the 'revised' edition of Hiren's Boot CD (the one with the mini-version of Windows XP) Here is the correct procedure: Insert your USB drive into your PC and start ...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
get hiren's Iso into your HDD. insert your USB pendrive or whatever, download rufus <http://rufus.akeo.ie/> and proceed with burning the hiren.ISO file into the USB. once you succeeded, you need to restart your pc and check that your BIOS is configured in such a way that your boot order has your harddrive as the last t...
You can make a bootable USB on Ubuntu from any (bootable) .ISO image using `dd` command: ``` dd if=./someisofile.iso of=/dev/sdb ``` however, I'd like to warn you that `dd` is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the `of` one. If...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
Unetbootin does the job of making a bootable USB, but for recent versions of Hiren's CD to work, [a small fix](https://www.raymond.cc/blog/how-to-put-hirens-bootcd-on-flash-memory/) must be made for the menu to work: * Open the Software Center and install [UNetbootin ![](https://hostmar.co/software-small)](https://app...
You can make a bootable USB on Ubuntu from any (bootable) .ISO image using `dd` command: ``` dd if=./someisofile.iso of=/dev/sdb ``` however, I'd like to warn you that `dd` is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the `of` one. If...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
Ok I found a solution [here](http://www.linuxquestions.org/questions/linux-newbie-8/boot-hirens-boot-iso-from-grub2-4175452264/) This approach use grub2 and so it is very convenient if you want to do a multi boot usb 1. install grub 2 on the usb driver ( `grub-install --force --no-floppy --boot-directory=[PATH_TO_US...
You can make a bootable USB on Ubuntu from any (bootable) .ISO image using `dd` command: ``` dd if=./someisofile.iso of=/dev/sdb ``` however, I'd like to warn you that `dd` is a very dangerous command and you should only proceed if you fully understand the meaning of its parameters, in particular, the `of` one. If...
146,127
Trying to create a [Hiren's BootCD](http://www.hiren.info/pages/bootcd) on a USB. Not needing anything else such as a dual boot of Ubuntu and Haren or Window's and Haren. All the programs that I can find to complete this either end up directing me on how to create a Ubuntu boot on a usb, or how to do it on Windows. But...
2012/06/04
[ "https://askubuntu.com/questions/146127", "https://askubuntu.com", "https://askubuntu.com/users/68196/" ]
None of the below methods will work. Although you will get a bootable USB, it doesn't chainload anything out of the Grub Menu. This is especially true for the 'revised' edition of Hiren's Boot CD (the one with the mini-version of Windows XP) Here is the correct procedure: Insert your USB drive into your PC and start ...
get hiren's Iso into your HDD. insert your USB pendrive or whatever, download rufus <http://rufus.akeo.ie/> and proceed with burning the hiren.ISO file into the USB. once you succeeded, you need to restart your pc and check that your BIOS is configured in such a way that your boot order has your harddrive as the last t...
72,061,993
I am making a "Treasure hunt" trails app. A user can go to a location and when they reach that location an action will happen. To monitor the users location I am using Gelocation.watchposition() from "react-native-geolocation-service". The point of interest (trailLocation) is got from our API and I set the "trailLocat...
2022/04/29
[ "https://Stackoverflow.com/questions/72061993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16427053/" ]
The data in your function is outdated - what's often referred to as a "stale closure". When you write `Geolocation.watchPosition((data) => newPositionHandler(data), ...`, the function is created with the state that exists at the time. When the function runs, this data has become outdated. You can read more about solut...
1. Remove await ``` axios.get(BACKEND_URL + 'api/v1/trails/' + trail.id + '/user/' + credentials.username + '/next-location?include=trail_location_ar_object.ar_object.ar_object_resources', { headers: { Authorization: 'Bearer ' + credentials.password, }, ...
67,826,261
The standard library utility `declval` is [defined](http://wg21.link/declval) as: ```cpp template<class T> add_rvalue_reference_t<T> declval() noexcept; ``` To add a *rvalue reference* here seemed like a good idea, if you think about the language when it was introduced in *C++11*: Returning a value involved a tempor...
2021/06/03
[ "https://Stackoverflow.com/questions/67826261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9167702/" ]
> > However the `is_construtible` type trait suggests this is not possible, because it is defined in terms of `declval`: > > > `Class` is not *constructible* from an instance of its own type. So `is_constructible` should not say that it is. If a type `T` satisfies `is_constructible<T, T>`, the expectation is that...
The `std::declval` function is primarily meant for forwarding. Here's an example: ``` template<typename... Ts> auto f(Ts&&... args) -> decltype(g(std::declval<Ts>()...)) { return g(std::forward<Args>(args)...); } ``` In that common case, having `std::declval` returning a prvalue is wrong, since there's no good w...
6,394,581
Hello I am using GDI+ to do some image processing. I am having it run from the command line with two arguments. The reason for this is the program is being called from VBA Excel 2007. A Open file dialog is run from VBA and gives the first argument. The first arguement is the original image to be processed and the seco...
2011/06/18
[ "https://Stackoverflow.com/questions/6394581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804297/" ]
Please take a look at the sample: [GetImage Sample: Demonstrates the Windows Image Acquisition API](http://msdn.microsoft.com/en-us/library/7eh90ebz%28v=vs.90%29.aspx): > > The sample application has a single command on its File menu, named > From scanner or camera. When a WIA device (or a device emulator) is > att...
You need to look into how shell handles the special paths, a good start is here: <http://msdn.microsoft.com/en-us/library/bb773559%28v=vs.85%29.aspx> For a lot of what you are doing, you should be using PathCanonicalize() or something along these lines. Unsure if this helps you with your camera, you may need to access...
5,210,941
I am looking for equivalent of following vi command **:! nl %** this runs nl command on currently open file What is emacs way to detect name of open file ? M-X shell-commnad nl I am not able find determine value of current open/buffer and substitute. Thx/Mahesh
2011/03/06
[ "https://Stackoverflow.com/questions/5210941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/280476/" ]
EDIT: Misread your question as wanting to apply that change to the file you're working on. If you just want to run a shell command against a buffer, you can use `shell-command-on-region`, which is usually bound to `M-|`. If you're just trying to get to a particular line number, `M-x goto-line` works. I bind that to `C...
If you always want the buffer's file name to be inserted for the shell command, you can use this advice: ``` (defadvice read-shell-command (before read-shell-command-with-filename activate) "force the initial contents to contain the buffer's filename" (if (and (null (ad-get-arg 1)) buffer-file-name) (ad-s...
5,210,941
I am looking for equivalent of following vi command **:! nl %** this runs nl command on currently open file What is emacs way to detect name of open file ? M-X shell-commnad nl I am not able find determine value of current open/buffer and substitute. Thx/Mahesh
2011/03/06
[ "https://Stackoverflow.com/questions/5210941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/280476/" ]
EDIT: Misread your question as wanting to apply that change to the file you're working on. If you just want to run a shell command against a buffer, you can use `shell-command-on-region`, which is usually bound to `M-|`. If you're just trying to get to a particular line number, `M-x goto-line` works. I bind that to `C...
I use this: ``` (defun my-shell-command-on-current-file (command &optional output-buffer error-buffer) "Run a shell command on the current file (or marked dired files). In the shell command, the file(s) will be substituted wherever a '%' is." (interactive (list (read-from-minibuffer "Shell command: " ...
56,448,276
I'm doing some R&D with a power BI Visual Studio solution and I'm struggling to programmatically embed content. I have the Power BI Pro trial. From the [Embed Setup](https://app.powerbi.com/embedsetup) webpage, I created an application ("User owns Data" with sample data) and downloaded the sample VS solution which com...
2019/06/04
[ "https://Stackoverflow.com/questions/56448276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2261245/" ]
You are mixing two different "app ids". First app ID (also called client ID) is the one that you are registering in the onboarding embed tool (<https://dev.powerbi.com/apps>), which I believe is what you called "Embed Setup" (or embed setup is something on top of that). This app registrations will be visible in Azure A...
I eventually found the [solution](https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/App%20Owns%20Data) I was looking for. Essentially you use the PowerBI C# SDK to authenticate and return your PowerBI data - like collections of reports, which you can then embed using the JS API ``` private async Task<...
499,370
Mark Zuckerberg said, "Our mission has, really, always been to connect the world." My questions is: Can we say "Our mission ***is,*** really, always to connect the world"? What's the difference between "has always been" and "is always" in this context? Thank you for your help!
2019/05/22
[ "https://english.stackexchange.com/questions/499370", "https://english.stackexchange.com", "https://english.stackexchange.com/users/349045/" ]
"has always been" means that the mission was always like this in the past. "is always" is less emphatic about the past, and stresses the current and future mission. If the mission were actually changing significantly, this could be made even clearer by saying "is now".
When you use: "has....to connect" it means their mission is trying continuously to connect the world. On the other hand,when you use:"is.....to connect" it means their mission is made up to connect the world.
7,351,744
I would like to know if there is any built in function in python to break the string in to 2 parts, based on the last occurrence of a separator. for eg: consider the string "a b c,d,e,f" , after the split over separator ",", i want the output as "a b c,d,e" and "f". I know how to manipulate the string to get the de...
2011/09/08
[ "https://Stackoverflow.com/questions/7351744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/809117/" ]
Use `rpartition(s)`. It does exactly that. You can also use `rsplit(s, 1)`.
``` >>> "a b c,d,e,f".rsplit(',',1) ['a b c,d,e', 'f'] ```
7,351,744
I would like to know if there is any built in function in python to break the string in to 2 parts, based on the last occurrence of a separator. for eg: consider the string "a b c,d,e,f" , after the split over separator ",", i want the output as "a b c,d,e" and "f". I know how to manipulate the string to get the de...
2011/09/08
[ "https://Stackoverflow.com/questions/7351744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/809117/" ]
Use `rpartition(s)`. It does exactly that. You can also use `rsplit(s, 1)`.
You can split a string by the last occurrence of a separator with [`rsplit`](http://docs.python.org/library/stdtypes.html#str.rsplit): > > Returns a list of the words in the string, separated by the delimiter string (starting from right). > > > To split by the last comma: ``` >>> "a b c,d,e,f".rsplit(',', 1) ['a...
3,522,062
I've written a two short programs that use anonymous pipes to communicate. The parent process shares the pipe handles by setting the standard IO handles for the child: ``` // -- Set STARTUPINFO for the spawned process ------------------------- ZeroMemory(&m_ChildSI, sizeof(STARTUPINFO)); GetStartupInfo(&m_ChildSI); m...
2010/08/19
[ "https://Stackoverflow.com/questions/3522062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I just read in the document [Pipe Handle Inheritance](http://msdn.microsoft.com/en-us/library/aa365782(v=VS.85).aspx) on MSDN that: "When the child has finished with the pipe, it should close the pipe handle by calling CloseHandle or by terminating, which automatically closes the handle."
Any handle can be left unclosed when application terminates, Windows will free resources automatically. But it is better practice to close them manually so everything is logical and coherent. Leaving handles opened can lead to bugs and leaks when the code is reused or modernized.
3,522,062
I've written a two short programs that use anonymous pipes to communicate. The parent process shares the pipe handles by setting the standard IO handles for the child: ``` // -- Set STARTUPINFO for the spawned process ------------------------- ZeroMemory(&m_ChildSI, sizeof(STARTUPINFO)); GetStartupInfo(&m_ChildSI); m...
2010/08/19
[ "https://Stackoverflow.com/questions/3522062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
On Win32, kernel objects such as pipes are references by one or more user mode handles. When all handles are closed, the underlying object can be closed. The handles in each process, while they might have the same value, and might refer to the same object, are different handles, and should be closed separately.
I just read in the document [Pipe Handle Inheritance](http://msdn.microsoft.com/en-us/library/aa365782(v=VS.85).aspx) on MSDN that: "When the child has finished with the pipe, it should close the pipe handle by calling CloseHandle or by terminating, which automatically closes the handle."
3,522,062
I've written a two short programs that use anonymous pipes to communicate. The parent process shares the pipe handles by setting the standard IO handles for the child: ``` // -- Set STARTUPINFO for the spawned process ------------------------- ZeroMemory(&m_ChildSI, sizeof(STARTUPINFO)); GetStartupInfo(&m_ChildSI); m...
2010/08/19
[ "https://Stackoverflow.com/questions/3522062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
On Win32, kernel objects such as pipes are references by one or more user mode handles. When all handles are closed, the underlying object can be closed. The handles in each process, while they might have the same value, and might refer to the same object, are different handles, and should be closed separately.
Any handle can be left unclosed when application terminates, Windows will free resources automatically. But it is better practice to close them manually so everything is logical and coherent. Leaving handles opened can lead to bugs and leaks when the code is reused or modernized.
13,051,632
just switched from single to dual monitors have managed to utilise both screens with emacs by using `C-x 5 f` to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate Prob I now have is how to efficiently switch between buffers in different frames I'm used...
2012/10/24
[ "https://Stackoverflow.com/questions/13051632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041868/" ]
With separate frames, I use the following to get mac osx style "same-app" switching with cmd-backtick. If you're on linux / windows you could do the same thing with alt-tilda: ``` (defined-key global-map (kbd "M-`") 'other-frame) ``` I like this because it keeps the action of switching frames separate from switching...
Turning my comment above into an answer as it seems to be what the OP is after: ``` (defun other-window-visible () (interactive) (other-window 0 'visible)) (global-set-key "\C-xo" 'other-window-visible) ```
13,051,632
just switched from single to dual monitors have managed to utilise both screens with emacs by using `C-x 5 f` to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate Prob I now have is how to efficiently switch between buffers in different frames I'm used...
2012/10/24
[ "https://Stackoverflow.com/questions/13051632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041868/" ]
I'd expect `C-x 5 o` to switch to the other frame, tho I don't have such a dual-screen setup to verify.
Turning my comment above into an answer as it seems to be what the OP is after: ``` (defun other-window-visible () (interactive) (other-window 0 'visible)) (global-set-key "\C-xo" 'other-window-visible) ```
13,051,632
just switched from single to dual monitors have managed to utilise both screens with emacs by using `C-x 5 f` to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate Prob I now have is how to efficiently switch between buffers in different frames I'm used...
2012/10/24
[ "https://Stackoverflow.com/questions/13051632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041868/" ]
I'd expect `C-x 5 o` to switch to the other frame, tho I don't have such a dual-screen setup to verify.
With separate frames, I use the following to get mac osx style "same-app" switching with cmd-backtick. If you're on linux / windows you could do the same thing with alt-tilda: ``` (defined-key global-map (kbd "M-`") 'other-frame) ``` I like this because it keeps the action of switching frames separate from switching...
13,051,632
just switched from single to dual monitors have managed to utilise both screens with emacs by using `C-x 5 f` to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate Prob I now have is how to efficiently switch between buffers in different frames I'm used...
2012/10/24
[ "https://Stackoverflow.com/questions/13051632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041868/" ]
With separate frames, I use the following to get mac osx style "same-app" switching with cmd-backtick. If you're on linux / windows you could do the same thing with alt-tilda: ``` (defined-key global-map (kbd "M-`") 'other-frame) ``` I like this because it keeps the action of switching frames separate from switching...
Maybe ``` (global-set-key (kbd "C-x o") 'next-multiframe-window) ``` (Though as spike mentioned, I think keeping `C-x o` bound to `other-window` and binding `next-multiframe-window` to something different makes sense.)
13,051,632
just switched from single to dual monitors have managed to utilise both screens with emacs by using `C-x 5 f` to open a file in a buffer in a new frame, i can drag that frame on to the 2nd monitor and enjoy my extra real-estate Prob I now have is how to efficiently switch between buffers in different frames I'm used...
2012/10/24
[ "https://Stackoverflow.com/questions/13051632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041868/" ]
I'd expect `C-x 5 o` to switch to the other frame, tho I don't have such a dual-screen setup to verify.
Maybe ``` (global-set-key (kbd "C-x o") 'next-multiframe-window) ``` (Though as spike mentioned, I think keeping `C-x o` bound to `other-window` and binding `next-multiframe-window` to something different makes sense.)
58,248,913
``` import csv price = [] score = [] numPrice = [] numScore = [] with open(r'C:\Users\Testing\Desktop\Test.csv') as f: reader = csv.DictReader(f) for row in reader: price.append(row['price']) score.append(row['helpfulness_score']) for item in price: numPrice.append(float(item)) ...
2019/10/05
[ "https://Stackoverflow.com/questions/58248913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6016132/" ]
For starters the vector should be passed to the function by reference. Otherwise a redundant copy of the vector will be created. Moreover the parameter should be declared with constant reference because the vector itself is not changed in the function. For the sum you should use the type `long long int` because it is ...
Use [`std::accumulate`](https://en.cppreference.com/w/cpp/algorithm/accumulate): ``` int simpleArraySum(vector<int> ar) { return std::accumulate(ar.begin(), ar.end(), 0); } ``` In any case, your `length` initialization is wrong, it should be: ``` int length = ar.size(); ``` If you are still having unexpected ...
225,377
"For a celebrated actor, I was surprised at how ordinary he was." The "celebrated actor" refers, of course, to "he" (not "I"). However it seems to me the grammatical construction is wrong. By substituting the preposition "for" with "as" to read "As a celebrated actor, I was surprised at how ordinary he was," is now gra...
2015/02/03
[ "https://english.stackexchange.com/questions/225377", "https://english.stackexchange.com", "https://english.stackexchange.com/users/108442/" ]
> > For a celebrated actor, I was surprised at how ordinary he was. > > > This is a [perfectly acceptable use of *for* indicating a comparison](http://dictionary.cambridge.org/dictionary/british/for#1-6), and it's pretty clear that *he* is the actor (although in theory it could refer to the *I*, in practice the ch...
In *writing*, I don't have a huge problem with your original formulation. I can't see a way to rearrange things that makes it clearer without making it more awkward. For *conversational* English though, its way too long-winded. If I was just talking to my buds, it would be more like, "I was shocked. He's just a regula...
225,377
"For a celebrated actor, I was surprised at how ordinary he was." The "celebrated actor" refers, of course, to "he" (not "I"). However it seems to me the grammatical construction is wrong. By substituting the preposition "for" with "as" to read "As a celebrated actor, I was surprised at how ordinary he was," is now gra...
2015/02/03
[ "https://english.stackexchange.com/questions/225377", "https://english.stackexchange.com", "https://english.stackexchange.com/users/108442/" ]
> > For a celebrated actor, I was surprised at how ordinary he was. > > > This is a [perfectly acceptable use of *for* indicating a comparison](http://dictionary.cambridge.org/dictionary/british/for#1-6), and it's pretty clear that *he* is the actor (although in theory it could refer to the *I*, in practice the ch...
The way the sentence is written "for a celebrated actor" modifies "I", which is not the intended meaning. This is called a dangling modifier. The following sentences avoid this ambiguity: I was surprised that for a celebrated actor, he was pretty/rather/quite ordinary. I was surprised that he was such an ordinary g...
1,874,203
> > Writing $\left(\mathbf Z\big/2\oplus\mathbf Z\big/4\oplus\mathbf Z\big/8\right)\oplus\left(\mathbf Z\big/9\oplus\mathbf Z\big/27\right)$ in a different way > > > If $M$ is equal to above how can I find the ideals,(of course of the form $m\mathbf Z$) $I\_1,\dots I\_n$ such that $I\_1\supset I\_2\supset \dots I\...
2016/07/28
[ "https://math.stackexchange.com/questions/1874203", "https://math.stackexchange.com", "https://math.stackexchange.com/users/337759/" ]
We have: $$M \cong Z/2 \oplus( Z/4 \oplus Z/9) \oplus (Z/8 \oplus Z/27) \cong Z/2 \oplus Z/36 \oplus Z/216$$
By Chinese Remainder Theorem if $I\_k$ and $I\_j$ are relatively prime ideals in a commutative ring $R$ then $R/I\_kI\_j \simeq R/I\_k \oplus R/I\_k$ (and one may generalize by induction). In your case there are many ways to split up $M$. You could write $$M \simeq \mathbb{Z}/2\mathbb{Z} \oplus \mathbb{Z}/72\mathbb{Z} ...
1,874,203
> > Writing $\left(\mathbf Z\big/2\oplus\mathbf Z\big/4\oplus\mathbf Z\big/8\right)\oplus\left(\mathbf Z\big/9\oplus\mathbf Z\big/27\right)$ in a different way > > > If $M$ is equal to above how can I find the ideals,(of course of the form $m\mathbf Z$) $I\_1,\dots I\_n$ such that $I\_1\supset I\_2\supset \dots I\...
2016/07/28
[ "https://math.stackexchange.com/questions/1874203", "https://math.stackexchange.com", "https://math.stackexchange.com/users/337759/" ]
We have: $$M \cong Z/2 \oplus( Z/4 \oplus Z/9) \oplus (Z/8 \oplus Z/27) \cong Z/2 \oplus Z/36 \oplus Z/216$$
Just list the powers of each prime in increasing order right justified and multiply them vertically (using the Chinese Remainder Theorem): \begin{array}{rrr} 2 & 4 & 8 \\ & 9 & 27 \\ \hline 2 & 36 & 216 \\ \end{array} This gives the invariant factors $\mathbb Z/2 \oplus \mathbb Z/36 \oplus \mathbb Z/216$.
1,874,203
> > Writing $\left(\mathbf Z\big/2\oplus\mathbf Z\big/4\oplus\mathbf Z\big/8\right)\oplus\left(\mathbf Z\big/9\oplus\mathbf Z\big/27\right)$ in a different way > > > If $M$ is equal to above how can I find the ideals,(of course of the form $m\mathbf Z$) $I\_1,\dots I\_n$ such that $I\_1\supset I\_2\supset \dots I\...
2016/07/28
[ "https://math.stackexchange.com/questions/1874203", "https://math.stackexchange.com", "https://math.stackexchange.com/users/337759/" ]
Just list the powers of each prime in increasing order right justified and multiply them vertically (using the Chinese Remainder Theorem): \begin{array}{rrr} 2 & 4 & 8 \\ & 9 & 27 \\ \hline 2 & 36 & 216 \\ \end{array} This gives the invariant factors $\mathbb Z/2 \oplus \mathbb Z/36 \oplus \mathbb Z/216$.
By Chinese Remainder Theorem if $I\_k$ and $I\_j$ are relatively prime ideals in a commutative ring $R$ then $R/I\_kI\_j \simeq R/I\_k \oplus R/I\_k$ (and one may generalize by induction). In your case there are many ways to split up $M$. You could write $$M \simeq \mathbb{Z}/2\mathbb{Z} \oplus \mathbb{Z}/72\mathbb{Z} ...
5,104,534
Can someone explain me IntelliJ IDEA's workflow of compilation, deployment and packaging with binded maven project ? I've encountered some misunderstanding when I'm starting tomcat server via IDEA's debug mode. For example I have one artifact - war archive. As I understand when I'm running debug mode - IDEA recompile...
2011/02/24
[ "https://Stackoverflow.com/questions/5104534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/71420/" ]
Intelli J doesn't use maven to build the project it uses its own build process. It uses the pom file as a description of the project. This means a couple of things, if you want to build an artifact such as a war file when running in tomcat then all you have to do is tell IntelliJ to build the war in the Run/Debug Con...
I think you are looking for that. [Maven IDEA Plugin](http://maven.apache.org/plugins/maven-idea-plugin/) The IDEA Plugin is used to generate files (ipr, iml, and iws) for a project so you can work on it using the IDE, IntelliJ IDEA. Hopes that helps
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The workspace in STS/Eclipse is not automatically the same as the file structure that you have on disc in your workspace directory. You can have projects in this workspace folder or somewhere else on disc. To get them into your project explorer (and access them from inside STS/Eclipse), you need to import them (Import...
Probably whey you 'accidentally deleted' your project, you only deleted it from the Eclipse workspace, but not from the actual workspace folder on your hard-drive (as other people pointed out, Eclipse can arbitrarily map workspace projects to files on disk, so it is possible for a project to be 'deleted' from your Ecli...
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Make sure it is really not in workspace, also if there aren't any other projects with the same name. If not, just delete the `.metadata` folder or create a new workspace.
the problem is that when you delete a project maybe sts only close it. Try View Menu --> uncheck closed projects Now you will see all closed project, simply delete it.
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The workspace in STS/Eclipse is not automatically the same as the file structure that you have on disc in your workspace directory. You can have projects in this workspace folder or somewhere else on disc. To get them into your project explorer (and access them from inside STS/Eclipse), you need to import them (Import...
I get this issue from time to time. Usually I just open a new workspace but sounds like you don't want to loose other projects. I simply open the.project file in my project and change the name of the project in name tag. Good Luck!
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The workspace in STS/Eclipse is not automatically the same as the file structure that you have on disc in your workspace directory. You can have projects in this workspace folder or somewhere else on disc. To get them into your project explorer (and access them from inside STS/Eclipse), you need to import them (Import...
Generally this kind of problems not occurred you can go to Project option and clean and than restart STS. May be STS is not synched with the latest configured project.
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Probably whey you 'accidentally deleted' your project, you only deleted it from the Eclipse workspace, but not from the actual workspace folder on your hard-drive (as other people pointed out, Eclipse can arbitrarily map workspace projects to files on disk, so it is possible for a project to be 'deleted' from your Ecli...
the problem is that when you delete a project maybe sts only close it. Try View Menu --> uncheck closed projects Now you will see all closed project, simply delete it.
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The workspace in STS/Eclipse is not automatically the same as the file structure that you have on disc in your workspace directory. You can have projects in this workspace folder or somewhere else on disc. To get them into your project explorer (and access them from inside STS/Eclipse), you need to import them (Import...
Make sure it is really not in workspace, also if there aren't any other projects with the same name. If not, just delete the `.metadata` folder or create a new workspace.
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Generally this kind of problems not occurred you can go to Project option and clean and than restart STS. May be STS is not synched with the latest configured project.
the problem is that when you delete a project maybe sts only close it. Try View Menu --> uncheck closed projects Now you will see all closed project, simply delete it.
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The workspace in STS/Eclipse is not automatically the same as the file structure that you have on disc in your workspace directory. You can have projects in this workspace folder or somewhere else on disc. To get them into your project explorer (and access them from inside STS/Eclipse), you need to import them (Import...
When you launch Spring Tools Suite, it will ask you to **Select directory as workspace** as below: [![spring tools suite launcher](https://i.stack.imgur.com/RAdzR.png)](https://i.stack.imgur.com/RAdzR.png) If the directory you selected here (i.e., workspace directory) is the same as the directory where the project th...
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I get this issue from time to time. Usually I just open a new workspace but sounds like you don't want to loose other projects. I simply open the.project file in my project and change the name of the project in name tag. Good Luck!
the problem is that when you delete a project maybe sts only close it. Try View Menu --> uncheck closed projects Now you will see all closed project, simply delete it.
28,507,487
Just by a mistake I had deleted a spring project in STS.To use it back I borrowed the same project from my friend in zip format but when I tried to import it says *Some projects cannot be imported because they already exist in the workspace* Following is the way I tried to import file->import->general->existing proj...
2015/02/13
[ "https://Stackoverflow.com/questions/28507487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The workspace in STS/Eclipse is not automatically the same as the file structure that you have on disc in your workspace directory. You can have projects in this workspace folder or somewhere else on disc. To get them into your project explorer (and access them from inside STS/Eclipse), you need to import them (Import...
Check if you still have the project in folder of the workspace on disk. You may have deleted in STS, without checking 'Delete on disk'. So, the project may be still there in the workspace folder though its deleted in STS.
59,532,836
I have a String like this: ``` Test+${user}100,very important text ``` I am trying to remove the part `+${user}100` Why my code isn't working? ``` noSpecialSigns = noSpecialSigns.replaceAll("\\+$\\{user}\\d",""); ```
2019/12/30
[ "https://Stackoverflow.com/questions/59532836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5359846/" ]
``` @Document(collation="company") ``` This looks like a typo and the cause of your issue. You try to set collection name, but instead of [`collection`](https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/mapping/Document.html#collection--) you use [`collation`](https://d...
This sometime happens when you miss annotated entity class with annotation @Document * Wrong @Document(collation = "department") * Right @Document(collection = "department")
59,532,836
I have a String like this: ``` Test+${user}100,very important text ``` I am trying to remove the part `+${user}100` Why my code isn't working? ``` noSpecialSigns = noSpecialSigns.replaceAll("\\+$\\{user}\\d",""); ```
2019/12/30
[ "https://Stackoverflow.com/questions/59532836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5359846/" ]
``` @Document(collation="company") ``` This looks like a typo and the cause of your issue. You try to set collection name, but instead of [`collection`](https://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/mapping/Document.html#collection--) you use [`collation`](https://d...
On my side i used `@Document(collection = "products")` and worked. Use `collection` instead of `collation` in `@Document`.
59,532,836
I have a String like this: ``` Test+${user}100,very important text ``` I am trying to remove the part `+${user}100` Why my code isn't working? ``` noSpecialSigns = noSpecialSigns.replaceAll("\\+$\\{user}\\d",""); ```
2019/12/30
[ "https://Stackoverflow.com/questions/59532836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5359846/" ]
This sometime happens when you miss annotated entity class with annotation @Document * Wrong @Document(collation = "department") * Right @Document(collection = "department")
On my side i used `@Document(collection = "products")` and worked. Use `collection` instead of `collation` in `@Document`.
134,179
How to get product **attribute group** in magento 2 from a **attribute set**. I want to show attribute on **listing page** by using a group so i can add more attributes in future
2016/09/01
[ "https://magento.stackexchange.com/questions/134179", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/40643/" ]
you simply get all product attribute by `$product->getAttributes();` ``` $productAttributes=$product->getAttributes(); $group_id=9; $attributeSetId=4; foreach ($productAttributes as $attribute) { if ($attribute->isInGroup($attributeSetId, $group_id)) { echo $attribute->...
We can use `getAttributeGroupId` method: *vendor/magento/module-catalog/Model/Config.php* ``` public function getAttributeGroupId($attributeSetId, $name) { ...... } ``` We can get attribute group id: ``` $obj = \Magento\Framework\App\ObjectManager::getInstance(); /** @var \Magento\Catalog\Model\Con...
11,984,312
I am currently taking a course that gives an introduction to project planning. It is mostly about how to draw UML diagrams (blegh), but also has a few other topics. One part in particular keeps bugging me. In the course they describe a method for going from a set of requirements to an initial class diagram, but every...
2012/08/16
[ "https://Stackoverflow.com/questions/11984312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383632/" ]
I would say it's reasonable to start with a logical model that's free of implementation constraints. That logical model is not necessarily concerned with physical implementation details (e.g. whether or not to use a database, what type of database, OS / UI choice, etc.) and thus represents just "real" business domain o...
> > When I go about designing a program, I try to identify major > abstractions > > > Same principle in UML as well. You represent abstractions and their relationships and due to existing Visual Tools you can do a presentation of a system to stakeholders or even generate automatically stubs from your design.
383,487
I have a tab delimited file with information in it about genetic material. Some information is cut into a smaller tab file with some of the columns extracted, and uniq is used to ensure there are no duplicates. A count is stored which is important later down the pipeline. I want to change the basis of the uniq function...
2017/08/02
[ "https://unix.stackexchange.com/questions/383487", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/234238/" ]
`-cmin` and `-ls` are *predicates* that are part of the *expression*, not options. Note that you can mark the end of options with `--`, but predicates are still allowed after it. With GNU `find`, which allows omitting *paths*: ``` find -- -L ``` Would complain about the *unknown -L predicate* (even though `-L` is ...
The `find` command is very old, dating back to [Unix V5](http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/find.c). At the time, the command line syntax conventions weren't as firmly established as they are now. A few old programs deviate from these conventions. Originally, `find` didn't have options. It e...
16,735,721
I've been looking around and everyone says the solution is to take "send" out of the following code: `if ( empty( $value ) ) $value = __('send', 'wpcf7');` That's the first thing I did after I replaced my submit button with an image but 'Send' is still overlaid the submit button image, and I'm at a loss as to what t...
2013/05/24
[ "https://Stackoverflow.com/questions/16735721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2259760/" ]
No Need to touch the code to change the message of the submit button. Go into your wp dashboard < Contact and change this line ``` <p>[submit "Send"]</p> ``` to ``` <p>[submit "Anything you would like here"]</p> ```
Trial and error. Replace everywhere it says "Submit" with something else like "Test" and change each one until it works. Then you will know exactly which one to change.
16,735,721
I've been looking around and everyone says the solution is to take "send" out of the following code: `if ( empty( $value ) ) $value = __('send', 'wpcf7');` That's the first thing I did after I replaced my submit button with an image but 'Send' is still overlaid the submit button image, and I'm at a loss as to what t...
2013/05/24
[ "https://Stackoverflow.com/questions/16735721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2259760/" ]
If you're looking for a blank button using Contact Form 7 ``` [submit "&nbsp;"] ```
Trial and error. Replace everywhere it says "Submit" with something else like "Test" and change each one until it works. Then you will know exactly which one to change.
16,735,721
I've been looking around and everyone says the solution is to take "send" out of the following code: `if ( empty( $value ) ) $value = __('send', 'wpcf7');` That's the first thing I did after I replaced my submit button with an image but 'Send' is still overlaid the submit button image, and I'm at a loss as to what t...
2013/05/24
[ "https://Stackoverflow.com/questions/16735721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2259760/" ]
No Need to touch the code to change the message of the submit button. Go into your wp dashboard < Contact and change this line ``` <p>[submit "Send"]</p> ``` to ``` <p>[submit "Anything you would like here"]</p> ```
In the the latest version (at the time of writing) in modules submit.php At line 27 Change ``` if ( empty( $value ) ) $value = __( 'Send', 'contact-form-7' ); ``` to ``` if ( empty( $value ) ) $value = __( ' ', 'contact-form-7' ); ```
16,735,721
I've been looking around and everyone says the solution is to take "send" out of the following code: `if ( empty( $value ) ) $value = __('send', 'wpcf7');` That's the first thing I did after I replaced my submit button with an image but 'Send' is still overlaid the submit button image, and I'm at a loss as to what t...
2013/05/24
[ "https://Stackoverflow.com/questions/16735721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2259760/" ]
No Need to touch the code to change the message of the submit button. Go into your wp dashboard < Contact and change this line ``` <p>[submit "Send"]</p> ``` to ``` <p>[submit "Anything you would like here"]</p> ```
If you're looking for a blank button using Contact Form 7 ``` [submit "&nbsp;"] ```
16,735,721
I've been looking around and everyone says the solution is to take "send" out of the following code: `if ( empty( $value ) ) $value = __('send', 'wpcf7');` That's the first thing I did after I replaced my submit button with an image but 'Send' is still overlaid the submit button image, and I'm at a loss as to what t...
2013/05/24
[ "https://Stackoverflow.com/questions/16735721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2259760/" ]
If you're looking for a blank button using Contact Form 7 ``` [submit "&nbsp;"] ```
In the the latest version (at the time of writing) in modules submit.php At line 27 Change ``` if ( empty( $value ) ) $value = __( 'Send', 'contact-form-7' ); ``` to ``` if ( empty( $value ) ) $value = __( ' ', 'contact-form-7' ); ```
444,200
I know that in a transformer the power is conserved on both sides, and hence there's no power amplification as such. That's fine! But if I instead want only a voltage amplification, then choosing proper turns ratio and connecting the load across the secondary would serve my purpose. So can you consider it as voltage a...
2019/06/18
[ "https://electronics.stackexchange.com/questions/444200", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/86971/" ]
Only for ideal transformers, power is conserved. Real transformers have losses, which may be load dependent. So, in that case, the 'output' voltage is not the gain times the 'input' voltage. For voltage amplifiers, you also want them to have unlimited (or at least large) current supply. This unlimited current is n...
Amplifiers typically provide input-output isolation. Changes in output energy need not require more input energy (tho the VDD rail must support the output demands) A transformer of course does not provide isolation.
444,200
I know that in a transformer the power is conserved on both sides, and hence there's no power amplification as such. That's fine! But if I instead want only a voltage amplification, then choosing proper turns ratio and connecting the load across the secondary would serve my purpose. So can you consider it as voltage a...
2019/06/18
[ "https://electronics.stackexchange.com/questions/444200", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/86971/" ]
It's just a subtlety of the terminology. If there's no (capability of) power amplification, then we don't call it an "amplifier" even though the output voltage might be higher than the input voltage. As others have pointed out, there are other functional differences between transformers and amplifiers, one being that ...
Amplifiers typically provide input-output isolation. Changes in output energy need not require more input energy (tho the VDD rail must support the output demands) A transformer of course does not provide isolation.
444,200
I know that in a transformer the power is conserved on both sides, and hence there's no power amplification as such. That's fine! But if I instead want only a voltage amplification, then choosing proper turns ratio and connecting the load across the secondary would serve my purpose. So can you consider it as voltage a...
2019/06/18
[ "https://electronics.stackexchange.com/questions/444200", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/86971/" ]
It's just a subtlety of the terminology. If there's no (capability of) power amplification, then we don't call it an "amplifier" even though the output voltage might be higher than the input voltage. As others have pointed out, there are other functional differences between transformers and amplifiers, one being that ...
Only for ideal transformers, power is conserved. Real transformers have losses, which may be load dependent. So, in that case, the 'output' voltage is not the gain times the 'input' voltage. For voltage amplifiers, you also want them to have unlimited (or at least large) current supply. This unlimited current is n...
26,494,858
So, because this is for a school project, I can't post actual source code for what is going on. Instead, I will try to explain what's going on and use some code snippets. For the project, a JPanel, contained by a JFrame, holds most of the Components of the overall GUI. I'll have like ``` JButton b1 = new Button("Opti...
2014/10/21
[ "https://Stackoverflow.com/questions/26494858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3512478/" ]
The 3rd argument to [`open`](http://msdn.microsoft.com/en-us/library/ms763809(v=vs.85).aspx) should be a boolean, specifying whether or not the request should be asynchronous. ``` oServerXMLHTTPRequest.open bstrMethod, bstrUrl, bAsync, bstrUser, bstrPassword ``` > > **bstrMethod**The HTTP method used to open the c...
If you're using Windows 8, Windows 8.1 or Windows Server 2012/2012R2, you might have to apply the following HotFix, which fixed this problem for me in a similar scenario: <https://support.microsoft.com/en-us/help/2968741/error-0x80070057-when-sql-server-communicates-to-a-web-server-using-st> For further info you can ...
12,426,191
When iterating through a collection of all controls on a page (from `Page.Controls` and those control's children and their children's children etc), how can you tell if the control came from the Page's Master Page? The following seems to work, but feels a bit dirty. Is there a better way to get this information? Upda...
2012/09/14
[ "https://Stackoverflow.com/questions/12426191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299110/" ]
Given a reference to a `Control`, you could recursively look at the `Parent` property: ``` bool IsFromMasterPage(Control control) { while(control.Parent != null) { if (control.Parent is MasterPage) return true; control = control.Parent; } return false; } ```
The `Page.Controls` **only contain controls from the current page** If you want to check the MasterPage controls, use: ``` this.Master.Controls ``` On the other hand if you want to find the MasterPage controls on your page: ``` IEnumerable<MasterPage> masterPageControls = this.Page.Controls.OfType<MasterPage>(); ...
12,426,191
When iterating through a collection of all controls on a page (from `Page.Controls` and those control's children and their children's children etc), how can you tell if the control came from the Page's Master Page? The following seems to work, but feels a bit dirty. Is there a better way to get this information? Upda...
2012/09/14
[ "https://Stackoverflow.com/questions/12426191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299110/" ]
Solution turned out to be going through the controls from the master page, excluding the children of content place holders (as these give you the controls added from the page itself). ``` public static bool IsFromMasterPage(Control control) { if (control.Page.Master != null) { // Get all controls on th...
The `Page.Controls` **only contain controls from the current page** If you want to check the MasterPage controls, use: ``` this.Master.Controls ``` On the other hand if you want to find the MasterPage controls on your page: ``` IEnumerable<MasterPage> masterPageControls = this.Page.Controls.OfType<MasterPage>(); ...
1,360,248
I'm trying to get Windows 10 to emulate the new "Digital Wellbeing" feature that Google released alongside Android 9. Basically it changes the screen to grey-scale at night-time to try and incentivize people to get off their phone and go to sleep. When I learned of Windows 10's "color filter" feature (which also allow...
2018/09/21
[ "https://superuser.com/questions/1360248", "https://superuser.com", "https://superuser.com/users/927750/" ]
So I was trying the same thing and ended up using: <https://zerowidthjoiner.net/negativescreen> in Grayscale mode, which is easy to trigger programmatically. --- Before I tried that, I ran into something interresting. I tried to set the registry entries to enable color filtering: ``` [HKEY_CURRENT_USER\Software\Mic...
I had exactly the same need. I used [AutoHotKey](https://www.autohotkey.com/) for this. This script checks every 10 min. If the time between 10:30 - 10:39 pm, it presses `Win`+`Ctrl`+`C`. ``` #Persistent SetTimer, ToggleGreyscaleFilter, 600000 ; Check every 10 min ToggleGreyscaleFilter: TheTime = %A_Hour%%A_Min% I...
1,360,248
I'm trying to get Windows 10 to emulate the new "Digital Wellbeing" feature that Google released alongside Android 9. Basically it changes the screen to grey-scale at night-time to try and incentivize people to get off their phone and go to sleep. When I learned of Windows 10's "color filter" feature (which also allow...
2018/09/21
[ "https://superuser.com/questions/1360248", "https://superuser.com", "https://superuser.com/users/927750/" ]
So I was trying the same thing and ended up using: <https://zerowidthjoiner.net/negativescreen> in Grayscale mode, which is easy to trigger programmatically. --- Before I tried that, I ran into something interresting. I tried to set the registry entries to enable color filtering: ``` [HKEY_CURRENT_USER\Software\Mic...
For those who looking for simple solution on Windows: You may use [WinMagnification](https://pypi.org/project/WinMagnification/) Python 3.8+ lib. It supports a grayscale color effect, and also you can animate transition with it (by changing effect power over time). ``` import win_magnification as mag mag_api = mag.Wi...