First time I saw a class Kase, I was scratching my head.
My guess it's something to do with a conflict of the keyboard case. BTW, since when, for which language(S), it becomes a norm?
I've never understood the need of #pragma once when #ifndef #define #endif always works.
I've seen the usage of #pragma comment to link with other files , but setting up the compiler settings was easier with an IDE.
What are some other usages of #pragma that is useful, but not widely known?
Edit:
I'm not just after a list of #pragma directives. Perhaps I should rephrase this question a bit more:
What code have you written with #pragma you found useful?
I have a storyboard like the following
Duration="0:0:1" Completed="DeviceExplorer_Completed"
The animation for some reason does not appear to be working linearly.
If I change the duration to something like Duration="0:0:0.8"
and assign the stroyboard to a MouseEnter event of a button, the animation moves but does not complete for some reason, I move my mouse over the button a few times before it enetually completes...
Any ideas why?
Hi,
I have an application resource of the following
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background" Value="{DynamicResource windowTextBackColor}"/>
<Setter Property="Foreground" Value="{DynamicResource windowsTextForeColor}"/>
</Style>
So all the text blocks in my application should assume those colours.
However the Menu and its containing MenuItems on my Main Window does not take these colours?
I have to do the XAML
for it to assume those colours, Is there a reason why setting a style that targets Text blocks does not work?
Thanks
There is only one text field on a HTML form. Users input some text, press Enter, submit the form, and the form is reloaded. The main use is barcode reading. I use the following code to set the focus to the text field:
<script language="javascript">
<!--
document.getElementById("#{id}").focus()
//-->
</script>
It works most of the time (if nobody touches the screen/mouse/keyboard).
However, when the user click somewhere outside the field within the browser window (the white empty space), the cursor is gone. One a single field HTML form, how can I prevent the cursor from getting lost? Or, how to re-focus the cursor inside the field after the cursor is lost? thx!
I am looking for a step-by-step Mercurial guide for iPhone projects. Please assume:
hg already installed
the audience is comfortable with command line operations
everything is on OS X
As a newbie, I am particular interested in:
what files should be excluded
how to exclude above files
guideline/suggestion of naming builds
any relevant experience to share with
Please do not discuss how hg is better/worse than any other SCS. This is a how-to question, not a why question.
Thanks!
I need to calculate the timestamp of exactly 7 days ago using PHP, so if it's currently March 25th at 7:30pm, it would return the timestamp for March 18th at 7:30pm.
Should I just subtract 604800 seconds from the current timestamp, or is there a better method?
Wordpress themes are beautiful!
Is there any guideline to use Wordpress themes in a rails app? Even better, are there rails app templates which can use the Wordpress themes already?
Thanks!
I have a table in data base which has column MonthNo ,Year ,MonthValue ,AvgYTD and it has values in
1 ROW... 1 , 2010 , 2.3 , 4.0 AND
2 ROW... 2, 2010, 3.3 ,5.0 AND
3 ROW.. 3, 2010, 3.3, 7.9
AND I want output in my SSRS.....
WHEN I SELECT MONTH MARCH USING PARAMETER THEN OUTPUT WILL BE....A TABLE AND IT HAS COLUMN
JAN , FEB , MARCH , AVGYTD and values in row are ..
2.3 ,3.3, 4.3, 7.9
thanks
What is the meaning of *~ in glob syntax? For example, in a sample .hgignore file:
syntax: glob
.DS_Store
*.swp
*~.nib
what is difference between a *~.nib and *.nib ? Thanks
When rotating a View from UIInterfaceOrientationPortrait to UIInterfaceOrientationPortraitUpsideDown on the iPad simulator, there is a white border along one side of the view (see diagram, lower left of the image). The white border shows only on one side, but not the opposite side. How can I prevent (hide) it? Thanks!
In one iPhone app, I'd like to add drop shadows to a few icons dynamically (the angle of the shadow is not fixed). Is there any built-in API for this purpose? If not, how can this be done? Thanks!
Hi,
Im still having issues using HttpWebRequest.
For some reason sometimes in my app the call just times out...
HttpWebRequest req = null;
req =
(HttpWebRequest)WebRequest.CreateDefault(new Uri(aRequest));
req.PreAuthenticate = true;
req.AllowAutoRedirect = true;
req.KeepAlive = false;
.....
resp = (HttpWebResponse)req.GetResponse();
resp.close();
I am closing the response but Im just wondering if it is more likely to fail since Im making requests all over the place?
I tried playing around with the ServicePointManager class hoping it would help but it hasnt really
System.Net.ServicePointManager.DefaultConnectionLimit = 100;
System.Net.ServicePointManager.MaxServicePoints = 100;
This is Part 2 of this question and thanks very much for David's answer. What if I need to extract dates which are bounded by two keywords?
Example:
text = "One 09 Jun 2011 Two 10 Dec 2012 Three 15 Jan 2015 End"
Case 1 bounding keyboards: "One" and "Three"
Result expected: ['09 Jun 2011', '10 Dec 2012']
Case 2 bounding keyboards: "Two" and "End"
Result expected: ['10 Dec 2012', '15 Jan 2015']
Thanks!
A periodic computer generated message (simplified):
Hello user123,
- (604)7080900
- 152
- minutes
Regards
Using python, how can I extract "(604)7080900", "152", "minutes" (i.e. any text following a leading "- " pattern) between the two empty lines (empty line is the \n\n after "Hello user123" and the \n\n before "Regards"). Even better if the result string list are stored in an array. Thanks!
I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it's like a big map. I assume I need to crop it up into smaller tiles. Questions:
what are the right ViewControllers to use?
(link) what is the tile strategy? (I put this in another question, as it's not iPhone specific)
Requirements:
whole image (though cropped) can be scrolled up/down/left/right by swipes
zoom in (up to pixel-to-pixel) out (down to screen-fit-by-height) by the 2-finger operation
memory efficiency by lazy loading tiles
Bonus requirements:
automatic scroll, say from left to right slowly and smoothly
Thanks!
(this is related to another question about implementation on iPhone)
I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it's like a big map. I assume I need to crop it up into smaller tiles. Questions:
what is the tile strategy?
Requirements:
whole image (though cropped) can be scrolled up/down/left/right by swipes
zoom in (up to pixel-to-pixel) out (down to screen-fit-by-height) by the 2-finger operation
memory efficiency by lazy loading tiles
Thanks!
I'm currently working with systems that has quite a lot of configuration settings that are environment specific (Dev, UAT, Production). Does anyone have any suggestions for minimizing the changes needed to the config file when moving between environments as well as minimizing the duplication of data in the config file?
It's mostly Application settings rather than User settings.
The way I'm doing it at the moment is something similar to this:
<DevConnectionString>xyz</DevConnectionString>
<DevInboundPath>xyz</DevInboundPath>
<DevProcessedPath>xyz</DevProcessedPath>
<UatConnectionString>xyz</UatConnectionString>
<UatInboundPath>xyz</UatInboundPath>
<UatProcessedPath>xyz</UatProcessedPath>
...
<Environment>Dev</Environment>
And then I have a class that reads in the Environment setting via the My.Settings class (it's VB project) and then uses that to decide what other settings to retrieve. This leads to too much duplication though so I'm not sure if it's worth it.
I zipped a rails project from OS X and sent it to a colleague who works on Windows. He updated the source, zipped the whole project folder and sent the zip file back to me.
After unzipping the project, I found that the file permissions information is kind of lost. For example, the script/server is changed from -rwxr-xr-x to -rw-r--r--. Is there a way to preserver the file permission flags, when transferring files between mac and windows?
Thanks
Chinese characters can be view horizontally and vertically. I want to let users have both options. How can this be done in an iPhone views?
e.g.
+-------------------------+ +-------------------------+
| Hello, I am a newbie. | | b a H |
| | | i m e |
| | | e l |
| | ---> | . a l |
| | | o |
| | | n , |
| | | e |
| | | w I |
+-------------------------+ +-------------------------+
I am look for a server side PDF library (or command line tool) which can:
split a multi-page PDF file into individual PDF files, based on
a search result of the PDF file content
Examples:
Search "Page ???" pattern in text and split the big PDF into 001.pdf, 002,pdf, ... ???.pdf
A server program will scan the PDF, look for the search pattern, save the page(s) which match the patten, and save the file in the disk.
It will be nice with integration with PHP / Ruby. Command line tool is also acceptable. It will be a server side (linux or win32) batch processing tool. GUI/login is not supported. i18n support will be nice but no required. Thanks~
So according to my testing, If you have something like:
Module modA = new AbstractModule() {
public void configure() {
bind(A.class).to(AImpl.class);
bind(C.class).to(ACImpl.class);
bind(E.class).to(EImpl.class);
}
}
Module modB = New AbstractModule() {
public void configure() {
bind(A.class).to(C.class);
bind(D.class).to(DImpl.class);
}
}
Guice.createInjector(Modules.overrides(modA, modB)); // gives me binding for A, C, E AND D with A overridden to A->C.
But what if you want to remove the binding for E in modB? I can't seem to find a way to do this without having to break the bind for E into a separate module. Is there a way?
In a new app, I plan to let users download their own files and stored them inside iPhone. The process is typically:
iPhone present a web page by UIWebView, in which there are several links to .zip files
the user browser the page and click on one of the .zip file link
iPhone downloads the file into the iPhone document folder, closes WebView, acknowledges the user when download is complete
How can that be done? Thanks