I've a table field consists of 10 digits expresses the date and the time.. I want to extract a report where the date/time field can be readable from this field
Hi,
I have 3 tables : Student , Subject and Score
Every student can add 3 Subjects (Physics, Mathematics and Chemistry) marks.
The combination of (student_id + subject_id) is added to Score table. i.e., capturing that sudent '1' has added 'Mathematics' marks with the actual score (say 0-100 range)
student id : subjectid Score
1 Mathematics 95
The Add page of Score has a "subject" drop down. which is displayed from "subject" table.
When the student wants to add the 2nd subject marks, in the add page, he should not be displayed the previoys added subject in the drop down.
Can any1 tell me how to do this?
I have a grid named 'GridView1' contains two columns 'Date' and 'Session Deatils' i am displaying like this way only
<asp:GridView ID="GridView1" OnRowCommand="ScheduleGridView_RowCommand"
runat="server" AutoGenerateColumns="False" Height="60px"
Style="text-align: center" Width="869px" EnableViewState="False">
<Columns>
<asp:BoundField HeaderText="Date" DataField="Date"><HeaderStyle Width="80px" /></asp:BoundField>
<asp:BoundField DataField="" HeaderText="Session Detais" /> </Columns>
But here i need to display 3 column sections downside Session details without any column borders for each dates,,how can i achive like this wasy
Date SessionDetails
06-04-2010 Time-(value from database) Topic-(value from database) Head-(value from database)
------- ------------------ ------------------- ----------------------
validates_format_of :email,
:with => /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/,
:message => "is missing or invalid"
Please let me know where is the problem? Is regular expression is wrong?
Hi,
Whats the best way to ensure the user has entered a valid time string such as:
5:24
5.4
102:30
102.5
It will be entered into a UITextField therefore will be in a NSString.
I want to allow the user to enter the time in either hours and minutes (hh:mm) or hours and decimal minutes (hh.m).
In the hours minutes example they should be able to enter as many hours as the like but only between 0 - 59 minutes. With the hours decimal minutes I want them to only be able to enter again as many hours as the like but decimal minutes can only be 0 - 9.
Many Thanks
I need to print the following values with printf as the follwoing around like this:
printf "[`date +%d"/"%b"/"%G"-"%T`] [WARN] $PARAM1 $PARAM2 $PARAM3
The required output:
[02/Jun/2010-11:08:42] [WARN] val1....val2...val3
Hi,
I would like to add some debugs for my simple ruby functions and I wrote a function as below,
def debug(&block)
varname = block.call.to_s
puts "#{varname} = #{eval(varname,block)}"
end
debug {:x} #prints x = 5
debug {:y} #prints y = 5
I understand that eval is evil. So I have two questions.
Is there any way to write that debug method without using eval? If NO is there a preferred way to do this?
Is there any way to pass a list of arguments to this method? I would ideally prefer debug {:x, :y. :anynumOfvariables}. I could not quite figure out how to factor that into the debug method (i.e, to take a list of arguments)
I am going to be writing documentation for two web services that I developed, and I started wondering what people on here do for documentation.
Do you create it in an HTML file so it can be viewed in the browser? Word document? Wiki? What do you guys/gals use?
I was originally leaning towards creating an HTML page since it seems a little more open and friendly than a word document. Plus I can use the prettify javascript to make code samples look nice. Our company has a Sharepoint though, so an HTML file may not be the best choice given that most documentation is put up in spreadsheets and word documents.
In a twitter RSS feed the pubDate is published as
Sat, Jun 5, 2010 19:20
Using PHP, whats the best way to convert this into the time lasped since published. For eaxmple,
posted 4 minutes ago
posted 1 hour ago
posted 4 hours ago
posted 1 day ago
posted 2 days ago
posted 1 month ago
posted 2 months ago
You help much appreciated
hi,
i am building a simple c++ client, i am splitting the info i get from the server to frames, and pass each frame to a function that processes it, i split the frame into lines using
Poco::StringTokenizer tokenizer(frame, "\n");
i take the first line of the tokenizer which represents the type of frame
StmpCommand command(tokenizer[0]);
a StmpCommand is an enum with the different types of messages
and the constructor works as follows :
StmpCommand(std::string command): commandType_() {
bool x=command=="CONNECTED";
std::cout<<x<<std::endl;
if ("SUBSCRIBE" == command)
commandType_ = SUBSCRIBE;
else if ("UNSUBSCRIBE" == command)
commandType_ = UNSUBSCRIBE;
else if ("SEND" == command)
commandType_ = SEND;
else if ("BEGIN" == command)
commandType_ = BEGIN;
else if ("COMMIT" == command)
commandType_ = COMMIT;
else if ("CONNECT" == command)
commandType_ = CONNECT;
else if ("MESSAGE" == command)
commandType_ = MESSAGE;
else if ("RECEIPT" == command)
commandType_ = RECEIPT;
else if ("CONNECTED" == command)
commandType_ = CONNECTED;
else if ("DISCONNECT" == command)
commandType_ = DISCONNECT;
else if ("ERROR" == command)
commandType_ = ERROR;
else {
std::cerr<<"Error in building StmpCommand object, unknown type - "<<command<<std::endl;
}
}
the first frame i am trying to proccess is a CONNECTED frame
therefor i try to create a StmpCommand with CONNECTED as the constructor's only argument
and for some reason i am getting an :
Error in building StmpCommand object, unknown type - CONNECTED
i am clearly passing a string containing CONNECTED but i'm guessing there is something else there that isn't allowing the condition else if ("CONNECTED" == command) to hap
HI.
I have multiple webpages. So I have a common external js file. And I have added this js file to every page. I have multiple check boxes in every page. And I have written the click event in the external, common js file. But I wonder how the js file should be?
Currently I have written like this.
$(document).ready(function() {
$(".chk").click(function() {
alert("hi");
});
});
But whenever I click a checkbox the click event is fired twice. it should be once. I dont know where is the error, is there any error in writing the js file?
please comment.
I have an array of array in which each array is like:
clusterA gene1 1
clusterA gene2 0
clusterB gene1 1
clusterB gene2 0
I want to produce a file like:
name gene1 gene2
clusterA 1 0
clusterB 1 0
Current attempt:
if (condition) {
@array = ($cluster, $genes, "1");
}
elsif (not condition) {
@array = ($cluster, $genes, "0");
}
push @AoA, [ @array ];
@A0A is my array of array.
Hi,
I've had to write an application that lists and plays tutorial videos along with accompanying text. It works well but since the videos are added by the user I need a way of checking to see whether or not a video can be played on the machine.
I'm not sure whether or not there is an easy way to try test the file (and catch errors) or if I need to start looking at codecs installed.
Does anybody have any experience with this?
I frequently come across this problem. I have a file:
something
something2
something3
which I want output as:
"something","something2","something3"
any quick tool for this, preferably online?
I have a decimal variable which represents a donation amount. Currently I am displaying it on screen as a currency like so-
DonationAmount.ToString("C");
This gives the following output (given a US locale)
1 -> $1.00
2 -> $2.00
0.5 -> $0.50
I am happy with the first two example, but want to have "0.5" show as "50c".
My current solution is with a conditional-
if (DonationAmount > 1)
return (DonationAmount * 100m).ToString() + "c";
else
return DonationAmount.ToString("C");
Is there a better way?
hello
i have a application on php , i want to create some report in my application, but i wnat users print some of them on A4 and some of them in A5 and some of them on A3
how should i config css?
thank
Hi I would like to list tags like it's listed by:
# git branch -v
* devel e7f5e36 firxed bugs
master 63e9c56 remove unused code
without the * (you can't checkout tag).
It would be good to have an option to list full or short SHA1. A bash script is also fine, but it would be nice to use git commands more and shell scripting less.
I've read this question Git - how to tell which commit a tag points to and it helped me, but it's not all I want.
Edit:
I didn't know that annotated tags had SHA1. I wanted SHA1 of commits that tag points to, not the tags themselfs.
Hello all,
I have a set of complex Excel files (with figures in it) that I want to show in a web browser. So I need to convert them into HTML page first. Since the excel files are very complex, I can not just parse them and generate a HTML table with HTML tags. The current manual solution that works fine is when I use Microsoft Excel software to save the spreadsheet as a HTML page. I want to automate this task in some way since I want to do it progrmatically through Java. Is their any existing solution or a way to do it? Thanks.
I have a string (€#,###.00) which works fine with aDecimal.ToString("€#,###.00") in .NET, i wonder if anyone knows how this could be achieved with javascript
Hi everyone,i created an application that takes the excell output of a table.There are long numbers in table cell.When i took the output the cells that have long numbers are seen like that 1234+E34.how can i fix that?Thanks for advance...
I want to write an windows application in c#.net in which I have to save hindi language fonts to the databases and reading them straight away.I have searched lots of websites and read about localization but couldn't make it through.Please help me.
Thanks
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
If i got a new message, in notification expanded view it shows only time. suppose If i got a message today(i.e on 06/06/2010) it should display simply a string "Today" and tomorrow it should show date on whilch message was received i.e it should display date 06/06/2010