I'm converting database from Teradata to SqlServer. I've noticed all tables and procedures are named by the prefix "dbo." (e.g. "dbo.Table1").
I would like to know if and how I can get rid of "dbo" because it would make the conversion task a lot more easier.
Hi I have a ActiveX like this:
class CMyActiveX :
public CComObjectRootEx...
...
{
HRESULT FinalContruct(){return S_OK;}
void Start()
{
// a new thread is created here for some task
}
void FinalRelease()
{
// if the thread is alive kill it
}
}
However when browser is closed the method FinalRelease is not called. So the thread keeps alive and a crash is encountered at the exit.
Any idea on this? Thank you!
I am trying to open all ports using this code, why can I not create a loop to perform this function?
http://www.kellbot.com/2010/02/tutorial-writing-a-tcp-server-in-python/
#!/usr/bin/python # This is server.py file
##server.py
from socket import * #import the socket library
n=1025
while n<1050:
##let's set up some constants
HOST = '' #we are the host
PORT = n #arbitrary port not currently in use
ADDR = (HOST,PORT) #we need a tuple for the address
BUFSIZE = 4096 #reasonably sized buffer for data
## now we create a new socket object (serv)
## see the python docs for more information on the socket types/flags
serv = socket( AF_INET,SOCK_STREAM)
##bind our socket to the address
serv.bind((ADDR)) #the double parens are to create a tuple with one element
serv.listen(5) #5 is the maximum number of queued connections we'll allow
serv = socket( AF_INET,SOCK_STREAM)
##bind our socket to the address
serv.bind((ADDR)) #the double parens are to create a tuple with one element
serv.listen(5) #5 is the maximum number of queued connections we'll allow
print 'listening...'
n=n+1
conn,addr = serv.accept() #accept the connection
print '...connected!'
conn.send('TEST')
conn.close()
How do I make this work so that I can specify input range and have the server open all ports up to 65535?
#!/usr/bin/python # This is server.py file
from socket import * #import the socket library
startingPort=input("\nPlease enter starting port: ")
startingPort=int(startingPort)
#print startingPort
def connection():
## let's set up some constants
HOST = '' #we are the host
PORT = startingPort #arbitrary port not currently in use
ADDR = (HOST,PORT) #we need a tuple for the address
BUFSIZE = 4096 #reasonably sized buffer for data
def socketObject():
## now we create a new socket object (serv)
serv = socket( AF_INET,SOCK_STREAM)
def bind():
## bind our socket to the address
serv = socket( AF_INET,SOCK_STREAM)
serv.bind((ADDR)) #the double parens are to create a tuple with one element
serv.listen(5) #5 is the maximum number of queued connections we'll allow
serv = socket( AF_INET,SOCK_STREAM)
print 'listening...'
def accept():
conn,addr = serv.accept() #accept the connection
print '...connected!'
conn.send('TEST')
def close():
conn.close()
## Main
while startingPort<65535:
connection()
socketObject()
bind()
accept()
startingPort=startingPort+1
I'm looking for a component to manage programmaticaly added items (div's) in a parent container.The component should scale child items. Almost like a task bar,if a new item gets added it goes in the div container.
Here's the objective. I have a PHP class and there are one or two of its methods that I would like to override with my own. As I understand OOP (in PHP and in general) I could write a child class that extends it and overrides the functionality of the methods in question.
However, I was wondering if this is the best way of achieving this task and if this is a proper use for child classes or if there is something better in PHP for what I'm trying to do.
Recently, when I tried to explain why Rails is a DSL to an intern at my organisation, I was not able to articulate my reasonings to the effect I would like to. Maybe I do not understand the space well enough to teach the nuances. Redirecting him to Martin Fowler' article or the google ranked one InfoQ or other material has not helped much either.
Can some explain why Rails is a DSL with an example / parallel situation which is not voodoo stuff for someone who is fairly new to the world of code? Understanding the ideology might also help in elaborating the intricacies of the rails ecosystem?
Let's say we have the following function:
foo <- function(x)
{
line1 <- x
line2 <- 0
line3 <- line1 + line2
return(line3)
}
And that we want to change the second line to be:
line2 <- 2
How would you do that?
One way is to use
fix(foo)
And change the function.
Another way is to just write the function again.
Is there another way? (Remember, the task was to change just the second line)
I need to create a vb.net program that consists of a unmovable, always on top bitmap, with no menu bar or anything, and does not show up in the task bar as program.
It needs to always start in the same place.
Essentially I need to mask a part of the screen by using a bitmap that blends into the scenery.
I am not sure which properties I need to tweak to achieve all of this.
How would you implement a search facility within an ASP.NET hybrid application? I'm really tempted to start rebuilding our Intranet application using ASP.NET MVC & Web Forms (mainly MVC though).
I know how to search the dynamic content from a database, but I'm struggling with the static content in the Views. Surely this should be an easy task with routing and a sitemap.
Hi,
In Python script,for every method definition in some C++ code of the form:
return_value ClassName::MethodName(args)
{MehodBody}
,I need to extract three parts: the class name, the method name and the method body for further processing. Finding and extracting the ClassName and MethodName is easy, but is there any simple way to extract the body of the method? With all possible '{' and '}' inside it? Or are regexes unsuitable for such task?
Hi all,
In considering several possible solutions to a recent task, I found myself considering how to get a php file that includes it's own MD5 hash. I ended up doing something else, but the question stayed with me.
Something along the lines of:
<?php
echo("Hello, my MD5 is [MD5 OF THIS FILE HERE]");
?>
Whatever placeholder you have in the file, the second you take its MD5 and insert it, you've changed it.
I have created a windows service in C#.NET that is continuously running. Now when i stop it from the services.msc initially it shows that it has been stopped but after some time when i refresh the services.msc it shows as started again. I also checked in the task manager at the same time, i see that the exe of my application gets killed but starts on its own again.
Please help.
I realize you can make one of each effect, set the same target, and hit .play();, but this produces weird results (acknowledged by Adobe, fixed in Flex 4).
I'm trying to have an object move from the top of the screen to the bottom while it rotates around it's own center. When called independently, both of these effects work perfectly. When called together, the object always rotates around the top left corner. I even tried putting them both inside a <Parallel> tag with no success. Has anyone come up with a workaround?
here is task
How many ways are there to choose from the set {1, 2, . . . , 100} three distinct
numbers so that their sum is even?
first of all sum of three numbers is even if only if
1.all number is even
2.two of them is odd and one is even
i know that
(n) = n!/(k!*(n-k)!
(k)
and can anybody help me to solve this problem
I want to send
www.mydomain.com/approve/SomeFunkyVariable to
www.mydomain.com/home/index.php?option=com_content&task=view&id=574&Itemid=85&approve=someFunkyVariable
What is the rule for this?
Problem/Task:
Write an interface with one method and two classes that implement this interface.
Now write a main method with an array that holds an instance of each class. Using a for-each loop, invoke the method upon each item.
Is this an interview question? (I'm not sure if the author meant to post this as a question or was looking for an answer to the above.)
The idea is to move all of the right elements into the left and the left into the right with an empty space in the middle. The elements can either jump over one or two pieces into an empty space.
LLL[ ]RRR
I'm trying to think of a heuristic for this task. Is the heuristic meant to aid in finding a possible solution, or actually return a number of moves as the solution? How would I express such a heuristic?
desired tree output should be like picture showed in below website.
[web]http://www.all-science-fair-projects.com/science_fair_projects_encyclopedia/upload/6/6d/Binary_search_tree.png
can I take output like that. If I can, how?
(sorry, because I cannot sketch the graph in question task so I must give link )
(language is gcc)(platform is linux)
I am trying to download a list of files from a ftp server using:
NSURL *ftpUrl = [NSURL URLWithString:@"ftp://xxx:[email protected]"];
I HAVE to use FTP, so please do not recommend an alternative. I want to know how to get the list of files from the root directory and also navigate inside folders (of FTP server).
P.S: I do not think external library would be required to accomplish such an easy task, but if I must, any recommendations would be appreciated.
Thank You :)
Hello Everybody,
I've got a question regarding a SQL-select-query:
The table contains several columns, one of which is an Integer-column called "size" - the task I'm trying to perform is query the table for the sum of all rows (their values), or to be more exact get a artifical column in my ResultSet called "overallSize" which contains the sum of all "size"-values in the table. Preferable it would be possible to use a WHERE-clause to add only certain values ("WHERE bla = 5" or something similar).
The DB-engine is HSQLDB (HyperSQL), which is compliant to SQL2008.
Thank you in advance :)
Hello everyone!
So I was just wondering if it was easy to develop a very simple Firefox plugin where you could click a button, and it would execute some Javascript code!
Please note that I have never developed any kind of plugin for firefox, I just want to know if that is an easy task to do (like less than an hour)
Here is my problem.
I need more than one row from the database, and i need the first row for certain task and then go through all the list again to create a record set.
$query = "SELECT * FROM mytable";
$result = mysql_query($query);
$firstrow = //extract first row from database
//add display some field from it
while($row = mysql_fetch_assoc($result)) {
//display all of them
}
Now, how to extract just the first row?
A friend is wanting me to help her convert her flash based website to html. She has an embedded textbox with a scrollbar that is using a flower instead of a normal scrollbar.
Avoiding the obvious question of why a user would want a non-standard element to do this task, is it possible to do this without flash?