Search Results

Search found 7380 results on 296 pages for 'scripting languages'.

Page 57/296 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • What's the purpose of arrays starting with nonzero index?

    - by helios35
    I tried to find answers, but all I got was answers on how to realize arrays starting with nonzero indexes. Some languages, such as pascal, provide this by default, e.g., you can create an array such as var foobar: array[1..10] of string; I've always been wondering: Why would you want to have the array index not to start with 0? I guess it may be more familiar for beginners to have arrays starting with 1 and the last index being the size of the array, but on a long-term basis, programmers should get used to values starting with 0. Another purpose I could think of: In some cases, the index could actually represent something thats contained in the respective array-entry. e.g., you want to get all capital letters in an array, it may be handy to have an index being the ASCII-Code of the respective letter. But its pretty easy just to subtract a constant value. In this example, you could (in C) simply do something like this do get all capital letters and access the letter with ascii-code 67: #define ASCII_SHIFT 65 main() { int capital_letters[26]; int i; for (i=0; i<26; i++){ capital_letters[i] = i+ASCII_SHIFT; } printf("%c\n", capital_letters[67-ASCII_SHIFT]); } Also, I think you should use hash tables if you want to access entries by some sort of key. Someone might retort: Why should the index always start with 0? Well, it's a hell of a lot simpler this way. You'll be faster when you just have to type one index when declaring an array. Also, you can always be sure that the first entry is array[0] and the last one is array[length_of_array-1]. It is also common that other data structures start with 0. e.g., if you read a binary file, you start with the 0th byte, not the first. Now, why do some programming languages have this "feature" and why do some people ask how to achieve this in languages such as C/C++?, is there any situation where an array starting with a nonzero index is way more useful, or even, something simply cannot be done with an array starting at 0?

    Read the article

  • Useful scripts for Sikuli

    - by Ivo Flipse
    Thanks to Lifehacker I came across Sikuli which is described as: Sikuli is a visual technology to search and automate graphical user interfaces (GUI) using images (screenshots). The first release of Sikuli contains Sikuli Script, a visual scripting API for Jython, and Sikuli IDE, an integrated development environment for writing visual scripts with screenshots easily. Sikuli Script automates anything you see on the screen without internal API's support. You can programmatically control a web page, a desktop application running on Windows/Linux/Mac OS X, or even an iphone application running in an emulator. As this looks very promising, perhaps complementary to AutoHotKey I'm curious what scripts you guys will come up with. Especially since this program is portable and could solve "simple" Super User problems. Example script from their documentation: setThrowException(True) setAutoWaitTimeout(10000) switchApp("System Preferences.app") click() click() click() click() wait() type("192.168.0.1\t") type("255.255.255.0\t") type("192.168.0.254\t") click()

    Read the article

  • Windows 7 won't recognize backup set can I script extracting the files in some other way?

    - by datatoo
    The Windows 7 Backup/Restore created multiple backup sets and I was able to restore the oldest version, but not the most recent, which is not seen by the application. I do see all of the zip files and there are hundreds in later versions. Is there a way to extract each of these correctly outside of the regular restoration method? Perhaps scripting an extract of each day one after another? further clarifying The backup files were all made to an external drive. The original computer died completely, power supply, drives everything. I am trying to reconstruct as much as possible and the only backup set recognized is 6 months older. This was recovered over a new install, but unzipping thousands of zip files is not really a simple unzip copy project as the original paths are not a simple thing to reconstruct.

    Read the article

  • Powershell script for setting password expiry

    - by Pierre E
    Due to mistakes by the helpdesk staff, I found that over a 100 user accounts in my company AD have been set so that their passwords never expire. To avoid the situation in which all these users suddenly find themselves unable to log in, I want to run a script to set the password expiry to a specified date. I'm using Quest AD cmdlets, but I've only used powershell for simple scripts to get lists of users. The attribute I'm trying to modify is 'PasswordStatus' and I want to set those with this attribute set as "password never expires' to a specific date. Not much of a scripting guy, so any help in this would be most welcome.

    Read the article

  • Pidgin: a me-specific log file?

    - by Wolfpack'08
    I'm trying to make a compilation file of all the text sent by me and all the responses that included my name.... What's the best way about scripting this? Is there a plugin like that for pidgin? I'd also like to be able to click on lines to add. For example, someone gives a really useful, easy-to-follow guide to another user, and I think: "I'm going to be doing that tomorrow." Rather than marking and pasting every line of it and skipping through all the other convo, I would like to be able to just click 'send to my personal log,' or something. It seems quite useful, right? And I think that a lot of people would use it. So, please try to provide a comprehensive answer, if possible, or one that I can follow through on.

    Read the article

  • Set security on pattern of sub folders (Server 2003)

    - by Mark Major
    I have a folder structure similar to the one shown below these paragraphs. How do I change security on every 'Photos' folder without clicking through each individually in Windows Explorer? There are about 50 top level folders (Bob, Jim, Eva, etc, etc) which have the same layout of folders inside. I am keen for any suggestions, either scripting or GUI. I am on Windows Server 2003. Cheap/free method would be good, as the company is part of a registered charity. Ideally I would like to do this via DFS path. E.G. \\mycompany.local\Shared\Staff\Bob\ Thanks for reading. Thanks for any info. Mark Bob Review Profile Photos Jim Review Profile Photos Eva Review Profile Photos

    Read the article

  • Script for run script

    - by user31568
    Hello everyone. There is script: Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath Set WSHShell = CreateObject("WScript.Shell") Dim objFSO, objFileCopy Dim strFilePath, strDestination Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set windir = objFSO.getspecialfolder(0) objFSO.CopyFile "\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" _ & strComputer & "\root\cimv2") JobID = "1" Set colScheduledJobs = objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in colScheduledJobs objJob.Delete Next Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ (windir & "\shutdown.vbs", "**093000.000000+660", _ True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId) How make that shutdown.vbs run not at 9:00 once, but run for 9:00 to 12:00 Thanks

    Read the article

  • Nginx & Lua: Hacks, optimizations & observations

    - by Quintin Par
    Following this post on using Lua to increase nginx’s flexibility and in reducing load on the web stack I am curious to know how people are using Lua to enhance nginx’s capability. Are there any notable hacks, optimizations & observations using Lua? Hacks that people have used to discover capability with Nginx that would otherwise be complicated/impossible with a webserver or reverse proxy? Edit: Links: http://thechangelog.com/post/3249294699/super-nginx-killer-build-of-nginx-build-for-luajit-plus http://skillsmatter.com/podcast/home/scripting-nginx-with-lua/te-4729 http://devblog.mixlr.com/2012/06/26/how-we-use-nginx-lua-and-redis-to-beta-ify-mixlr/

    Read the article

  • Cron Script to Delete Folder Contents Every 5 Minutes on Media Temple

    - by Brian Iannone
    I'm not familiar with server-side scripting, but I'm currently using a PHP application on Media Temple to cache JPEGs from four webcams hosted on a server located in the middle of the Indian Ocean. (Hence my reason for caching them in the US.) The webcams are updated every five minutes. The PHP application stores the cached images in http://static.rigic.co/cache/. I would like to create a cron script to automatically delete the contents of "cache" (not the folder itself; just the files inside) at a regular interval.

    Read the article

  • How to script printer creation on a Windows Server 2008 R2 clustered print server?

    - by Massimo
    As per subject. I've found some ways of scripting printer creation on Windows print servers using WMI, but it looks like WMI doesn't support clustered print servers (or clustered servers at all). The scripts in C:\Windows\System32\Printing_Admin_Scripts are useless because, they are not cluster-aware and end up creating the printers on the active cluster node (just like using WMI). The only tool I found that was able to work on a clustered print server is printui.exe (shortcut for rundll32 printui.dll, PrintUIEntry), but it can't create TCP printing ports: it can only add printers if the port already exists. How can I completely script printer creation (including TCP printing ports!) on a clustered Windows Server 2008 R2 print server?

    Read the article

  • Files copying between servers by creation time

    - by driftux
    My bash scripting knowledge is very weak that's why I'm asking help here. What is the most effective bash script according to performance to find and copy files from one LINUX server to another using specifications described below. I need to get a bash script which finds only new files created in server A in directories with name "Z" between interval from 0 to 10 minutes ago. Then transfer them to server B. I think it can be done by formatting a query and executing it for each founded new file "scp /X/Y.../Z/file root@hostname:/X/Y.../Z/" If script finds no such remote path on server B it will continue copying second file which directory exists. File should be copied with permissions, group, owner and creation time. X/Y... are various directories path. I want setup a cron job to execute this script every 10 minutes. So the performance is very important in this case. Thank you.

    Read the article

  • Script for creating directories and subdirectories on SBS 2008

    - by Rich Piedmont
    I have a small business server 2008 and have a directory named LAWFILES. I have a 6 digit file system (eg 106568) and I create a directory to store anything to do with the file (documents, outlook emails, PDFs, WAV files, ect.) I group 100 files in a 4 digit directory (eg 1065) for quicker access. My new years resolution is to organize these directories. I used to have a script the batch created directories and sub directories but it didn't work the last time I tried it (2 years ago). I would like to run a batch file that would ask for the 4 digit directory name (eg 1065) and then create that directory and 100 subdirectories (106500 - 106599) each of which contained subdirectories named "Documents," "Correspondence" & "Email-Voicemail" Can anyone suggest where I would go to find a scripting language that would be available to accomplish this? Thanks for the Help. Rich Piedmont

    Read the article

  • Non-Mainstream Languages, Bad for your resume?

    - by Joe
    Hi folks, I got my BS in Computer Science about seven years ago. I spent two years in neuroscience research and the next three providing what amounts to tech support. But I love computer programming - and I have since written, as a freelancer, non-trivial commercial code in Haskell, Smalltalk, and Objective-C. I used these languages because I find them rewarding, they make me a better programmer and thus, I thought, more attractive to companies. However the polar opposite has occured and I am now unhireable. The freelance market has bottomed out and I am looking for regular employment. But I am being repeatedly turned down, even for entry-level positions, because I don't specifically fit the requirements - eg. Java programmer with 2+ years with JUnit, JavaMail, Servlets etc. And none of the hiring managers, let alone the recruiters, have heard of either Haskell or Smalltalk and more disturbing is their thinly veiled contempt for my background. My question is , how should I market myself to these positions? Is anyone here in a similar position? What should I be doing different professionally? More broadly is this contempt for non-mainstream experience occurring everywhere or just my town? And if there are any hiring managers reading this, I'd love to hear your side. Please be brutally honest. thanks, joe

    Read the article

  • Java (or possibly other languages) learning path

    - by bgo
    I am familiar (as a self-learner) with C, python and php such that i can solve some problems involving simple steps (for example, i easily do calculations for physics lab reports with python which normally would take 4x-5x times longer with a calculator). The point here is, as doing such things, i learnt the idea / concepts of programming language and problem solving along with oop or fuctional programming etc. Recently i have started Java and, with the familiarity of other languages, i am doing well for starters but i need guidence. -I am thinking of learning syntax from sun java tutorials and then practicing with codingbat.com or similar sites. I need a reference book that i can study deeper aspects of the topics i am learning. What do you suggest about these? -The problem is (and always have been) the lack of practice. I need coding and problem-solving practices sources. I stuck at the point where i can't figure out what to do next. Can you suggest any source (possibly like codingbat)? If i could plan a learning trail, i can progress faster and efficiently. So i need ideas, comments, suggestions. Thanks in advance.

    Read the article

  • How do programming languages bind identifiers to functions

    - by sub
    I'm talking about C and/or C++ here as this are the only languages I know used for interpreters where the following could be a problem: If we have an interpreted language X how can a library written for it add functions to the language which can then be called from within programs written in the language? PHP example: substr( $str, 5, 10 ); How is the function substr added to the "function pool" of PHP so it can be called from within scripts? It is easy for PHP storing all registered function names in an array and searching through it as a function is called in a script. However, as there obviously is no eval in C(++), how can the function then be called? I assume PHP doesn't have 100MB of code like: if( identifier == "substr" ) { return PHP_SUBSTR(...); } else if( ... ) { ... } Ha ha, that would be pretty funny. I hope you have understood my question so far. How do interpreters solve this problem? How can I solve this for my own experimental toy interpreter?

    Read the article

  • How do the size standard libraries compare for different languages

    - by Roman A. Taycher
    Someone was recently raving about how great jQuery was and how it made javascript into a pleasure and also how the whole source code was so small(and one file). I looked it up on www.ohloh.net/ and it said it was about 30,000 lines of javascript, when I tired curl piped to wc it said about 5000 lines(strange discrepancy that, maybe test suites, ect?). I thought well it isn't that strange since javascript from what I've heard has a lot of fun dynamic tricks, so you can probably get away with a small library. But then I thought what about other high level languages, the ones with large standard libraries and wondered how big the standard are for python/ruby/haskell/pharo(smalltalk)/*ml/ect. (libraries not vm stuff to the degree its possible to separate it) Anybody know? Any details (comment/blank/code lines , test code lines, lines in language vs lines in ffi/byte-code) are appreciated! edit: ps. since it started this me asking about jQuery as a bonus if you could please list the size of mega frameworks, a megaframewok provides so much that people using an x megaframework in language y might sometimes refer to programming in xy or even x rather then in y (ie. : qt, jQuery, etc.).

    Read the article

  • Flowcharting functional programming languages

    - by Sadface
    Flowcharting. This ancient old practice that's been in use for over 1000 years now, being forced upon us poor students, without any usefulness (or so do I think). It might work well with imperative, sequentially running languages, but what about my beloved functional programming? Sadly, I'm forced to create a flow chart for my programm (that is written in Haskell). I imagine it being easy for something like this: main :: IO () main = do someInput <- getLine let upped = map toUpper someInput putStrLn upped Which is just 3 sequenced steps, fetching data, uppercasing it, outputting it. Things look worse this time: main :: IO () main = do someInput <- fmap toUpper getLine putStrLn someInput Or like this: main :: IO () main = interact (map toUpper) Okay, that was IO, you can handle that like an imperative language. What about pure functions? An actual example: onlyMatching :: String -> [FilePath] -> [FilePath] onlyMatching ext = filter f where f name = lower ('.' : ext) == (lower . takeExtension $ name) lower = map toLower How would you flowchart that last one?

    Read the article

  • What'd be a good pattern on Doctrine to have multiple languages

    - by PERR0_HUNTER
    Hi! I have this challenge which consist in having a system that offers it's content in multiple languages, however a part of the data contained in the system is not translatable such as dates, ints and such. I mean if I have a content on the following YAML Corporativos: columns: nombre: type: string(254) notnull: true telefonos: type: string(500) email: type: string(254) webpage: type: string(254) CorporativosLang: columns: corporativo_id: type: integer(8) notnull: true lang: type: string(16) fixed: false ubicacion: type: string() fixed: false unsigned: false primary: false notnull: true autoincrement: false contacto: type: string() fixed: false unsigned: false primary: false notnull: true autoincrement: false tipo_de_hoteles: type: string(254) fixed: false unsigned: false primary: false notnull: true autoincrement: false paises: type: string() fixed: false unsigned: false primary: false notnull: true autoincrement: false relations: Corporativo: class: Corporativos local: corporativo_id foreign: id type: one foreignAlias: Data This would allow me to have different corporative offices, however the place of the corp, the contact and other things can be translate into a different language (lang) Now this code here would create me a brand new corporative office with 2 translations $corporativo = new Corporativos(); $corporativo->nombre = 'Duck Corp'; $corporativo->telefonos = '66303713333'; $corporativo->email = '[email protected]'; $corporativo->webpage = 'http://quack.com'; $corporativo->Data[0]->lang = 'en'; $corporativo->Data[0]->ubicacion = 'zomg'; $corporativo->Data[1]->lang = 'es'; $corporativo->Data[1]->ubicacion = 'zomg amigou'; the thing now is I don't know how to retrieve this data in a more friendly way, because if I'd like to access my Corporative info in english I'd had to run DQL for the corp and then another DQL for the specific translation in english, What I'd love to do is have my translatable fields available in the root so I could simply access them $corporativo = new Corporativos(); $corporativo->nombre = 'Duck Corp'; $corporativo->telefonos = '66303713333'; $corporativo->email = '[email protected]'; $corporativo->webpage = 'http://quack.com'; $corporativo->lang = 'en'; $corporativo->ubicacion = 'zomg'; this way the translatable fields would be mapped to the second table automatically. I hope I can explain my self clear :( any suggestions ?

    Read the article

  • How fast should an interpreted language be today?

    - by Tarbal
    Is speed of the (main/only viable) implementation of an interpreted programming language a criteria today? What would be the optimal balance between speed and abstraction? Should scripting languages completely ignore all thoughts about performance and just follow the concepts of rapid development, readability, etc.? I'm asking this because I'm currently designing some experimental languages and interpreters

    Read the article

  • How can I sandbox Python in pure Python?

    - by Blixt
    I'm developing a web game in pure Python, and want some simple scripting available to allow for more dynamic game content. Game content can be added live by privileged users. It would be nice if the scripting language could be Python. However, it can't run with access to the environment the game runs on since a malicious user could wreak havoc which would be bad. Is it possible to run sandboxed Python in pure Python? If not, are there any open source script interpreters written in pure Python that I could use? The requirements are support for variables, basic conditionals and function calls (not definitions).

    Read the article

  • PowerShell Script to Find and Replace for all Files with a Specific Extension

    - by Brandon
    I have several configuration files on Windows Server 2008 nested like such: C:\Projects\Project_1\project1.config C:\Projects\Project_2\project2.config In my configuration I need to do a string replace like such: <add key="Environment" value="Dev"/> will become: <add key="Environment" value="Demo"/> I thought about using batch scripting, but there was no good way to do this, and I heard that with PowerShell scripting you can easily perform this. I have found examples of find/replace, but I was hoping for a way that would traverse all folders within my C:\Projects directory and find any files that end with the '.config' extension. When it finds one, I want it to replace my string values. Any good resources to find out how to do this or any PowerShell gurus that can offer some insight?

    Read the article

  • Does the Frontier Kernel have a future?

    - by pbreitenbach
    Whatever you think about Dave Winer, Frontier is an incredible piece of software. It includes quite a few advances that have yet to be surpassed: the object database, the database viewer, the scripting environment, the hierarchical-including website generation scheme, the elegant scripting language, the mixing of scripts and compilation, rapid prototyping, built in web server, simple debugger, cross-platform, simple UI, etc. My question: Dave turned Frontier over to open source and there is a Frontier Kernel project. However it is fairly quiet. Does Frontier have a future from here?

    Read the article

  • Ruby on Rails: What are Erubis' disadvantages and why isn't it packaged with Rails by default? How t

    - by williamjones
    I just discovered Erubis, a replacement for the default view renderer for Ruby on Rails. However, from what I can tell from reading about it, it's superior across the board. It is much faster. It has many more options. It can prevent cross site scripting without having to use h. Does this have any disadvantages versus the standard erb renderer? Why isn't this the standard renderer packaged with Rails? Also, the docs for Erubis say to install it just by installing the gem, and then add the following to environment.rb: require 'erubis/helpers/rails_helper' #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby Reading the docs, FastEruby seems to be just a faster renderer than Eruby. Why wouldn't it be default and used by everyone? I'm highly interested in using the engine erubis::EscapedEruby which automatically calls h to escape html on fields from the database. Are there any gotchas I should be aware of or does this pretty much solve all cross site scripting?

    Read the article

  • Checking if parsed date is within a date range

    - by Brett Powell
    So I am using a scripting language with c++-like syntax, and I am trying to think of the best way to check if a date is within range. The problem I am running into is that if the current day is in a new month, the check is failing. Here is what my code looks like: if(iMonth >= iStartMonth && iMonth <= iEndMonth) { if(iDay >= iStartDay && iDay <= iEndDay) { if(iYear >= iStartYear && iYear <= iEndYear) { bEnabled = true; return; When I have something like this: Start date: 3 27 2010 End Date: 4 15 2010 Current Date: 3 31 2010 The day check fails because if (iDay <= iEndDay) does not pass. The scripting language doesn't have a lot of time related functions, and I can't compare timestamps because I'm allowing users to put like "03:27:2010" and "04:15:2010" as start/end dates in a config file. I'm assuming I am just not thinking straight and missing an easy fix.

    Read the article

  • How to copy files from local machine to server using SSH file transfer protocol?

    - by morpheous
    I have an Ubuntu 9.10 desktop machine which I use locally. I am setting up a server on a hosting provider. The server will run a very minimal version of Ubuntu server LTS (only LAMP and email server no GUI). I want to write a script (scheduled as a cron job) that will allow me to upload local files onto the server. I want to use [SFTP][1], for security reasons. I am new to shell scripting - but I guess shell scripting is the way to do this (unless I am mistaken). Can anyone provide me with the initial pointers on how to go about writing such a script, in order to SECURELY upload local files to the server? Ideally, I would like to compress the files before the transfer (to save on bandwidth) [1]: http://SSH file transfer protocol

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >