Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 112/271 | < Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >

  • By-Name-Parameters for Constructors

    - by hotzen
    Hello, coming from my other question is there a way to get by-name-parameters for constructors working? I need a way to provide a code-block which is executed on-demand/lazy/by-name inside an object and this code-block must be able to access the class-methods as if the code-block were part of the class. Following Testcase fails: package test class ByNameCons(code: => Unit) { def exec() = { println("pre-code") code println("post-code") } def meth() = println("method") def exec2(code2: => Unit) = { println("pre-code") code2 println("post-code") } } object ByNameCons { def main(args: Array[String]): Unit = { val tst = new ByNameCons { println("foo") meth() // knows meth() as code is part of ByNameCons } tst.exec() // ByName fails (executed right as constructor) println("--------") tst.exec2 { // ByName works println("foo") //meth() // does not know meth() as code is NOT part of ByNameCons } } } Output: foo method pre-code post-code -------- pre-code foo post-code

    Read the article

  • nagios-nrpe-unable-to-read-output [closed]

    - by Bill S
    Oracle Linux; Icinga; Nagios plugins I did all the easy steps command runs fine standalone through my normal login; looked at /var/log/messages to see if any clues there Trying to run plugin under nrpe login - cant login don't know password; does this password matter? can I reset it? clone id? Any way to have shell being executed log all commands and output to somewhere? Trying to run this shell script plugin "nqcmd OBIEE plugin for Nagios" from this URL: http://www.rittmanmead.com/2012/09/advanced-monitoring-of-obiee-with-nagios/ I went through script and made sure that everything obvious was set to 755 Any help would be appreciated

    Read the article

  • Dynamically call a stored procedure from another stored procedure

    - by Greg
    I want to be able to pass in the name of a stored procedure as a string into another stored procedure and have it called with dynamic parameters. I'm getting an error though. Specifically I've tried: create procedure test @var1 varchar(255), @var2 varchar(255) as select 1 create procedure call_it @proc_name varchar(255) as declare @sp_str varchar(255) set @sp_str = @proc_name + ' ''a'',''b''' print @sp_str exec @sp_str exec call_it 'test' So procedure call_it should call procedure test with arguments 'a', and 'b'. When I run the above code I get: Msg 2812, Level 16, State 62, Procedure call_it, Line 6 Could not find stored procedure 'test 'a','b''. However, running test 'a','b' works fine.

    Read the article

  • passing value of sqlplus variable from one script to another.

    - by FrustratedWithFormsDesigner
    I have a script that gets the current time, and must pass it to another script. variable v_s_time varchar2(30); exec :v_s_time := to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM'); --Lots of unrelated code here variable v_e_time varchar2(30); exec :v_e_time := to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM'); @"test report script.sql" :v_s_time :v_e_time; --yes, I also tried ":v_s_time", didn't seem to do anything. This does not work, it seems that the literal :v_s_time is passed to the script, instead of what I want: "2010-04-14 05:50:01 PM". To execute this manually, I could enter: @"test report script.sql" "2010-04-14 05:50:01 PM" "2010-04-14 05:57:34 PM" I found that what does work is this: define v_s_time = "2010-04-14 05:50:01 PM" --Lots of unrelated code here define v_e_time = "2010-04-14 05:57:34 PM" @"test report script.sql" "&&v_s_time" "&&v_e_time"; But it is unrealistic to hardcode the datetimes. Anyone know how to handle this? (Oracle 10g)

    Read the article

  • Disable Foreign key constraint on all tables didn't work ?

    - by Space Cracker
    i try a lot of commands to disable tables constraints in my database to make truncate to all tables but still now it give me the same error Cannot truncate table '' because it is being referenced by a FOREIGN KEY constraint. i try EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" EXEC sp_MSforeachtable "TRUNCATE TABLE ?" and i tried this for each table ALTER TABLE [Table Name] NOCHECK CONSTRAINT ALL truncate table [Table Name] ALTER TABLE [Table Name] CHECK CONSTRAINT ALL and every time i have the previous error message .. could any please help me to solve sucha a problem ?

    Read the article

  • T-SQL out of order insert

    - by tearman
    Basically I have a User-Defined Table Type (for use as a table-valued variable) which I'm referencing in a stored procedure that effectively just calls two other stored procedures, then inserts those values into the table type. Id est INSERT INTO @tableValuedVariable (var1, var2, var3, var4, var5) EXEC [dbo].StoredProcedure1; INSERT INTO @tableValuedVariable (var1, var2, var5) EXEC [dbo].StoredProcedure2; You can probably already tell what I'm going to ask. Basically StoredProcedure2 only returns a few of the values the table is set to hold, and I'd like those other variables to just be null (as defined as default). Only SQL is complaining that I'm not specifying all the variables available to that table. The return datasets can be quite sizable so I'd like to avoid loops and such for obvious reasons. Thanks for any help.

    Read the article

  • How to boot RHEL with no bash?

    - by nmelmun
    How can I boot a RHEL VM if I deleted /bin/bash? When trying to boot, I now get the following error: "INIT: Cannot execute "/etc/rc/d/rc.sysinit" The next thing I tried was to modify the kernel boot parameters by adding init=/bin/ksh at the end of the line, which gave me a functional shell. After this, in order to get write permissions, I remounted the root partition with: mount -o remount,rw / Then I tried to boot using ksh as the shell by tricking the system into thinking it's bash: ln -s /bin/ksh /bin/bash Then restarted the system normally. Unfortunately this didnt work since ksh is not compatible and /etc/rc.d/rc.sysinit uses several bash-specific tricks. Does anyone else have a suggestion on how I could get the system to boot normally without reinstalling bash?

    Read the article

  • executing a script from maven inside a multi module project

    - by Roman
    Hi everyone. I have this multi-module project. In the beginning of each build I would like to run some bat file. So i did the following: <profile> <id>deploy-db</id> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> <executions> <execution> <phase>validate</phase> <goals> <goal>exec</goal> </goals> <inherited>false</inherited> </execution> </executions> <configuration> <executable>../database/schemas/import_databases.bat</executable> </configuration> </plugin> </plugins> </pluginManagement> </build> </profile> when i run the mvn verify -Pdeploy-db from the root I get this script executed over and over again in each of my modules. I want it to be executed only once, in the root module. What is there that I am missing ? Thanks

    Read the article

  • How to create chroot jail with ability to change some system settings

    - by Tadeck
    How to properly create chroot jail (on Ubuntu, or some some other Linux if not applicable) to make user able to edit system settings (eg. with ifconfig) and be able to communicate with external scripts? The use case would be to enable user to authenticate using SSH and then be able to perform very limited set of actions from command line. Unfortunately the tricky part is the access to system settings. I have considered multiple options and the alternative is to setup fake SSH server (eg. with Twisted), try to use restricted shell (however, I seem to need chroot still), or write a script on top of the shell (?).

    Read the article

  • problem with sql job and datetime parameter

    - by geoff swartz
    Another developer created a stored procedure that is set up to run as a sql job each month. It takes one parameter of datetime. When I try to invoke it in the job or in just a query window I get an error "Incorrect syntax near ')'" The call to execute it is... exec CreateHeardOfUsRecord getdate() When I give it a hard coded date like exec CreateHeardOfUsRecord '4/1/2010' it works fine. Any idea why I can't use getdate() in this context? Thanks.

    Read the article

  • Ubuntu: One or more of the mounts listed in fstab cannot ye be mounted

    - by Phuong Nguyen
    I was enjoying a Movie when my Ubuntu suddenly hung. At the next reboot, here is the message: One or more of the mounts listed in /etc/fstab cannot yet be mounted: /home: waiting for /dev/disk/by-uuid/.... Press ESC to enter a recovery shell. Problems: When I enter recovery shell, I don't know that to do. If I press Ctrl+D, then the message above will reappear. What should I do? I checked with Ubuntu Live CD and my partition looks OK. I have 2 separate partitions for / and /home

    Read the article

  • Calling system commands from Perl

    - by Dan J
    In an older version of our code, we called out from Perl to do an LDAP search as follows: # Pass the base DN in via the ldapsearch-specific environment variable # (rather than as the "-b" paramater) to avoid problems of shell # interpretation of special characters in the DN. $ENV{LDAP_BASEDN} = $ldn; $lcmd = "ldapsearch -x -T -1 -h $gLdapServer" . <snip> " > $lworkfile 2>&1"; system($lcmd); if (($? != 0) || (! -e "$lworkfile")) { # Handle the error } The code above would result in a successful LDAP search, and the output of that search would be in the file $lworkfile. Unfortunately, we recently reconfigured openldap on this server so that a "BASE DC=" is specified in /etc/openldap/ldap.conf and /etc/ldap.conf. That change seems to mean ldapsearch ignores the LDAP_BASEDN environment variable, and so my ldapsearch fails. I've tried a couple of different fixes but without success so far: (1) I tried going back to using the "-b" argument to ldapsearch, but escaping the shell metacharacters. I started writing the escaping code: my $ldn_escaped = $ldn; $ldn_escaped =~ s/\/\\/g; $ldn_escaped =~ s/`/\`/g; $ldn_escaped =~ s/$/\$/g; $ldn_escaped =~ s/"/\"/g; That threw up some Perl errors because I haven't escaped those regexes properly in Perl (the line number matches the regex with the backticks in). Backticks found where operator expected at /tmp/mycommand line 404, at end of line At the same time I started to doubt this approach and looked for a better one. (2) I then saw some Stackoverflow questions (here and here) that suggested a better solution. Here's the code: print("Processing..."); # Pass the arguments to ldapsearch by invoking open() with an array. # This ensures the shell does NOT interpret shell metacharacters. my(@cmd_args) = ("-x", "-T", "-1", "-h", "$gLdapPool", "-b", "$ldn", <snip> ); $lcmd = "ldapsearch"; open my $lldap_output, "-|", $lcmd, @cmd_args; while (my $lline = <$lldap_output>) { # I can parse the contents of my file fine } $lldap_output->close; The two problems I am having with approach (2) are: a) Calling open or system with an array of arguments does not let me pass > $lworkfile 2>&1 to the command, so I can't stop the ldapsearch output being sent to screen, which makes my output look ugly: Processing...ldap_bind: Success (0) additional info: Success b) I can't figure out how to choose which location (i.e. path and file name) to the file handle passed to open, i.e. I don't know where $lldap_output is. Can I move/rename it, or inspect it to find out where it is (or is it not actually saved to disk)? Based on the problems with (2), this makes me think I should return back to approach (1), but I'm not quite sure how to

    Read the article

  • How do I get the window id and tab number of a Terminal window using AppleScript via the ScriptingBr

    - by Gavin Brock
    I can open a Terminal tab using the following AppleScript: tell application "Terminal" set myTab to do script "exec sleep 1" get myTab end tell This returns a string like: tab 1 of window id 3263 of application "Terminal". This is great, I can see the window id 3263 and tab number 1 (although I don't know how to query myTab to get only these values). In the Cocoa ScriptingBridge, I can do: SBApplication *terminal; SBObject *tab; terminal = [SBApplication applicationWithBundleIdentifier:@"com.apple.terminal"] tab = [terminal doScript:@"exec sleep 1" in:nil] How do I get the window id and tab number from the tab object?

    Read the article

  • T-SQL - Date rounding and normalization

    - by arun prakash
    Hi: I have a stored procedure that rounds a column with dates in (yyyy:mm:dd hh:mM:ss) to the nearest 10 minute handle (yyyy:mm:dd hh:mM) 20100303 09:46:3000 ------ 20100303 09:50 but i want to chage it to round it off to the nearest 15 minute handle: 20100303 09:46:3000 ------20100303 09:45 here is my code : IF OBJECT_ID(N'[dbo].[SPNormalizeAddWhen]') IS NOT NULL DROP PROCEDURE [dbo].[SPNormalizeAddWhen] GO CREATE PROCEDURE [dbo].[SPNormalizeAddWhen] As declare @colname nvarchar(20) set @colname='Normalized Add_When' if not exists (select * from syscolumns where id=object_id('Risk') and name=@colname) exec('alter table Risk add [' + @colname + '] datetime') declare @sql nvarchar(500) set @sql='update Risk set [' + @colname + ']=cast(DATEPART(yyyy,[add when]) as nvarchar(4)) + ''-'' + cast(DATEPART(mm,[add when]) as nvarchar(2)) + ''-'' + cast(DATEPART(dd,[add when]) as nvarchar(2)) + '' '' + cast(DATEPART(Hh,[add when]) as nvarchar(2)) + '':'' + cast(round(DATEPART(Mi,[add when]),-1) as nvarchar(2)) ' print @sql exec(@sql) GO

    Read the article

  • man: command not found in zsh (Mac OS 10.58)

    - by Oscar
    I changed to zsh from the default (by changing the "Shells open with" preference in Terminal to "command (complete path)" set to /bin/zsh While most things seem to work, I tried to see the man page for a command and got a "permission denied" message. When I tried sudo, I got "man: command not found". I changed to the default shell (/bin/tcsh), and this is what I get when I open a new shell: Last login: Fri Nov 18 13:53:50 on ttys000 Fri Nov 18 13:55:21 CST 2011 /usr/bin/manpath: Permission denied. If I try man, I get the same "command not found message". I guess there is something wrong in my PATH, but I have no idea how to fix it. "echo $PATH" (in tcsh) gets: /sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/texbin In zsh, it gets: /usr/bin:/bin:/sw/bin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/sbin:/sbin:/usr/texbin:/usr/X11/bin Any ideas?

    Read the article

  • How do I return a bit from a stored procedure with nHibernate

    - by tigermain
    I am using nHibernate in my project but I have a stored procedure which just returns a boolen of success or now. How do I code this in c#? I have tried the following but it doesnt like cause I dont have a mapping for bool!!! {"No persister for: System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"} IQuery query = NHibernateSession.CreateSQLQuery("EXEC MyDatabase.dbo.[ContentProvider_Import] :ContentProviderImportLogId", "success", typeof(bool)) .SetInt32("ContentProviderImportLogId", log.Id); var test = query.UniqueResult<bool>(); and the same result from IQuery query = NHibernateSession.CreateSQLQuery("EXEC MyDatabase.dbo.[ContentProvider_Import] :ContentProviderImportLogId") .AddEntity(typeof(bool)) .SetInt32("ContentProviderImportLogId", log.Id); var test = query.UniqueResult<bool>();

    Read the article

  • AWS EC2 - How to specify an IAM role for an instance being launched via awscli

    - by Skaperen
    I am using the "aws ec2 run-instances" command (from the awscli package) to launch an instance in AWS EC2. I want to set an IAM role on the instance I am launching. The IAM role is configured and I can use it successfully when launching an instance from the AWS web UI. But when I try to do this using that command, and the "--iam-instance-profile" option, it failed. Doing "aws ec2 run-instances help" shows Arn= and Name= subfields for the value. When I try to look up the Arn using "aws iam list-instance-profiles" it gives this error message: A client error (AccessDenied) occurred: User: arn:aws:sts::xxxxxxxxxxxx:assumed-role/shell/i-15c2766d is not authorized to perform: iam:ListInstanceProfiles on resource: arn:aws:iam::xxxxxxxxxxxx:instance-profile/ (where xxxxxxxxxxxx is my AWS 12-digit account number) I looked up the Arn string via the web UI and used that via "--iam-instance-profile Arn=arn:aws:iam::xxxxxxxxxxxx:instance-profile/shell" on the run-instances command, and that failed with: A client error (UnauthorizedOperation) occurred: You are not authorized to perform this operation. If I leave off the "--iam-instance-profile" option entirely, the instance will launch but it will not have the IAM role setting I need. So the permission seems to have something to do with using "--iam-instance-profile" or accessing IAM data. I repeated several times in case of AWS glitches (they happen sometimes) and no success. I suspected that perhaps there is a restriction that an instance with an IAM role is not allowed to launch an instance with a more powerful IAM role. But in this case, the instance I am doing the command in has the same IAM role that I am trying to use. named "shell" (though I also tried using another one, no luck). Is setting an IAM role not even permitted from an instance (via its IAM role credentials)? Is there some higher IAM role permission needed to use IAM roles, than is needed for just launching a plain instance? Is "--iam-instance-profile" the appropriate way to specify an IAM role? Do I need to use a subset of the Arn string, or format it in some other way? Is it possible to set up an IAM role that can do any IAM role accesses (maybe a "Super Root IAM" ... making up this name)? FYI, everything involves Linux running on the instances. Also, I am running all this from an instance because I could not get these tools installed on my desktop. That and I do not want to put my IAM user credentials on any AWS storage as advised by AWS here. after answered: I did not mention the launching instance permission of "PowerUserAccess" (vs. "AdministratorAccess") because I did not realize additional access was needed at the time the question was asked. I assumed that the IAM role was "information" attached to the launch. But it really is more than that. It is a granting of permission.

    Read the article

  • How to setup ssh's umask for all type of connections

    - by Unode
    I've been searching for a way to setup OpenSSH's umask to 0027 in a consistent way across all connection types. By connection types I'm referring to: sftp scp ssh hostname ssh hostname program The difference between 3. and 4. is that the former starts a shell which usually reads the /etc/profile information while the latter doesn't. In addition by reading this post I've became aware of the -u option that is present in newer versions of OpenSSH. However this doesn't work. I must also add that /etc/profile now includes umask 0027. Going point by point: sftp - Setting -u 0027 in sshd_config as mentioned here, is not enough. If I don't set this parameter, sftp uses by default umask 0022. This means that if I have the two files: -rwxrwxrwx 1 user user 0 2011-01-29 02:04 execute -rw-rw-rw- 1 user user 0 2011-01-29 02:04 read-write When I use sftp to put them in the destination machine I actually get: -rwxr-xr-x 1 user user 0 2011-01-29 02:04 execute -rw-r--r-- 1 user user 0 2011-01-29 02:04 read-write However when I set -u 0027 on sshd_config of the destination machine I actually get: -rwxr--r-- 1 user user 0 2011-01-29 02:04 execute -rw-r--r-- 1 user user 0 2011-01-29 02:04 read-write which is not expected, since it should actually be: -rwxr-x--- 1 user user 0 2011-01-29 02:04 execute -rw-r----- 1 user user 0 2011-01-29 02:04 read-write Anyone understands why this happens? scp - Independently of what is setup for sftp, permissions are always umask 0022. I currently have no idea how to alter this. ssh hostname - no problem here since the shell reads /etc/profile by default which means umask 0027 in the current setup. ssh hostname program - same situation as scp. In sum, setting umask on sftp alters the result but not as it should, ssh hostname works as expected reading /etc/profile and both scp and ssh hostname program seem to have umask 0022 hardcoded somewhere. Any insight on any of the above points is welcome. EDIT: I would like to avoid patches that require manually compiling openssh. The system is running Ubuntu Server 10.04.01 (lucid) LTS with openssh packages from maverick. Answer: As indicated by poige, using pam_umask did the trick. The exact changes were: Lines added to /etc/pam.d/sshd: # Setting UMASK for all ssh based connections (ssh, sftp, scp) session optional pam_umask.so umask=0027 Also, in order to affect all login shells regardless of if they source /etc/profile or not, the same lines were also added to /etc/pam.d/login. EDIT: After some of the comments I retested this issue. At least in Ubuntu (where I tested) it seems that if the user has a different umask set in their shell's init files (.bashrc, .zshrc,...), the PAM umask is ignored and the user defined umask used instead. Changes in /etc/profile did't affect the outcome unless the user explicitly sources those changes in the init files. It is unclear at this point if this behavior happens in all distros.

    Read the article

  • Conditionally execute a task after building a solution with MSBuild + TFS

    - by SoMoS
    Hello, I'm using MSBuild with TFS and I have to build 4 solutions. When the compilation is done I should launch upon to 4 different Exec tasks depending on wherever the compilation was successful or not. I know how to do that with MSBuild alone using targets with conditions using the var $(BuildBreak) because I can do build solution - check result - exec task - build ... but I don't know how to do that with the TFS extensions ... any help will be very appreciated. Thanks mates.

    Read the article

  • cc.net dynamic paramaters in publisher block

    - by aseabridge
    I am Using CC.Net to run an .exe file after project build is complete and need to pass the project name, publish date/time and user on the command line as paramaters to the .exe. However I can't get cc.net to recognise these a dynamic properties and replace them with the correct values. Any ideas? <publishers><exec executable="C:\MyApp.exe"></exec><buildArgs>"$[$CCNetProject]" "$[$CCNetBuildDate]" "$[$CCNetBuildTime]" "$[$CCNetUser]"</buildArgs><buildTimeoutSeconds>30</buildTimeoutSeconds></publishers> Thanks in advance for the help. Adam

    Read the article

  • INSERT INTO temporary table from sp_executsql

    - by gotqn
    Generally, I am bulding dynamic SQL statement that is executing using sp_executsql like this: EXEC sp_executesql @TempSQLStatement I need to insert the return result row set in something (table variable or temporary table), but I am getting the following error: Msg 208, Level 16, State 0, Line 1746 Invalid object name '#TempTable'. after executing this: INSERT INTO #TempTable EXEC sp_executesql @TempSQLStatement From what I have read, I believe the issue is caused because I am not specifying the columns of the temporary table, but I am not able to do this because the return columns count varies. I have read that I can use global temporary tables, but I have done this before and wonder is there an other way to do that.

    Read the article

  • Make xargs execute the command once for each line of input

    - by Readonly
    How can I make xargs execute the command exactly once for each line of input given? It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. From http://en.wikipedia.org/wiki/Xargs: find /path -type f -print0 | xargs -0 rm In this example, find feeds the input of xargs with a long list of file names. xargs then splits this list into sublists and calls rm once for every sublist. This is more efficient than this functionally equivalent version: find /path -type f -exec rm '{}' \; I know that find has the "exec" flag. I am just quoting an illustrative example from another resource.

    Read the article

  • Problems with sp_addlinkedserver in MSSQL 2000

    - by manneorama
    Hi! I'm having a bit of a problem with moving specific data from one server running MSSQL 2000 (A) and another running MSSQL 2008 (B). I'm writing a script according to customer specifications which is to be executed on A, populating tables in B with data. However, I can't seem to get the server link to work. -- Bunch of declarations here EXEC sp_addlinkedserver @server = @ServerName, @srvproduct = @ServerProduct, @provider = @ProviderString, @datasrc = @RemoteHost -- Data migration stuff here EXEC sp_dropserver @ServerName Now if I run the script in its entirety I get an error saying: Msg 7202, Level 11, State 2, Line 55 Could not find server 'remoteServer' in sysservers. Execute sp_addlinkedserver to add the server to sysservers. However, if I higlight only the sp_addlinkedserver-part and execute that, there is no error and I can highlight the rest of the script and run it. What am I missing here? Please help! PS. If backup-restore was an option, I would have done that already.

    Read the article

  • google link for the RGBA library?

    - by Navruk
    I want google link for the RGBA library <script type='text/javascript' src='jquery.color-RGBa-patch.js'></script> This file contains /* * jQuery Color Animations */ (function(jQuery){ // We override the animation for all of these color styles jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ jQuery.fx.step[attr] = function(fx){ if ( fx.colorFunction == undefined || fx.state == 0 ) { fx.start = getColor( fx.elem, attr ); fx.end = getRGB( fx.end ); if ( fx.start == undefined ) { fx.start = [ 255,255,255,0 ]; } else { if ( fx.start[3] == undefined ) // if alpha channel is not spotted fx.start[3] = 1; // assume it is fully opaque if ( fx.start[3] == 0 ) // if alpha is present and fully transparent fx.start[0] = fx.start[1] = fx.start[2] = 255; // assume starting with white } if ( fx.end[3] == undefined ) // if alpha channel is not spotted fx.end[3] = 1; // assume it is fully opaque fx.colorFunction = ( fx.start[3] == 1 && fx.end[3] == 1 ? calcRGB : calcRGBa ); } fx.elem.style[attr] = fx.colorFunction(); } }); var calcRGB = function() { return 'rgb(' + Math.max(Math.min( parseInt((this.pos * (this.end[0] - this.start[0])) + this.start[0]), 255), 0) + ',' + Math.max(Math.min( parseInt((this.pos * (this.end[1] - this.start[1])) + this.start[1]), 255), 0) + ',' + Math.max(Math.min( parseInt((this.pos * (this.end[2] - this.start[2])) + this.start[2]), 255), 0) + ')'; }; var calcRGBa = function() { return 'rgba(' + Math.max(Math.min( parseInt((this.pos * (this.end[0] - this.start[0])) + this.start[0]), 255), 0) + ',' + Math.max(Math.min( parseInt((this.pos * (this.end[1] - this.start[1])) + this.start[1]), 255), 0) + ',' + Math.max(Math.min( parseInt((this.pos * (this.end[2] - this.start[2])) + this.start[2]), 255), 0) + ',' + Math.max(Math.min( parseFloat((this.pos * (this.end[3] - this.start[3])) + this.start[3]), 1), 0) + ')'; }; // Color Conversion functions from highlightFade // By Blair Mitchelmore // http://jquery.offput.ca/highlightFade/ // Parse strings looking for color tuples [255,255,255] function getRGB(color) { var result; // Check if we're already dealing with an array of colors if ( color && color.constructor == Array && color.length >= 3 ) return color; // Look for rgb(num,num,num) if (result = /rgba?\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,?\s*((?:[0-9](?:\.[0-9]+)?)?)\s*\)/.exec(color)) return [ parseInt(result[1]), parseInt(result[2]), parseInt(result[3]), parseFloat(result[4]||1) ]; // Look for rgb(num%,num%,num%) if (result = /rgba?\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,?\s*((?:[0-9](?:\.[0-9]+)?)?)\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55, parseFloat(result[4]||1)]; // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; // Otherwise, we're most likely dealing with a named color var colorName = jQuery.trim(color).toLowerCase(); if ( colors[colorName] != undefined ) return colors[colorName]; return [ 255, 255, 255, 0 ]; } function getColor(elem, attr) { var color; do { color = jQuery.curCSS(elem, attr); // Keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) break; attr = "backgroundColor"; } while ( elem = elem.parentNode ); return getRGB(color); }; // Some named colors to work with // From Interface by Stefan Petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255], azure:[240,255,255], beige:[245,245,220], black:[0,0,0], blue:[0,0,255], brown:[165,42,42], cyan:[0,255,255], darkblue:[0,0,139], darkcyan:[0,139,139], darkgrey:[169,169,169], darkgreen:[0,100,0], darkkhaki:[189,183,107], darkmagenta:[139,0,139], darkolivegreen:[85,107,47], darkorange:[255,140,0], darkorchid:[153,50,204], darkred:[139,0,0], darksalmon:[233,150,122], darkviolet:[148,0,211], fuchsia:[255,0,255], gold:[255,215,0], green:[0,128,0], indigo:[75,0,130], khaki:[240,230,140], lightblue:[173,216,230], lightcyan:[224,255,255], lightgreen:[144,238,144], lightgrey:[211,211,211], lightpink:[255,182,193], lightyellow:[255,255,224], lime:[0,255,0], magenta:[255,0,255], maroon:[128,0,0], navy:[0,0,128], olive:[128,128,0], orange:[255,165,0], pink:[255,192,203], purple:[128,0,128], violet:[128,0,128], red:[255,0,0], silver:[192,192,192], white:[255,255,255], yellow:[255,255,0] }; })(jQuery);

    Read the article

  • Ubuntu: One or more of the mounts listed in fstab cannot ye be mounted

    - by Phuong Nguyen
    I was enjoying a Movie when my Ubuntu suddenly hung. At the next reboot, here is the message: One or more of the mounts listed in /etc/fstab cannot yet be mounted: /home: waiting for /dev/disk/by-uuid/.... Press ESC to enter a recovery shell. Problems: When I enter recovery shell, I don't know that to do. If I press Ctrl+D, then the message above will reappear. What should I do? I checked with Ubuntu Live CD and my partition looks OK.

    Read the article

< Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >