I want to convert an int to a string but if it is a single digit I want to add a leading 0
Is that one of the built in format options? or do I have to do it manually?
If I want to validate that a text box contains an integer greater than or equal to zero. Do I need to use TWO asp:CompareValidator controls: one with a DataTypeCheck operator and one with a GreaterThanEqual operator?
Or is the datatype operator redundant? Can I just use a single validator with the GreaterThanEqual operator (and the type set to Integer)?
Hey,
Don't find any good answer to this simple question about helper/utils classes:
Why would i create a singleton (stateless) rather than static methods?
Why an object instance could be needed while the object has no state?
Sometimes i really don't know what to use...
i am trying to load database values from 6 - 7 tables on a single page i.e users, their post e.g with $.load(); and it is taking from 15+ seconds to load but i want to load that page from 1-5 seconds ...i know it depends on internet connection speed but how can i do that ....
I trying my luck to manage my mailbox with python.
My example code is
for eachmail in mailbox.mbox(mboxfile):
print eachmail['From']
I got following by printing entire content.
Delivered-To
Subject
To
Content-Type
MIME-Version
Message-Id
Is there any full document showing what are all the properties I can get from the mbox message instance? Python docs doesn't specify any of these http://docs.python.org/library/mailbox.html#mailbox.mbox
I've got the following at the start of a script
Param(
[string]$command,
[string]$version = "1.1.0"
)
This is fine, only I need for $version to not be a positional parameter, so that if you type
.\script.ps1 run argument
Then $args should contain argument and $version should be 1.1.0.
Is this even possible? I know I can do it with a c# cmdlet, but it would be massively more convenient if I could deliver this as a single script.
to run a single file you can run in mysql
.\ filename
or you outside of mysql you can run
mysql < filename
I have a directory of sql files so I'm trying to run them all at once by using a wildcard
*.sql
but it doesn't work.
Any ideas?
I have daemon script written in Perl that checks a database tables for rows, pulls them in one by one, sends the contents via HTTP post to another service, then logs the result and repeats (only a single child). When there are rows present, the first one is posted and logged immediately, but every subsequent one is delayed for around 20 seconds. There are no sleep()'s running, and I can't find any other obvious delays. Any ideas?
Does asynchronous call always create a new thread?
Example:
If Javascript is single threaded then how can it do an async postback? Is it actually blocking until it gets a callback? If so, is this really an async call?
Hello,
I have a ajax, jquery form which works fine, but returning a message from <div></div>. I want to return a value from a db query, a single value.
How do I go about doing it.
Thanks
Dave
I want to insert a record into a sqlite table if its actually not inserted.
Let's say it has three fields pk, name, address
I want to INSERT new record with name if that name not added preveously.
Can we do with this in a single Query. Seems like its slightly different from SQL Queries sometimes.
Thanks you,
Tharindu Madushanka
I have two text files, I want to place a text in the middle of another, I did some research and found information about adding single strings:
I have a comment in the second text file called STUFFGOESHERE, so I tried:
sed '/^STUFFGOESHERE/a file1.txt' file2.txt
sed: 1: "/^STUFFGOESHERE/a long.txt": command a expects \ followed by text
So I tried something different, trying to place the contents of the text based on a given line, but no luck.
Any ideas?
Here's the scenario:
Many users access an application (running on tomcat), the user's data is segmented into multiple databases, say each db containing 1000 user's data.
Now is it somehow possible to have 100s of tomcat servers running on 'inexpensive' PC class machines with each connecting to a single db, with user's session getting passed to appropriate tomcat and becoming 'Sticky' there. Can have some sort of 'gateway' deciding which user goes where and doing the load-balancing appropriately.
Would make a great scalability solution :)
Our development cycle rarely requires a branch so we have what tfs appears to consider a single, never-ending development cycle. Our problem is that each build includes an ever increasing long "Generating list of changesets and updating work items" step that includes all changesets/work items back to day 1.
What is the proper step that we need to perform to formally lock and label (wrong terms I'm sure) the source tree so that a new cycle of changesets and work items can begin.
Thanks!
I have a WPF UI Bound to a collection of AwesomeClass
Now, AwesomeClass has a collection of AwesomeParts objects.
How can I make my UI In such a way that (as an example)
for each AwesomeClass instance, there is a Tab on a tab panel
and then for each awesome part in that, there is an object on a listbox, on that tab.
Basically: Awesomes-Tabs
And Then : Awesome.Awesomeparts-Tabs.Listbox
I'd like to implement "Always on top" configuration option in my application that takes effect immediately.
I know that I can call Shell constructor with ON_TOP style. Is there a way to do that at runtime, that is after Shell instance has already been created?
Suppose I have a Dictionary like so:
Dictionary<string, Stream>
How can I get a list (or IEnumerable or whatever) of JUST the Keys from this dictionary? Is this possible?
I could enumerate the dictionary, and extract the keys one by one, but I was hoping to avoid this.
In my instance, the Dictionary contains a list of filenames (file1.doc, filex.bmp etc...) and the stream content of the file from another part of the application.
Does anyone know how to change these length parameters in the middle of a latex document?
\paperwidth
\paperheight
I would like to define a page size for a single page (possibly two or three). I tried v5.3 of the geometry package, which just added some new features; like \newgeometry. Unfortunately \newgeometry cannot be used to redefine \paperheight and \paperwidth.
Any help would be very appreciated.
Hey,
I need to call "panel.invalidate" outside my form (WINform) class also I need to change some other controls as well, I read similar question here, and tried what they said, but it didn't work and I wasn't convinced at all.
The answer I read was about exposing a public method like this:
public void EnableButton(bool enable)
{
this.myButton.Enabled = enable;
}
Also I made a static instance in the other file
static Form1 myForm = new Form1();
Any useful suggestions??
Hello All
I would like to update a column in Table with reference to other column(s) in same table.
Ex: As in figure below - I would like to update effective endate with min date whichever is greater than effective Start Date of currrent record.
How can this be acheived in T-SQL. Can this be done with single update statement ?
Thanks.
Is there a way to embed multiple dependent assemblies into a single one for projects written on the following platform types: Windows Store Apps, Windows Phone 8, Portable Class Library?
I know that for regular .Net projects there is ILMerge, but on the aforementioned project types it doesn't work. Embedding assemblies as resources and then manually resolving the references using AppDomain.CurrentDomain.AssemblyResolve is not possible either, since AppDomain is not available in these types of project.
Hi,
Is there any way to completely ignore link break and tab characters etc. in RegEx?
For instance, the line break and tab characters could be found anywhere and in any order in the content string.
... [CustomToken \t \r\n Type="" \t \r\n Property="" \n /] ... [CT ...
The is the RegularExpression that I am currently using:
(\[CustomToken).*?(\/\])
.NET API
Regex.Matches(string input, string pattern)
Thanks for your suggestion.
Based on the post it is mentioned (By Brett Porter) that a POM can be read. What i need is to read not only a single pom. I need to read the whole tree of pom's in a multimodule build. Starting with the root pom and it should read automatically the child pom's if it's possible? I need to do this in separate Java Code not in relationship with Maven itself.
I intend to perform opening for reading a single file from many threads using std::ifstream. My concern is if std::ifstream is thread-safe & lock-free?
On Windows, it's possible to program an LSP service on top of Winsock which provides the ability to do a lot of manipulation/etc. with networked applications. For instance, some anti virus applications register an LSP and analyse network traffic that way. Is there a friendly way to accomplish the same sort of thing on OSX?