Should there be any specific order in which I should write the following :
public static void main() ?
In other words, can I re-shuffle public,static,void in any order ?
Why or Why not ?
I write an application in Java. I get form a database a table (clients) which contains fields like:
name | surname | adress
What is the best solution to store this data in my app? Should I create an object for each client and store these objects in a list or set?
The table contains about 100 records and it's already sorted.
Thanks in advance.
I have a category system that is related many-to-many with posts. How can I select a list of those categories that are related to one or more posts?
$q = Doctrine_Query::create()
->from('Category c')
->where('<DONT KNOW WHAT TO WRITE>')
->select('c.name');
I am new in Prolog. I need to declare a function which looks at a list like
[[1, 0, 0], [1, 0, 0], [1, 0, 0]]
and if the value is 0 returns its address(by considering it as a double array).
I wrote a function basicly in the format:
function(..., X) :-
function(called by other values).
How can I write a function, that returns a value when each times it called(recursively). May I get them (in above question) as alternative X's???
I have a custom table cell. In it I have put (via the IB) an image view of a certain frame
In 'cellForRowAtIndexPath', under certain conditions, I would like to modify the frame of this UIImageView, so I write something like:
UIImageView *imgv = (UIImageView *)[cell viewWithTag:1];
CGRect r = CGRectMake(20.0, 20.0, 10.0, 10.0);
imgv.frame = r;
But nothing expected happens (The frame does move a little though not to where I want, but doesn't change its size at all);
So I have a Linux program that runs in a while(true) loop, which waits for user input, process it and print result to stdout.
I want to write a shell script that open this program, feed it lines from a txt file, one line at a time and save the program output for each line to a file.
So I want to know if there is any command for:
- open a program
- send text to a process
- receive output from that program
Many thanks.
Two tables:
table_a
-------
table_a_id: (primary, int)
table_b
-------
table_a_id: (index, int, from table_a)
table_b_value: (varchar)
A one to many relationship between table_a_id and table_b_value.
Given a query like this:
SELECT DISTINCT(table_a_id) FROM table_a
JOIN table_b ON table_a.table_a_id=table_b.table_a_id
I want to order by the number of occurrences of table_a_id in table_b. I'm not really sure how to write this in MySQL.
I'm trying to write a store procedure that can take some input parameters (obviously), run multiple queries against those, taking the output from those and doing calculations, and from those calculations and the original queries, outputting a formatted text string like:
Number of Rows for max(Z) matching condition x and y of total rows matching x (x&y/x*100).
To explain the max(Z) bit, this will be the username field, it won't matter which actual entry is picked, because the where clause will filter the results by user id, is there a saner way to do this?
Hi Acidentally locked my rootviewcontroller.h file in my application, so if i write some code
in that file it shows "Not Writable RootViewController.h", i am a beginer so please help me how to unlock that .h file.
thanks in advance
Similar to this question. I would like to find all commented files. But in my case /* */ is a possibility.
Apparently when you write changes to a database project, dropped objects are only commented out instead of deleting the file. I would like to remove all of these commented out files from the project.
Is is possible to find all files which start with /* and end with */?
Contract.all(:conditions => ['voided == ?', 0]).size
=> 364
Contract.all(:conditions => ['voided != ?', 0]).size
=> 8
Contract.all.size
=> 441
the 3 numbers does not added up (364 + 8 != 441). What's the proper way write the :conditions to count the rows which the voided column value is NULL or equal to zero?
Hi,
I am using C language and Linux as my programming platform.
I am learning how to create a daemon, and I want to create a log file so that I write a debug message in my daemon. My question is where should I put the log file in my system. Should I put it in the var folder?
Please advice.
Many thanks.
i want to create an array of 7 days through php
means all 7 days name...
i don't want to write ..sunday monday tuesday...etc...
and days will be started from sunday ..
means if today is 29 march( monday) then it automatically grabs the current date and create an array of days name starting from sunday.
array always be in this way
$weakarray=("sunday","monday",......,"saturday");
What would be matlab's equivalent of
write(1,'("Speed, resistance, power",3f8.2)')(a(i),i=1,3)
I've tried
a = [10. 20. 200.]
fprintf(unit1,'a = 3%8.1e',a)
but I'm still having trouble with it (the whole matlab output formatting thing).
Edit for Kenny: for the values of a as given above, it would give (in a new row):
Speed, resistance, power 10.00 20.00 200.00
How to write the contents of the "XmlNodeList" in a separate xml file(ie.,the contents should be appended at the end of a file,if the file already contains some text)?
can anybody help me on this.
Write a recursive method that converts a decimal number into a binary number as a string. The method header is as follows:
public static String convertDecimalToBinary(int value)
i need to write a program that counts the number of nodes from a certain level given in binary
tree
i mean < numberofnodes(int level){}
i tried writing it without any success because i don't how to get to a certain level then go
to count number of nodes
for a table valued function in sql why cant we write sql statements inside begin and end tags like-
create function dbo.emptable()
returns Table
as
BEGIN --it throws an error
return (select id, name, salary from employee)
END
go
while in scalar valued function we can use these tags like
create function dbo.countemp()
returns int
as
begin
return (select count(*) from employee)
end
go
is there any specific rule where we should use BEGIN & END tags
Often three (or more) way associations are needed for habtm associations. For instance a permission model with roles.
A particular area of functionality has many users which can access many areas.
The permissions on the area are setup via roles (habtm)
The user/roles association is also habtm
The permissions (read, write, delete, etc) are habtm towards roles.
How would that be best done with rails/activerecord?
i accidently zipped a log file of process (the process wasnt writing in it though, it writes it only during weekends when the process get killed).I unzipped the file immediately back. will it affect the process when it is trying to write in the log file?
I'm trying to write a regular expression which specifies that text should start with a letter, every character should be a letter, number or underscore, there should not be 2 underscores in a row and it should end with a letter or number. At the moment, the only thing I have is ^[a-zA-Z]\w[a-zA-Z1-9_] but this doesn't seem to work properly since it only ever matches 3 characters, and allows repeated underscores. I also don't know how to specify requirements for the last character.
Hi guys,
I would like to know how have I do to add a field in the customer administration at system-configuration-Customer settings panel.
Have I create the system.xml file from the core and paste in the local folder with the same path?
and have I maintain all the content of the file or I can write only the portion interested?
thanks