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
i have two selects a & b and i join them like:
select * from
(
select n.id_b || ',' || s.id_b ids, n.name, s.surname
from names n,
surnames s where n.id_a = s.id_a
) a
left join
(
select sn.id, sn.second_name
) b on b.id in (a.ids)
in this case join doesn't work :(
The problem is in b.id in (a.ids). But why if it looks like 12 in (12,24) and no result :(
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?
Using a facade controller pattern in .net. It seems as if though it is not efficient BECAUSE, for every event that happens in a domain object(Sales, Register, Schedule, Car) it has to be subscribed to by the controller(use case controller) and then the controller in turn has to duplicate that same event to make it available for the presentation, so that the presentation can show it to the user. Does this make sense? Please comment!
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?
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#.
My iPad app was working fine until I opened up IB and started editing the interface. Now, my application:didFinishLaunchingWithOptions isn't getting called. I understand it's an optional function and it gets skipped if it doesn't exist, but in my case it does. What are some reasons that application:didFinishLaunchingWithOptions method could get skipped?
Thanks in advance for your help!
I am binding a BulletedList control in page load to a datasource, what i want to do is to set custom IDs for this BulletedList's ListItems while binding
This custom ID will be in my current case "li_"+ItemId.ToString()
Sample Code i used to fill the bulletedList:
bulletedList.DataSource = MyDataCollection;
bulletedList.DataTextField = "Name";
bulletedList.DataValueField = "Id";
bulletedList.DataBind();
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?
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
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
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).
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!
I am trying to find out how lucene search works so fast. Cant find any useful docs on the web. If you have anything (short of lucene source code) to read, let me know.
A text search query using mysql5 text search with index takes about 18 minutes in my case. A lucene search for the same query takes less than a second
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?
How is that function pointer better than if-else or switch case? Is it because function pointer helps callback functions and thus promotes asynchronous implementation?
I am writing a client - server system in which I used NON-BLOCKING sockets. My problem is to detect error { while performing send() or write() } that may occur while data transfer. Example lets say, while the data is being transferred the peer crashes. Another case there is some network problem, something like wire unplugged etc.
As of now, I am using a high level ACK, that peer sends after receiving the complete data.
Ripunjay Tripathi
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.
I store file’s attributes (size, update time…) in database. So the problem is how to manage transaction for database and file.
In jee environment, JTA is just able to manage database transaction.
In case, updating database is successful but file operation fails, should I write file-rollback method for this? Moreover, file operation in EJB container violates EJB spec.
What’s your opinion? Thank!
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
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 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..??
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?
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 ?