Search Results

Search found 10355 results on 415 pages for 'shell extension'.

Page 18/415 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • FF extension: displaying an array of string elements in a sidebar

    - by sujay-jain
    I am developing a ff extension which displays a list of elements from an array (dynamic) in the sidebar. The array is dynamic and needs to be constructed in a function everytime the sidebar is opened (or any other event handler). Later, i will need to implement link functionality on parts of the string. What is the best way to go about this? I have created an empty sidebar and just know the label element as of now. menu, and menuitem dont work. What other elements can i use to display text in a good way which supports dynamic contruction. Is there some good tutorial/sample extension which i can see and learn?

    Read the article

  • Refer to te current directory in a shell script

    - by One Two Three
    How do I refer to the current directory in a shell script So I have this script which calls another script in the same directory #! /bin/sh #Call the other script ./foo.sh # do something ... For this I got ./foo.sh: No such file or directory So I changed it to: #! /bin/sh #Call the other script foo.sh # do something ... But this would call the foo script which is, by default, in the PATH. This is not what I want. So the question is, what's the syntax of doing './` in a shell script?

    Read the article

  • Improve performance of sorting files by extension

    - by DxCK
    With a given array of file names, the most simpliest way to sort it by file extension is like this: Array.Sort(fileNames, (x, y) => Path.GetExtension(x).CompareTo(Path.GetExtension(y))); The problem is that on very long list (~800k) it takes very long to sort, while sorting by the whole file name is faster for a couple of seconds! Theoretical, there is a way to optimize it: instead of using Path.GetExtension() and compare the newly created extension-only-strings, we can provide a Comparison than compares starting from the LastIndexOf('.') without creating new strings. Now, suppose i found the LastIndexOf('.'), i want to reuse native .NET's StringComparer and apply it only to the part on string after the LastIndexOf('.'). Didn't found a way to do that. Any ideas?

    Read the article

  • Creating standalone, console (shell) for domain-specific operations

    - by mr.b
    Say that I have a system service, and I want to offer a low-level maintenance access to it. For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just like linux bash shell, mysql cli, cmd.exe, and countless others), allow command line editing capabilities (history, cursor keys to move around text..), etc. Now, it's not that much of a problem to create something like that by rolling my own from scratch, handling user input, scanning pressed keys, and doing correct actions. But, why reinvent the wheel? Is there some library/framework that helps with this kind of problems, just like readline library that offers improved command-line editing capabilities under linux? Of course, this new "shell" would respond only to valid, domain-specific commands, and would suggest valid arguments, options, switches... Any ideas? Thanks!

    Read the article

  • Passing multiple aruments to a UNIX shell script

    - by Waffles
    Hello all, I have the following (bash) shell script, that I would ideally use to kill multiple processes by name. #!/bin/bash kill `ps -A | grep $* | awk '{ print $1 }'` However, while this script works is one argument is passed: end chrome (the name of the script is end) it does not work if more than one argument is passed: $end chrome firefox grep: firefox: No such file or directory What is going on here? I thought the $* passes multiple arguments to the shell script in sequence. I'm not mistyping anything in my input - and I the programs I wan to kill (chrome and firefox) are open. Any help is appreciated.

    Read the article

  • Are google chrome extension "content" scripts sandboxed?

    - by jabapyth
    I was under the impression that the content_scripts were executed right on the page, but it now seems as though there's some sandboxing going on. I'm working on an extension to log all XHR traffic of a site (for debugging and other development purposes), and in the console, the following sniff code works: var o = window.XMLHttpRequest.prototype.open; window.XMLHttpRequest.prototype.open = function(){ console.log(arguments, 'open'); return o.apply(this, arguments); }; console.log('myopen'); console.log(window, window.XMLHttpRequest, window.XMLHttpRequest.prototype, o, window.XMLHttpRequest.prototype.open); This logs a message everytime an XHR is sent. When I put this in an extension, however, the real prototype doesn't get modified. Apparently the window.XMLHttpRequest.prototype that my script is seeing differs from that of the actual page. Is there some way around this? Also, is this sandboxing behavior documented anywhere? I looked around, but couldn't find anything.

    Read the article

  • How extension methods work in background ?

    - by Freshblood
    I am just cuirous about behind of extension method mechanism.Some questions and answer appear in my mind. MyClass.OrderBy(x=>x.a).OrderBy(x=>x.b); I was guessing that mechanism was first orderby method works and order them by a member then returns sorted items in IEnumarable interface then next Orderby method of IEnumarable Order them for b paramater.But i am wrong when i look at this linq query. MyClass.Orderby(x=>x.a).ThenOrderBy(x=>x.b); this is slightly different and tells me that i am wrong.Because this is not ordering by a then b and not possible to have such result if i was right.This get me confuse enough... Similiar structure is possible to write withot extension methods as first query but second is not possible.This prove i am wrong . Can u explain it ?

    Read the article

  • How to get number of rows deleted from mysql in shell script

    - by simonlord
    Hi all I can't work out how to get the mysql client to return the number of rows deleted to the shell when running a delete. Does anyone know what option will enable this? Or ways around it? Here's what i'm trying, but i get no output: #!/bin/bash deleted=`mysql mydb -e "delete from mytable where insertedtime < '2010-04-01 00:00:00'"|tail -n 1` I was expecting something like this as the output from mysql: deleted 999999 Which is why i have the tail -n 1 so i only pick up the count and not the column name. When running the command by hand (mysql mydb -e "delete from mytable where insertedtime < '2010-04-01 00:00:00'") there is no output. When running the command interactively when running the mysql client i ge the following: mysql>delete from mytable where insertedtime < '2010-04-01 00:00:00'; Query OK, 0 rows affected (0.00 sec) I want to get the rows affected count into my shell variable. Any help would be most appreciated.

    Read the article

  • How to edit doxygen.config from shell script?

    - by Sayan Ghosh
    Hi, I tried using Apple's shell script to automate doc set creation with every build (and loading that in XCode) - http://developer.apple.com/tools/creatingdocsetswithdoxygen.html but found that it had some bugs. Firstly it's not updating the entries in doxygen.config, perhaps one needs to put the settings in the exact hierarchy as it appears in the native doxygen file (?). My intention is to specify the settings in the following fashion in the shell script, and have a suitable config file generated tailored to my needs. ... echo "DOCSET_FEEDNAME = Some app" $TEMP_DIR/doxygen.config echo "GENERATE_LATEX = NO" $TEMP_DIR/doxygen.config echo "RECURSIVE = YES" $TEMP_DIR/doxygen.config ... Thank you, Sayan

    Read the article

  • Creating Instance of Python Extension Type in C

    - by Brad Zeis
    I am writing a simple Vector implementation as a Python extension module in C that looks mostly like this: typedef struct { PyObject_HEAD double x; double y; } Vector; static PyTypeObject Vector_Type = { ... }; It is very simple to create instances of Vector while calling from Python, but I need to create a Vector instance in the same extension module. I looked in the documentation but I couldn't find a clear answer. What's the best way to do this?

    Read the article

  • Make Arrow and delete keys work in Korn shell Command line

    - by user66854
    Hi all, I am new to unix and am using sun solaris (v10 i think) . I have my shell set as korn shell . i am wondering how to make the arrow keys and delete key work in the command line . I have done set -o emacs and the backspace works , but not the arrow keys and the delete keys . Also is it possible to set the up and down arrow key to cycle through the command line history ? . any help is appreciated .

    Read the article

  • Extension method not working if I set controller property in Action, works in OnExecuting

    - by Blankman
    I have a class MyController that inherits from Controller, so all my controllers inherit from MyController. I have a property in MyController: public class MyController : Controller { public string SomeProperty {get;set;} } if I set this property in MyController's OnExecuting method, my HtmlHelper extension method works fine: public static string SomeExtension(this HtmlHelper htmlHelper) { StringBuilder sb = new StringBuilder(); string result = ""; var controller = htmlHelper.ViewContext.Controller as MyController; if (controller != null) { result = controller.SomeProperty; } return result; } it doesn't work if I set 'SomeProperty' in my controllers action method. I guess because I am doing 'as MyController' in the extension method? is there a way for it to work in both situations? I am using the value of SomeProperty to be outputted on my view pages.

    Read the article

  • build a chrome extension in order to upload images (from clipboard)

    - by dayscott
    I wanted to write a simple chrome extension in order to substitute the following sequence of steps which i have to do very often for university: make screenshot of something edit screenshot in Paint save unnamend.png to harddrive upload unnamed.png to imageshack.us/pic-upload.de or any other website share link of image with others. I don't care which image upload service to use, i just want automize this use-case in order to save time (I already red and did a getting-started chrome extension and checked out their API, but that's it, this page: http://farter.users.sourceforge.net/blog/2010/11/20/accessing-operating-system-clipboard-in-chromium-chrome-extensions/ seemed useful, but i couldn't make it overwrite my systems clipboard - moreover i can't find a tutorial which helps me further).

    Read the article

  • C input loop for shell

    - by AustinM
    So I'm working on creating a very simple C program that just preforms shell commands. This is what I have so far: #include <stdio.h> int main() { char input[30]; fputs("$ ", stdout); fflush(stdout); fgets(input, sizeof input, stdin); system(input); } It works, but only for one command. For example if I compile and type ./cmd I get the $ prompt. If I type ls I get what I'm supposed to get. But then it exits and goes back to the regular system shell. How can I make it so after the user types a command it goes back to the "$" input.

    Read the article

  • [C#] Creating standalone, console (shell) for domain-specific operations

    - by mr.b
    Say that I have a system service, and I want to offer a low-level maintenance access to it. For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just like linux bash shell, mysql cli, cmd.exe, and countless others), allow command line editing capabilities (history, cursor keys to move around text..), etc. Now, it's not that much of a problem to create something like that by rolling my own from scratch, handling user input, scanning pressed keys, and doing correct actions. But, why reinvent the wheel? Is there some library/framework that helps with this kind of problems, just like readline library that offers improved command-line editing capabilities under linux? Of course, this new "shell" would respond only to valid, domain-specific commands, and would suggest valid arguments, options, switches... Any ideas? Thanks!

    Read the article

  • Extension methods on a static object

    - by Max Malygin
    I know (or so I hear) that writing extension methods for a single stand alone .net class (not an implementation of IEnumerable) is potential code smell. However, for the sake of making the life easier I need to attach a method to the ConfigurationManager class in asp.net. It's a static object so this won't work: public static List<string> GetSupportedDomains(this ConfigurationManager manager) { //the manager needs to be static. } So the question is - is it possible to write an extension method for a static class in .net?

    Read the article

  • Notify via email if something wrong got happened in the shell script

    - by Nevzz03
    fileexist=0 for i in $( ls /data/read-only/clv/daily/Finished-HADOOP_EXPORT_&processDate#.done); do mv /data/read-only/clv/daily/Finished-HADOOP_EXPORT_&processDate#.done /data/read-only/clv/daily/archieve-wip/ fileexist=1 done --some other script below Above is the shell script I have in which in the for loop, I am moving some files. I want to notify myself via email if something wrong got happened in the moving process, as I am running this script on the Hadoop Cluster, so it might be possible that cluster went down while this was running etc etc. So how can I have better error handling mechanism in this shell script? Any thoughts?

    Read the article

  • Emacs and Long Shell Commands

    - by darrint
    Is there a way to run a shell command, have the output show up in a new buffer and have that output show up incrementally? Eshell and other emacs terminal emulators do a find job of this but I see no way to script them. What I'd like to do is write little elisp functions to do stuff like run unit tests, etc. and watch the output trickle into a buffer. The elisp function shell-command is close to what I want but it shows all the output at once when the process finishes.

    Read the article

  • Finding all the URL requests from a firefox extension

    - by user303052
    I am building a firefox extension. In this extension, I want to see the URLs of any new webpage that the user visits. The webpage can be in a different tab or window than the current tab that the user is viewing (this should also catch the URL of pop-ups). Is there a way to find when firefox makes a GET or POST request and grab the URL? An alternative that I am trying to avoid is going through all the tabs and manually check to see if they have loaded a new page. Thanks

    Read the article

  • Why can't I reinstall MySQL?

    - by Johannes Nielsen
    I've been looking all around the Internet for an answer but didn't find anything. I hope you can help me now. I have a server with MySQL. From one day to another, MySQL didn't let me enter with my root password anymore (accsess denied for user 'root'@'localhost' using password: 'YES'). So I tried two ways to reset the password: No.1: I typed: shell> /etc/init.d/mysqld stop To stop MySQL. Then I restarted it skipping the grant-tables: shell> mysqld_safe --skip-grant-tables So I was able to log in as root and change the password using: mysql> UPDATE mysql.user SET Password = PASSWORD('MyNewPassword') WHERE User = 'root'; FLUSH PRIVILEGES; I restarted MySQL and tried to log in as root with my new password - didn't work. So I tried the solution that's described here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html (I don't want to post it here because this post is already pretty long). Didn't work either. Actually it made it worse, because since that day, every time I try to start MySQL, it doesn't even ask me for my password, but I get: shell> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) Well, I've looked up what it means and found that my mysqld.sock is missing. I tried to create it using touch but MySQL can't start with that socket. Now I'm trying to reinstall MySQL but everytime I type in shell> apt-get --purge remove mysql-server mysql-common mysql-client In that or any other order or every one of those three alone, I get: shell> Reading package lists... Done shell> Building dependency tree shell> Reading state information... Done shell> Package mysql-client is not installed, so not removed shell> Package mysql-server is not installed, so not removed shell> You might want to run 'apt-get -f install' to correct these: shell> The following packages have unmet dependencies: shell> libmysqlclient18 : Depends: mysql-common (>= 5.5.28-0ubuntu0.12.04.2) but it is not going to be installed shell> libmysqlclient18:i386 : Depends: mysql-common:i386 (>= 5.5.28-0ubuntu0.12.04.2) shell> mysql-client-5.5 : Depends: mysql-common (>= 5.5.28-0ubuntu0.12.04.2) but it is not going to be installed shell> mysql-server-5.5 : PreDepends: mysql-common (>= 5.5.28-0ubuntu0.12.04.2) but it is not going to be installed shell> psa-firewall : Depends: plesk-core (>= 11.0.9) but it is not installable shell> Depends: mysql-server but it is not going to be installed shell> psa-spamassassin : Depends: plesk-core (>= 11.0.9) but it is not installable shell> psa-vpn : Depends: plesk-core (>= 11.0.9) but it is not installable shell> Depends: plesk-base (>= 11.0.9) but it is not installable shell> Depends: mysql-server but it is not going to be installed shell> E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). So I said to my self "let's just remove those files with depenencies, too" (that psa-stuff since plesk is virtual and can't be uninstalled)... Guess what happened: shell> Reading package lists... Done shell> Building dependency tree shell> Reading state information... Done shell> Package mysql-client is not installed, so not removed shell> Package mysql-server is not installed, so not removed shell> You might want to run 'apt-get -f install' to correct these: shell> The following packages have unmet dependencies: shell> libmysqlclient18 : Depends: mysql-common (>= 5.5.28-0ubuntu0.12.04.2) but it is not going to be installed shell> libmysqlclient18:i386 : Depends: mysql-common:i386 (>= 5.5.28-0ubuntu0.12.04.2) shell> mysql-client-5.5 : Depends: mysql-common (>= 5.5.28-0ubuntu0.12.04.2) but it is not going to be installed shell> mysql-server-5.5 : PreDepends: mysql-common (>= 5.5.28-0ubuntu0.12.04.2) but it is not going to be installed shell> E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). Of course I tried apt-get -f install, too many times even. What am I doing wrong? No matter, which other packages I include into apt-get --purge remove, I always get new dependencies. Do I have to delete every MySQL-related directory and file manually? Hope there's someone out there who can help me! Cheers! EDIT: After trying apt-get purge mysql-server mysql-common mysql-client libmysqlclient18 libmysqlclient18:i386 mysql-client-5.5 mysql-server-5.5 psa-firewall psa-spamassassin psa-vpn Reading package lists... Done Building dependency tree Reading state information... Done Package mysql-client is not installed, so not removed Package mysql-server is not installed, so not removed You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: libdbd-mysql-perl : Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed libmyodbc : Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed libqt4-sql-mysql:i386 : Depends: libmysqlclient18:i386 (>= 5.5.13-1) but it is not going to be installed php5-mysql : Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed ruby-mysql : Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). So I tried to remove all these and got: Building dependency tree Reading state information... Done Package mysql-client is not installed, so not removed Package mysql-server is not installed, so not removed You might want to run 'apt-get -f install' to correct these:qlclient18:i386 mysql The following packages have unmet dependencies: libmysql-ruby1.8 : Depends: ruby-mysql but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). And actually I think removing that file, too solved my problem :-S Next time I'll try everything before asking :D Thank you Eric for keeping me couraged to just go on removing :D

    Read the article

  • Batch deletion of smaller files from group of files via unix command line

    - by artlung
    I have a large number (more than 400) of directories full of photos. What I want to do is to keep the larger sizes of these photos. Each directory has 31 to 66 files in it. Each directory has thumbnails, and larger versions, plus a file called example.jpg I dispatched the example.jpg file easily with: rm */example.jpg I initially thought that it would be easy to delete the thumbnails, but the problem is they are not consistently named. The typical pattern was photo1.jpg and photo1s.jpg. I did rm */photo*s.jpg but it ended up some of the files named photoXs.jpg were actually larger and not smaller. Argh. So what I want to do is scan each directory for filesize and delete (or move) the thumbnails. I initially thought I'd just ls -R every file and extract the size of each file and save those under a threshold. The problem? In one directory the large will be 1.1 MB and the thumb is 200k. In another the large is 200k and the small 30k. Even worse, the files really are mostly named photo1.jpg - so simply putting them all in the same folder, sorting by size, and deleting in groups would not work without renaming already, and if it's possible I'd prefer to keep them in their folders. I was almost resolved to just doing this all manually, but then thought I'd ask here. How would you do this task?

    Read the article

  • hardlinking takes a lot of space

    - by mr_schlomo
    I made an rsync incremental backup script for my server that will copy a MySQL database backup and a specified folder path to a remote server. Here's the code on Github. Code excerpt from lines 53-57: ############### Create most current hand link echo "Creating most current hard link on backup server $most_recent_backup_link" ssh $remote_backup_server rm -rf ${most_recent_backup_link} ssh $remote_backup_server cp -alv ${remote_backup_folder}/backup-${backup_folder_name}/ ${most_recent_backup_link} I'm having a problem with creating the most current hard links on the backup server (lines 53-57 in the program). Everything works, and rsync only copies about 1-2MB of data. But the hard link copy process uses about 30MB of data. I get a huge laundry list of files that haven't changed and the only ones that have changed are very small in size. Normally this isn't a problem, but when you backup every hour, the backup should be as small as possible. For example, the last backup I did, rsync transferred 1.3MB. But the backup directory grew 35MB. Why are the hard links taking up so much hard drive space?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >