I need help with math script
here's what i want to do.
chart looks like this:
number 1
-/+
number 2
number 3
number 4
total
if '+' sign or no sign is used in the space for it, number1 + number2 + number3 + number4 = total
if '-' sign is used, then number1 - number2 + number3 + number4 = total
any suggestions? i tried this;
var a = this.getField ("2"); 'corresponds to number 1'
var b = this.getField ("3"); 'corresponds to number 2'
var c = this.getField ("4"); 'corresponds to number 3'
var d = this.getField ("5"); 'corresponds to number 4'
var e = this.getField ("7"); 'corresponds to number -/+'
if (e.value = "-"){
event.value = a.value - b.value + c.value + d.value;
else {
event.value = a.value + b.value + c.value + d.value;
}
Ok, thanks for the replies, and I will try the suggestions, but I finally solved the problem. Here it is.
var a = this.getField ("2");
var b = this.getField ("3");
var c = this.getField ("4");
var d = this.getField ("5");
var e = this.getField ("7");
if (e.value == "-")
event.value = a.value - b.value + c.value + d.value;
else
event.value = a.value + b.value + c.value + d.value;
Similar Messages
-
I need help with this script please ASAP
So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
The script (Sorry if it's a bit long):
#------------Startup-------------
display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
set Lolz to (button returned of the result)
if Lolz is "Cyaaaa" then
killapp()
else if Lolz is "Take the Quiz" then
do shell script "say -v samantha Ok starting in 3…2…1…GO!"
#------------Question 1-----------
display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
set A1 to (button returned of the result)
if A1 is "Apprentices" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 2--------
display dialog "Most children were taught
to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
set A2 to (button returned of the result)
if A2 is "Bible" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------------Question 3---------
display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
set A3 to (button returned of the result)
if A3 is "Great Awakening" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#-----------Question 4--------
display dialog "_______ was
a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
set A4 to (button returned of the result)
if A4 is "Ben Franklin" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 5-------
display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
set A5 to (button returned of the result)
if A5 is "Land" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 6--------
display dialog "The first step toward guaranteeing these rights came in 1215. That
year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
set A6 to (button returned of the result)
if A6 is "Magna Carta" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 7--------
display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
set A7 to (button returned of the result)
if A7 is "Parliament" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 8-----
display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
set A8 to (button returned of the result)
if A8 is "King James II" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 9------
display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
set A9 to (button returned of the result)
if A9 is "William/Mary/Glorius Revolution" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 10-----
display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
set A10 to (button returned of the result)
if A10 is "Rights" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 11------
display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
set A11 to (button returned of the result)
if A11 is "Ohio" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------Question 12---------
display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
set A12 to (button returned of the result)
if A12 is "George Washington" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 13-------
display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
set A13 to (button returned of the result)
if A13 is "Ben Franklin" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 14------
display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
set A14 to (button returned of the result)
if A14 is "" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#-------Question 15-------
display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
set A15 to (button returned of the result)
if A15 is "Command an attack against French" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------TheLolQuestion-----
display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
set LOOL to (button returned of the result)
if LOOL is "Mr.White" then
do shell script "say -v samantha Congratulations…you…have…common…sense"
else
do shell script "say -v alex Do…you…have…eyes?"
#------END------
display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
set endmenu to (button returned of the result)
if endmenu is "I did!" then
do shell script "say -v samantha Your awesome"
else
do shell script "say -v alex Go outside and run a lap"
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end ifUse code such as:
display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
set A1 to (button returned of the result)
if A1 is "Apprentices" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
return
end if
#----------Question 2--------
display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
set A2 to (button returned of the result)
if A2 is "Bible" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
return
end if
(90444) -
Need help with Math related operations...
I'm learning JAVA for more than 3 weeks and I really need help...
I'm using SDK1.4 with Elixir IDE Lite (+patch installed).
In the following screenshot <http://www.geocities.com/jonny_fyy/pics/java1.png>, I've got this error (when I right-click -> Compile) . Do you know what it means & how can I solve it?
Here's how it should look if correct (pic scan from lab worksheet)... <http://www.geocities.com/jonny_fyy/pics/lab.jpg>
Here's my java file... <http://www.geocities.com/jonny_fyy/FahToCeltxt.java>
Thanks for helping :>Hi jonny
One step ahead:
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class FahToCeltxt extends Applet implements ActionListener {
TextField msgField ;
String msg = null;
int msgValue;
Label title;
Button b;
public void init() {
title = new Label("Enter degrees in Fahrenheit: ");
add(title);
msgField = new TextField (10);
add(msgField);
// msgField.addTextListener(this);
b = new Button("Convert");
b.addActionListener(this);
add(b);
// public void textValueChanged(TextEvent event) {
// msgValue = Integer.parseInt(msgField.getText());
// repaint();
public void paint (Graphics g) {
int result = (msgValue - 32) * 5/9 ;
g.drawString("Degree Centigrade is " + result , 50, 50);
public void actionPerformed(ActionEvent e) {
msgValue = Integer.parseInt(msgField.getText());
repaint();
}Regards. -
Need help with a script applied by GPO
Hello,
I need to automate WebFeed insertion for Remote App Users at user logon.
RDS 2012 R2 in place. Remote Apps are provided to W7 clients.
Currently, WebFeed link must be inserted manually in each user's Control Panel\RemoteApp and Desktop Connections. There
is no straight forward way from Microsoft.
But there is a script and instruction I found on web...
I followed the instruction... Created GPO. GPO applies to user but nothing happens.
Can somebody check the script and the instruction that I could wrongly applied.
In instruction there is no word about changing something in the script but only wcx file that the script should
use.
The script is below and here is my .wcx file:
<?xml version="1.0? encoding="utf-8? standalone="yes"?>
<workspace name="Enterprise Remote Access" xmlns="http://schemas.microsoft.com/ts/2008/09/tswcx" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<defaultFeed url="https://my_webserver_real_FQDN/rdweb/Feed/webfeed.aspx" />
</workspace>
I changed the quotes to vertical (") from (”) that
were in my wcx when copied the lines from web.
Still not works.
I
checked Application log, PowerShell and RemoteApp in eventviewer under user session
Everything is clean.
Were I can check the script execution log?
When the user with applied script logs in, the icon of Remote
connection appears for 10 seconds on the task bar and disappears.
Looks like it's trying...
Check please if the script really should not be touched and provide some troubleshooting
steps.
Thanks!
INSTRUCTIONS from
the link:
http://www.concurrency.com/infrastru...rver-2012-rds/
"Unfortunately
Windows 7 clients are out of luck here. If you really want to use GPO to deploy
RemoteApps to Windows 7 clients, then you have to jump through a few
hoops.
Create a new GPO and under User ConfigurationPoliciesWindows
SettingsScripts, double click Logon and click the
Show Files
button. This will open an explorer window where you can copy files that will be
saved within this GPO. Download the
Install-RADCConnection.ps1 script from the TechNet gallery and
save it there. Also create a new Text file named something like feed.wcx,
open it in Notepad and paste in the following three lines of text:
<?xml
version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
<workspace
name=”Enterprise Remote Access” xmlns=”http://schemas.microsoft.com/ts/2008/09/tswcx”xmlnss=”http://www.w3.org/2001/XMLSchema”>
<defaultFeed
url=”https://rds.domain.com/RDWeb/Feed/webfeed.aspx”
/>
</workspace>
Now select the PowerShell Scripts tab and
click the Add button.
Click Browse and select the .ps1 file and
for the parameters enter the name of the wcx file. Click OK twice and you are
ready to scope that policy to a set of users.
<#
.SYNOPSIS
Installs a connection in RemoteApp and Desktop Connections.
.DESCRIPTION
This script uses a RemoteApp and Desktop Connections bootstrap file(a .wcx file) to set up a connection in Windows 7 workstation. No user interaction is required.It sets up a connection only for the current user. Always run the script in the user's session.
The necessary credentials must be available either as domain credentials or as cached credentials on the local machine. (You can use Cmdkey.exe to cache the credentials.)
Error status information is saved in event log: (Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections).
.Parameter WCXPath
Specifies the path to the .wcx file
.Example
PS C:\> Install-RADCConnection.ps1 c:\test1\work_apps.wcx
Installs the connection in RemoteApp and Desktop Connections using information
in the specified .wcx file.
#>
Param(
[parameter(Mandatory=$true,Position=0)]
[string]
$WCXPath
function CheckForConnection
Param (
[parameter(Mandatory=$true,Position=0)]
[string]
$URL
[string] $connectionKey = ""
[bool] $found = $false
foreach ($connectionKey in get-item 'HKCU:\Software\Microsoft\Workspaces\Feeds\*' 2> $null)
if ( ($connectionKey | Get-ItemProperty -Name URL).URL -eq $URL)
$found = $true
break
return $found
# Process the bootstrap file
[string] $wcxExpanded = [System.Environment]::ExpandEnvironmentVariables($WCXPath)
[object[]] $wcxPathResults = @(Get-Item $wcxExpanded 2> $null)
if ($wcxPathResults.Count -eq 0)
Write-Host @"
The .wcx file could not be found.
exit(1)
if ($wcxPathResults.Count -gt 1)
Write-Host @"
Please specify a single .wcx file.
exit(1)
[string] $wcxFile = $wcxPathResults[0].FullName
[xml] $wcxXml = [string]::Join("", (Get-Content -LiteralPath $wcxFile))
[string] $connectionUrl = $wcxXml.workspace.defaultFeed.url
if (-not $connectionUrl)
Write-Host @"
The .wcx file is not valid.
exit(1)
if ((CheckForConnection $connectionUrl))
Write-Host @"
The connection in RemoteApp and Desktop Connections already exists.
exit(1)
Start-Process -FilePath rundll32.exe -ArgumentList 'tsworkspace,WorkspaceSilentSetup',$wcxFile -NoNewWindow -Wait
# check for the Connection in the registry
if ((CheckForConnection $connectionUrl))
Write-Host @"
Connection setup succeeded.
else
Write-Host @"
Connection setup failed.
Consult the event log for failure information:
(Applications and Services\Microsoft\Windows\RemoteApp and Desktop Connections).
exit(1)
--- When you hit a wrong note its the next note that makes it good or bad. --- Miles DavisUse GPP for this. Do not use a script. Post your issues in the GP forum.
You should also visit the RDS forum to get information on how to distribute remote app links.
¯\_(ツ)_/¯ -
Need help with Java Script to perform a calculation in Adobe Acrobat Pro 9 form
I have a form (test) that I am creating in Adobe Acrobat Pro 9.
I need help creating custom Java Script so I can get the desired answer.
1) There are several questions in each group that require a numerical answer between 0-4
2) There is a total field set up to sum the answers from all above questions
3) The final "score" takes the answer from Step 2 above and divides by the total possible answer
Any help on what Java Script I need to complete this would be greatly appreciated!
I've attached a "spreadsheet" that shows it in more detail as well as what formulas I used in Excel to get the desired end result.
Thanks in advance.Have you tried the "The field is the average of:"?
-
Need help with easy script for open / close app and move files
Hi,
I'm not a scripter.. never done anything special perhaps more complicated than /shutdown -s on cmd..
I actually learned ASCII C language on university but never used it in real.
I'm trying to create a basic script that perhaps you could help me or guide me how to do it..
The commands are
1) Close a running app (end task it or force kill it, I prefer end task it)
2) delete files from x location
3) run .exe app from y location
4) close that running app
5) move files from z to y
Perhaps adding few "wait few seconds" commands in between each, so the apps will launch successfully..
My first question will be whats the easiest script language to do that?
I tried VBScript but couldn't find commands for open or close apps.. also for controlling files..
And what commands can do that? I could google them up for better understanding no need for rough guide
And lastly, does it too hard? If it takes more than hour to make it (learn and process) than it ain't worth it..
Thanks alot ahead!
Jordan.hmm 2 questions:
1) taskkill.exe causing me access deny error.. I used "taskkill.exe /IM softwarename.exe"
how do I get permission or something to fix that?
2) on the "move" command..
First, its a "copy" instead.. but I easily figured that out..
but more important is that I want to copy a folder.. with unknown list of way too long files and sub folders..
and all I see is ability to move a file..
Is this possible?
Thanks -
Need help with shell scripting and Patching
Hello all,
I am a very new Oracle DBA and I just have an interview where i have been ask two questions that i have no idea of what it is
1/ What is shell scripting and how do you do shell scripting?
2/ What is Patching and how do you do patching?
Can some one help to have a very good understanding of these tow questions?
Thanks a lot1/ What is shell scripting and how do you do shell scripting?shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.
Shell script defined as:
"Shell Script is series of command written in plain text file. Shell script is just like batch file in MS-DOS
for example:- for taking backup, health check and doing some task Operating system level or Oracle database level we can create shell script and schedule a cron job
2/ What is Patching and how do you do patching?for example ,in windows while using sometimes you might face an issue/error and it gives pop up error message would like to send/report this error to microsoft? microsoft will send you a fix for that. lot of fixes for errors/bugs are released as patches.( n number of patches with newer features are releases as new version)
likewise in oracle for resolving bugs we should have to apply patch.
patch is basically a fix for a bug/bugs. we need to use opatch utility to apply the paches.
hope, this helps you -
Hi All,
I am not sure why my Holiday scripts keep returning Null, I have attached the script and xml files.
If someone can help would be great.
Thanks,
HamedSo if you read through the logic of the script, it looks for Hokiday1 in the XML file theN Holiday2 then Holiday3, etc. As soon as it find one that doesn't exist is when the loop ends. If it doesn't find any, it returns null. Since your XML file starts with Holiday2, it returns null when looking for Holiday1 and then exits the script. I would try changing your XML file to begin with Holiday1 and aee what the debugging looks like after that.
-
I just thought I may find someone here that could help me write a script I'm having trouble with.
I'm using a 'Personal Domain' name at MobileMe.
I have this Code listed below that requires the 'Formmail' free script
from my provider. I don't want to use 'Formmail', so how should I
right the Code below to allow users to click 'Submit' and then the
users own email program would open by default with my email
address in the 'To" box.
[color=red]<!-- THIS FORM IS MADE TO WORK WITH ALLWEBCO SERVERS --><!-- YOU MUST GO TO YOUR CONTROL PANEL TO INSTALL THE Formmail FREE SCRIPT -->
<form method="post"
action="http://your-domain.com/cgi-bin/formmail.cgi" target="_top"
style="margin: 0px;"><input name="recipient"
value="[email protected]" type="hidden"> <input name="subject"
value="WebSite Contact" type="hidden"> <input name="redirect"
value="http://your-domain.com/thanks.htm" type="hidden"><input
name="required" value="email,your_name" type="hidden"> <input
name="sort" value="yourname,phone,musicstyle,email,comments"
type="hidden">
<table border="0" cellpadding="1" cellspacing="0">
<tbody>
<tr>
<td>Name:
</td>
</tr>
<tr>
<td><input name="your_name" size="20" class="shadeform"
type="text">
</td>
</tr>
<tr>
<td>E-mail:
</td>
</tr>
<tr>
<td><input name="email" size="20" class="shadeform"
type="text">
</td>
</tr>
<tr>
<td>Comments/Questions:
</td>
</tr>
<tr>
<td><textarea name="comments" rows="5" cols="25"
class="textarea"></textarea>
</td>
</tr>
<tr>
<td>
<input value="Submit Form"
onmouseover="this.className='buttonon'"
onmouseout="this.className='button'" class="button"
style="width: 180px; margin-top: 5px;" type="submit">
</td>
</tr>
</tbody>
</table>
</form>[/color]
Message was edited by: StyleSupportGoogle doesn't care about your CNAME. It simply indexes your website.
action="http://your-domain.com/cgi-bin/formmail.cgi" target="_top"
Your website should have the formmail.cgi in the cgi-bin folder.
MobileMe does not support server side scripts. With or without a domainname.
One iWeb and one personal domain
iWeb is an application to create webpages. It's not a domain. All pages at MobileMe are covered by your Personal Domain. No matter what application you use to create webpages.
Have a look:
http://me.wyodor.net/
http://www.wyodor.net/
http://web.me.com/wyodor/
They're all the same. -
Need help with Java script calling an html page
Hello -
I have a bunch of web pages, that call a java script called "header.js". The "header.js" puts a header on the top of each web page. In the Java script, I have a gif (picture) that displays a logo and if you click on it, it will send to you a different website.
I'd like to replace this gif with an actual web page. So, the "header" would actually be a web page and not some gif.
Below is a snippet of the code and I'd like to replace the highlighted section with a web page called "header.html". I don't even know if this is possible.
Can anyone tell me what I need to do? I know pretty much nothing about Javascripting so please be as detailed as you can. Thanks!
/* Common header across all pages... */
document.write(' <div id="header" class="clearfix">');
document.write(' <div id="left" class="float_left">');
document.write(' <div id="logo"><a href="http://www.xyz.com/" onclick="window.open(this.href);return false;" onkeypress="window.open(this.href);return false;" target=_blank><img src="/images/xyz.gif" width="105" height="75" alt="" border="0" /></a></div>');
document.write(' <div id="mainNav" class="clearfix"> ');
document.write(' <ul>');
//document.write(' <li id="nav_controls"><a href="controls.html">Controls</a></li>');
document.write(' <li id="nav_motion"><a href="motion.html">Motion</a></li>');
document.write(' <li id="nav_sensor"><a href="sensor.html">Sensor</a></li>');
document.write(' <li id="nav_encoder"><a href="encoder.html">Encoder</a></li>');
document.write(' <li id="nav_system"><a href="system.html">System</a></li>');
//document.write('<!-- <li id="nav_logs"><a href="#">Logs</a></li> -->');
document.write(' </ul>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div id="right" class="float_left">');
document.write(' <div id="controls">');Well, the problem with this is that I'm not an expert on SSI and I really know nothing about javascripting...so I'm afraid of breaking the whole web site and also having to modify all the web pages that call this header.
I'll have to read up on server side include...cause I don't know much about it.
If I could do what I want with this "header.js", it would be a lot easier. -
Beginner need help with a script
I have a little experience with Linux, I am finding that darwin is a little different and not everything works the same as it does with linux.
I have a tomcat service running and i would like to automate a scrip to stop the service, update the war file, then restart the service.
I would also like to add a way to verify the service is stopped before removing and replacing the file.
Here is the current process
Terminal window 1
ssh admin@box1
/bin/Tomcat7.sh stop
ps auxww | grep box
rm /webapps/console.war
Terminal window 2
scp - /newbuild/console.war admin@box1:/webapps/console.war
Terminal window 1
/bin/Tomcat7.sh start
ps auxww |grep box
tail -100f /logs/catalina-daemon.out
repeat for box2
i do this process twice a week and would love a way to automate itI tried to removing () but the script only displayed an output of "Tomcat_server_system" instead of asking me for the admin password to BOX1
The next task i need to do is add variables to the script.
I have 2 servers, each server runs 3 instances of Tomcat
I would like a prompt to ask the following
Server 2 or Server 3?
BOX2=$2server2.test.com
BOX3=$3server3.test.com
Then ask
Tomcat1, 2 or 3?
TOMCAT1=$1tomcat1
TOMCAT2=$2tomcat2
TOMCAT3=$3tomcat3
Finally it will ask
What is the build #?
BUILD#=$XX
(this could be any number, which needs to be entered into the scp line)
Based on what the user choses it would run the following code
ssh admin@${BOX} "${TOMCAT}/bin/Tomcat7.sh stop; ps auxww | grep ${BOX}; rm ${TOMCAT}/webapps/console.war"
scp - /build${BUILD}/console.war admin@${BOX}:${TOMCAT}/webapps/console.war
ssh admin@${BOX} "${TOMCAT}/bin/Tomcat7.sh start; ps auxww |grep ${BOX}; tail -100f ${TOMCAT}/logs/catalina-daemon.out" -
Need help with configure script for audacious plugin
Hello. I have written a small plugin for audacious, that uses an Amarok script to retrieve song lyrics and displays them in a window. I'd like to make an AUR package of it, but I don't even know how to write a configure script. I used to compile it with audacious-plugins, but I suppose a package with all audacious plugins plus my own would be sort of a duplicate of the vanilla audacious-plugins.
Can anyone help me?btn1.addEventListener(MouseEvent.CLICK,f1):
function f1(e:MouseEvent){
nextFrame();
btn2.addEventListener(MouseEvent.CLICK,f2):
function f2(e:MouseEvent){
prevFrame(); -
Need help with python script for Deluge
I am using Deluge 1.3.2 with web server, and all works fine, I use this script in the Deluge settings to execute upon torrent completion:
#!/bin/bash
torrentid=$1
torrentname=$2
torrentpath=$3
torrenttimedelta=`/usr/bin/python2 /home/bobby/scripts/deluge/torrentTimeDelta.py $1`
subject="Started download new torrent!"
message="$torrentname to $torrentpath"
echo -e `date`"::Finished downloading torrent:$2 in: $3" with id:$torrentid >> ~/logs/scripts.log
echo -e `sendEmail -t [email protected] -f [email protected] -u "deluge server notification: torrent $torrentname is complete!" -m "$torrentname has completed downloading at: $torrentpath and took $torrenttimedelta to complete :)" -xu [email protected] -xp password -v -o tls=yes -s email.com` >> ~/logs/scripts.log
echo ---------------------------------------- >> ~/logs/scripts.log
This is to email me when a torrent is done and works. What I wanted to add to this email was the time taken to complete the torrent. I have gotten help from Deluge forum in this thread: http://forum.deluge-torrent.org/viewtop … =9&t=36989 However I think it's something with Python within Arch that is the obstacle, and so that helpful person can't do much more IMO. The python script I'm using is:
#!/usr/bin/python2
from deluge.ui.client import client
from twisted.internet import reactor
d = client.connect()
def on_connect_success(result):
print "Connection was successful!"
def on_get_torrent_value(value):
for torrent in value:
print "%s: %s" % (torrent, value[torrent]["name"])
client.disconnect()
reactor.stop()
client.core.get_torrents_status({}, ["name"]).addCallback(on_get_torrent_value)
d.addCallback(on_connect_success)
def on_connect_fail(result):
print "Connection failed!"
print "result:", result
d.addErrback(on_connect_fail)
reactor.run()
Now if I call this from shell directly, it works. However, including it with my email script at the top, Deluge itself freezes and no email is sent. I run ps aux | grep deluge and I can see that the script has run, but apparently died and all is just hanging. I kill the script process and Deluge resumes just fine, the email is sent. Kinda confused how to remedy this, appreciate any help Thanks
P.S. When I get the email, the part that says ""$torrentname has completed downloading at: $torrentpath and took $torrenttimedelta to complete "" shows nothing where $torrenttimedelta should be, it just says "and took to complete"[edit] Sorry, I don't use deluge and I messed up my test script. If the script is executable try `/home/bobby/scripts/deluge/torrentTimeDelta.py $1`
Are there any other errors? or try running bash with debug output to see if it will tell you something else
The problem you are having is bash doesn't recognize variables inside the tick marks.
Hope that helps
Last edited by rickeyski (2011-07-05 19:27:36) -
Need help with Math functions for text-based calculator!!!
I have the calculator working but I am having trouble figuring out thow to do a square root function, nth factorial, absolute value, and Fibonacci. Basically i got the easy part done. Also I am using the case to do the funtions but I am not sure if there are symbols on the keyboard that are commonly used for these funtions so i just made some up. I am new to java and this is only my second assignment so any help would be appreciated. Thanks
import java.util.*;
import java.math.*;
public class calculator
static Scanner console=new Scanner(System.in);
public static void main(String[]args)
double num1=0,num2=0;
double result=0;
char expression;
char operation;
String Soperation;
System.out.println("Enter ? for help or enter the operation in which to be processed");
Soperation=console.next();
operation = Soperation.charAt(0);
switch(operation)
case '+':
System.out.println("Please the first number");
num1=console.nextInt();
System.out.println("Please enter the second number");
num2=console.nextInt();
result=num1+num2;
break;
case'-':
System.out.println("Please the first number");
num1=console.nextInt();
System.out.println("Please enter the second number");
num2=console.nextInt();
result=num1-num2;
break;
case'*':
System.out.println("Please the first number");
num1=console.nextInt();
System.out.println("Please enter the second number");
num2=console.nextInt();
result=num1*num2;
break;
case'/':
System.out.println("Please the first number");
num1=console.nextInt();
System.out.println("Please enter the second number");
num2=console.nextInt();
if(num2==0)
System.out.println("Cannot Divide by Zero");
result=num1/num2;
break;
//square root
case'^':
System.out.println("Please enter a number");
break;
//fibonacci
case'#':
System.out.println("Please enter the position of the Fibonacci number");
break;
//factorial
case'!':
System.out.println("Please enter the number for factoring");
break;
//absolute value
case'&':
System.out.println("Please enter a number");
num1=console.nextInt();
result=num1;
break;
// help funtion
case'?':
System.out.println("Type + for addition, - for subtraction");
System.out.println("* for multipliction, / for division,^ for the square root");
System.out.println(" & for absolute value, # for fibonacci,and ! for factorial");
break;
System.out.println("The result is:"+result);
}rmabrey wrote:
I have the calculator working but I am having trouble figuring out thow to do a square root function, nth factorial, absolute value, and Fibonacci. java.lang.Math.sqrt()
nothing for factorial - write your own.
java.lang.Math.abs()
nothing for Fibonacci - write your own.
% -
Need help with a script for moving bulk users to another OU and removing/assigning groups
I've never used PowerShell before and have been asked to track down a script that can move bulk users from one OU to another, and remove and assign new group membership. I've been googling it for about 30 minutes and haven't really gotten anywhere. If
somebody can point me in the right direction or give some tips I'd greatly appreciate it. I'm sure this kind of task has been done by several people in similar environments I just haven't been able to find those people/examples.Here's what I've got so far...
Moving to new OU
CSV constructed like below...
DN
TargetOU
“CN=John R, OU=BB,OU=ES,OU=Students,OU=OSD,DC=usd233,=DC=local”
"OU=PRT,OU=MS,OU=Students,OU=OSD,DC=usd233,DC=local"
Import-Module activedirectory
$UserList = Import-Csv "c:\yourCSVhere.csv"
foreach ($User in $UserList) {
$User.DN
$User.TargetOU
Move-ADObject -Identity $User.DN -TargetPath $User.TargetOU
Would this work? I also need to remove the user from two groups and add them to two different groups as well. Would I need to use the addUsertoGroups and removeUserfromGroups commands?
Maybe you are looking for
-
I have an established ITunes account using my IPod Touch. How do I add my new IPhone 4S to my account and share my libraries between both devices?
-
I purchased Adobe Creative Suite 5 and Premiere Pro CS5 in late 2010 and I use the applications on a daily basis, until now. About a month ago I decided to create an adobe account and log in since it asks me every time, after i logged in the applicat
-
Aspect Ratio between FCE and LiveType
I've been working on a project in FCE 3.5 and doing titles in LiveType 2.1. I noticed that when I import into LiveType there is a thin checkered line at the bottom of the video window. When I looked at the aspect ratio setting in the Livetype "Projec
-
Can't use ipod and external HD anyon imac g3 after using it on intel mac...
hi, i've recently bought a intel imac and it has (what else) tiger on it. My girlfriend has an old g3 imac with jaguar on it. Today I connected my ipod to the old g3 imac (because i needed some files, about 10gb) and it didn't appear in finder or in
-
Calendars for manufacturing and finance
hi, we have a situation here in which we have gone live on financials with the calendar having 13 periods, periods coinciding with calendar mths. in manufacturing, we are going to have the 4/4/5 calendar: we believe manufacturing calendar cannot be a