qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
34,623,336
I'm using a bootstrap theme, and i kind of edited it to my needs. Internal links (on the same page) are working, but external links are not clickable with the left mouse button. When i right click and open a link in a different tab it does work. I have no clue on what i did wrong, as i have not massively destroyed the ...
2016/01/05
[ "https://Stackoverflow.com/questions/34623336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
As you are using `singlePageNav()` function you just need to add `external` class to external link. **Updated HTML** ``` <li><a href="#body" class="current">Home</a></li> <li><a href="#info" class="">information</a></li> <li><a href="#server" class="">Server</a></li> <li><a href="#packages" class="">packages</a></li>...
you have a click handler somewhere that has code that is preventing the click from working. I am guessing that this is the evil line , I really don't know fr sure I didn't go through all your js files: ``` jQuery('#nav').singlePageNav({ ``` I don't know what `singlePageNav()` does , but I'd be willing to bet that is...
36,726,166
i know that i can search in mongoose like ``` schema.find( { '_id' : { $in: [1,2,3]} }, function(err,data){}); ``` my problem is that e.g. objects with \_id 1 and 3 exist but no object with \_id 2. So the find method will fail. Is there a way to find all possible objects ignoring the inavlid id\_s?
2016/04/19
[ "https://Stackoverflow.com/questions/36726166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2866309/" ]
According to the [MongoDB documentation](https://docs.mongodb.org/manual/reference/operator/query/in/), your query should not fail where no documents exist with an id of 2. The documentation states: > > The $in operator selects the documents where the value of a field > equals any value in the specified array. > >...
Mongo first checks the length of \_id and it must be 24 characters, if one of the array members be less than 24 chars it will shows length error to you, for example: 234324533423423423423424 \_id is not exists in db ``` db.users.find({ '_id' :{ $in:[ObjectId("56d461517a2f02941bfb967a"),ObjectId("56d461517a2f02941b...
159,570
Let * $G\_\mathbb{Q} = \text{GL}\_2(\mathbb{Q})$ * $\mathbb{A} = $ the adeles over $\mathbb{Q}$ * $G\_\mathbb{A} = \text{GL}\_2(\mathbb{A})$ * $Z\_\mathbb{R} = \{(1,1,...,| \epsilon \cdot \text{id}) : \epsilon \in \mathbb{R}^\times\}$ There are essentially two ways to define a measure on $$ G\_\mathbb{Q} Z\_\mathb...
2014/03/06
[ "https://mathoverflow.net/questions/159570", "https://mathoverflow.net", "https://mathoverflow.net/users/39310/" ]
Yes, the two are the same, but I'd be inclined to separate the issues into first converting automorphic forms (with automorphy factors) on the domain $\mathfrak H$ into automorphic forms on the group $G=SL\_2(\mathbb R)$ or $GL\_2(\mathbb R)$, and look at the measures as a separate issue. That is, for $f(\gamma\cdot z...
You simply have to use uniqueness. Let $G$ be a locally compact group with closed subgroup $H$ such that the modular functions of $H$ and $G$ coincide on $G$, then there is up to normalization by a positive real only one $G$ right invariant measure on $H \backslash G$. Now you have defined an $G$-equivariant isomorph...
159,570
Let * $G\_\mathbb{Q} = \text{GL}\_2(\mathbb{Q})$ * $\mathbb{A} = $ the adeles over $\mathbb{Q}$ * $G\_\mathbb{A} = \text{GL}\_2(\mathbb{A})$ * $Z\_\mathbb{R} = \{(1,1,...,| \epsilon \cdot \text{id}) : \epsilon \in \mathbb{R}^\times\}$ There are essentially two ways to define a measure on $$ G\_\mathbb{Q} Z\_\mathb...
2014/03/06
[ "https://mathoverflow.net/questions/159570", "https://mathoverflow.net", "https://mathoverflow.net/users/39310/" ]
Yes, the two are the same, but I'd be inclined to separate the issues into first converting automorphic forms (with automorphy factors) on the domain $\mathfrak H$ into automorphic forms on the group $G=SL\_2(\mathbb R)$ or $GL\_2(\mathbb R)$, and look at the measures as a separate issue. That is, for $f(\gamma\cdot z...
Ok, thanks to the discussion with Paul Garrett and Marc Palm I got the idea: One starts with the Haar measure on $G\_\mathbb{A}$. The one forms the quotient measure on $G\_\mathbb{Q} Z\_\mathbb{R} \backslash G\_\mathbb{A}$. First of all, we form another quotient measure from this, namely on $G\_\mathbb{Q} Z\_\mathbb{R...
54,146,698
I'm trying to write a GUI and switch on and off a LED on a Raspberry Pi 3B+. I added an idle function to `gtk` main loop and ran only once, the counter (`szamlalo`) did not increase. When i write: ``` printf("\r"); //? ``` behind `szamlalo++` all works well. Have someone any idea? my full code: ``` #include <gtk...
2019/01/11
[ "https://Stackoverflow.com/questions/54146698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You have already a mapping in ES and the document you want to index doesnot match with it.
> > why does it build request to /customer/customer ??? What am I configurating wrong? > > > It builds it to `customer` (index) and `customer` (type) because 1. the index request does not specify an index into which the document should be indexed, so the request uses the [configured default index from `Connection...
29,204,650
I am using the `Dao` pattern in my application, and I tried to use the generic Dao like this: ``` interface IDao<I,T>{ // CRUD operation } abstract class AbstractDaoImpl<I, T> implements IDao<I, T> { // reusable method } interface UserDao extends IDao<Integer,User>{ // special method for UserDao } class...
2015/03/23
[ "https://Stackoverflow.com/questions/29204650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/306719/" ]
No, this will not cause problems, because the interface does not contain any implementation (at least until you use Java 8 default methods). It is not only acceptable, but common practice in Java to factor out general interfaces and only specialize where necessary.
There are 3 ways in Java to implement the interface: 1. Run time polymorphism {function overiding} 2. Using Anonymous class 3. Lambda expression [Applicable only for lambda expression] **1. Run time polymorphism** [![enter image description here](https://i.stack.imgur.com/WgqPU.png)](https://i.stack.imgur.com/WgqPU.p...
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
From the errors, it would appear any Classes appear multiple time.Find and removed that Classes it will working. Am creating AppDelegate.h and .m file creating multiple time. So this error will occur.Finally find and removed that classes it's working fine for me.
I got this issue because I was lazily defining a variable in my .m outside of a method, then in another .m file I was defining another variable with the same name outside a method. This was causing a global variable name duplicate issue.
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
On upgrading to Xcode 8, I got a message to upgrade to recommended settings. I accepted and everything was updated. I started getting compile time issue : Duplicate symbol for XXXX Duplicate symbol for XXXX Duplicate symbol for XXXX A total of 143 errors. Went to Target->Build settings -> No Common Blocks -> Set it ...
I was doing my tutorial, then I divided answers into different files, didn't mean to relate them to make a big program. I didn't solve the problem until I **commented out the remaining lines of the "main.cpp" file** to **make sure the program can run separately** without the influence of it. I'm not really sure about...
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Below Patch work for me..:) ``` Step 1: Go to TARGETS -> Build Settings -> No Common Blocks -> No Step 2: Go to TARGETS -> Build Settings -> enable testability -> No ``` **Setting it back to NO solved the problem!**
On upgrading to Xcode 8, I got a message to upgrade to recommended settings. I accepted and everything was updated. I started getting compile time issue : Duplicate symbol for XXXX Duplicate symbol for XXXX Duplicate symbol for XXXX A total of 143 errors. Went to Target->Build settings -> No Common Blocks -> Set it ...
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
See [Duplicate symbol error when adding NSManagedObject subclass, duplicate link](https://stackoverflow.com/questions/40460307/duplicate-symbol-error-when-adding-nsmanagedobject-subclass-duplicate-link)
I was doing my tutorial, then I divided answers into different files, didn't mean to relate them to make a big program. I didn't solve the problem until I **commented out the remaining lines of the "main.cpp" file** to **make sure the program can run separately** without the influence of it. I'm not really sure about...
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Plz Change setting. Step 1: Go to TARGETS -> Build Settings -> No Common Blocks -> No Step 2: Go to TARGETS -> Build Settings -> enable testability -> No
I got this issue when I had two files that had the same name on accident (large project, oops!) Ironically they were actually the same file, I just had forgotten that I had already created one as a placeholder weeks earlier and gave it the same name again, haha!
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Plz Change setting. Step 1: Go to TARGETS -> Build Settings -> No Common Blocks -> No Step 2: Go to TARGETS -> Build Settings -> enable testability -> No
Sometime It works with cache cleaning in Xcode using command+shift+k Mine issue was that I have multiple files with same name, So I removed duplicate files, In console You can see file name Hope can help somebody.
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you are moving to Xcode 7 or 8 and are opening a really old project, I've encountered this problem: in `SomeConstFile.h` ``` NSString * const kAConstant; ``` in `SomeConstFile.m` ``` NSString *const kAConstant = @"a constant"; ``` Earlier versions of the compiler assumed that the definition in the header file...
For me, I created a method called `sampleMethod` in ViewController\_A and created the same method in ViewController\_B too, It caused me this error, then i changed the method name in ViewController\_B to `secondSampleMethod`. It fixed the error. Seems like a Good feature to reduce the code and not to duplicate the sam...
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For me it was that i imported a file as a .m not a .h by mistake
This error happens when Linker is trying to link the obj files. Few reasons that i could think of for this error are: 1. The duplicated Function/Class is defined at two different places/files in the project and only one of them was supposed to compile for any variation of build command. But somehow both those files go...
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I've messed up my pods while downgrading a pod and I've managed to resolve the issue with *duplicate symbols for architecture arm64* by removing the pods and installing them again with: ``` pod deintegrate pod install ```
I got this issue because I was lazily defining a variable in my .m outside of a method, then in another .m file I was defining another variable with the same name outside a method. This was causing a global variable name duplicate issue.
26,303,782
When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: ![enter image description here](https://i.stack.imgur.com/jliti.png) Any ideas how to fix this?
2014/10/10
[ "https://Stackoverflow.com/questions/26303782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This error happens when Linker is trying to link the obj files. Few reasons that i could think of for this error are: 1. The duplicated Function/Class is defined at two different places/files in the project and only one of them was supposed to compile for any variation of build command. But somehow both those files go...
check your include file, I had this issue because I accidentally #imported "filename.m" instead of "filename.h", autocorrect (tab) put an "m" not "h".
10,806,979
I have a database on Heroku I'm trying to copy to my local machine. I created a backup of the database by doing: `heroku pgbackups:capture` This create a dump file of the database which I downloaded by creating a URL link to it: `heroku pgbackups:url b004` But now I have a dump file and don't really know what do ...
2012/05/29
[ "https://Stackoverflow.com/questions/10806979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1328021/" ]
I hate to be "that guy", who suggests that you take a completely different approach than what you asked about, but have you looked at Groovy? It's JVM language, can be mixed freely with Java, and in addition to a bunch of other really nice language features, it has heredocs.
Try Rythm template engine, which is built as a high performance Java template engine with Razor like clean syntax. Links: * Check the [full featured demonstration](http://play-rythm-demo.appspot.com/) * read [a brief introduction to Rythm](http://software-lgl.blogspot.com.au/2012/03/rythm-easy-to-use-high-performance...
10,221,998
I want to know that where the plugins settings data saved in server? Means, when we change any plugin settings (e.g. For simple captcha, it is settings as-> use number, user alpha, captcha color etc), then in which file or database , these settings are saved.
2012/04/19
[ "https://Stackoverflow.com/questions/10221998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343051/" ]
All settings of the Plugin will be saved in the db. Your Plugin can choose which table they wanted to store the setting into. Check the source code of your Plugin. * If your Plugins uses `get_options()`, then it will stored in the `wp_options` table * If your Plugins uses `get_post_meta()`, then it will be stored in ...
Inside WordPress database you will look a table like 'wp\_options'. During wp install ,If you use your table prefix 'xyz'. Inside database your table name will 'xyz\_options'. If you use WP Setting API and options.php, your plugin data will save in this table. ``` <?php $data= $GLOBALS['wpdb']->get_results( 'SELECT *...
27,463,002
Hello i'm trying to make an image fill the screen. The image is 20x20 pixels. i don't really know how to explain it. I think the code might explain it better thank you for your help. and the screen is 800x600 pixels. I have looked for a few days and found nothing.i want it to fill the whole screen with this image i jus...
2014/12/13
[ "https://Stackoverflow.com/questions/27463002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3723323/" ]
> > i'm trying to make an image fill the screen. The image is 20x20 pixels > > > Then you need to tile the image. Check out [Background Panel](http://tips4java.wordpress.com/2008/10/12/background-panel/) which allows you to add an image to a panel and support tiling. The basic code would be: ``` BackgroundPanel ...
You need to create a custom class that extends JPanel, then overwrite the paintComponent method. This works for me: ``` import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import javax.swing.JPanel; public class BackgroundPanel extends JPanel { private Image backgroundImage; public Bac...
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
@rajkumar is right, but you have to take care with Xiaomi running pure Android, MI A1, MI A2 and MI A3 is coming, so you should add something like: ``` if (Build.MANUFACTURER.toLowerCase().contains("xiaomi") && !Build.MODEL.toLowerCase().contains("mi a")){ //intent } ```
you can do it by following: ``` if (manufactXiaomi.equalsIgnoreCase(android.os.Build.MANUFACTURER)) { if (!session.getVisibilityOfAutoStartDialog()) {Intent intent = new Intent(); intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManageme...
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
Try this...it's working for me. It will open the screen to enable autostart. But if you try to disable from there it will close the app. I am figuring out a solution for that. Till then you can use this as solution. ``` String manufacturer = "xiaomi"; if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTU...
you can do it by following: ``` if (manufactXiaomi.equalsIgnoreCase(android.os.Build.MANUFACTURER)) { if (!session.getVisibilityOfAutoStartDialog()) {Intent intent = new Intent(); intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManageme...
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
You cannot enable auto start directly, but you can redirect user to auto start setting screen and ask user to turn it on for your app. Use the below solution for xiaomi, oppo, vivo, letv, honor, asus, nokia, huawei phones. Autostart screen will be launched if it exists. ``` try { val intent = Intent() ...
I stumbled upon this library. [Autostarter](https://github.com/judemanutd/AutoStarter). It is a autostarter library for different device manufacturers Last time i used it, it had support for Xiaomi and Letv devices. I cant really give you code examples, but i hope it helps someone who stumbles upon this
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
You cannot enable auto start directly, but you can redirect user to auto start setting screen and ask user to turn it on for your app. Use the below solution for xiaomi, oppo, vivo, letv, honor, asus, nokia, huawei phones. Autostart screen will be launched if it exists. ``` try { val intent = Intent() ...
``` import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Build; import android.support.v7.widget....
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
Try this...it's working for me. It will open the screen to enable autostart. But if you try to disable from there it will close the app. I am figuring out a solution for that. Till then you can use this as solution. ``` String manufacturer = "xiaomi"; if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTU...
@rajkumar is right, but you have to take care with Xiaomi running pure Android, MI A1, MI A2 and MI A3 is coming, so you should add something like: ``` if (Build.MANUFACTURER.toLowerCase().contains("xiaomi") && !Build.MODEL.toLowerCase().contains("mi a")){ //intent } ```
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
You may try this: ``` if ("xiaomi".equalsIgnoreCase(str)) { intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")); } else if ("oppo".equalsIgnoreCase(str)) { intent.setComponent(new ComponentName("com.coloros.safecenter",...
you can do it by following: ``` if (manufactXiaomi.equalsIgnoreCase(android.os.Build.MANUFACTURER)) { if (!session.getVisibilityOfAutoStartDialog()) {Intent intent = new Intent(); intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManageme...
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
``` import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Build; import android.support.v7.widget....
you can do it by following: ``` if (manufactXiaomi.equalsIgnoreCase(android.os.Build.MANUFACTURER)) { if (!session.getVisibilityOfAutoStartDialog()) {Intent intent = new Intent(); intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManageme...
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
Try this...it's working for me. It will open the screen to enable autostart. But if you try to disable from there it will close the app. I am figuring out a solution for that. Till then you can use this as solution. ``` String manufacturer = "xiaomi"; if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTU...
You may try this: ``` if ("xiaomi".equalsIgnoreCase(str)) { intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")); } else if ("oppo".equalsIgnoreCase(str)) { intent.setComponent(new ComponentName("com.coloros.safecenter",...
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
Try this...it's working for me. It will open the screen to enable autostart. But if you try to disable from there it will close the app. I am figuring out a solution for that. Till then you can use this as solution. ``` String manufacturer = "xiaomi"; if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTU...
I stumbled upon this library. [Autostarter](https://github.com/judemanutd/AutoStarter). It is a autostarter library for different device manufacturers Last time i used it, it had support for Xiaomi and Letv devices. I cant really give you code examples, but i hope it helps someone who stumbles upon this
34,149,198
I have a service in my app which needs to be running in the background all the time. On all devices, it's working fine except Xiaomi. I have read somewhere that we need to enable auto-start in settings for an app to keep a service running. So please tell me how to enable auto-start programmatically, because the user w...
2015/12/08
[ "https://Stackoverflow.com/questions/34149198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5311481/" ]
Try this...it's working for me. It will open the screen to enable autostart. But if you try to disable from there it will close the app. I am figuring out a solution for that. Till then you can use this as solution. ``` String manufacturer = "xiaomi"; if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTU...
``` import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Build; import android.support.v7.widget....
4,647,565
The Canada EGMO TST was held around a month ago across the nation, and I wish to give a talk at local math club about the problems. I was able to solve $4$ problems, but there is one problem that I simply have no idea how to approach. However I would very much like to go through all of them during the talk. The probl...
2023/02/27
[ "https://math.stackexchange.com/questions/4647565", "https://math.stackexchange.com", "https://math.stackexchange.com/users/640345/" ]
Yet another drawing of the graph (thanks to @JaapScherphuis): [![enter image description here](https://i.stack.imgur.com/gRRdv.png)](https://i.stack.imgur.com/gRRdv.png)
This is not the answer to the question, but since there is no way to insert a picture in the comments, I put it here. This is how this graph looks more clear. Of course there is nothing remarkable in it, but this drawing makes it look like a stylized eye. [![enter image description here](https://i.stack.imgur.com/ukH...
4,647,565
The Canada EGMO TST was held around a month ago across the nation, and I wish to give a talk at local math club about the problems. I was able to solve $4$ problems, but there is one problem that I simply have no idea how to approach. However I would very much like to go through all of them during the talk. The probl...
2023/02/27
[ "https://math.stackexchange.com/questions/4647565", "https://math.stackexchange.com", "https://math.stackexchange.com/users/640345/" ]
This is not the answer to the question, but since there is no way to insert a picture in the comments, I put it here. This is how this graph looks more clear. Of course there is nothing remarkable in it, but this drawing makes it look like a stylized eye. [![enter image description here](https://i.stack.imgur.com/ukH...
If you look carefully you will see a structural resemblance between the extended octahedral graph (top/left) and the 4-dimensional hypercube (bottom/middle): you may see a 3x3 grid with some center vertices doubled (18/54, 130/154) or quadrupled (2/26/38/62): [![enter image description here](https://i.stack.imgur.com/...
4,647,565
The Canada EGMO TST was held around a month ago across the nation, and I wish to give a talk at local math club about the problems. I was able to solve $4$ problems, but there is one problem that I simply have no idea how to approach. However I would very much like to go through all of them during the talk. The probl...
2023/02/27
[ "https://math.stackexchange.com/questions/4647565", "https://math.stackexchange.com", "https://math.stackexchange.com/users/640345/" ]
Yet another drawing of the graph (thanks to @JaapScherphuis): [![enter image description here](https://i.stack.imgur.com/gRRdv.png)](https://i.stack.imgur.com/gRRdv.png)
If you look carefully you will see a structural resemblance between the extended octahedral graph (top/left) and the 4-dimensional hypercube (bottom/middle): you may see a 3x3 grid with some center vertices doubled (18/54, 130/154) or quadrupled (2/26/38/62): [![enter image description here](https://i.stack.imgur.com/...
65,294,069
I have a link in Angular that displays a number of user selectable avatars. I have around 100 of these avatars and don't want to hard code the link into my code. I just want to be able to tell angular how many there are and to display this link this many times. Each link has a click event attached to it that selects t...
2020/12/14
[ "https://Stackoverflow.com/questions/65294069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1520700/" ]
I have solved this problem by creating a directive `src/app/directives/ng-times.directives.ts`: ```js import {Directive, Input, OnInit, TemplateRef, ViewContainerRef} from '@angular/core'; /** * A simple directive which iterates a HTML template for given "X" times. * * @author Shashank Agrawal */ @Directive({ ...
I'd do it this way: ``` <div> <a *ngFor="let num of numbers" class="dropdown-item" > <img [src]="'assets/avatars/' + num + '.png'" [alt]="'assets/avatars/' + num + '.png'" alt="" class="partnerAvatar"> </a> </div> ``` Typescript code ``` @Component({ selector: "my-app", templateUrl: "./app.component.htm...
36,807,017
I'm looking at this small program that creates a shell. `parse()` takes a character pointer `line` and an array of character pointers `argv`, saving the address of each word in `argv`. ``` void parse(char *line, char **argv) { while (*line != '\0') { /* if not the end of line ....... */ while (*line == ...
2016/04/23
[ "https://Stackoverflow.com/questions/36807017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4123745/" ]
It is not a bad idea. The actual way to attach depends on what the external profiler supports. * If profiler can launch the Java process under profiling (e.g. like Solaris Studio Performance Analyzer's `collect`), then executing `my-awesome-profiler java -jar benchmarks.jar` would get you half-way there. Note, howeve...
You can run with YourKit profiling agent by adding "-agentpath" JVM option. Please find details here <https://www.yourkit.com/docs/java/help/agent.jsp>
36,807,017
I'm looking at this small program that creates a shell. `parse()` takes a character pointer `line` and an array of character pointers `argv`, saving the address of each word in `argv`. ``` void parse(char *line, char **argv) { while (*line != '\0') { /* if not the end of line ....... */ while (*line == ...
2016/04/23
[ "https://Stackoverflow.com/questions/36807017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4123745/" ]
Yes it is possible, it is simple to do, and I recommend it as a best practice to do it all the time! It is always good to have data available to explain what is going on without the need to spend extra time to reproduce the issue. I wrote my own JMH profiler to use JFR (Java Flight Recorder): [JmhFlightRecorderProfile...
You can run with YourKit profiling agent by adding "-agentpath" JVM option. Please find details here <https://www.yourkit.com/docs/java/help/agent.jsp>
29,610,780
I'm wondering if this is defined: ``` vector<int> v; v.push_back(1337); int * p1 = &*vi.end(); ``` (**Update 1** If this is undefined, I'd like to know more about exactly where my error is. For example, perhaps the reference `int &r = &*(v.data()+v.size())` *is* legal in general, but `*end()` isn't required to retur...
2015/04/13
[ "https://Stackoverflow.com/questions/29610780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146041/" ]
No, any `*` on `v.end()` is illegal. You can do `v.data()+v.size()` instead for a pointer to the end, and `v.data()` for a pointer to the beginning. This is defined even for an empty `std::vector`.
v.end() points one beyond the last element. Therefore, dereferencing it is illegal. You could use \*(v.end()-1) to get the last element as long as v.size()>=1. (Or use &\*(v.end()-1) to get a pointer to it.)
7,528,631
Sorry let me revise. I have a three tables: events\_year • EventID • YearID • id Date • YearID • Year Event • EventID • EventName • EventType i want to dispay a record from the three tables like so: EventName - Year: Marathon - 2008 i linked it to a table called "members" which conta...
2011/09/23
[ "https://Stackoverflow.com/questions/7528631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/954325/" ]
the notices are almost self-explaining. There are no `'Year'` and `'EventName'` fields in the resultset. It's difficult (or: impossible) to tell why this happens as you haven't given your table-structure, but i guess this: `'Year'` is a field of the `date`-table, `'EventName'` is a field of the `event`-table - you're o...
Does the field 'Year' exist in the query output ? I suspect not.
7,528,631
Sorry let me revise. I have a three tables: events\_year • EventID • YearID • id Date • YearID • Year Event • EventID • EventName • EventType i want to dispay a record from the three tables like so: EventName - Year: Marathon - 2008 i linked it to a table called "members" which conta...
2011/09/23
[ "https://Stackoverflow.com/questions/7528631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/954325/" ]
the notices are almost self-explaining. There are no `'Year'` and `'EventName'` fields in the resultset. It's difficult (or: impossible) to tell why this happens as you haven't given your table-structure, but i guess this: `'Year'` is a field of the `date`-table, `'EventName'` is a field of the `event`-table - you're o...
the string $query is only using the first line of text: ``` "SELECT * FROM members JOIN events_year ON members.id = events_year.id "; ``` and not the others. The query itself is not returning any fields that are called Year or EventName. Do a var\_dump($row) to find out what is being returned.
63,505
What are the advantages and disadvantages of running separate models vs. multilevel modeling? More particularly, suppose a study examined patients nested within doctors' practices nested within countries. What are the advantages/disadvantages of running separate models for each country vs. a three level nested model?
2013/07/06
[ "https://stats.stackexchange.com/questions/63505", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/686/" ]
The question is dated but I think it's very important. The best answer I can get is from Joop J Hox (2010) book "Multilevel Analysis Techniques and Applications, Second Edition". Suppose two-level hierarchical data with $p$ explanatory variables at the lowest level and $q$ explanatory variables at the highest level. ...
Advantage: The ability to explicitly test for differences in parameters by cluster (i.e. differences in significance do not mean significant differences).
63,505
What are the advantages and disadvantages of running separate models vs. multilevel modeling? More particularly, suppose a study examined patients nested within doctors' practices nested within countries. What are the advantages/disadvantages of running separate models for each country vs. a three level nested model?
2013/07/06
[ "https://stats.stackexchange.com/questions/63505", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/686/" ]
The question is dated but I think it's very important. The best answer I can get is from Joop J Hox (2010) book "Multilevel Analysis Techniques and Applications, Second Edition". Suppose two-level hierarchical data with $p$ explanatory variables at the lowest level and $q$ explanatory variables at the highest level. ...
Specifying a random effect involves assuming that the means of those levels are samples from a normal distribution. Better to specify them as fixed effects, AKA dummy variables if this assumption doesn't fit your data. In this way you are controlling for groupwise heterogeneity in the mean (at that level), but you are ...
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
There are two ways you can achieve this. 1) Either you extend / implement the Abstract class / interface in a new class, create the object of this new class and then use this object as per your need. 2) The Compiler allows you to create anonymous objects of the interfaces in your code. For eg. ( new Runnable() { ......
No, you are not creating the instance of your abstract class here. Rather you are creating an instance of an anonymous subclass of your abstract class. And then you are invoking the method on your abstract class reference pointing to subclass object.
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
There are two ways you can achieve this. 1) Either you extend / implement the Abstract class / interface in a new class, create the object of this new class and then use this object as per your need. 2) The Compiler allows you to create anonymous objects of the interfaces in your code. For eg. ( new Runnable() { ......
"instantiate" means "create an object of". So you can't create one directly. The purpose of interfaces and abstract classes is to describe the behaviour of some concrete class that implements the interface or extends the abstract class. A class that implements an interface can be used by other code that only knows a...
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
What you know is correct. You cannot create an object of abstract class or interface since they are incomplete class (interface is not even considered as a class.) What you can do is to implement a subclass of abstract class which, of course, must not be abstract. For interface, you must create a class which implement...
No, you are not creating the instance of your abstract class here. Rather you are creating an instance of an anonymous subclass of your abstract class. And then you are invoking the method on your abstract class reference pointing to subclass object.
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
You can provide an implementation as an anonymous class: ``` new SomeInterface() { public void foo(){ // an implementation of an interface method } }; ``` Likewise, an anonymous class can extend a parent class instead of implementing an interface (but it can't do both).
No, you are not creating the instance of your abstract class here. Rather you are creating an instance of an anonymous subclass of your abstract class. And then you are invoking the method on your abstract class reference pointing to subclass object.
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
You can not instantiate an abstract class or an interface - you can instantiate one of their subclasses/implementers. Examples of such a thing are typical in the use of Java Collections. ``` List<String> stringList = new ArrayList<String>(); ``` You are using the interface type `List<T>` as the type, but the instan...
To create object of an abstract class just use **new** just like creating objects of other non abstract classes with just one small difference, as follows: ``` package com.my.test; public abstract class MyAbstractClass { private String name; public MyAbstractClass(String name) { this.name = name;...
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
There are two ways you can achieve this. 1) Either you extend / implement the Abstract class / interface in a new class, create the object of this new class and then use this object as per your need. 2) The Compiler allows you to create anonymous objects of the interfaces in your code. For eg. ( new Runnable() { ......
NO, we can't create object out of an interface or Abstract class because Main intention of creating an object is to utilize the wrapped methods and data. As interface don't have any concrete implementation hence we cannot. For abstract class we may have concrete method or abstract method or both. There is no way for ...
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
You can not instantiate the abstract class or an interface, but you can instantiate one of their subclasses/implementers. You can't instantiate an abstract class or an interface, you can only instantiate one of their derived classes. In your example ``` MyAbstractClass ABC = new MyAbstractClass("name") { }; ``...
No, you are not creating the instance of your abstract class here. Rather you are creating an instance of an anonymous subclass of your abstract class. And then you are invoking the method on your abstract class reference pointing to subclass object.
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
What you know is correct. You cannot create an object of abstract class or interface since they are incomplete class (interface is not even considered as a class.) What you can do is to implement a subclass of abstract class which, of course, must not be abstract. For interface, you must create a class which implement...
``` public abstract class AbstractClass { ... } public interface InterfaceClass { ... } // This is the concrete class that extends the abstract class above and // implements the interface above. You will have to make sure that you implement // any abstract methods from the AbstractClass and implement all method defi...
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
To create object of an abstract class just use **new** just like creating objects of other non abstract classes with just one small difference, as follows: ``` package com.my.test; public abstract class MyAbstractClass { private String name; public MyAbstractClass(String name) { this.name = name;...
What you know is correct. You cannot create an object of abstract class or interface since they are incomplete class (interface is not even considered as a class.) What you can do is to implement a subclass of abstract class which, of course, must not be abstract. For interface, you must create a class which implement...
4,321,387
Say I am doing the following manipulation using jQuery: ``` $("#myid").html('<span id="inserted">inserted portion</span>') ``` After doing this operation, if I view the page source, the inserted portion of the HTML (the span tag with id "inserted") is not available there and any further operation I do with $("#inser...
2010/12/01
[ "https://Stackoverflow.com/questions/4321387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/475247/" ]
There are two ways you can achieve this. 1) Either you extend / implement the Abstract class / interface in a new class, create the object of this new class and then use this object as per your need. 2) The Compiler allows you to create anonymous objects of the interfaces in your code. For eg. ( new Runnable() { ......
You can provide an implementation as an anonymous class: ``` new SomeInterface() { public void foo(){ // an implementation of an interface method } }; ``` Likewise, an anonymous class can extend a parent class instead of implementing an interface (but it can't do both).
56,393,186
first, thanks in advance for your help. I have some problems trying to get data from an online JSON file. I using PHP (with cURL). I can access the file and I can put an echo and see all of the "raw" data in it. I want to find a way to show only the type of data I want (for example, only a movie). I use the foreach b...
2019/05/31
[ "https://Stackoverflow.com/questions/56393186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11582120/" ]
First of all, I can suggest you to use the `file_get_contents` builtin function for fetching the content from the API. ``` $sJSON = file_get_contents("link"); ``` Now come to the decode of JSON file, the `json_decode` is good. But I suggest you not to use the `true` as 2nd Argument, as it converts the Object into As...
Can change to `$aJSON['apiver']` in you `foreach()` loop or change this line `$aJSON = json_decode($sJSON, true);` to `$aJSON = json_decode($sJSON);`
55,239,429
I found this strange problem when I trying to add comments to my code. I used the triple-quoted strings to comment but the program crashed by giving the following error: `IndentationError: unexpected indent` When I use `#` to comment the triple-quoted strings, everything works normally. Does anyone know the reason b...
2019/03/19
[ "https://Stackoverflow.com/questions/55239429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8956723/" ]
This code works for the above case ``` class UserManager(BaseUserManager): def create_user(self, mobile_no, role, password=None): """ Creates and saves a User with the given email and password. """ if not mobile_no: raise ValueError('Users must have an Mobile No') ...
You are probably having this issue because in your required fields, you only specified email and role without the first\_name, last\_name, and location. When declaring the user user manager, you did not supply default values for those fields, so you have to specify them in the required field. That should solve your pro...
6,182,884
for example i have this code : ``` Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try Dim Cmd As New Data.OracleClient.OracleCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FR...
2011/05/31
[ "https://Stackoverflow.com/questions/6182884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777033/" ]
``` CommandBehavior.CloseConnection ``` When you pass above values as argument to ExecuteReader 1. there is no need to close connection explicitly connection get close when you close your reader check full post : <http://pranayamr.blogspot.com/2010/11/executereader-with-commanbehavior.html>
Why shouldn't you explicitly close the reader like this. > > datareader.Close() > > > ``` Dim Conn As New Data.SqlClient.SqlConnection Conn.Open() Try Dim Cmd As New Data.SqlClient.SqlCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT *...
6,182,884
for example i have this code : ``` Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try Dim Cmd As New Data.OracleClient.OracleCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FR...
2011/05/31
[ "https://Stackoverflow.com/questions/6182884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777033/" ]
You should create the objects in a using block so they are properly disposed: ``` Using Conn As New Data.SqlClient.SqlConnection Conn.Open() Dim Cmd As New Data.SqlClient.SqlCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FROM MONTH...
``` CommandBehavior.CloseConnection ``` When you pass above values as argument to ExecuteReader 1. there is no need to close connection explicitly connection get close when you close your reader check full post : <http://pranayamr.blogspot.com/2010/11/executereader-with-commanbehavior.html>
6,182,884
for example i have this code : ``` Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try Dim Cmd As New Data.OracleClient.OracleCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FR...
2011/05/31
[ "https://Stackoverflow.com/questions/6182884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777033/" ]
You should create the objects in a using block so they are properly disposed: ``` Using Conn As New Data.SqlClient.SqlConnection Conn.Open() Dim Cmd As New Data.SqlClient.SqlCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FROM MONTH...
Why shouldn't you explicitly close the reader like this. > > datareader.Close() > > > ``` Dim Conn As New Data.SqlClient.SqlConnection Conn.Open() Try Dim Cmd As New Data.SqlClient.SqlCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT *...
6,182,884
for example i have this code : ``` Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try Dim Cmd As New Data.OracleClient.OracleCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FR...
2011/05/31
[ "https://Stackoverflow.com/questions/6182884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777033/" ]
Just make new object of data reader after it been closed ``` private void button2_Click(object sender, EventArgs e) { //SqlConnection cn1 = new SqlConnection(); cn.ConnectionString = "server = .\\SQLEXPRESS ; database=store ; integrated security = true "; SqlCommand cm = new SqlCommand("se...
Why shouldn't you explicitly close the reader like this. > > datareader.Close() > > > ``` Dim Conn As New Data.SqlClient.SqlConnection Conn.Open() Try Dim Cmd As New Data.SqlClient.SqlCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT *...
6,182,884
for example i have this code : ``` Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try Dim Cmd As New Data.OracleClient.OracleCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FR...
2011/05/31
[ "https://Stackoverflow.com/questions/6182884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777033/" ]
You should create the objects in a using block so they are properly disposed: ``` Using Conn As New Data.SqlClient.SqlConnection Conn.Open() Dim Cmd As New Data.SqlClient.SqlCommand With Cmd .Connection = Conn .CommandType = Data.CommandType.Text .CommandText = "SELECT * FROM MONTH...
Just make new object of data reader after it been closed ``` private void button2_Click(object sender, EventArgs e) { //SqlConnection cn1 = new SqlConnection(); cn.ConnectionString = "server = .\\SQLEXPRESS ; database=store ; integrated security = true "; SqlCommand cm = new SqlCommand("se...
1,033,268
I'm developing a REST api, and I'm wondering the following: I want to use HTTP PUT to update some entities in the webservice. The format will be a urlencoded body. Is it acceptable to only update the fields that were actually specified, rather than the entire entity? I'm asking, because PUT would be a very convenient...
2009/06/23
[ "https://Stackoverflow.com/questions/1033268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80911/" ]
Put is only for complete replacement. There is a proposal for the verb PATCH to address the problem you have (<http://www.ietf.org/internet-drafts/draft-dusseault-http-patch-14.txt>) Patch, however, still may not be what you want. What is sent is an update resource that can do things like increment counters and so, un...
I would say it may make sense. I consider the REST idea very flexible, so if you Update one entity why not only transfer the fields that need to be updated in your implementation. It is true, that it needs more server sided effort though. You have to check if the entity is available and can be updated with the data tra...
1,033,268
I'm developing a REST api, and I'm wondering the following: I want to use HTTP PUT to update some entities in the webservice. The format will be a urlencoded body. Is it acceptable to only update the fields that were actually specified, rather than the entire entity? I'm asking, because PUT would be a very convenient...
2009/06/23
[ "https://Stackoverflow.com/questions/1033268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80911/" ]
You could simply POST the updated properties to the resource. Remember POST is the catch-all verb that you can use to do whatever you need to do when the other verbs don't work for you. Check out Roy's article [It's ok to use POST](http://roy.gbiv.com/untangled/2009/it-is-okay-to-use-post)
I would say it may make sense. I consider the REST idea very flexible, so if you Update one entity why not only transfer the fields that need to be updated in your implementation. It is true, that it needs more server sided effort though. You have to check if the entity is available and can be updated with the data tra...
1,033,268
I'm developing a REST api, and I'm wondering the following: I want to use HTTP PUT to update some entities in the webservice. The format will be a urlencoded body. Is it acceptable to only update the fields that were actually specified, rather than the entire entity? I'm asking, because PUT would be a very convenient...
2009/06/23
[ "https://Stackoverflow.com/questions/1033268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80911/" ]
Put is only for complete replacement. There is a proposal for the verb PATCH to address the problem you have (<http://www.ietf.org/internet-drafts/draft-dusseault-http-patch-14.txt>) Patch, however, still may not be what you want. What is sent is an update resource that can do things like increment counters and so, un...
You could simply POST the updated properties to the resource. Remember POST is the catch-all verb that you can use to do whatever you need to do when the other verbs don't work for you. Check out Roy's article [It's ok to use POST](http://roy.gbiv.com/untangled/2009/it-is-okay-to-use-post)
1,033,268
I'm developing a REST api, and I'm wondering the following: I want to use HTTP PUT to update some entities in the webservice. The format will be a urlencoded body. Is it acceptable to only update the fields that were actually specified, rather than the entire entity? I'm asking, because PUT would be a very convenient...
2009/06/23
[ "https://Stackoverflow.com/questions/1033268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80911/" ]
Put is only for complete replacement. There is a proposal for the verb PATCH to address the problem you have (<http://www.ietf.org/internet-drafts/draft-dusseault-http-patch-14.txt>) Patch, however, still may not be what you want. What is sent is an update resource that can do things like increment counters and so, un...
I've never liked any of the solutions for partial updates, either. If I were designing a web service for widespread use, I'd probably go with `POST`. If it were for use by a fairly small number of people, i.e., I could talk to all the people I expected to call it, I've had two different ideas for addressing it. 1. `PU...
1,033,268
I'm developing a REST api, and I'm wondering the following: I want to use HTTP PUT to update some entities in the webservice. The format will be a urlencoded body. Is it acceptable to only update the fields that were actually specified, rather than the entire entity? I'm asking, because PUT would be a very convenient...
2009/06/23
[ "https://Stackoverflow.com/questions/1033268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80911/" ]
You could simply POST the updated properties to the resource. Remember POST is the catch-all verb that you can use to do whatever you need to do when the other verbs don't work for you. Check out Roy's article [It's ok to use POST](http://roy.gbiv.com/untangled/2009/it-is-okay-to-use-post)
I've never liked any of the solutions for partial updates, either. If I were designing a web service for widespread use, I'd probably go with `POST`. If it were for use by a fairly small number of people, i.e., I could talk to all the people I expected to call it, I've had two different ideas for addressing it. 1. `PU...
66,182,541
``` class Student: def __init__(self,m1,m2): self.m1=m1 self.m2=m2 def add(self,s1,s2): summ1 = self.m1 + self.m2 summ2 = s1.m1 + s1.m2 summ3 = s2.m1 + s2.m2 std1=Student(89,99) std2=Student(95,99) std3=Student(95,99) std1.add(std2,std3) print(summ1) print(summ2) print...
2021/02/13
[ "https://Stackoverflow.com/questions/66182541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15202000/" ]
It should be `==` or `===` ```js let isNegative = curr => curr == "-1"; let isPositive = curr => curr == "+1"; let out1 = ["+1", "-1", "+1"].every(isPositive) ? "T" : "F"; console.log(out1); //->"T" instead of "F" let out2 = [1, -1, 1].every(isPositive) ? "T" : "F"; console.log(out2); //->"T" instead of "F" ```
you are using `=` (assignment operator), Because of this you getting the `cur` as return value. You should return a boolean value in `every` callback method. ```js const isNegative = curr => curr < 0; const isPositive = curr => curr > 0; const out1 = ["+1", "-1", "+1"].every(isPositive) ? "T" : "F"; console.log(out1)...
701,786
I have used the Microsoft Task Scheduler to schedule my Malwarebytes updates and full scan since I can't get the Malwarebytes scheduler to work. The thing that is bothering me is that each time the scan starts, the GUI opens. How can I stop this? I want the scan to run without the GUI open.
2014/01/15
[ "https://superuser.com/questions/701786", "https://superuser.com", "https://superuser.com/users/269035/" ]
There are a couple different suggestions floating around on the internet, in some it mentions `/fullauto`, and in others it mentions `mbam.exe -silent`. Try these, or see below. A full list of the usable switches is in the help file, according to this website: <http://malwaretips.com/threads/mbam-command-line-paramet...
mbam.exe /parameter (where parameter is one of the following) /debug: allows you to collect information to send as a bug report. /developer: this command line parameter is explained in the false positives section. /minimized: allows you to start the program minimized. /quickscan: allows you to run a quick scan. /q...
11,964,860
Stack Overflow's diff view is very good. I want to do this using `javascript`, but I don't know how to start, who can give some suggestion? such as: ![StackOverflow's diff view](https://i.stack.imgur.com/c60n9.jpg)
2012/08/15
[ "https://Stackoverflow.com/questions/11964860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572504/" ]
you can try [google-diff-match-patch](https://code.google.com/p/google-diff-match-patch/) project ,this project offer robust algorithms to perform the operations required for synchronizing plain text. Demo:<http://jsfiddle.net/N6bAn/> Code: ``` <div class="test"> <div id="oldStr" class="text">the stackoverflow q...
There are JavaScript libraries that does diff visualization. These are a few examples I found: * <https://github.com/cemerick/jsdifflib> * <http://prettydiff.com/> I haven't tried any of them, so unfortunately I can't tell you which is most suited for you needs, but it might be worth checking them out. **Update** j...
61,463,180
Is there any option to check is string value exists in [JavaScript Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) structure and if it does, take the necessary key value? For example: ``` let string = 'James never fly to Dubai' let exampleMap = = new Map([ ['Sasha', ' g...
2020/04/27
[ "https://Stackoverflow.com/questions/61463180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7475615/" ]
Use forEach to iterate map and check if key included in the string ```js let str = 'James never fly to Dubai' let exampleMap = new Map([ ['Sasha', ' goes to school'], ['James', ' goes to college'], ['Kevin', ' goes to work'], ]); exampleMap.forEach((value, key) => str.includes(key)&&console.log(str...
To get O(n) lookup time, `.entries()` and `.includes` won't help you. Instead you would've to iterate the string somehow, e.g. splitting by words (which seems to work in your case): ``` string.split(" ").some(word => exampleMap.has(word)) ```
61,463,180
Is there any option to check is string value exists in [JavaScript Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) structure and if it does, take the necessary key value? For example: ``` let string = 'James never fly to Dubai' let exampleMap = = new Map([ ['Sasha', ' g...
2020/04/27
[ "https://Stackoverflow.com/questions/61463180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7475615/" ]
Use forEach to iterate map and check if key included in the string ```js let str = 'James never fly to Dubai' let exampleMap = new Map([ ['Sasha', ' goes to school'], ['James', ' goes to college'], ['Kevin', ' goes to work'], ]); exampleMap.forEach((value, key) => str.includes(key)&&console.log(str...
You can convert the `exampleMap.entries()` to an array and then apply array `.some()` method like this: ```js let string = 'James never fly to Dubai' let exampleMap = new Map([ ['Sasha', ' goes to school'], ['James', ' goes to college'], ['Kevin', ' goes to work'], ]); [...exampleMap.entries()].som...
16,051,587
I am working with a `ASP.NET & C#` application residing in an `windows server` with `windows server 2008 R2` Operating System, the server I am using is a `VM`. I changed my windows datetime format to `"en-US"` and my SQL server datetime format, regional settings datetime format is showing as `"MM/dd/yyyy"` but withing ...
2013/04/17
[ "https://Stackoverflow.com/questions/16051587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/925080/" ]
You need to change culture, used in your application. Add this to the `system.web` section of web.config: `<globalization culture="en-US" />` And also, if you don't want to change default culture for all application, you can pass en-US culture to `DateTime.ToString` method: `var str = DateTime.Now.ToString(CultureInfo....
then try ``` this.TextBox3.Text = DateTime.Now.ToString("MM.dd.yyyy"); ``` or thry this...... ``` string format = "MM/dd/yyyy hh:mm:ss.fff"; DateTime d = DateTime.ParseExact("05/15/2012 10:09:28.650", format, System.Globalization.CultureInfo.Invariant...
78,638
I'd like to access a DB table and render it in some data grid format using php on a dedicated wordpress page, accessible to members of a certain group. Is this at all possible with wordpress or is there another way to do so? using wp 3.5 on linux system + mysql thanks
2013/01/07
[ "https://wordpress.stackexchange.com/questions/78638", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/25812/" ]
You can [create a simple plugin](http://codex.wordpress.org/Writing_a_Plugin) and either [add a shortcode](http://codex.wordpress.org/Shortcode_API) to run your php, or [filter `the_content`](http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content) and add a [conditional check](http://codex.wordpress.org/Con...
What do you mean by "page" here? You can throw whatever PHP you want into a page *template*. If this is a more or less one-off thing, what you should probably do is use the [conditional tags](http://codex.wordpress.org/Conditional_Tags) to just embed it. If you mean you want to do this within *content* arbitrarily ...
78,638
I'd like to access a DB table and render it in some data grid format using php on a dedicated wordpress page, accessible to members of a certain group. Is this at all possible with wordpress or is there another way to do so? using wp 3.5 on linux system + mysql thanks
2013/01/07
[ "https://wordpress.stackexchange.com/questions/78638", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/25812/" ]
What do you mean by "page" here? You can throw whatever PHP you want into a page *template*. If this is a more or less one-off thing, what you should probably do is use the [conditional tags](http://codex.wordpress.org/Conditional_Tags) to just embed it. If you mean you want to do this within *content* arbitrarily ...
There are plugins that allow you to run php code in the post content. Here are a couple: <http://wordpress.org/extend/plugins/php-code-for-posts/> http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/
78,638
I'd like to access a DB table and render it in some data grid format using php on a dedicated wordpress page, accessible to members of a certain group. Is this at all possible with wordpress or is there another way to do so? using wp 3.5 on linux system + mysql thanks
2013/01/07
[ "https://wordpress.stackexchange.com/questions/78638", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/25812/" ]
You can [create a simple plugin](http://codex.wordpress.org/Writing_a_Plugin) and either [add a shortcode](http://codex.wordpress.org/Shortcode_API) to run your php, or [filter `the_content`](http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content) and add a [conditional check](http://codex.wordpress.org/Con...
There are plugins that allow you to run php code in the post content. Here are a couple: <http://wordpress.org/extend/plugins/php-code-for-posts/> http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/
84,557
Hello all, If you have a theorem $\vdash \alpha \rightarrow \beta$ and a theorem $\vdash \gamma$ then if $\alpha$ is a sub-expression of $\gamma$, and this sub-expression has an even number of negations within $\gamma$ (and it is not within a xor or boolean equality), then a new theorem can be obtained by replacing $\...
2011/12/29
[ "https://mathoverflow.net/questions/84557", "https://mathoverflow.net", "https://mathoverflow.net/users/5917/" ]
The following paper shows that if chronological order on $\mathbb R^n$ is defined by cone (i.e., $x\in \mathbb R^n$ chronologically precedes $y\in \mathbb R^n$ iff $y − x$ belongs to some fixed cone) then any bijection which preserve the chronological order has to be linear. * [Alexandrov A.D. Contribution to chronoge...
I haven't worked out the details, so I might have this all wrong, but couldn't you proceed as follows: 1. Prove that an isometry is differentiable. 2. Prove that an isometry is an infinitesimal isometry. In other words, the pull back of the metric tensor is equal to the metric tensor. 3. Prove that the composition of ...
84,557
Hello all, If you have a theorem $\vdash \alpha \rightarrow \beta$ and a theorem $\vdash \gamma$ then if $\alpha$ is a sub-expression of $\gamma$, and this sub-expression has an even number of negations within $\gamma$ (and it is not within a xor or boolean equality), then a new theorem can be obtained by replacing $\...
2011/12/29
[ "https://mathoverflow.net/questions/84557", "https://mathoverflow.net", "https://mathoverflow.net/users/5917/" ]
The following paper shows that if chronological order on $\mathbb R^n$ is defined by cone (i.e., $x\in \mathbb R^n$ chronologically precedes $y\in \mathbb R^n$ iff $y − x$ belongs to some fixed cone) then any bijection which preserve the chronological order has to be linear. * [Alexandrov A.D. Contribution to chronoge...
The following general result is described in the answer I posted on math.stackexchange [here](https://math.stackexchange.com/questions/137139/isometry-without-injection-and-surjection): if $V\_1$ and $V\_2$ are finite-dimensional vector spaces of equal dimension over an arbitrary field and they are both equipped with n...
84,557
Hello all, If you have a theorem $\vdash \alpha \rightarrow \beta$ and a theorem $\vdash \gamma$ then if $\alpha$ is a sub-expression of $\gamma$, and this sub-expression has an even number of negations within $\gamma$ (and it is not within a xor or boolean equality), then a new theorem can be obtained by replacing $\...
2011/12/29
[ "https://mathoverflow.net/questions/84557", "https://mathoverflow.net", "https://mathoverflow.net/users/5917/" ]
Let's fix notation and define the bilinear form $\eta: \mathbb{R}^4 \times \mathbb{R}^4 \to \mathbb{R}$ by: $\eta((x,y,z,t),(x',y',z',t')) = xx'+yy'+zz'- tt'$ Given a map $T:\mathbb{R}^4 \to \mathbb{R}^4$ which fixes $0$ and preserves $\eta$ we want to show that $T$ is linear. Let $e\_1,e\_2,e\_3,e\_4$ be the canoni...
I haven't worked out the details, so I might have this all wrong, but couldn't you proceed as follows: 1. Prove that an isometry is differentiable. 2. Prove that an isometry is an infinitesimal isometry. In other words, the pull back of the metric tensor is equal to the metric tensor. 3. Prove that the composition of ...
84,557
Hello all, If you have a theorem $\vdash \alpha \rightarrow \beta$ and a theorem $\vdash \gamma$ then if $\alpha$ is a sub-expression of $\gamma$, and this sub-expression has an even number of negations within $\gamma$ (and it is not within a xor or boolean equality), then a new theorem can be obtained by replacing $\...
2011/12/29
[ "https://mathoverflow.net/questions/84557", "https://mathoverflow.net", "https://mathoverflow.net/users/5917/" ]
Let's fix notation and define the bilinear form $\eta: \mathbb{R}^4 \times \mathbb{R}^4 \to \mathbb{R}$ by: $\eta((x,y,z,t),(x',y',z',t')) = xx'+yy'+zz'- tt'$ Given a map $T:\mathbb{R}^4 \to \mathbb{R}^4$ which fixes $0$ and preserves $\eta$ we want to show that $T$ is linear. Let $e\_1,e\_2,e\_3,e\_4$ be the canoni...
The following general result is described in the answer I posted on math.stackexchange [here](https://math.stackexchange.com/questions/137139/isometry-without-injection-and-surjection): if $V\_1$ and $V\_2$ are finite-dimensional vector spaces of equal dimension over an arbitrary field and they are both equipped with n...
84,557
Hello all, If you have a theorem $\vdash \alpha \rightarrow \beta$ and a theorem $\vdash \gamma$ then if $\alpha$ is a sub-expression of $\gamma$, and this sub-expression has an even number of negations within $\gamma$ (and it is not within a xor or boolean equality), then a new theorem can be obtained by replacing $\...
2011/12/29
[ "https://mathoverflow.net/questions/84557", "https://mathoverflow.net", "https://mathoverflow.net/users/5917/" ]
The following general result is described in the answer I posted on math.stackexchange [here](https://math.stackexchange.com/questions/137139/isometry-without-injection-and-surjection): if $V\_1$ and $V\_2$ are finite-dimensional vector spaces of equal dimension over an arbitrary field and they are both equipped with n...
I haven't worked out the details, so I might have this all wrong, but couldn't you proceed as follows: 1. Prove that an isometry is differentiable. 2. Prove that an isometry is an infinitesimal isometry. In other words, the pull back of the metric tensor is equal to the metric tensor. 3. Prove that the composition of ...
5,976,525
Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables. Every additional helper function clutters up the interface, since often th...
2011/05/12
[ "https://Stackoverflow.com/questions/5976525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377052/" ]
> > Every additional helper function clutters up the interface > > > A `private` helper function doesn't. > > I usually create a helper class which becomes the friend of the class that needs to be operated on > > > Don't do this unless it's absolutely unavoidable. You might want to break up your class's data...
I sometimes have the same problems as you have described: increasingly large classes that need too many helper functions to be accessed in a civilized manner. When this occurs I try to seperate the class in multiple smaller classes if that is possible and convenient. Scott Meyers states in Effective C++ that friend c...
5,976,525
Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables. Every additional helper function clutters up the interface, since often th...
2011/05/12
[ "https://Stackoverflow.com/questions/5976525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377052/" ]
> > Every additional helper function clutters up the interface > > > A `private` helper function doesn't. > > I usually create a helper class which becomes the friend of the class that needs to be operated on > > > Don't do this unless it's absolutely unavoidable. You might want to break up your class's data...
> > An alternative are free functions that > need parameters, but even though > premature optimization is evil, and I > haven't actually profiled or > disassembled it... I still DREAD the > mere thought of passing all the stuff > I need sometimes, even just as > reference, even though that should be > a simple...
5,976,525
Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables. Every additional helper function clutters up the interface, since often th...
2011/05/12
[ "https://Stackoverflow.com/questions/5976525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377052/" ]
> > Every additional helper function clutters up the interface > > > A `private` helper function doesn't. > > I usually create a helper class which becomes the friend of the class that needs to be operated on > > > Don't do this unless it's absolutely unavoidable. You might want to break up your class's data...
Another way to keep your classes free of cruft is to use the pimpl idiom. Hide your private implementation behind a pointer to a class that actually implements whatever it is that you're doing, and then expose a limited subset of features to whoever is the consumer of your class. ``` // Your public API in foo.h (note:...
5,976,525
Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables. Every additional helper function clutters up the interface, since often th...
2011/05/12
[ "https://Stackoverflow.com/questions/5976525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377052/" ]
I sometimes have the same problems as you have described: increasingly large classes that need too many helper functions to be accessed in a civilized manner. When this occurs I try to seperate the class in multiple smaller classes if that is possible and convenient. Scott Meyers states in Effective C++ that friend c...
> > An alternative are free functions that > need parameters, but even though > premature optimization is evil, and I > haven't actually profiled or > disassembled it... I still DREAD the > mere thought of passing all the stuff > I need sometimes, even just as > reference, even though that should be > a simple...
5,976,525
Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables. Every additional helper function clutters up the interface, since often th...
2011/05/12
[ "https://Stackoverflow.com/questions/5976525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377052/" ]
I sometimes have the same problems as you have described: increasingly large classes that need too many helper functions to be accessed in a civilized manner. When this occurs I try to seperate the class in multiple smaller classes if that is possible and convenient. Scott Meyers states in Effective C++ that friend c...
Another way to keep your classes free of cruft is to use the pimpl idiom. Hide your private implementation behind a pointer to a class that actually implements whatever it is that you're doing, and then expose a limited subset of features to whoever is the consumer of your class. ``` // Your public API in foo.h (note:...
5,976,525
Over time I have come to appreciate the mindset of many small functions ,and I really do like it a lot, but I'm having a hard time losing my shyness to apply it to classes, especially ones with more than a handful of nonpublic member variables. Every additional helper function clutters up the interface, since often th...
2011/05/12
[ "https://Stackoverflow.com/questions/5976525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/377052/" ]
Another way to keep your classes free of cruft is to use the pimpl idiom. Hide your private implementation behind a pointer to a class that actually implements whatever it is that you're doing, and then expose a limited subset of features to whoever is the consumer of your class. ``` // Your public API in foo.h (note:...
> > An alternative are free functions that > need parameters, but even though > premature optimization is evil, and I > haven't actually profiled or > disassembled it... I still DREAD the > mere thought of passing all the stuff > I need sometimes, even just as > reference, even though that should be > a simple...
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
I may have seen this problem before when somebody had committed the .svn directory itself to the repository. Thus, when trying to create the working directory, the versioned .svn directory couldn't be created because the working directory already had its own .svn directory.
My encounter with the "**failed to add directory a versioned directory XYZ... a the same name already exists**" error. I checked out files in `/regular-folder/`: I did not: * changed the folder name * add or modified any camelCase files I just added new files and modified existing files in existing checked out fold...
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
If you're absolutely certain that the directory you're checking out into is empty, you may want to see if the repository contains directories with the same name using different capitalization. This sometimes happens when the host OS for the repository is Linux. Sometimes this causes problems when the working directory ...
I believe I had the same issue because I'd updated my SVN client to a newer version and had not updated the working copy to the new format.
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
If you've previously checked out into this directory, there could be a hidden .svn folder (folders prefixed with dot are the equivalent of hidden in Linux/OSX)? Does the same problem occur in another recently created folder?
I believe I had the same issue because I'd updated my SVN client to a newer version and had not updated the working copy to the new format.
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
I had a similar problem, though not with a '.svn' directory, but a normal one. I was getting this error when checking out into an empty dir: > > svn: Failed to add directory 'files': an unversioned directory of the > same name already exists > > > The directory had dynamic content and was set to svn:ignore, and...
I believe I had the same issue because I'd updated my SVN client to a newer version and had not updated the working copy to the new format.
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
I may have seen this problem before when somebody had committed the .svn directory itself to the repository. Thus, when trying to create the working directory, the versioned .svn directory couldn't be created because the working directory already had its own .svn directory.
I had a similar problem, though not with a '.svn' directory, but a normal one. I was getting this error when checking out into an empty dir: > > svn: Failed to add directory 'files': an unversioned directory of the > same name already exists > > > The directory had dynamic content and was set to svn:ignore, and...
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
I may have seen this problem before when somebody had committed the .svn directory itself to the repository. Thus, when trying to create the working directory, the versioned .svn directory couldn't be created because the working directory already had its own .svn directory.
Are you **sure** it is empty and that .svn doesn't exist? Have you tried not giving it `projectname` and instead moving into that dir and checking it out?
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
Are you **sure** it is empty and that .svn doesn't exist? Have you tried not giving it `projectname` and instead moving into that dir and checking it out?
I believe I had the same issue because I'd updated my SVN client to a newer version and had not updated the working copy to the new format.
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
I may have seen this problem before when somebody had committed the .svn directory itself to the repository. Thus, when trying to create the working directory, the versioned .svn directory couldn't be created because the working directory already had its own .svn directory.
I believe I had the same issue because I'd updated my SVN client to a newer version and had not updated the working copy to the new format.
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
My encounter with the "**failed to add directory a versioned directory XYZ... a the same name already exists**" error. I checked out files in `/regular-folder/`: I did not: * changed the folder name * add or modified any camelCase files I just added new files and modified existing files in existing checked out fold...
I believe I had the same issue because I'd updated my SVN client to a newer version and had not updated the working copy to the new format.
1,028,908
``` svn co svn+ssh://myhost/path/projectname/trunk projectname [...] svn: Failed to add directory 'projectname/test/.svn': an unversioned directory of the same name already exists ``` How is that possible?? I'm checking out into an empty dir. Same error checking out to Windows and OS X.
2009/06/22
[ "https://Stackoverflow.com/questions/1028908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
I may have seen this problem before when somebody had committed the .svn directory itself to the repository. Thus, when trying to create the working directory, the versioned .svn directory couldn't be created because the working directory already had its own .svn directory.
If you've previously checked out into this directory, there could be a hidden .svn folder (folders prefixed with dot are the equivalent of hidden in Linux/OSX)? Does the same problem occur in another recently created folder?
1,500,312
Background: We have software that (remotely) retrieves information from a Windows desktop. The desktop needs to be locked, but if we do that the simple way, Windows thinks no-one is looking at the screen and stops updating it. To prevent that, we open an RDP session to the computer. This locks the screen as a side-effe...
2019/11/08
[ "https://superuser.com/questions/1500312", "https://superuser.com", "https://superuser.com/users/1110579/" ]
Connecting to Terminal Server service running on localhost (or IP 127.0.0.1), ends in session disconnected or unable to connect. This behavior is explicitly baked into RDP by Microsoft, and the reason for it is lost in time. Below are some workarounds that bypass that limitation. As you can see, the Microsoft develope...
This is indeed working as designed. Normally, you cannot initiate an RDP session to the same computer, due to a loopback. It is possible to patch the terminal services .dll file to allow this, but it is not a nice solution, because with every windows update, it will break, and the patch have to be applied again, which...
1,500,312
Background: We have software that (remotely) retrieves information from a Windows desktop. The desktop needs to be locked, but if we do that the simple way, Windows thinks no-one is looking at the screen and stops updating it. To prevent that, we open an RDP session to the computer. This locks the screen as a side-effe...
2019/11/08
[ "https://superuser.com/questions/1500312", "https://superuser.com", "https://superuser.com/users/1110579/" ]
My question would be what service is it running under? If you are able to have it execute under system it should continue to run regardless of a lock screen or anyone logging in. I had to do this for sharepoint automation and some scripting, this way end user never sees it, no one has to be logged in etc and with the g...
This is indeed working as designed. Normally, you cannot initiate an RDP session to the same computer, due to a loopback. It is possible to patch the terminal services .dll file to allow this, but it is not a nice solution, because with every windows update, it will break, and the patch have to be applied again, which...
60,456
I'm using an Arduino for sensor readings and sending them to a Raspberry Pi via USB, using PySerial for data reception. It works great, except for the fact received data is awkwardly modified (And set as constant). For example, I'm reading voltages and calculating currents. The results on the Arduino serial are as fol...
2013/03/10
[ "https://electronics.stackexchange.com/questions/60456", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/18839/" ]
The arduino is not well suited to doing floating point math, nor is it partiularly well suited to doing string manipulation. You would be better off by sending the value read from the analog input directly to the python code on the Pi and do the math and string manipulation in Python. On the arduino side just do some...
I found a way to send the information correctly using `Serial.write()`, but apparently it works byte-by-byte. Thus, I'l have to write some more code to translate each and every byte. I'm sure there's a better and easier way though.
60,456
I'm using an Arduino for sensor readings and sending them to a Raspberry Pi via USB, using PySerial for data reception. It works great, except for the fact received data is awkwardly modified (And set as constant). For example, I'm reading voltages and calculating currents. The results on the Arduino serial are as fol...
2013/03/10
[ "https://electronics.stackexchange.com/questions/60456", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/18839/" ]
The arduino is not well suited to doing floating point math, nor is it partiularly well suited to doing string manipulation. You would be better off by sending the value read from the analog input directly to the python code on the Pi and do the math and string manipulation in Python. On the arduino side just do some...
If you're suspecting the PySerial library, I have to say I'd be really suprised if the issue is there. I've used PySerial pretty extensively, for both binary and ascii data without issues (though not on a Raspberry Pi). One thing I can think of is it's possible the port is opening in a weird mode. Try manually specif...
60,456
I'm using an Arduino for sensor readings and sending them to a Raspberry Pi via USB, using PySerial for data reception. It works great, except for the fact received data is awkwardly modified (And set as constant). For example, I'm reading voltages and calculating currents. The results on the Arduino serial are as fol...
2013/03/10
[ "https://electronics.stackexchange.com/questions/60456", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/18839/" ]
The arduino is not well suited to doing floating point math, nor is it partiularly well suited to doing string manipulation. You would be better off by sending the value read from the analog input directly to the python code on the Pi and do the math and string manipulation in Python. On the arduino side just do some...
Actually, pyserial reads data from the Arduino as bytes, e.g.: `b234\r\n`. So you need to strip those unnecessary values before you can use them: ``` valuebtw0to1023= serialObj.readline().strip('\r\n').strip() ```
60,456
I'm using an Arduino for sensor readings and sending them to a Raspberry Pi via USB, using PySerial for data reception. It works great, except for the fact received data is awkwardly modified (And set as constant). For example, I'm reading voltages and calculating currents. The results on the Arduino serial are as fol...
2013/03/10
[ "https://electronics.stackexchange.com/questions/60456", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/18839/" ]
The arduino is not well suited to doing floating point math, nor is it partiularly well suited to doing string manipulation. You would be better off by sending the value read from the analog input directly to the python code on the Pi and do the math and string manipulation in Python. On the arduino side just do some...
if you plan to read serial data from al APC220 RF antenna with python, you will have to add the line : ``` ser = serial.Serial('/dev/ttyACM1', 19200) ser.setRTS(0) # <------------------- this line solve the problem ``` I found it after a whole day of try-error.
23,592,131
I could not find the main difference. And I am very confused when we could use inheritance and when we can use subtyping. I found some definitions but they are not very clear. What is the difference between subtyping and inheritance in object-oriented programming?
2014/05/11
[ "https://Stackoverflow.com/questions/23592131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3337256/" ]
In addition to the answers already given, here's a [link](http://www.cmi.ac.in/%7Emadhavan/courses/pl2006/lecturenotes/lecture-notes/node28.html) to an article I think is relevant. Excerpts: > > In the object-oriented framework, inheritance is usually presented as a feature that goes hand in hand with subtyping when ...
If you inherit privately in C++, you get inheritance without subtyping. That is, given: ```cpp class Derived : Base // note the missing public before Base ``` You cannot write: ```cpp Base * p = new Derived(); // type error ``` Because `Derived` is not a subtype of `Base`. You merely inherited the implem...
23,592,131
I could not find the main difference. And I am very confused when we could use inheritance and when we can use subtyping. I found some definitions but they are not very clear. What is the difference between subtyping and inheritance in object-oriented programming?
2014/05/11
[ "https://Stackoverflow.com/questions/23592131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3337256/" ]
In addition to the answers already given, here's a [link](http://www.cmi.ac.in/%7Emadhavan/courses/pl2006/lecturenotes/lecture-notes/node28.html) to an article I think is relevant. Excerpts: > > In the object-oriented framework, inheritance is usually presented as a feature that goes hand in hand with subtyping when ...
Inheritance is about gaining attributes (and/or functionality) of super types. For example: ``` class Base { //interface with included definitions } class Derived inherits Base { //Add some additional functionality. //Reuse Base without having to explicitly forward //the functions in Base } ``` Her...