Hello,
I'd like to know if the executing thread is the one that created a given control instance (to prevent cross-thread if it's not).
Is that possible ?
Thx.
Hello,
I am trying to use this query to return every instance where the variable $d['userID'] is equal to the User ID in a separate table, and then echo the username tied to that user ID.
Here's what I have so far:
$uid = $d['userID'];
$result = mysql_query("SELECT u.username
FROM users u
LEFT JOIN comments c
ON c.userID = u.id
WHERE u.id = $uid;")$row = mysql_fetch_assoc($result);
echo $row['username'];
Certain settings in the Settings app allow you to add rows to tables within the interface (for instance, within the Mail settings you can add accounts)
Is this done with a settings bundle? How is this done?
I have a Queue of items I want to process in a thread, and any instance of a class can add items to the Queue to be processed.
My idea for doing this is to have a static Thread in the class that processes the items, the only problem is that I don't know where to start this thread, since I can't start it in its initialization.
Is there a way I can start a static thread? Or should I be changing the architecture completely?
This is useful if you are trying to create class methods metaprogramatically:
def self.create_methods(method_name)
# To create instance methods:
define_method method_name do
...
end
# To create class methods that refer to the args on create_methods:
???
end
My answer to follow...
I was wondering if there was any recommended max size for MDF and/or LDF Files for an SQL server instance.
For example, if I want to create a 400 GBytes Database, is there a rule to help me decide how many mdf files I should create ? or should I just go ahead and create a single gigantic 400Gbytes mdf file?
If so is this going to somehow affect the database performances ?
When creating a new instance of a MyClass as an argument to a function like so:
class MyClass
{
MyClass(int a);
};
myFunction(MyClass(42));
does the standard make any grantees on the timing of the destructor?
Specifically, can I assume that the it is going to be called before the next statement after the call to myFunction() ?
Many Windows apps (like Skype or MSN for instance) don't let you start multiple instances, rather trying to run it a 2nd time just leaves the existing version running.
Is this typically done in some simple way - the start-menu shortcut is a 'wrapper' app around the main app - or is there some registry magic you can do to delegate the problem to Windows itself?
Specifically dealing with Win32 here (unmanaged C++) but happy to hear more general solutions as long as they are workable on Windows XP or alter.
I have the following 2 macros:
#define SCOPED_ENUM_HEADER(NAME) struct NAME{ enum _NAME{
#define SCOPED_ENUM_FOOTER(NAME) };}; typedef NAME::_NAME NAMEtype;
Only the first instance of NAME get remplaced by the passed NAME. What's wrong with it?
Is is to be used in such a way:
SCOPED_ENUM_HEADER(LOGLEVEL)
UNSET,
FILE,
SCREEN
SCOPED_ENUM_FOOTER(LOGLEVEL)
Thanks you
Hi,
I am trying to make an exit button for my application. Anyhow I am able to track all the instance of activity in my application and then finish them all. But still some activity remain alive in some cases. Dont know how. Is there any method to kill a particular application in android. Or any other way can I exit from my application.
Thanks
If I have a template definition like the one below, can someone provide a code sample for how I would actually instantiate an instance of this with two of my own classes?
template <class T1, class T2>
class LookUpTable {
public:
LookUpTable();
void set(Tl x, T2* y);
T2* get(Tl x);
};
Thanks.
Hey!
Has anybody used a good obfuscator for PHP?, I've tried some but they dont work for very big projects. They can't handle variables that are included in one file and used in another, for instance.
Or do you have any other tricks for stopping the spread of your great code? :)
I have a table with anniversary dates. I want a query that returns me rows of anniversaries coming up in the next 10 days. For instance:
birthdate
---------
1965-10-10
1982-05-25
SELECT birthdate FROM Anniversaries WHERE mystical_magical_mumbo_jumbo <= 10
+------------+
| birthdate |
+------------+
| 1982-05-25 |
+------------+
1 row in set (0.01 sec)
I'd like to keep the query in the form x <= 10, because I'll use that number 10 in other parts of the query, and if I set it to a variable, I can change it once everywhere by changing the variable, and not have to re-write the query.
I have a column of states, and, depending on the query, I want to order by results by a particular state, then by id (Asc or Desc, depending). For instance, I might want to show all rows with state "HI", sorted by ID desc, and then all the other rows, sorted by id desc.
I was hoping I could do this in one query, rather than getting all my favored state results, and then getting the rest. Can I?
I need a way to see all the defined variables of the current PHP instance.
By currently defined I mean all the globals, all the local to THIS scope and all the locals to other scopes.
Is there something built in?
(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSLog(@"delet it");
// Delete the row from the data source.
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
why is this crashing my application
I would like to have in my Flex application the ability to post objects (for instance images or text items) where user can drag/drop for absolute positioning on the screen, resize it and rotate it (although not high priority). I'm wondering if there is a library that would do so out of the box or do you recommend implementing my own?
For example, I open a file called "abc.txt". Now I want to search for all occurrences of "he is" and "first" simultaneously. I want to be able to do a search forward i.e. Ctrl-s and I'll reach the next instance of either of the two search strings.
Hello, could some one recommend a way to get page name from a url using JavaScript?
For instance if I have http://www.cnn.com/news/1234/news.html?a=1&b=2&c=3
I just need to get "news.html" string
Thanks!
My table has records for every minute (for instance the column name is date), now I want to fetch records with an interval of 5 minutes!
Can it be done at database level?
I am using Django with MySQL
I have two different C# applications that are running at the same time.
I would like both of them to be able to access the same instance of a DLL (also in C#).
My DLL is thread-safe so I was hoping this would be possible but I'm not sure how.
Any help or advice would be much appreciated.
Hello,
How can I programmatically retrieve the current connection type (eg. LAN or Direct connection).
InternetGetConnectedState(&ConTypeRet, 0) isn't very reliable.
For instance, I'm connected to a wireless network, but ConTypeRet is 18 which is INTERNET_CONNECTION_LAN & INTERNET_RAS_INSTALLED. Isn't there anyway to make sure that ConTypeRet is either INTERNET_CONNECTION_LAN or INTERNET_CONNECTION_MODEM
Hello,
We can restrict type of method parameters; for example, we should say that function parameter should be an instance of object described in class with name "Some Class".
function some_function(Some_Class $object) {
}
Is there any php native posibilities to restrict method parameter with two or more classes? For examle, "Some Class" or "Some Class2" or "Some Class3".
Or maybe there is any way to restrict method parameter with classes which implements interface with name "Some_Interface"?
Thank you.