Hi,
Lets say I have a string " Hello World"
How can I use a regular expression to return the number of spaces I have in the string. In this case it would be '2'.
Thanks
when i send realtime media message,
socket were blocked and shut down itself.
how can i deal with this case?
some answers are buffer is not large enough,so can someone give me some demo?thanks
Hello,
Is it possible to create a filter in a Drupal 6 View that is only applied for registered users?
For one filter I need I'm using the user vote (With fivestar and votingapi) to know if they user already voted this node or not, and when the user is annonymous, is working as if all the votes from all the annonymous users where from the same. This is why I need to add this filter, but ignore it in case the user is annonymous.
Thanks a lot in advance for the help!
Trying to do something similiar to how sourceforge starts the download on the page, and uses a direct link in case it doesn't work.
I can't seem to locate the javascript they use to start the downlaod popup.
Exampe link: http://sourceforge.net/projects/htmlparser/files/Integration-Builds/2.0-20060923/HTMLParser-2.0-SNAPSHOT-bin.zip/download
Hello everyone,
I'm interested in building a JBoss service. Because I'm reusing some existing code, the service must be able to talk SSL/TLS and Protocol Buffers.
The documentation I see on the JBoss wiki makes it look like services have their transport and data interpretation handled by JBoss itself. Is it really the case?
How could I implement this requirement?
Regards,
M-A
On SQLITE this way fine. I switch to mysql and instead of ??? i get ???. The column is TEXT or sometimes VARCHAR(255) (i believe its VARCHAR(255) in this case).
How do i have mysql save the characters properly?
I have a lot of Perl scripts that looks something like the following. What it does is that it will automatically open any file given as a command line argument and in this case print the content of that file. If no file is given it will instead read from standard input.
while ( <> ) {
print $_;
}
Is there a way to do something similar in Python without having to explicitly open each file?
Hi,
i don't understand this little thing:
Suppose, we have "Person" model
class Person < ActiveRecord::Base
end
Why Person.all works ?
Person.all.each { |p| do_something }
This syntax tells us, that we have Person class-object instanciated somewhere ?
Or is it some convention over configuration case ?
I have a new client that really just has a need for a CMS setup. If she is going to need training (and she will) on how to use joomla as software, I'm going to charge her support fees but I also want to provide her with a useful resource in case I'm too busy to help her out.
Anyone got a good user manual recommendation for Joomla?
Hello,
I need to execute 3 parallel tasks and after completion of each task they should call the same function which prints out the results.
I don't understand in .net why we have Asychronous calling (delegate.BeginInvoke() & delegate.EndInvoke()) as well as Thread class?
I'm little confused which one to use when? Now in this particular case, what should I use Asychronous calling or Thread class?
I'm using C#.
Are the "modify" operators like +=, |=, &= etc atomic?
I know ++ is atomic (if you perform x++; in two different threads "simultaneously", you will always end up with x increased by 2, as opposed to x=x+1 with optimization switched off.)
What I wonder is whether variable |= constant, and the likes are thread-safe or do I have to protect them with a mutex?
(...or is it CPU-dependent? In this case, how is it on ARM?)
I have the string
a.b.c.d
I want to count the occurrences of '.' in an idiomatic way, preferably a one-liner.
(Previously I had expressed this constraint as "without a loop", in case you're wondering why everyone's trying to answer without using a loop).
I want to pass a rest in a netconnection call, something like this:
public function requestData(service : String, ...params) : void
{
nc.call(service, params);
}
this doesn't work since the call is expecting each parameter to be separated by commas, like:
nc.call(service, params[0], params[1], params[2]);
I've read some posts about apply, but I can't find a solution for this specific case.
I want to develop a plugin web project for a web project.
In this case i have to build an aspx which needs
to use site.master of the main
web project. Is it possible using site.master from any other webreference?
I have a datagrid control which is bound to a table which containing more than 1000 records. And i want to show only 25 records once a time. I have used paging in datagrid. But each time the next page index is set, query is fired again. This takes lots of time. So what is the easiest way to bound data in this case to improve performance..??
I have 2 models:
class A(Model):
#Some Fields
objects = ClassAManager()
class B(A):
#Some B-specific fields
I would expect B.objects to give me access to an instance of ClassAManager, but this is not the case....
>>> A.objects
<app.managers.ClassAManager object at 0x103f8f290>
>>> B.objects
<django.db.models.manager.Manager object at 0x103f94790>
Why doesn't B inherit the objects attribute from A?
I'd like to set up an additional log file in symfony, so that some messages (payment processing in my case) would go to a different file from the rest of symfony. Is it possible? Here's my current log configuration from factories.yml:
all:
logger:
param:
level: debug
loggers:
sf_file_debug:
param:
level: notice
file: /var/log/symfony/%SF_ENVIRONMENT%/%SF_APP%.log
Hey there you lot, is there a way that I can open a lightbox (in this case iBox) from within an IFRAME and have the actual lightbox open in the Parent page?
sigh I am confusing myself here!
I would like to track metrics that can be used to improve my team’s software development process, improve time estimates, and detect special case variations that need to be addressed during the project execution.
Please limit each answer to a single metric, describe how to use it, and vote up the good answers.
Actually its the mono version of asp.net, XSP.
In my begin request function i check the url and rewrite when necessary. In one case i do
context.RewritePath("~/App_Data/public" + path);
When i try to request images or anything i get a 404 instead of the content. Why?
What are those pro/subtle techniques that SQL provides and not many know about which also cut code and improve performance?
eg: I have just learned how to use CASE statements inside aggregate functions and it totally changed my approach on things.
Are there others?
I use BroadcastReceiver to intercept incoming call on Android phone as below
tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
Bundle bundle = intent.getExtras();
String number = bundle.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
In the "private number" case, I tested on two devices, it shows the number as -1 on HTC Wildfire and -2 on Galaxy S. I checked the android.telephony.PhoneNumberUtils but it could't help me.
Is there a function or a generic way to detect a private number on Android phone? Thanks
I've had geben running perfectly on previous versions of Ubuntu. After the upgrade, and installing the latest version of geben (0.26), it only half works. Specifically, when in context mode, local variables are always marked as undefined.
Has anybody successfully gotten geben up and running under Ubuntu 10.04, or is this a bug in geben (I've reported it as one, but thought I'd check here just in case there is a workaround).
geben 0.26
xdebug 2.0.5
emacs 23.1.1
5.3.2-1ubuntu4.1
Thanks!
I have a silly use case for eclipse:
At work, they use 2 spaces for a tab character. Indentation looks really squashed and I'm finding it obstructs readability.
Now, I can't set Eclipse to use 4 spaces for a tab as it'll edit any files I change, and obviously don't want to violate the coding standards.
So, can I have a custom view onto my document, with saving maintaining the original spacing?
Cheers