|
|
I would love to be able to use Python, but I cannot find any explanations or examples of how to get a python script to run in a web browser. The actual data manipulation should be easy, but writing the interface is where I'm stuck. Everything I find on either ASP.NET or Python is on how to communicate with the server, or create a static page based on dynamic information. I want a dynamic page. Any tutorials or books on this subject using ASP or Python would be appreciated.
The Code Demon Rises.
|
|
|
|
|
I would suggest looking at a UI toolkit such as http://www.extjs.com[^] or http://developer.yahoo.com/yui/[^]
They use a combination of HTML/CSS/Javascript inside the browser.
Then their controls talk to the web server via a communication object written in javascript which can use Http GET, Http POST, or SOAP web services (behind the scenes its using jQuery Ajax[^] to talk to the server).
Google uses python on the backend. It's still using HTML/CSS/Javascript within the client.
As for the server side code that talks to mysql you can use pretty much whatever. I would suggest PHP or Rails for the server side goop unless you already have experience in asp.net.
Todd Smith
|
|
|
|
|
Latest post to top
Hi, I'm working on a forum script which does what it's supposed to do, except for one thing. That is, listing the latest reply or new thread at the top of the topic list correctly.
I had help on the code below from a forum which is now closed. The code works, but - this happens:
If this month is say May, then the latest post goes to the top of the list (only because May is at the top).
If someone posts a reply to a thread made in say April or March, then the reply only goes to the top of the section in the list where that particular month is displayed. Which is not what I want it to do.
Does that make sense?
What is needed to make any posting go to the top of the whole list, regardless of the month the original thread began?
I do not know how to do that (I'm not all that good a programmer).
sub printMonthLines {
my($filename) = @_;
$filename =~ s/[\^<>'\$!#;\*\?\&\|\`\/\~\\\(\)\{\}\"\n\r]//go;
$filename =~ s/\.\.//go;
# open file
$thefilenm = "$cgidir/$forumdata/$filename.txt";
if (open(DATA,"$thefilenm")) {
my %records;
while (<DATA>) {
chomp;
my @data = split(/_/);
my $date = join '', (split(/[\/:-]/, $data[5]))[2,1,0,3,4,5];
push @{$records{$date}},$_;
}
close(DATA);
foreach my $key (sort {$b cmp $a} keys %records) {
@sorted = "@{$records{$key}}";
# split new array
foreach $line (@sorted ) {
if ($line ne '') {
@info = split (/_/, $line);
$num = $info[0];
$subject = $info[1];
$name = $info[2];
$date = $info[3];
$responses = $info[4];
$replytime = $info[5];
$replyname = $info[6];
# print it all out
print qq ~
<TR valign="top"><td>
<A HREF="$ENV{'SCRIPT_NAME'}?msg=$num" onFocus="if(this.blur)this.blur()">$subject</A>
<div class="small">Posted on: $date</div></td>
<td>$name</td>
<td>$responses</td>
<td align="right">$replytime<br>by $replyname <A HREF="$ENV{'SCRIPT_NAME'}?msg=$num#$responses" onFocus="if(this.blur)this.blur()">$viewpost</a></td></TR>
~;
}}}}}
I hope someone can help please,
Thanks
|
|
|
|
|
look up "reverse sorting vb" - i presume you are using vb.
|
|
|
|
|
|
well then "reverse array perl"
i'd try inserting the following after "@sorted = "@{$records{$key}}";":
reverse(@sorted);
|
|
|
|
|
I tried that but it didn't change anything. Also tried adding an epoch date field at the end and sorting it by that (think I did it right) and that didn't work either. This is so far beyond me it's scary :-/
It's a pity as everything else works a treat on the forum scripts (so far - I'm redoing them). I had thought this would be an easy thing to do (famous last words).
|
|
|
|
|
or:
@sorted = reverse(@sorted);
????
if that doesn't work i suggest passing it to a web designer.
|
|
|
|
|
Okay. We'll just consider the thread closed now.
|
|
|
|
|
Hi,
I am trying to get the height of the page after the page loads everything, I currently used document.body.scrollHeight but now it keeps on returning 0, no matter in want page event I add it.
I am using ASP.NET 2.0.
Thanks
|
|
|
|
|
The method to get the height differs depending in what browser you are using. I have a javascript function that i use to center an element on a screen. This determines the browser being used and uses the correct method accordingly. Hope this helps.
function centerElement(element, left, top)
{
var x = document.body.scrollWidth;
var y = document.body.scrollHeight;
if (getBrowser().indexOf('IE') == 0)
{
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
}
x = (x / 2) + document.body.scrollLeft - (element.offsetWidth / 2);
y = (y / 2) + document.body.scrollTop - (element.offsetHeight / 2);
if (arguments.length < 2) left = true;
if (left) element.style.left = x + 'px';
if (arguments.length < 3) top = true;
if (top) element.style.top = y + 'px';
}
function getBrowser()
{
if (navigator.appName == 'Microsoft Internet Explorer')
{
return 'IE' + parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]);
}
else if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1)
{
return 'Firefox';
}
return 'Other';
}
Cheers,
Craig
** I'd rather try and fail than fail to try **
|
|
|
|
|
I want to design a security software of a small company. the company has 3 books which are:
Visitors book
Occurrence book
tools book
the guard will be able to input to visitors book visitors name, time in, time out and so on...
even in the occurrence book the guard should be able to input some thing.
I am having some difficulties in coming up with the interface of this software. Especially in the visitors book (time out column). the manager of the company should be able to view those how visited and any thing else every day. The software will use an intranet. Pleas
|
|
|
|
|
So come clean and tell your client you lied and have no idea what you are doing and that he better get a real programmer to do the job.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi all,
I want to run .ppsm file in slideshow window using c# in web based application without opening presentaion in powerpoint. I was given anchor link like following -
<a href="CD-12 Open Value Module EMEA and Latam BlackWhite.ppsm"> Open/Save </a>
When I open html page in IE8 & click on "Open/Save" link it launch a open/Save dailog box and when click on Open button it open the .ppsm file in powerpoint application but not run the file in slideshow window.
So please help me How to run the .ppsm file using C# in web based application.
Please give me an example if these are possible in any way.
Thanks in Advance
Regards,
Anil Dwivedi
|
|
|
|
|
you need to add in the correct mime type (if there is one)
|
|
|
|
|
Hi!
I have added MIME Type but still have same problem with IE. One thing i notice when try same in other browsers, it work fine and show file type "Microsoft Office PowerPoint Macro-Enabled Slide Show" but same thing in IE, it show file type "Microsoft Office PowerPoint Macro-Enabled Presentation" &amp; open the presentation (.ppsm) in PowerPoint application instead of run the .ppsm file in slide show window.
Is it possible to run PowerPoint presentation (.ppsm) file without using anchor link in web based application?
Thanks & regards,
Anil Dwivedi
modified on Friday, May 29, 2009 3:26 AM
|
|
|
|
|
I dont think you can with a ppsm. you can with pptx. but it all depends on what the end user has installed on his/her machine. there might be some microsoft embedding tool though.
|
|
|
|
|
Hi guys,
I have tried following code and it work when choose server option as "Use Visual Studio Development Server" in Web tab of Website Project's property and running with Visual Studio. But it doesn't work When I choose server option as "Use Local IIS Web server" in Web tab of Website Project's property and also it doesn't work when i deploy it on IIS web server & no any exception/error throws as well.
try
{
ProcessStartInfo psi = new ProcessStartInfo(MapPath("MaxMinTest.ppsm"));
Process p = new Process();
if (psi.FileName.Contains("pptx"))
psi.Verb = "Show";
p.StartInfo = psi;
p.Start();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
Here I have used [ using System.Diagnostics ] name space.
Please help me If you guys have any solution. It's very urgent
Thanks & Regards,
Anil Dwivedi
|
|
|
|
|
hi ,
i want to ask about problem accurse with me
i install MOSS 2007 on local server and i start it's configuration and created we site but when i want to add user to my web site or to moss serer generally i can't find user in my active directory or on my network
i click on add users under security and permission at add user\group section i click on book to search for users i can't find any users i have active directory on separate machine
|
|
|
|
|
is the local server joined to the domain?
|
|
|
|
|
yes,joined this server in the company where i work
|
|
|
|
|
|
Hello Everyone
I am using ASP.NET 3.0 and I want a code for javscript that appears a link on a page at a client machine.
I want minimum code for 3 to 4 lines that put on a client server.
Thanks in Advance
Saurabh Agarwal
|
|
|
|
|
you need css position:fixed or something. google "css positioning"
|
|
|
|