I have a list of class names and methods that can only be read during runtime. Is it possible to create a class dynamically like that? I'm currently using C# 4.0.
I really appreciate the possibility to define regions in your code, as it improves the readability insanely.
Anyways, I'd like to have everyone using the same convention in all classes (with the predefined order of all regions) like:
Private Fields
Constructors
Class Properties
Event Handlers
etc...
Do you have any proposition how this division could look like (What regions have sense and what names should they have) and in which order should they be defined ?
I got the group names by using
ContactList clist=(ContactList)pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
String[] s=clist.getCategories();
and now i want the groupid like i am getting the contact id using Contact.uid
- (IBAction)randomnum{
int randomNumber1 = 1+ arc4random() %(49);
label1.text = [NSString stringWithFormat:@"d", randomNumber];
Local declaration of randomNumber hides instance variable.
How can i get round this warning?
thanks
I ve connected my mobile phone to my PC and used this,
string[] lPorts = System.IO.Ports.SerialPort.GetPortNames();
and the result was an array of port names
"COM4"
"COM3"
"COM1"
"COM7"
"COM6"
Now,How to find which serial port is currently used/to which port my mobile phone is connected in c#?
I have a script that has a GET variable: $_GET['percentage']
I have a MySQL table of data.
Now lets say that there are 100 rows of data in this table.
In pseudo-code:
SELECT data FROM table
Now would it be possible to select $_GET['percentage'] of random data from table?
For example (again in pseudo-code):
$_GET['percentage'] = 10;
SELECT 10% of data from table order by rand()
If this IS possible, how could I do it?
I frequently see a code snippet like this in class instance methods:
static NSString *myString = @"This is a string.";
I can't seem to figure out why this works. Is this simply the objc equivalent of a #define that's limited to the method's scope? I (think) I understand the static nature of the variable, but more specifically about NSStrings, why isn't it being alloc'd, init'd?
Thanks~
I'm trying to read property name but I'm not shore how.
Is it possible in ObjC to get string "theProperty" from self.theProperty?
I know how to read all properties (with "class_copyPropertyList") and their names (with "property_getName") but couldn't find a way to do something like:
NSString *text = [self.theProperty somehowReadThePropertyName];
// expected result is: text == @"theProperty"
Any ideas?
We have link to some page (with html code), that page have one img, which attributes title and alt are equal.
Script must open link, grab the src attribute of img which title=alt, and throw the value into some variable.
How to do it?
Thanks.
I have a program which places structures in a linked list based on the 'name' they have stored in them.
To find their place in the list, i need to figure out if the name im inserting is earlier or later in the alphabet then those in the structures beside it.
The names are inside the structures, which i have access to.
I don't need a full comaparison if that is more work, even just the first letter is fine.
Thanks for the help!
I would like to debug my separately running JSP/Struts/Tomcat/Hibernate application stack using the Eclipse IDE debugger. How do I setup the java JVM and eclipse so that I can set breakpoints, monitor variable values, and see the code that is currently executing?
i wonder where one can find template interfaces.
eg. i am creating these classes that implements iLog:
DatabaseLog
ScreenLog
FileLog
i wonder what methods should a typical Log class have?
is there a set of interfaces you could just implement/learn from rather than reinvent the wheel and have to think about the method names.
eg. Interfaces:
iLog
iDatabase
iErrorMessage
etc.
Thanks
string createTable = "CREATE TABLE IF NOT EXISTS " + m_strDatabase + "_TimeLogs (logName VARCHAR(16), logTime INTEGER, logCountry TEXT, UNIQUE(logName)) TYPE=MyISAM;";
When this runs, no table is created.
No errors either.
Im using an ODBC connector.
the variable passes in the db name, so that the table created would be users_TimeLogs if the database was called users for example.
Am I doing something wrong?
How can I find the dimensions of a matrix in Python. Len(A) returns only one variable.
Edit:
Hi Thanks.
close = dataobj.get_data(timestamps, symbols, closefield)
Is (I assume) generating a matrix of integers (less likely strings). I need to find the size of that matrix, so I can run some tests without having to iterate through all of the elements. As far as the data type goes, I assume it's an array of arrays (or list of lists).
I ve connected my mobile phone to my PC and used this,
string[] lPorts = System.IO.Ports.SerialPort.GetPortNames();
and the result was an array of port names
"COM4"
"COM3"
"COM1"
"COM7"
"COM6"
Now,How to find which serial port is currently used/to which port my mobile phone is connected in c#?
What could happen if my template looks for variables which weren't assigned?
For example:
var uwfs_id = '{$tpl_uwfs_id}';
This snippet is from my javascript code. I outputted the value and it is simply empty. I know I could use isset(). But I couldn't find anything about how Smarty handles non-existing variables. So, what happens if template can't find a variable, because it wasn't assigned?
When using Zend Studio to write views for a MVC framework, is there any way of having those variables autocomplete, perhaps using PHPdoc?
For example, I set a variable in a view called $cart which is an instance of my ShoppingCart class. When I type "$cart-", I'd like the IDE to pop up with all of the objects properties.
I am trying to write some code to return an array in C#, but don't know the proper syntax. I think my method is set up correctly, but to set an array to the result of the method is what I'm having difficulty with.
Method Declaration:
double[,] function(double variable)
{
...
code
...
return array
}
I just had a test on java and we had to give the definition of
1) Static:
2) IOExcepion:
What I said for static was...a static method is used to define a method as a class method. And I got it wrong so I asked my teacher and he said he wants the actually definition of static not a static method, class or variable just static. Can someone tell me the definition of this and for IOException please Thanks.
Hello,
in C#
How to get all instances from certain class or Kill all instances of certain class ?
For Example :
I've a Class Names "MyClass" from which i make 3 instances "m1","m2","m3".
Is there a way to get all these instances or kill them all ??
When do I execute query COPY TO ... CSV, I create CSV file. BUt when open it column with names in excel that should be with national characters are not as it should be. So my question is, If it is possible within a sql query to change this encoding to utf8? Or something else? Because I want that new created CSV file to be as final product for user on web. I hope someone understood what I want:)
I want someone to type words in the console, and autocomplete from a list when they hit "tab" key. However, raw_input won't return a string until someone hits [Enter].
How do I read characters into a variable until the user hits [Enter]?
*Note: I don't want to use import readline for autocompletion because of OS issues.
hi,
This is my bash command
grep -rl "System.out.print" Project1/ |
xargs -I{} grep -H -n "System.out.print" {} |
cut -f-2 -d: |
sed "s/\(.*\):\(.*\)/filename is \1 and line number is \2/
What I'm trying to do here is,I'm trying to iterate through sub folders and check what files contains "System.out.print" (using grep)
using 2nd grep trying to get file names and line numbers
using sed command I display those to console.
from here I want to remove "System.out.print" with "XXXXX" how I can pipe sed command to this?
pls help me
thanxx
I am just working on a project where the library has an object with the property color, however being British I always use colour when writing variables and properties.
I also just found some legacy code where the British developer used color in a variable name.
Is American English the default for development now?