qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
According to the section on [Font Configuration Files](http://java.sun.com/javase/6/docs/technotes/guides/intl/fontconfig.html) in the JDK documentation of [Internationalization Support](http://java.sun.com/javase/6/docs/technotes/guides/intl/)-related APIs, the concept of **Logical Font**s is used to define certain pl...
For people who have the same problem, you can download any font ttf file, put it in the resource folder (in my case /font/*\**\*.ttf) and add this methode to your application. It's work 100 %. ``` public Font loadDigitalFont(int policeSize) { URL fontFile = YouClassName.class .getResource("/fonts/DS-DI...
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
To the best of my knowledge, the AWT API does not expose underlying Font information. If you can get to it, I would expect it to be implementation dependent. Certainly, comparing the font mapping files in a couple of JRE lib directories, I can see that they are not defined in a consistent way. You could load your own ...
If you want just a Monospaced font use "Courier" => `new Font(display, "Courier", 10, SWT.NORMAL)`
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
I spent a while bashing my head against this one until I realised that obviously eclipse must have access to a monospace font for use in its text fields, console etc. A little digging turned up: ``` Font terminalFont = JFaceResources.getFont(JFaceResources.TEXT_FONT); ``` Which works if all you're interested in is g...
To the best of my knowledge, the AWT API does not expose underlying Font information. If you can get to it, I would expect it to be implementation dependent. Certainly, comparing the font mapping files in a couple of JRE lib directories, I can see that they are not defined in a consistent way. You could load your own ...
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
I spent a while bashing my head against this one until I realised that obviously eclipse must have access to a monospace font for use in its text fields, console etc. A little digging turned up: ``` Font terminalFont = JFaceResources.getFont(JFaceResources.TEXT_FONT); ``` Which works if all you're interested in is g...
If you want just a Monospaced font use "Courier" => `new Font(display, "Courier", 10, SWT.NORMAL)`
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
For people who have the same problem, you can download any font ttf file, put it in the resource folder (in my case /font/*\**\*.ttf) and add this methode to your application. It's work 100 %. ``` public Font loadDigitalFont(int policeSize) { URL fontFile = YouClassName.class .getResource("/fonts/DS-DI...
If you want just a Monospaced font use "Courier" => `new Font(display, "Courier", 10, SWT.NORMAL)`
221,568
Is there a way in SWT to get a monospaced font simply, that works across various operating systems? For example. this works on Linux, but not Windows: ``` Font mono = new Font(parent.getDisplay(), "Mono", 10, SWT.NONE); ``` or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco,...
2008/10/21
[ "https://Stackoverflow.com/questions/221568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17832/" ]
I spent a while bashing my head against this one until I realised that obviously eclipse must have access to a monospace font for use in its text fields, console etc. A little digging turned up: ``` Font terminalFont = JFaceResources.getFont(JFaceResources.TEXT_FONT); ``` Which works if all you're interested in is g...
For people who have the same problem, you can download any font ttf file, put it in the resource folder (in my case /font/*\**\*.ttf) and add this methode to your application. It's work 100 %. ``` public Font loadDigitalFont(int policeSize) { URL fontFile = YouClassName.class .getResource("/fonts/DS-DI...
46,599,446
I'm seeking some help on how I can click the "Play Activity button" in our Global Productivity Hub in our office using excel VBA. I'm creating an attendance log in tool with lunch and break trackers. Once the employee click Log In with tool that I created, the GPH site will launch and will logged them in, the same thin...
2017/10/06
[ "https://Stackoverflow.com/questions/46599446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8730433/" ]
You could use a rank analytic function here, e.g. ``` SELECT salary FROM ( SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) dr FROM c ) t WHERE dr = 2; ``` This would return the second highest salary by dense rank, including all ties for second.
Explanation why your subquery can't work: 1. At first, records are read from the table in an arbitrary order. This is when they get their `rownum`. 2. Then aggregation takes place; all records for one `salary` are condensed to a single row. The `rownum` of the single rows you had before are no longer available. 3. The...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
The lineup of Canon crop (EF-S) lenses is not nearly as broad as the full-frame (EF) lenses. * In the focal length of interest, some EF options give better image quality than the respective EF-S options. * Additionally, some EF lenses offer features that are not available for EF-S lenses, such as weather sealing and s...
Short form: In general it is wise then, and only then, when you seriously consider moving to a full frame body later. If you don't then it is just a case-by-case decistion, as yours obviously is. You are thinking of a number of specific lens for now. Then, when the choice is just beween an EF lens and an EF-S cons...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
The lineup of Canon crop (EF-S) lenses is not nearly as broad as the full-frame (EF) lenses. * In the focal length of interest, some EF options give better image quality than the respective EF-S options. * Additionally, some EF lenses offer features that are not available for EF-S lenses, such as weather sealing and s...
As usual: it depends * In terms of image quality, it's definitely wise as only the best part of the lens will be used (the center) by your camera. Lenses are usually sharper near the center and you will notice less vignetting. * the downside is, EF lenses are usually more expensive than equivalent EF-S lenses. * on th...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
The lineup of Canon crop (EF-S) lenses is not nearly as broad as the full-frame (EF) lenses. * In the focal length of interest, some EF options give better image quality than the respective EF-S options. * Additionally, some EF lenses offer features that are not available for EF-S lenses, such as weather sealing and s...
If you never plan on moving to a full frame body, then sticking with crop lenses are liable to be a smart path to take, because the lenses will be as sharp, be less expensive, smaller, and lighter. Most EF-S lenses have much more modern designs than their full-frame counterparts and the smaller sensor size means that t...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
I bought a Canon 24-70mm f/2.8 L lens for my Canon 450D crop sensor body before I had purchased the full-frame Canon 5DMKII. By going this route, I had time to learn my lens on a crop body well before I could afford the full frame of the 5D. I even borrowed and used 70-200mm f/2.8 L lenses on the 450D body, which gave ...
Short form: In general it is wise then, and only then, when you seriously consider moving to a full frame body later. If you don't then it is just a case-by-case decistion, as yours obviously is. You are thinking of a number of specific lens for now. Then, when the choice is just beween an EF lens and an EF-S cons...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
If you have the money, go with the full frame option. The basic reasoning that I would have for that is simple: lenses will stay with you longer than the camera body. That's the nutshell answer. Longer answer is that today you have a 550D and you're learning. Stay with that camera while you're doing that, until you fe...
Short form: In general it is wise then, and only then, when you seriously consider moving to a full frame body later. If you don't then it is just a case-by-case decistion, as yours obviously is. You are thinking of a number of specific lens for now. Then, when the choice is just beween an EF lens and an EF-S cons...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
I bought a Canon 24-70mm f/2.8 L lens for my Canon 450D crop sensor body before I had purchased the full-frame Canon 5DMKII. By going this route, I had time to learn my lens on a crop body well before I could afford the full frame of the 5D. I even borrowed and used 70-200mm f/2.8 L lenses on the 450D body, which gave ...
If you never plan on moving to a full frame body, then sticking with crop lenses are liable to be a smart path to take, because the lenses will be as sharp, be less expensive, smaller, and lighter. Most EF-S lenses have much more modern designs than their full-frame counterparts and the smaller sensor size means that t...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
I am going to keep it simple. 1. Many people do it. In fact, I have seen most people using APS-C camera with a mix of EF-S and EF lenses, and less people use **only** EF-S lenses. 2. Expensive lenses offers **excellent** image quality with the trade-off of being expensive, inflexible (usually a narrow zoom range, may ...
There are a few factors to consider here. Firstly the EF L range lenses are considerably better build quality than typical EF-S lenses and the optical quality tends to be much higher too. On a crop sensor the 70-200 f4 L is outstanding. You do however have to remember when choosing EF lenses to apply the crop factor to...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
If you never plan on moving to a full frame body, then sticking with crop lenses are liable to be a smart path to take, because the lenses will be as sharp, be less expensive, smaller, and lighter. Most EF-S lenses have much more modern designs than their full-frame counterparts and the smaller sensor size means that t...
Short form: In general it is wise then, and only then, when you seriously consider moving to a full frame body later. If you don't then it is just a case-by-case decistion, as yours obviously is. You are thinking of a number of specific lens for now. Then, when the choice is just beween an EF lens and an EF-S cons...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
The lineup of Canon crop (EF-S) lenses is not nearly as broad as the full-frame (EF) lenses. * In the focal length of interest, some EF options give better image quality than the respective EF-S options. * Additionally, some EF lenses offer features that are not available for EF-S lenses, such as weather sealing and s...
I am going to keep it simple. 1. Many people do it. In fact, I have seen most people using APS-C camera with a mix of EF-S and EF lenses, and less people use **only** EF-S lenses. 2. Expensive lenses offers **excellent** image quality with the trade-off of being expensive, inflexible (usually a narrow zoom range, may ...
17,028
I have a Canon 550D which I've been using for around a year now. I really love it and have learned a great deal with this and the 18 - 135mm kit lens. But now with experience I feel the need to get some better glass. I won't be buying a new body any time soon because I figure investing in some good glass is more import...
2011/11/08
[ "https://photo.stackexchange.com/questions/17028", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1924/" ]
There are a few factors to consider here. Firstly the EF L range lenses are considerably better build quality than typical EF-S lenses and the optical quality tends to be much higher too. On a crop sensor the 70-200 f4 L is outstanding. You do however have to remember when choosing EF lenses to apply the crop factor to...
Short form: In general it is wise then, and only then, when you seriously consider moving to a full frame body later. If you don't then it is just a case-by-case decistion, as yours obviously is. You are thinking of a number of specific lens for now. Then, when the choice is just beween an EF lens and an EF-S cons...
21,069,530
I'm trying to somehow determine based on my interface what type came in and then do some validation on that type. Validation differes based on type that comes in. ``` public static bool RequestIsValid(IPaymentRequest preAuthorizeRequest) { switch (preAuthorizeRequest) { case ...
2014/01/12
[ "https://Stackoverflow.com/questions/21069530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93468/" ]
`.myClass/DomElement > .myotherclassinsidethatelement` selects only the direct children of the parent class. So: ``` <div class='myClass'> <div class='someOther'> <div class='myotherclassinsidethatelement'></div> </div> </div> ``` In this case, the `>` version won't select it. See here: <http://js...
**UPDATE** The previous answer I gave was incorrect. I was under the impression that inheritance and nesting were the same thing, but they are not. If anyone else had this impression, here is a resource explaining what nesting is: <http://www.htmldog.com/guides/css/intermediate/grouping/> Here is another explaining...
5,515
I know that mining pool shares have no value on their own, but it should be possible to find an average value based on the pool's average payout per share. [This site](https://en.bitcoin.it/wiki/Mining_pool_reward_FAQ#What_will_be_my_expected_payout_per_share.3F) describes the expected payout per share as `([block rewa...
2012/11/27
[ "https://bitcoin.stackexchange.com/questions/5515", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/2029/" ]
If the global network difficulty is D and the difficulty of shares in the pool is d, then the probability that a share will lead to a valid block is d/D. The reward in this case is B, so the average reward per share is B\*(d/D). If the operator's average fee is f (so for example f=0.01 means 1% fee), the average reward...
**Variable difficulty mining:** If you are mining at a pool with a higher difficulty, then each share (proof-of-work) is worth more on average. Proving that you worked very hard is worth more than proving that you worked a little bit. Some pools now use variable difficulty, which means the difficulty can change over t...
81,413
I was wondering if tension on both ends of a rope is still the same, even if there is objects with different weights on both sides of the rope.
2013/10/20
[ "https://physics.stackexchange.com/questions/81413", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/29959/" ]
I'm assuming there is a pulley involved which allows the tension from both objects to be in the same direction (i.e towards the source of gravity). ![enter image description here](https://i.stack.imgur.com/u2bzU.png) Taking this to be the case, yes, the tension in the rope is constant. However, the entire system will...
They can be different at certain circumstances. For example, in a pulley problem if we assume that the pulley and the rope is massless then the tension is same.[![This is the proof](https://i.stack.imgur.com/g3g5g.jpg)](https://i.stack.imgur.com/g3g5g.jpg) But if we consider them to have considerable mass then we can ...
3,380,033
I'm using xmlwriter to create an xml document. The xml document looks like this: ``` <?xml version="1.0" encoding="utf-8" ?> <ExceptionsList /> ``` How can i prevent the /> and appropriately end the root node? Because of this, i can't append anything to the root node. My code for creating the xml file looks like...
2010/07/31
[ "https://Stackoverflow.com/questions/3380033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/405046/" ]
Your code is right, and you don't need to change how your `ExceptionsList` element is closed. ``` xmlWriter.WriteStartElement("ExceptionsList"); // ExceptionsList (Root) Element xmlWriter.WriteStartElement("Exception"); // An Exception element xmlWriter.WriteEndElement(); xmlWriter.WriteEndElement(); // End of Excep...
I believe the problem is here: ``` new XElement("Exception Type", exceptionType), new XElement("Exception Message", exceptionMessage), ``` Neither `Exception Type` nor `Exception Mesage` is a valid name for an xml element. Then of course, if you use *this* (doomed) method to log the error... stack overflow.
17,578,280
When I set the src of an image object, it will trigger an onload function. How can I add parameters to it? ``` x = 1; y = 2; imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; x = 3; y = 4; ``` In here, I want to use the x and y values that were s...
2013/07/10
[ "https://Stackoverflow.com/questions/17578280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497454/" ]
Make a private scope closure that will store x & y values: ``` imageObj.onload = (function(x,y){ return function() { context.drawImage(imageObj, x, y); }; })(x,y); ```
Make a small function that handles it. Local variables will hold the correct scope. ``` function loadImage( src, x, y) { var imageObj = new Image(); imageObj.src = src; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; } var x = 1, y = 2; loadImage("foo.png", x, y); ...
17,578,280
When I set the src of an image object, it will trigger an onload function. How can I add parameters to it? ``` x = 1; y = 2; imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; x = 3; y = 4; ``` In here, I want to use the x and y values that were s...
2013/07/10
[ "https://Stackoverflow.com/questions/17578280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497454/" ]
All the other answers are some version of "make a closure". OK, that works. I think closures are cool, and languages that support them are cool... However: there is a much cleaner way to do this, IMO. Simply use the image object to store what you need, and access it in the load handler via "`this`": ``` imageObj = ne...
Make a small function that handles it. Local variables will hold the correct scope. ``` function loadImage( src, x, y) { var imageObj = new Image(); imageObj.src = src; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; } var x = 1, y = 2; loadImage("foo.png", x, y); ...
17,578,280
When I set the src of an image object, it will trigger an onload function. How can I add parameters to it? ``` x = 1; y = 2; imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; x = 3; y = 4; ``` In here, I want to use the x and y values that were s...
2013/07/10
[ "https://Stackoverflow.com/questions/17578280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497454/" ]
Make a private scope closure that will store x & y values: ``` imageObj.onload = (function(x,y){ return function() { context.drawImage(imageObj, x, y); }; })(x,y); ```
You could use an anonymous function ``` x = 1; y = 2; (function(xValue, yValue){ imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, xValue, yValue); }; })(x,y); x = 3; y = 4; ```
17,578,280
When I set the src of an image object, it will trigger an onload function. How can I add parameters to it? ``` x = 1; y = 2; imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; x = 3; y = 4; ``` In here, I want to use the x and y values that were s...
2013/07/10
[ "https://Stackoverflow.com/questions/17578280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497454/" ]
All the other answers are some version of "make a closure". OK, that works. I think closures are cool, and languages that support them are cool... However: there is a much cleaner way to do this, IMO. Simply use the image object to store what you need, and access it in the load handler via "`this`": ``` imageObj = ne...
You could use an anonymous function ``` x = 1; y = 2; (function(xValue, yValue){ imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, xValue, yValue); }; })(x,y); x = 3; y = 4; ```
17,578,280
When I set the src of an image object, it will trigger an onload function. How can I add parameters to it? ``` x = 1; y = 2; imageObj = new Image(); imageObj.src = "....."; imageObj.onload = function() { context.drawImage(imageObj, x, y); }; x = 3; y = 4; ``` In here, I want to use the x and y values that were s...
2013/07/10
[ "https://Stackoverflow.com/questions/17578280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497454/" ]
All the other answers are some version of "make a closure". OK, that works. I think closures are cool, and languages that support them are cool... However: there is a much cleaner way to do this, IMO. Simply use the image object to store what you need, and access it in the load handler via "`this`": ``` imageObj = ne...
Make a private scope closure that will store x & y values: ``` imageObj.onload = (function(x,y){ return function() { context.drawImage(imageObj, x, y); }; })(x,y); ```
45,666,502
I'm new to this site so hopefully I'm phrasing my question correctly. I'm working through some introductory Android programming. What allows me to call the `Toast.makeText` method, but I cannot do the same for the `setGravity` method immediately after? Why can I reference the first non-static method, but not the next...
2017/08/14
[ "https://Stackoverflow.com/questions/45666502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8459833/" ]
You have to create Toast class object ``` public void ShowToast(String message){ Toast t = Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG); OR // Toast t = new Toast(getContext()); if custom view require t.setDuration(Toast.LENGTH_LONG); t.setText(message); t.setGravity...
``` Toast toast = Toast.makeText(getApplicationContext(), "text", Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); ``` `makeText` return a toast object.
45,666,502
I'm new to this site so hopefully I'm phrasing my question correctly. I'm working through some introductory Android programming. What allows me to call the `Toast.makeText` method, but I cannot do the same for the `setGravity` method immediately after? Why can I reference the first non-static method, but not the next...
2017/08/14
[ "https://Stackoverflow.com/questions/45666502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8459833/" ]
You have to create Toast class object ``` public void ShowToast(String message){ Toast t = Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG); OR // Toast t = new Toast(getContext()); if custom view require t.setDuration(Toast.LENGTH_LONG); t.setText(message); t.setGravity...
Static methods can be accessed by using their class name. Like: `Classname.staticMethod();` So, here in `Toast` class, we have `makeText()` method and `setGravity()` method. But `makeText()` method is a static method. So, we can access it by their class name. Just like below: ``` Toast.makeText() ``` But `setGravit...
16,972,295
So i'm trying to create a simple String struct which will contain the text of the string and the size of it, at least for now. However I'm having issues allocating my struct. Right now i'm simply trying to get a size of 1 character to work, but its simply crashing at this point and i don't know what i'm doing wrong wit...
2013/06/06
[ "https://Stackoverflow.com/questions/16972295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1998810/" ]
You need to allocate memory for the structure but also for `text` string. ``` scanf("%s",str->text); ``` `str->text` is an uninitialized pointer.
``` int main(int argc, char** argv){ String* str1 = getString(); printf("%s",str1->text); free(str1->text); free(str1); return 0; } String* getString(){ String* str = (String*)malloc(sizeof(String));//for struct str->size = 16;//initialize str->text = (char*)malloc(sizeof(char)*str->si...
16,972,295
So i'm trying to create a simple String struct which will contain the text of the string and the size of it, at least for now. However I'm having issues allocating my struct. Right now i'm simply trying to get a size of 1 character to work, but its simply crashing at this point and i don't know what i'm doing wrong wit...
2013/06/06
[ "https://Stackoverflow.com/questions/16972295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1998810/" ]
You don't allocate any memory for `str->text`. You leave it uninitialized, so your program invokes undefined behavior. You need to allocate memory for it using `str->text = malloc(MAX_SIZE);` where `MAX_SIZE` is the maximal size for the string. Alternatively, if your strings will be short, you may use a regular, fixed...
``` int main(int argc, char** argv){ String* str1 = getString(); printf("%s",str1->text); free(str1->text); free(str1); return 0; } String* getString(){ String* str = (String*)malloc(sizeof(String));//for struct str->size = 16;//initialize str->text = (char*)malloc(sizeof(char)*str->si...
1,614,501
> > Find the last $4$ digits of $2016^{2016}$. > > > Technically I was able to solve this question by I used Wolfram Alpha and modular arithmetic so the worst I had to do was raise a $4$ digit number to the $9$th power. I would do $2016^2 \equiv 4256^2 \equiv \cdots$ and then continue using the prime factorizatio...
2016/01/16
[ "https://math.stackexchange.com/questions/1614501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297795/" ]
$$\begin{align}(2000+16)^{2016}&\equiv 2016\cdot 2000\cdot 16^{2015} + 16^{2016}&\pmod{10000}\\ &\equiv 2000+16^{2016}&\pmod{10000} \end{align}$$ So you need to find the last four digits of $16^{2016}$ and add $2000$. You can actually reduce the exponent modulo $500$, because $16^{2016}\equiv 16^{16}\pmod{625}$ and $...
You can afford to work modulo $16=2^4$ and modulo $625=5^4$ separately. The basis $2016$ is a multiple of $16$ and therefore so are all its powers. We also know that $2016\equiv141$ modulo $625.$ To take the $2016$-th power note that $141$ is invertible modulo $625$ (because it is relatively prime with $5$) and there...
1,614,501
> > Find the last $4$ digits of $2016^{2016}$. > > > Technically I was able to solve this question by I used Wolfram Alpha and modular arithmetic so the worst I had to do was raise a $4$ digit number to the $9$th power. I would do $2016^2 \equiv 4256^2 \equiv \cdots$ and then continue using the prime factorizatio...
2016/01/16
[ "https://math.stackexchange.com/questions/1614501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297795/" ]
You can afford to work modulo $16=2^4$ and modulo $625=5^4$ separately. The basis $2016$ is a multiple of $16$ and therefore so are all its powers. We also know that $2016\equiv141$ modulo $625.$ To take the $2016$-th power note that $141$ is invertible modulo $625$ (because it is relatively prime with $5$) and there...
Allow me give a different answer from the three ones above and easy to achieve with a calculator, please. This direct procedure can be applied to similar calculations. One can simply use one or both properties, $A^{abc}=(A^a)^{bc}\equiv(B)^{bc}\pmod{M}$ and $A^n=A^r\cdot A^s\equiv(B)\cdot (C)\pmod{M}$ where $r+s=n$, ...
1,614,501
> > Find the last $4$ digits of $2016^{2016}$. > > > Technically I was able to solve this question by I used Wolfram Alpha and modular arithmetic so the worst I had to do was raise a $4$ digit number to the $9$th power. I would do $2016^2 \equiv 4256^2 \equiv \cdots$ and then continue using the prime factorizatio...
2016/01/16
[ "https://math.stackexchange.com/questions/1614501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297795/" ]
$$\begin{align}(2000+16)^{2016}&\equiv 2016\cdot 2000\cdot 16^{2015} + 16^{2016}&\pmod{10000}\\ &\equiv 2000+16^{2016}&\pmod{10000} \end{align}$$ So you need to find the last four digits of $16^{2016}$ and add $2000$. You can actually reduce the exponent modulo $500$, because $16^{2016}\equiv 16^{16}\pmod{625}$ and $...
Since $2016$ is a multiple of $16$, we shall look at the $2016^ {2016}$ modular $625$. Well, following from [Euler`s Theorem](https://en.wikipedia.org/wiki/Euler%27s_theorem), $2016^{2016} \equiv 2016^{16} \pmod {625}$. Note that $2016^ {15}=(2000+16)^ {15} \equiv16^ {15} \pmod {625}$, following from the [Binomial th...
1,614,501
> > Find the last $4$ digits of $2016^{2016}$. > > > Technically I was able to solve this question by I used Wolfram Alpha and modular arithmetic so the worst I had to do was raise a $4$ digit number to the $9$th power. I would do $2016^2 \equiv 4256^2 \equiv \cdots$ and then continue using the prime factorizatio...
2016/01/16
[ "https://math.stackexchange.com/questions/1614501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297795/" ]
Since $2016$ is a multiple of $16$, we shall look at the $2016^ {2016}$ modular $625$. Well, following from [Euler`s Theorem](https://en.wikipedia.org/wiki/Euler%27s_theorem), $2016^{2016} \equiv 2016^{16} \pmod {625}$. Note that $2016^ {15}=(2000+16)^ {15} \equiv16^ {15} \pmod {625}$, following from the [Binomial th...
Allow me give a different answer from the three ones above and easy to achieve with a calculator, please. This direct procedure can be applied to similar calculations. One can simply use one or both properties, $A^{abc}=(A^a)^{bc}\equiv(B)^{bc}\pmod{M}$ and $A^n=A^r\cdot A^s\equiv(B)\cdot (C)\pmod{M}$ where $r+s=n$, ...
1,614,501
> > Find the last $4$ digits of $2016^{2016}$. > > > Technically I was able to solve this question by I used Wolfram Alpha and modular arithmetic so the worst I had to do was raise a $4$ digit number to the $9$th power. I would do $2016^2 \equiv 4256^2 \equiv \cdots$ and then continue using the prime factorizatio...
2016/01/16
[ "https://math.stackexchange.com/questions/1614501", "https://math.stackexchange.com", "https://math.stackexchange.com/users/297795/" ]
$$\begin{align}(2000+16)^{2016}&\equiv 2016\cdot 2000\cdot 16^{2015} + 16^{2016}&\pmod{10000}\\ &\equiv 2000+16^{2016}&\pmod{10000} \end{align}$$ So you need to find the last four digits of $16^{2016}$ and add $2000$. You can actually reduce the exponent modulo $500$, because $16^{2016}\equiv 16^{16}\pmod{625}$ and $...
Allow me give a different answer from the three ones above and easy to achieve with a calculator, please. This direct procedure can be applied to similar calculations. One can simply use one or both properties, $A^{abc}=(A^a)^{bc}\equiv(B)^{bc}\pmod{M}$ and $A^n=A^r\cdot A^s\equiv(B)\cdot (C)\pmod{M}$ where $r+s=n$, ...
7,757,506
I have the following code: ``` <tr> <td class="add_border_bold" nowrap="nowrap">Schedule Saved (days)</td> <td width="100%" class="add_border"> <%# Eval("schedule_saved_days", "{0:0,0}")%> &nbsp; </td> </tr> <tr> <td class="add_border_bold" nowrap="nowrap">Scheduled Saved in Months</td> ...
2011/10/13
[ "https://Stackoverflow.com/questions/7757506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397344/" ]
Try something like this: ``` <%#(Convert.ToDecimal(Eval("schedule_saved_days")) / 30).ToString("0,0")%> ```
I think something like this is what you are after: ``` <%# (Eval("schedule_saved_days") / 30).ToString("0,0")%> ```
7,757,506
I have the following code: ``` <tr> <td class="add_border_bold" nowrap="nowrap">Schedule Saved (days)</td> <td width="100%" class="add_border"> <%# Eval("schedule_saved_days", "{0:0,0}")%> &nbsp; </td> </tr> <tr> <td class="add_border_bold" nowrap="nowrap">Scheduled Saved in Months</td> ...
2011/10/13
[ "https://Stackoverflow.com/questions/7757506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397344/" ]
Try something like this: ``` <%#(Convert.ToDecimal(Eval("schedule_saved_days")) / 30).ToString("0,0")%> ```
You will need to cast it as an integer first and then divide by 30 ``` <%# ((int)Eval("schedule_saved_days", "{0:0,0}")/30).tostring() %> ```
58,909,925
I need to call a function when modal close. My code as follows, ``` function openModal(divName) { $("#"+divName+"Modal").modal({ overlayClose: false, closeHTML: "<a href='#' title='Close' class='modal-close'>X</a>", onShow: function (dialog) { $('#simplemodal-container').css...
2019/11/18
[ "https://Stackoverflow.com/questions/58909925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3703534/" ]
For `Grouper` need datetimes, so format of datetimes is changed by [`MultiIndex.set_levels`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.MultiIndex.set_levels.html) after aggregation and also added `closed='left'` for left closing bins: ``` df1['date'] = pd.to_datetime(df1['date']) df2 = df1.gro...
1. Add a column that maps the date to a week 2. Do something with grouping: i.e. `df.groupby(df.week).count()`
1,996,482
I thought I would write some quick code to download the number of "fans" a Facebook page has. For some reason, despite a fair number of iterations I've tried, I can't get the following code to pick out the number of fans in the HTML. None of the other solutions I found on the web correctly match the regex in this case...
2010/01/03
[ "https://Stackoverflow.com/questions/1996482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207201/" ]
``` import urllib import re fbhandle = urllib.urlopen('http://www.facebook.com/Microsoft') pattern = "6 of(.*)fans" #this wild card doesnt appear to work? compiled = re.compile(pattern) ms = compiled.search(fbhandle.read()) print ms.group(1).strip() fbhandle.close() ``` You needed to use `re.search()` instead. Usin...
don't need regex ``` import urllib fbhandle = urllib.urlopen('http://www.facebook.com/Microsoft') for line in fbhandle.readlines(): line=line.rstrip().split("</span>") for item in line: if ">Fans<" in item: rind=item.rindex("<span>") print "-->",item[rind:].split()[2] ``` outp...
1,996,482
I thought I would write some quick code to download the number of "fans" a Facebook page has. For some reason, despite a fair number of iterations I've tried, I can't get the following code to pick out the number of fans in the HTML. None of the other solutions I found on the web correctly match the regex in this case...
2010/01/03
[ "https://Stackoverflow.com/questions/1996482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207201/" ]
``` import urllib import re fbhandle = urllib.urlopen('http://www.facebook.com/Microsoft') pattern = "6 of(.*)fans" #this wild card doesnt appear to work? compiled = re.compile(pattern) ms = compiled.search(fbhandle.read()) print ms.group(1).strip() fbhandle.close() ``` You needed to use `re.search()` instead. Usin...
Evan Fosmark already gave a good answer. This is just more info. You have this line: ``` pattern = "6 of(.*)fans" ``` In general, this isn't a good regular expression. If the input text was: "6 of 99 fans in the whole galaxy of fans" Then the match group (the stuff inside the parentheses) would be: " 99 fans in ...
1,996,482
I thought I would write some quick code to download the number of "fans" a Facebook page has. For some reason, despite a fair number of iterations I've tried, I can't get the following code to pick out the number of fans in the HTML. None of the other solutions I found on the web correctly match the regex in this case...
2010/01/03
[ "https://Stackoverflow.com/questions/1996482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/207201/" ]
Evan Fosmark already gave a good answer. This is just more info. You have this line: ``` pattern = "6 of(.*)fans" ``` In general, this isn't a good regular expression. If the input text was: "6 of 99 fans in the whole galaxy of fans" Then the match group (the stuff inside the parentheses) would be: " 99 fans in ...
don't need regex ``` import urllib fbhandle = urllib.urlopen('http://www.facebook.com/Microsoft') for line in fbhandle.readlines(): line=line.rstrip().split("</span>") for item in line: if ">Fans<" in item: rind=item.rindex("<span>") print "-->",item[rind:].split()[2] ``` outp...
28,664,098
I'm extremely new to code writing, so please forgive any ignorance on my part. I have a simple bit of code in which I would like to make the visibility of a couple of "outerCircle" divs turn off when the user clicks anywhere on the page. I have tried several ways, but it's just not working. If anyone has a suggestion, ...
2015/02/22
[ "https://Stackoverflow.com/questions/28664098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4484550/" ]
edited my answer since I've been learning a thing or two these last couple of weeks ;) you need an apostrophe around to: and cc: lists with more than one recipient you also need an apostrophe around any main body text or attachments you're going to send if you put an apostrophe into your VBA editor, it just comments ...
Write proper programs. You can't send attachments with mailto. The standard only allows one parameter (although everyone accepts many). ``` Set emailObj = CreateObject("CDO.Message") emailObj.From = "dc@gmail.com" emailObj.To = "dc@gmail.com" emailObj.Subject = "Test CDO" emailObj.TextBody = "Test CD...
13,357,583
Which Platforms are supported for the IBM Social Business Toolkit SDK? Can I run the SDK on an IBM Domino/XWork server?
2012/11/13
[ "https://Stackoverflow.com/questions/13357583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1167759/" ]
The following platforms are supported: * WebSphere Application Server 7 * WebSphere Portal 8 * Domino Server 8.5 * Tomcat 7 So yes, you can use the SDK on an IBM Domino/XWork Server.
The SDK should work with minimal amount of work on any J2EE server. The WebSphere Application Server, Portal 8, Domino 8.5, Tomcat 7 are the tested versions.
2,535,958
I have obtained the crosshair cursor from NSCursor crosshairCursor. Then, how can i change to it. I don't want to call enclosingScrollView to setDocumentCursor as [[view enclosingScrollView] setDocumentCursor:crosshaircursor ];
2010/03/29
[ "https://Stackoverflow.com/questions/2535958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276989/" ]
I found out an easy way to do this: setStyle("arrowButtonWidth", 0); In my custom combobox, I set the initial width of the arrow button to 0. Then in the List change event, ``` addEventListener(ListEvent.CHANGE, changeHandler); ``` if the size of the dataprovider is greater than 1, the arrow width is set back ...
How about creating a simple custom canvas with both components (textinput and combo) with two states. You display the textinput in one state and the combo in the other state? ``` <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300"> <mx:states> ...
2,535,958
I have obtained the crosshair cursor from NSCursor crosshairCursor. Then, how can i change to it. I don't want to call enclosingScrollView to setDocumentCursor as [[view enclosingScrollView] setDocumentCursor:crosshaircursor ];
2010/03/29
[ "https://Stackoverflow.com/questions/2535958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276989/" ]
I found out an easy way to do this: setStyle("arrowButtonWidth", 0); In my custom combobox, I set the initial width of the arrow button to 0. Then in the List change event, ``` addEventListener(ListEvent.CHANGE, changeHandler); ``` if the size of the dataprovider is greater than 1, the arrow width is set back ...
You could also provide a custom button skin for either case, which would be accessible by changing the styleName. This would potentially be lighter weight than user294702's solution. For example, using dummy names for source and symbols: ``` .comboBoxWithArrow { up-skin: Embed(source="graphics.swf",symbol="comboArr...
274,229
How can we convert a .tif with .tfw .htm into a raster KML/KMZ file to open in google earth? I have a .tif file along with a .tfw and .htm files. I wanted to open it in Google Earth. Converting the .tif into a raster in KML/KMZ format will solve the problem. I was working in MATLAB mapping toolbox and did not find a so...
2018/03/09
[ "https://gis.stackexchange.com/questions/274229", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/116129/" ]
You can use [`ST_Dimension`](https://postgis.net/docs/ST_Dimension.html), which returns the largest dimension of a GeometryCollection's components. For an undoubtedly excellent reason that's well-rooted in thoughtfully-drafted specifications, [`ST_Dimension`](https://postgis.net/docs/ST_Dimension.html) produces dimens...
I think there must be a more elegant way of doing this, but one approach would be to combine three UNION SELECTS with three CASE statements testing for each geomety type, combined with an ST\_IsEmpty test returning -1 if the type is not found, and then use the max of the result of that in a final select. This returns a...
41,505,806
``` create table abc(name character(n), name1 character varying(n), name2 text); ``` In the above query what is the limit of 'n'? ``` create table abc(name character(), name1 character varying(), name2 text); ``` In the above query what it will take if we not specify any value to 'n'?
2017/01/06
[ "https://Stackoverflow.com/questions/41505806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6853242/" ]
[Quote from the manual](https://www.postgresql.org/docs/current/static/datatype-character.html) > > The notations `varchar(n)` and `char(n)` are aliases for `character varying(n)` and `character(n)`, respectively. `character` without length specifier is equivalent to `character(1)`. If `character varying` is used wit...
While creating table the limit of 'n' for CHARACTER and CHARACTER VARYING datatype is, ``` MIN MAX CHARACTER(n) --> 1 to 10485760 characters(not bytes) CHARACTER VARYING(n) --> 1 to 10485760 characters(not bytes) ``` * character() if you do not specify the...
5,333,734
I am messing around trying to write a small web crawler. I parse out a url from some html and sometimes I get a php redirect page. I am looking for a way to get the uri of the redirected page. I am trying to use System.Net.WebRequest to get a a stream using code like this ``` WebRequest req = WebRequest.Creat...
2011/03/17
[ "https://Stackoverflow.com/questions/5333734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/582080/" ]
``` HttpWebRequest req = (HttpWebRequest)WebRequest.Create(link); req.AllowAutoRedirect = true; reg.AutomaticDecompression = DecompressionMethods.GZip; StreamReader _st = new StreamReader(_req.GetResponseStream(), System.Text.Encoding.GetEncoding(req.CharacterSet)); ``` the AllowAutoRedirect will aut...
Check the "Location" header from the response - it should contain the new URL.
2,921,389
I am creating a doc file and writing a text containing ^m in it and facing issue. Does this ^m is a special character for doc file ? If I replace ^m with some other characters (like ^m with >m or any other) then It works fine. I faced this issue with other characters too like ^a and few other. What could be the solutio...
2010/05/27
[ "https://Stackoverflow.com/questions/2921389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276279/" ]
^M -- as in: Control-M -- is often used to type a 'carriage return' character (ASCII-code 13 in decimal, 0D in hex).
It could be that it is evaluated as an logical expression. Try to escape it either prepending ' before it, or \ .
53,773,278
I created two Rectangles. I want to add events on them. For example when mouse hover on one, the hovered one will change color, can do resize or drag them(rectangles) to other place... I was just wondering if I could control the drawn graphic, or it will like *Microsoft Paint* that after you painted, the object can no...
2018/12/14
[ "https://Stackoverflow.com/questions/53773278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10309167/" ]
Also, you can create your own control like: ``` class RectangleControl : Control { public void FillRectangle(Color color) { this.BackColor = color; } } ``` Then : ``` private void Form1_Paint(object sender, PaintEventArgs e) { RectangleControl rect1 = new RectangleControl() { Pa...
You can use Panel control instead. Just add 2 panel controls as you would like them to be arranged and add 2 event handlers: ``` private void panel1_MouseHover(object sender, EventArgs e) { panel1.BackColor = Color.Yellow; } private void panel1_MouseLeave(object sender, EventArgs e) { ...
53,773,278
I created two Rectangles. I want to add events on them. For example when mouse hover on one, the hovered one will change color, can do resize or drag them(rectangles) to other place... I was just wondering if I could control the drawn graphic, or it will like *Microsoft Paint* that after you painted, the object can no...
2018/12/14
[ "https://Stackoverflow.com/questions/53773278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10309167/" ]
Also, you can create your own control like: ``` class RectangleControl : Control { public void FillRectangle(Color color) { this.BackColor = color; } } ``` Then : ``` private void Form1_Paint(object sender, PaintEventArgs e) { RectangleControl rect1 = new RectangleControl() { Pa...
You can monitor the `MouseMove`. Here's code using `MouseMove` and some brush values used by the rectangles. ``` using System.Drawing; using System.Windows.Forms; namespace Question_Answer_WinForms_App { public partial class Form1 : Form { public Brush outerRectangleBrush = Brushes.DeepSkyBlue; ...
53,773,278
I created two Rectangles. I want to add events on them. For example when mouse hover on one, the hovered one will change color, can do resize or drag them(rectangles) to other place... I was just wondering if I could control the drawn graphic, or it will like *Microsoft Paint* that after you painted, the object can no...
2018/12/14
[ "https://Stackoverflow.com/questions/53773278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10309167/" ]
Also, you can create your own control like: ``` class RectangleControl : Control { public void FillRectangle(Color color) { this.BackColor = color; } } ``` Then : ``` private void Form1_Paint(object sender, PaintEventArgs e) { RectangleControl rect1 = new RectangleControl() { Pa...
@FJF, writing a ms-paint like application is not a complicated task. Windows Forms applications are using GDI+ to render graphics. so you can write a simple paint application using WindowsForms. @nexolini uses a panel to do some draws. actually Ms-Paint does the same somehow. Ms-Paint is a Single-Layer Editor. So you...
17,519,572
Can not figure out why this error keeps getting thrown: ``` -[__NSCFString bytes]: unrecognized selector sent to instance 0xc3eb200 ``` for this code: ``` - (void)parser:(SBJsonStreamParser *)parser foundObject:(NSDictionary *)dict { empty = NO; for (NSDictionary *valueDictionary in [dict objectForKey:@"Contacts"]...
2013/07/08
[ "https://Stackoverflow.com/questions/17519572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/663192/" ]
The error message shows that ``` Thecontacts = [valueDictionary objectForKey:@"Contacts"]; ``` returns a `NSString` object, not a `NSData` object as you expected. I assume that you created the JSON using something like ``` [NSString stringWithFormat:@"%@", Contacts] ``` which uses the `description` method of `NSD...
Not applicable for the case above but I got the exact same message when I omitted the external parameter name from init declaration. I am new to Objective C/Swift world so the concept of different parameter name externally and internally is novel still and easy to overlook, I am posting here as a convenience to those w...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
As of Laravel 5.4, whenever you use `foreach` or `for` within blade files you will now have access to a [$loop variable](https://laravel.com/docs/5.4/blade#the-loop-variable). The $loop variable provides many useful properties and methods, one of them being useful here, for skipping the first iteration. See the example...
There is two way to do this: 1- if your $key is numeric you can use: ``` @foreach($aboutcontent as $key => $about) @if($key == 0) @continue @endif code @endforeach ``` 2- if a $key is not numeric use @loop->first as a condition
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
There is two way to do this: 1- if your $key is numeric you can use: ``` @foreach($aboutcontent as $key => $about) @if($key == 0) @continue @endif code @endforeach ``` 2- if a $key is not numeric use @loop->first as a condition
Alternatively, you can just remove the first element from the array before iterating: ``` @php array_shift($aboutcontent); @endphp @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> ...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
As of Laravel 5.4, whenever you use `foreach` or `for` within blade files you will now have access to a [$loop variable](https://laravel.com/docs/5.4/blade#the-loop-variable). The $loop variable provides many useful properties and methods, one of them being useful here, for skipping the first iteration. See the example...
You need some kind of a counter if you want to do that in blade: ``` <?php $count = 0;?> @foreach @if($count>1) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="captio...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
Try This : ``` @foreach($aboutcontent as $key => $about) @if($key > 0){ <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="caption"> <h3>{{ $about->aboutname }}</h3> ...
Alternatively, you can just remove the first element from the array before iterating: ``` @php array_shift($aboutcontent); @endphp @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> ...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
As of Laravel 5.4, whenever you use `foreach` or `for` within blade files you will now have access to a [$loop variable](https://laravel.com/docs/5.4/blade#the-loop-variable). The $loop variable provides many useful properties and methods, one of them being useful here, for skipping the first iteration. See the example...
Assuming that the `$aboutcontents` is numeric array just use the good old fashioned `for` loop instead of your new fangled `foreach` ``` // Notice you start at 1 and your first // elem is 0 so... ta da... skipped @for ($i = 1; $i < count($aboutcontents); $i++){ $about = $aboutcontents[$i]; //This is the object ...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
You need some kind of a counter if you want to do that in blade: ``` <?php $count = 0;?> @foreach @if($count>1) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="captio...
Try this ``` @foreach($aboutcontent->slice(1) as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="caption"> <h3>{{ $about->aboutname }}</h3> <p>...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
Try This : ``` @foreach($aboutcontent as $key => $about) @if($key > 0){ <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="caption"> <h3>{{ $about->aboutname }}</h3> ...
Assuming that the `$aboutcontents` is numeric array just use the good old fashioned `for` loop instead of your new fangled `foreach` ``` // Notice you start at 1 and your first // elem is 0 so... ta da... skipped @for ($i = 1; $i < count($aboutcontents); $i++){ $about = $aboutcontents[$i]; //This is the object ...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
Alternatively, you can just remove the first element from the array before iterating: ``` @php array_shift($aboutcontent); @endphp @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> ...
Try this ``` @foreach($aboutcontent->slice(1) as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="caption"> <h3>{{ $about->aboutname }}</h3> <p>...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
As of Laravel 5.4, whenever you use `foreach` or `for` within blade files you will now have access to a [$loop variable](https://laravel.com/docs/5.4/blade#the-loop-variable). The $loop variable provides many useful properties and methods, one of them being useful here, for skipping the first iteration. See the example...
Try this ``` @foreach($aboutcontent->slice(1) as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="caption"> <h3>{{ $about->aboutname }}</h3> <p>...
38,896,260
I am trying to fill my webpage with content based on content stored in a database. However, I would like to skip the first item; I want to start looping from the second item. How can I achieve this? ``` @foreach($aboutcontent as $about) <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" cla...
2016/08/11
[ "https://Stackoverflow.com/questions/38896260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5875799/" ]
As of Laravel 5.4, whenever you use `foreach` or `for` within blade files you will now have access to a [$loop variable](https://laravel.com/docs/5.4/blade#the-loop-variable). The $loop variable provides many useful properties and methods, one of them being useful here, for skipping the first iteration. See the example...
Try This : ``` @foreach($aboutcontent as $key => $about) @if($key > 0){ <div class="col-md-4 text-center"> <div class="thumbnail"> <img id="" class="img-responsive" src="images/{{ $about->aboutimg }}" alt=""> <div class="caption"> <h3>{{ $about->aboutname }}</h3> ...
13,828,661
I am having trouble with an hw problem in my CS class. The problem has to do with creating a class in python. Heres the prompt Your class should be named Student, and you should define the following methods: `__init__`: This method initializes a Student object. Parameters: a name, a GPA, and a number of units taken ...
2012/12/11
[ "https://Stackoverflow.com/questions/13828661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786698/" ]
Let’s go through some points which will hopefully help you: ### Constructor (`__init__`) > > If the GPA or number of units is negative, sets it to 0. > > > So you probably want to check each separately: ``` if units < 0: units = 0 if GPA < 0: GPA = 0 ``` ### Update method Methods in general take a r...
I'll help you to complete the question, but let me point out a little mistake first: ``` if units <0 and GPA <0: units=0 GPA=0 ``` This will set units and GPA to zero only if they are both negative. You'll want to set each to zero if it's negative, even if the other is not. Change it to: ``` if units < 0: units...
10,830,183
I have a working node.js / express based server and am using jade for templating. Usually there is no problem but a couple of times every day I get an error message when requsting any page. The error is 'failed to locate view'. I don't know why i get this error since it worked fine just minutes before. The question h...
2012/05/31
[ "https://Stackoverflow.com/questions/10830183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1306716/" ]
You can add an error handling middleware. ``` app.use(function handleJadeErrors(err, req, res, next) { // identify the errors you care about if (err.message === 'failed to locate view') { // do something sensible, such as logging and then crashing // or returning something more useful to the client } els...
Try this: ``` app.use(function (req, res, next) { fs.exists(__dirname + '/views/' + req.url.substring(1) + '.jade', function (exists) { if(!exists) { console.log(err); return next(); } res.render(req.url.substring(1), { title: "No Controller", user: req.session.user }); } }); ...
10,965,285
I am trying to loop over an array. However, I would like to add a 15 second delay between each array value. This will write value 1 to console, then count down 15 seconds and write value 2 to console, and so on. I'm not sure exactly how to do this. My code as of now just outputs the numbers 15 all the way to 1 on the...
2012/06/09
[ "https://Stackoverflow.com/questions/10965285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1320596/" ]
``` // loop through array with all new ids var i = 0, l = adArray.length; (function iterator() { console.log(adArray[i]); if(++i<l) { setTimeout(iterator, 15000); } })(); ``` Something like this?
There's a really simple pattern for this type of iterator, using closure scope to store a `loop` counter and a nested `looper()` function which runs the `setTimeout()` iterator. The `looper()` function actually iterates the `loop` count, so there is no need for a `for` or `do`/`while` construct. I use this pattern ofte...
10,965,285
I am trying to loop over an array. However, I would like to add a 15 second delay between each array value. This will write value 1 to console, then count down 15 seconds and write value 2 to console, and so on. I'm not sure exactly how to do this. My code as of now just outputs the numbers 15 all the way to 1 on the...
2012/06/09
[ "https://Stackoverflow.com/questions/10965285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1320596/" ]
``` // loop through array with all new ids var i = 0, l = adArray.length; (function iterator() { console.log(adArray[i]); if(++i<l) { setTimeout(iterator, 15000); } })(); ``` Something like this?
Use this function to make it easier to run: ``` function loopArr(arr, callback, time, infinite){ console.log('loop run'); var i=0, total=arr.length-1; var loop=function(){ // RUN CODE console.log('loop arr['+i+']'); callback( arr[i] ); if (i < total )...
10,965,285
I am trying to loop over an array. However, I would like to add a 15 second delay between each array value. This will write value 1 to console, then count down 15 seconds and write value 2 to console, and so on. I'm not sure exactly how to do this. My code as of now just outputs the numbers 15 all the way to 1 on the...
2012/06/09
[ "https://Stackoverflow.com/questions/10965285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1320596/" ]
There's a really simple pattern for this type of iterator, using closure scope to store a `loop` counter and a nested `looper()` function which runs the `setTimeout()` iterator. The `looper()` function actually iterates the `loop` count, so there is no need for a `for` or `do`/`while` construct. I use this pattern ofte...
Use this function to make it easier to run: ``` function loopArr(arr, callback, time, infinite){ console.log('loop run'); var i=0, total=arr.length-1; var loop=function(){ // RUN CODE console.log('loop arr['+i+']'); callback( arr[i] ); if (i < total )...
20,319,104
In my C++ code I use templates a lot.. that might be an understatement. The end result is that the type names take more than 4096 characters and watching the GCC output is painful to say the least. In several debugging packages like GDB or Valgrind one can request that C++ types not be demangled. Is there a similar wa...
2013/12/02
[ "https://Stackoverflow.com/questions/20319104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055685/" ]
This will never work. When you make the template class: ``` B<A<int> > ``` this class no longer has the function f() within its definition. If you compile this with clang++ you'll get the error (where test is of type `B<A<int> >`): ``` error: no member named 'f' in 'B<A<int> >' test.f(); ~~~~ ^ ``...
You could use `typedef`: ``` typedef queue<int> IntQueue; ``` Obviously, at this example you removed only 2 characters of the type name, but with more complex examples this will narrow down even more chars and will improve readability of your code. Also, this may help the auto-completing feature of your IDE (if you...
20,319,104
In my C++ code I use templates a lot.. that might be an understatement. The end result is that the type names take more than 4096 characters and watching the GCC output is painful to say the least. In several debugging packages like GDB or Valgrind one can request that C++ types not be demangled. Is there a similar wa...
2013/12/02
[ "https://Stackoverflow.com/questions/20319104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055685/" ]
People are suffering from this particular shortcoming of C++ error reporting for ages. :) However, more verbose error reports are generally better for complex problem solving. Thus, a better approach is to let g++ to spit out the long and verbose error message and then use a stand alone error parser to make the outpu...
You could use `typedef`: ``` typedef queue<int> IntQueue; ``` Obviously, at this example you removed only 2 characters of the type name, but with more complex examples this will narrow down even more chars and will improve readability of your code. Also, this may help the auto-completing feature of your IDE (if you...
20,319,104
In my C++ code I use templates a lot.. that might be an understatement. The end result is that the type names take more than 4096 characters and watching the GCC output is painful to say the least. In several debugging packages like GDB or Valgrind one can request that C++ types not be demangled. Is there a similar wa...
2013/12/02
[ "https://Stackoverflow.com/questions/20319104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055685/" ]
People are suffering from this particular shortcoming of C++ error reporting for ages. :) However, more verbose error reports are generally better for complex problem solving. Thus, a better approach is to let g++ to spit out the long and verbose error message and then use a stand alone error parser to make the outpu...
This will never work. When you make the template class: ``` B<A<int> > ``` this class no longer has the function f() within its definition. If you compile this with clang++ you'll get the error (where test is of type `B<A<int> >`): ``` error: no member named 'f' in 'B<A<int> >' test.f(); ~~~~ ^ ``...
336,838
I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?
2011/09/17
[ "https://superuser.com/questions/336838", "https://superuser.com", "https://superuser.com/users/97637/" ]
[`compress`](http://en.wikipedia.org/wiki/Compress) (the Unix command, ported to Linux and others) itself only has one file extension that is used for its output, and that is `.z` There are other compression algorithms (and their associated programs) that compress files differently for different results. Some popular...
While `.z` is the oldest, as old as Unix, the most prevalent compression format is `.zip` because it is the only format supported natively by all versions and flavors of Windows since Windows 98.
336,838
I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?
2011/09/17
[ "https://superuser.com/questions/336838", "https://superuser.com", "https://superuser.com/users/97637/" ]
[`compress`](http://en.wikipedia.org/wiki/Compress) (the Unix command, ported to Linux and others) itself only has one file extension that is used for its output, and that is `.z` There are other compression algorithms (and their associated programs) that compress files differently for different results. Some popular...
I prefer compressing my data using \*.rar with WinRAR as it is completely customizable. I use it because I can choose how much I want to compress it and I can set passwords to protect my archive. If I'm doing something involving disk images, I'll compress to \*.iso or \*.daa using PowerISO. Whenever I'm not on one of...
336,838
I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?
2011/09/17
[ "https://superuser.com/questions/336838", "https://superuser.com", "https://superuser.com/users/97637/" ]
[`compress`](http://en.wikipedia.org/wiki/Compress) (the Unix command, ported to Linux and others) itself only has one file extension that is used for its output, and that is `.z` There are other compression algorithms (and their associated programs) that compress files differently for different results. Some popular...
If its linux based, .tar.gz or .tar.bz - otherwise known as your humble tarball. In windows, .zip - natively supported since windows XP. You also often encounter .rar (especially with files from slightly dubious sources) and .7z (windows/open source software most often). If you want to be ABSOLUTELY sure your file wil...
336,838
I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?
2011/09/17
[ "https://superuser.com/questions/336838", "https://superuser.com", "https://superuser.com/users/97637/" ]
While `.z` is the oldest, as old as Unix, the most prevalent compression format is `.zip` because it is the only format supported natively by all versions and flavors of Windows since Windows 98.
I prefer compressing my data using \*.rar with WinRAR as it is completely customizable. I use it because I can choose how much I want to compress it and I can set passwords to protect my archive. If I'm doing something involving disk images, I'll compress to \*.iso or \*.daa using PowerISO. Whenever I'm not on one of...
336,838
I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?
2011/09/17
[ "https://superuser.com/questions/336838", "https://superuser.com", "https://superuser.com/users/97637/" ]
If its linux based, .tar.gz or .tar.bz - otherwise known as your humble tarball. In windows, .zip - natively supported since windows XP. You also often encounter .rar (especially with files from slightly dubious sources) and .7z (windows/open source software most often). If you want to be ABSOLUTELY sure your file wil...
While `.z` is the oldest, as old as Unix, the most prevalent compression format is `.zip` because it is the only format supported natively by all versions and flavors of Windows since Windows 98.
336,838
I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?
2011/09/17
[ "https://superuser.com/questions/336838", "https://superuser.com", "https://superuser.com/users/97637/" ]
If its linux based, .tar.gz or .tar.bz - otherwise known as your humble tarball. In windows, .zip - natively supported since windows XP. You also often encounter .rar (especially with files from slightly dubious sources) and .7z (windows/open source software most often). If you want to be ABSOLUTELY sure your file wil...
I prefer compressing my data using \*.rar with WinRAR as it is completely customizable. I use it because I can choose how much I want to compress it and I can set passwords to protect my archive. If I'm doing something involving disk images, I'll compress to \*.iso or \*.daa using PowerISO. Whenever I'm not on one of...
1,124,217
This is the answer I can come up with. I get the complete opposite of what I'm supposed to get. My mistake is probably in the first part, could anyone help me out? $$\left|x^2+x+1\right|\:\ge \left|x^2+x\right|-\left|1\right|\ge \left|x^2\right|-\left|x\right|-\left|1\right|\:=\:x^2\:-\left|x\right|-1 $$ and $$ \frac{...
2015/01/28
[ "https://math.stackexchange.com/questions/1124217", "https://math.stackexchange.com", "https://math.stackexchange.com/users/174613/" ]
If $f(g(b))=b$ for all $b$, then in particular for $b:=f(a)$ we also have $f(g(f(a))=f(a)$ for all $a$. Now, using that $f$ is injective we arrive at $g(f(a)=a$.
The relation $\forall b \in B, f(g(b)) = b$ implies that $f$ is surjective, since for any $b\in B$, the element $g(b) \in A$ is sent to it by $f$. Thus $f$ is both an injection and a surjection, and therefore a bijection.
1,124,217
This is the answer I can come up with. I get the complete opposite of what I'm supposed to get. My mistake is probably in the first part, could anyone help me out? $$\left|x^2+x+1\right|\:\ge \left|x^2+x\right|-\left|1\right|\ge \left|x^2\right|-\left|x\right|-\left|1\right|\:=\:x^2\:-\left|x\right|-1 $$ and $$ \frac{...
2015/01/28
[ "https://math.stackexchange.com/questions/1124217", "https://math.stackexchange.com", "https://math.stackexchange.com/users/174613/" ]
If $f(g(b))=b$ for all $b$, then in particular for $b:=f(a)$ we also have $f(g(f(a))=f(a)$ for all $a$. Now, using that $f$ is injective we arrive at $g(f(a)=a$.
Yes. From the stated assumptions, it is straightforward to prove that $f$ is surjective, as follows. Let $b \in B$. Then since $f(g(b)) = b$, $b$ is in the image of $f$.
2,689,794
I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using `Me.Controls.Count` - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single fo...
2010/04/22
[ "https://Stackoverflow.com/questions/2689794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67361/" ]
Most MSForms controls are windowless (as in they are not true windows, rather they are drawn directly by the VBA Forms engine as graphical objects) which are "light-weight" by comparison. This means you can dump more onto a Userform than you could using equivalent non-MSForms controls on a VB6 form. I don't know what ...
No hard n soft rule... ---------------------- --- There is no definite number of controls that VBA will limit you to. It is entirely dependent on the system you run it on. As a general rule of thumb: * Reduce the number of controls. * Use grid controls instead of arrays of buttons. * Split it into logical forms...
2,689,794
I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using `Me.Controls.Count` - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single fo...
2010/04/22
[ "https://Stackoverflow.com/questions/2689794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67361/" ]
No hard n soft rule... ---------------------- --- There is no definite number of controls that VBA will limit you to. It is entirely dependent on the system you run it on. As a general rule of thumb: * Reduce the number of controls. * Use grid controls instead of arrays of buttons. * Split it into logical forms...
I try to stay away from userforms that are this big. I much prefer to use the spreadsheet to handle the data collection for things this big. If there are dependencies, then I hide/unhide rows as necessary, or use multiple sheets. I find it is an easier solution (sometimes).
2,689,794
I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using `Me.Controls.Count` - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single fo...
2010/04/22
[ "https://Stackoverflow.com/questions/2689794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67361/" ]
Most MSForms controls are windowless (as in they are not true windows, rather they are drawn directly by the VBA Forms engine as graphical objects) which are "light-weight" by comparison. This means you can dump more onto a Userform than you could using equivalent non-MSForms controls on a VB6 form. I don't know what ...
There is no hard limit for the maximum number of controls on a form. As mentioned in another answer, this will vary based on your hardware, Excel version, and operating system. Sadly, I have had too much experience at building VBA forms with too many controls. :( I can say, that once you get above about 200 controls,...
2,689,794
I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using `Me.Controls.Count` - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single fo...
2010/04/22
[ "https://Stackoverflow.com/questions/2689794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67361/" ]
Most MSForms controls are windowless (as in they are not true windows, rather they are drawn directly by the VBA Forms engine as graphical objects) which are "light-weight" by comparison. This means you can dump more onto a Userform than you could using equivalent non-MSForms controls on a VB6 form. I don't know what ...
I try to stay away from userforms that are this big. I much prefer to use the spreadsheet to handle the data collection for things this big. If there are dependencies, then I hide/unhide rows as necessary, or use multiple sheets. I find it is an easier solution (sometimes).
2,689,794
I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using `Me.Controls.Count` - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single fo...
2010/04/22
[ "https://Stackoverflow.com/questions/2689794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67361/" ]
There is no hard limit for the maximum number of controls on a form. As mentioned in another answer, this will vary based on your hardware, Excel version, and operating system. Sadly, I have had too much experience at building VBA forms with too many controls. :( I can say, that once you get above about 200 controls,...
I try to stay away from userforms that are this big. I much prefer to use the spreadsheet to handle the data collection for things this big. If there are dependencies, then I hide/unhide rows as necessary, or use multiple sheets. I find it is an easier solution (sometimes).
21,376,200
I am using open cv and C++. I have 2 face images which contain marker points on them. I have already found the coordinates of the marker points. Now I need to align those 2 face images based on those coordinates. The 2 images may not be necessarily of the same height, that is why I can't figure out how to start alignin...
2014/01/27
[ "https://Stackoverflow.com/questions/21376200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217694/" ]
In your case, you cannot apply the homography based alignment procedure. Why not? Because it does not fit in this use case. It was designed to align flat surfaces. Faces (3D objects) with markers at different places and depths are clearly no planar surface. Instead, you can: 1. try to match the markers between images...
Define "align". Or rather, notice that there does not exist a unique warp of the face-side image that matches the overlapping parts of the frontal one - meaning that there are infinite such warps. So you need to better specify what your goal is, and what extra information you have, in addition to the images and a fe...
1,400,937
Suppose there is a bash file named "`uploadme`" in the `/usr/bin` folder. *I am using that file as a command*, and passing the **file names** as a **command line argument**, in any subdirectory of my home directory. Suppose I am in the directory directory`/home/John/documents/`. In that directory, there is only one f...
2022/04/05
[ "https://askubuntu.com/questions/1400937", "https://askubuntu.com", "https://askubuntu.com/users/1584541/" ]
The tool `realpath` does that: ``` echo $(realpath "$1") ```
There is an environment variable named `PWD` that holds the name of the current/working directory. Also, the command `pwd` prints the current directory. So you can get the full path to the passed argument in your script with `$PWD/$1`.
1,400,937
Suppose there is a bash file named "`uploadme`" in the `/usr/bin` folder. *I am using that file as a command*, and passing the **file names** as a **command line argument**, in any subdirectory of my home directory. Suppose I am in the directory directory`/home/John/documents/`. In that directory, there is only one f...
2022/04/05
[ "https://askubuntu.com/questions/1400937", "https://askubuntu.com", "https://askubuntu.com/users/1584541/" ]
There is an environment variable named `PWD` that holds the name of the current/working directory. Also, the command `pwd` prints the current directory. So you can get the full path to the passed argument in your script with `$PWD/$1`.
If you're trying to get the path to the command, rather than to the file argument, you can use the `which` command. If, inside the scripted command, you want to know where the command is (rather than the current working directory or the full path to a parameter file), you can look at `which $0` (for scripts) or `argv[0...
1,400,937
Suppose there is a bash file named "`uploadme`" in the `/usr/bin` folder. *I am using that file as a command*, and passing the **file names** as a **command line argument**, in any subdirectory of my home directory. Suppose I am in the directory directory`/home/John/documents/`. In that directory, there is only one f...
2022/04/05
[ "https://askubuntu.com/questions/1400937", "https://askubuntu.com", "https://askubuntu.com/users/1584541/" ]
The tool `realpath` does that: ``` echo $(realpath "$1") ```
You can use `readlink -f`: ``` readlink -f "$1" ```
1,400,937
Suppose there is a bash file named "`uploadme`" in the `/usr/bin` folder. *I am using that file as a command*, and passing the **file names** as a **command line argument**, in any subdirectory of my home directory. Suppose I am in the directory directory`/home/John/documents/`. In that directory, there is only one f...
2022/04/05
[ "https://askubuntu.com/questions/1400937", "https://askubuntu.com", "https://askubuntu.com/users/1584541/" ]
The tool `realpath` does that: ``` echo $(realpath "$1") ```
If you're trying to get the path to the command, rather than to the file argument, you can use the `which` command. If, inside the scripted command, you want to know where the command is (rather than the current working directory or the full path to a parameter file), you can look at `which $0` (for scripts) or `argv[0...
1,400,937
Suppose there is a bash file named "`uploadme`" in the `/usr/bin` folder. *I am using that file as a command*, and passing the **file names** as a **command line argument**, in any subdirectory of my home directory. Suppose I am in the directory directory`/home/John/documents/`. In that directory, there is only one f...
2022/04/05
[ "https://askubuntu.com/questions/1400937", "https://askubuntu.com", "https://askubuntu.com/users/1584541/" ]
You can use `readlink -f`: ``` readlink -f "$1" ```
If you're trying to get the path to the command, rather than to the file argument, you can use the `which` command. If, inside the scripted command, you want to know where the command is (rather than the current working directory or the full path to a parameter file), you can look at `which $0` (for scripts) or `argv[0...
54,140,610
I have a `<ul>`, which has many `<li>` , each of which contains an anchor tag. The xpath of the list elements looks like the one: `String xpath = "//*[@id='page']/section[8]/div/div/div[2]/div/ul/li[";` `String part2 = "]/a";` My task involves clicking on each of those links, coming back to the homepage, and then cl...
2019/01/11
[ "https://Stackoverflow.com/questions/54140610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2451763/" ]
Are you allowed to store their count? :) ``` int len = driver.findElements(By.xpath("//*[@id='page']/section[8]/div/div/div[2]/div/ul/li/a").size() ``` `findElements` will find all elements matching the locator (note the plural), return as a List, on which you you get the size (length). So now you'll know the upper...
Since you mentioned each `<li>` tag has one anchor tag. That means the number of `<li>` and `<a>` tags are same. You can use `driver.findElements` to get a list of all `<li>` tags and save them in an ArrayList and can easily get the size of the `<li>` tags. This value would be the iterator value for you in the loop you...
67,920,614
So I have read mutliple articles regarding this issue, but none worked for my case. What happens: When you toggle the keyboard by clicking an entry, on Android the whole layout is shifted up by as much as the keyboard is big. iOS simply renderes the keyboard on top. This is ofc terrible, and especially for the chat a...
2021/06/10
[ "https://Stackoverflow.com/questions/67920614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15801387/" ]
You can create class that extend grid in shared code firstly. ``` public class KeyboardView: Grid{} ``` Then create a custom renderer to do the resize control. ``` [assembly: ExportRenderer(typeof(KeyboardView), typeof(KeyboardViewRenderer))] namespace KeyboardSample.iOS.Renderers { public class KeyboardViewRendere...
Install **Xamarin.IQKeyboardManager** nuget package in Xamarin.Forms iOS project only. Add below code in AppDelegate.cs before Forms.init() ``` IQKeyboardManager.SharedManager.Enable = true; IQKeyboardManager.SharedManager.KeyboardDistanceFromTextField = 20; ``` When you click on entry, it will shift UI up as you m...
1,978,657
Is there any predefined UIViewController/NavigationController in the IPhone API as same as "Info" in "Phone/Mobile" application? For example, suppose I received a call or dialed a number, which is not stored in address book. Then later I wanna see the details of that number, IPhone navigates me to the "Info" view whe...
2009/12/30
[ "https://Stackoverflow.com/questions/1978657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233177/" ]
no, you don't have something this specific in the API. if you want that kind of viewcontroller, you'll have to roll your own.
After going through the API, I found that "ABUnknownPersonViewController" is suitable to serve the purpose. And also "ABPersonViewController" can be used to display the if you get a contact details (if that contact exists in the Address Book). Thanks refulgentis and Brad Larson for your comments. refulgentis, as I sa...
1,978,657
Is there any predefined UIViewController/NavigationController in the IPhone API as same as "Info" in "Phone/Mobile" application? For example, suppose I received a call or dialed a number, which is not stored in address book. Then later I wanna see the details of that number, IPhone navigates me to the "Info" view whe...
2009/12/30
[ "https://Stackoverflow.com/questions/1978657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233177/" ]
no, you don't have something this specific in the API. if you want that kind of viewcontroller, you'll have to roll your own.
Not really. Use a `UITableViewController` in the "grouped" style (`UITableViewStyleGrouped`) and initialize your cells with the `UITableViewCellStyleValue2` style, adding a custom `tableHeaderView` if necessary to contain any title / non-listworthy information.
1,978,657
Is there any predefined UIViewController/NavigationController in the IPhone API as same as "Info" in "Phone/Mobile" application? For example, suppose I received a call or dialed a number, which is not stored in address book. Then later I wanna see the details of that number, IPhone navigates me to the "Info" view whe...
2009/12/30
[ "https://Stackoverflow.com/questions/1978657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233177/" ]
It's just a UITableViewController with a complex header view and a different text color for the cell's textLabel.
After going through the API, I found that "ABUnknownPersonViewController" is suitable to serve the purpose. And also "ABPersonViewController" can be used to display the if you get a contact details (if that contact exists in the Address Book). Thanks refulgentis and Brad Larson for your comments. refulgentis, as I sa...
1,978,657
Is there any predefined UIViewController/NavigationController in the IPhone API as same as "Info" in "Phone/Mobile" application? For example, suppose I received a call or dialed a number, which is not stored in address book. Then later I wanna see the details of that number, IPhone navigates me to the "Info" view whe...
2009/12/30
[ "https://Stackoverflow.com/questions/1978657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233177/" ]
It's just a UITableViewController with a complex header view and a different text color for the cell's textLabel.
Not really. Use a `UITableViewController` in the "grouped" style (`UITableViewStyleGrouped`) and initialize your cells with the `UITableViewCellStyleValue2` style, adding a custom `tableHeaderView` if necessary to contain any title / non-listworthy information.
1,978,657
Is there any predefined UIViewController/NavigationController in the IPhone API as same as "Info" in "Phone/Mobile" application? For example, suppose I received a call or dialed a number, which is not stored in address book. Then later I wanna see the details of that number, IPhone navigates me to the "Info" view whe...
2009/12/30
[ "https://Stackoverflow.com/questions/1978657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233177/" ]
After going through the API, I found that "ABUnknownPersonViewController" is suitable to serve the purpose. And also "ABPersonViewController" can be used to display the if you get a contact details (if that contact exists in the Address Book). Thanks refulgentis and Brad Larson for your comments. refulgentis, as I sa...
Not really. Use a `UITableViewController` in the "grouped" style (`UITableViewStyleGrouped`) and initialize your cells with the `UITableViewCellStyleValue2` style, adding a custom `tableHeaderView` if necessary to contain any title / non-listworthy information.
28,922,247
I'm working on cleaning up the tags of mp3s that contain the web links. I tried the regular expression that clears up the web-links ``` (\w+)*(\s|\-)(\w+\.(\w+)) with $1 ``` However, when I try using the same on the file, the extension is replaced. How do I make the extension here, .mp3 as an exception with the abo...
2015/03/08
[ "https://Stackoverflow.com/questions/28922247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3003393/" ]
based on your examples, use this pattern ``` \s-\s\S+(?=\.) ``` and replace w/ nothing ``` \s # <whitespace character> - # "-" \s # <whitespace character> \S # <not a whitespace character> + # (one or more)(greedy) (?= # Look-Ahead \...
If you replace by the first group only, sthi will only be the name of the file, extension not included. Your regex do not actually catch the extension, it stops after the top level domain (.com) of the website. You should use: ``` (\w+)(\s\-\s)(\w+\.\w+.\w+)(\.\w+) ``` ![Regular expression visualization](https://ww...
53,744,017
I have the following User entity that contains list of friends, that is the list of the same entitities. ``` @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String name; private String surname; List<User> friends; } ``` How is the ...
2018/12/12
[ "https://Stackoverflow.com/questions/53744017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9505054/" ]
Here you can use the following example: ``` @Entity @Table(name = "users") class User implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String name; private String surname; @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name = "use...
You must add appropriate `@OneToMany` and `@ManyToOne` annotations. You must introduce a new field which would work as a parent. ``` @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String name; private String surname; @ManyToOne ...
27,351,274
I've got two select queries I need to combine into one result. ``` /* Count of all classes students have passed */ /* A */ SELECT COUNT(TECH_ID) as Number1, ct.SUBJ, ct.COU_NBR FROM [ISRS].[ST_COU] st JOIN [ISRS].[CT_COU_SQL] ct ON st.COU_ID = ct.COU_ID WHERE GRADE = 'A' OR Grade = 'B' or Grade = 'C' GROUP BY ct.SU...
2014/12/08
[ "https://Stackoverflow.com/questions/27351274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4335893/" ]
If I understand your requirement correctly, you want the footer to sit at the bottom of the content box. One solution is to make the content box `position:relative` and move the footer inside it, so that its `position:absolute` will bind it to the content box, and the `bottom:0` will achieve the desired effect of havi...
you can use the sticky footer trick. Wrap all of your content in a wrapper excluding the footer, set `min-height:100%` and `margin: -(footer height)` on said wrapper to keep it at the bottom: [FIDDLE](http://jsfiddle.net/wn6uvske/6/) **UPDATE** You can take the `header` section out and use CSS `calc()` to adjust the...