Search Results

Search found 25663 results on 1027 pages for 'script programmer'.

Page 23/1027 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • The most dangerous SQL Script in the world!

    - by DrJohn
    In my last blog entry, I outlined how to automate SQL Server database builds from concatenated SQL Scripts. However, I did not mention how I ensure the database is clean before I rebuild it. Clearly a simple DROP/CREATE DATABASE command would suffice; but you may not have permission to execute such commands, especially in a corporate environment controlled by a centralised DBA team. However, you should at least have database owner permissions on the development database so you can actually do your job! Then you can employ my universal "drop all" script which will clear down your database before you run your SQL Scripts to rebuild all the database objects. Why start with a clean database? During the development process, it is all too easy to leave old objects hanging around in the database which can have unforeseen consequences. For example, when you rename a table you may forget to delete the old table and change all the related views to use the new table. Clearly this will mean an end-user querying the views will get the wrong data and your reputation will take a nose dive as a result! Starting with a clean, empty database and then building all your database objects using SQL Scripts using the technique outlined in my previous blog means you know exactly what you have in your database. The database can then be repopulated using SSIS and bingo; you have a data mart "to go". My universal "drop all" SQL Script To ensure you start with a clean database run my universal "drop all" script which you can download from here: 100_drop_all.zip By using the database catalog views, the script finds and drops all of the following database objects: Foreign key relationships Stored procedures Triggers Database triggers Views Tables Functions Partition schemes Partition functions XML Schema Collections Schemas Types Service broker services Service broker queues Service broker contracts Service broker message types SQLCLR assemblies There are two optional sections to the script: drop users and drop roles. You may use these at your peril, particularly as you may well remove your own permissions! Note that the script has a verbose mode which displays the SQL commands it is executing. This can be switched on by setting @debug=1. Running this script against one of the system databases is certainly not recommended! So I advise you to keep a USE database statement at the top of the file. Good luck and be careful!!

    Read the article

  • Script to gather all the files ending in .log and create a tar.gz file.

    - by Oscar Reyes
    I'm currently using this script line to find all the log files from a given directory structure and copy them to another directy where I can easily compress them. find . -name "*.log" -exec cp \{\} /tmp/allLogs/ \; The problem I have, is, the directory/subdirectory information gets lost because, I'm copying only the file. For instance I have: ./product/install/install.log ./product/execution/daily.log ./other/conf/blah.log And I end up with: /tmp/allLogs/install.log /tmp/allLogs/daily.log /tmp/allLogs/blah.log And I would like to have: /tmp/allLogs/product/install/install.log /tmp/allLogs/product/execution/daily.log /tmp/allLogs/other/conf/blah.log

    Read the article

  • Linux script that indicates time the server was offline?

    - by RD
    Below is data taken from my dedicated server: root@namhost [~]# last root pts/0 XXX Tue May 18 09:46 still logged in root pts/0 XXX Mon May 17 08:51 - 12:18 (03:26) reboot system boot XXX Mon May 17 08:49 (1+00:59) root pts/0 XXX Sun May 16 11:50 - 13:15 (01:25) root@namhost [~]# last | grep "system boot" reboot system boot 2.6.18-164.15.1. Mon May 17 08:49 (1+01:02) reboot system boot 2.6.18-164.el5 Tue May 11 04:20 (7+05:31) reboot system boot 2.6.18-164.el5 Tue May 11 03:53 (7+05:58) reboot system boot 2.6.18-128.el5 Mon Oct 5 22:40 (-3:-50) .... I need a script that I can run on an hourly basis that will: 1. Calculate the total downtime since the first date 2. The overall downtime percentage 3. Store this data in a file at /home/bla/file.txt, in the following format: TotalDowntime=03:02:02 Average=0.01% How do I go about doing this?

    Read the article

  • How do I create a script that checks if a computer is connected via wireless or ethernet?

    - by user4941
    I am using log-me-in Central to look after a few dozen computers. These computers are used both for home use and work use. When the computers are used for work, they should not be connected via wireless. In the best case, I'd like to be able to use LogMeIn to prevents users on shift from connecting wirelessly. Still acceptable would be to have the computer email me if it connects wirelessly. If I knew how to set up a script that checks to see if the computer connected wirelessly and I could send an email, then I would be set.

    Read the article

  • determine the archetecture of a mac from the command line or script?

    - by Brian Postow
    I'm writing a shell script, and I need to know the archetecture, ie PPC or Intel. Back in the day, there was a program /bin/arch that told you, but my mac doesn't seem to have it... Is there an easy way I can do this? Grep for something in a logfile? call some other program that spits that out as a side effect? It would be nice to know what OS Version I'm running too, but that may not be necessary. thanks

    Read the article

  • Determine the architecture of a Mac from the command line or script?

    - by Brian Postow
    I'm writing a shell script, and I need to know the archetecture, ie PPC or Intel. Back in the day, there was a program /bin/arch that told you, but my mac doesn't seem to have it... Is there an easy way I can do this? Grep for something in a logfile? call some other program that spits that out as a side effect? It would be nice to know what OS Version I'm running too, but that may not be necessary. thanks

    Read the article

  • Script/scheduled task to clean up Dowloads folder (Windows 7)?

    - by Andrew
    My downloads folder is my primary connection to the internet (and thus the world), and has rapidly become a virtual junk drawer. I imagine I'm not alone here. What I'd like to do is have some sort of a script that -creates a new folder (named YYYY_MM Archive so it sorts nicely) -takes everything* inside of the Downloads folder (for the current user) -moves it to the new folder and have this run once/month. *(excluding previous archives) This strikes me as the type of thing Saw some answers on related questions that seemed to suggest that this is an eminently doable task in PowerShell. Is it? I'm on Windows 7 Enterprise.

    Read the article

  • user input of one php script pass to another php without modification in first php script

    - by ish12
    hi all.. Consider two php scripts(o.php & t.php) o.php contains both html and php. html here gets user input for eg:user name and password this information is passed to php using php-self. I want the user input of o.php passed to t.php without any modification in o.php. I ve used include and require in the t.php but the problem is it displays the output of o.php but i need only the user input values from o.php without displaying the output of o.php. Using functions or session in o.php we can pass user input but am in the situation tat i should not add or modify o.php. thanks in advance!!

    Read the article

  • How can a student programmer improve his teamwork skill?

    - by Turtle
    I am a student right now. Recently, I am working in a project as a leader with three other students. Due to the lack of experience, our project is progressing slowly and our members are frustrated. They do not feel sense of accomplishment in the project. I am pressured and frustrated, too. But as a team leader, I think I need to push them. But I do not know how to do. Do I help them solve coding problem or just encouragement? But if I pay too much attention on it, it would slow down my own progress. It is a not technical question, but it is very common in software development. I hope veteran programmers would give me some suggestions. Thanks!

    Read the article

  • running "./script" gets syntax error after import statements, but "python script" works fine

    - by nzomkxia
    I'm doing something with the sys.argv in python here is the code: age1.py import datetime import os import sys if len(sys.argv) == 2: now_time = datetime.datetime.now() future_time = now_time + datetime.timedelta(int(sys.argv[1])) print "date in", sys.argv[1],"days",future_time elif len(sys.argv) == 4: print "three paras" spe_time = datetime.datetime(int(sys.argv[1]),int(sys.argv[2]),int(sys.argv[3])) now_time = datetime.datetime.now() diff_time = now_time - spe_time print "days since then..." , diff_time if I run the code in bash like: python age1.py xxxx, the program goes fine but if I run that like ./age1.py xxxx, the mouse will become a symbol like "+", then the program ends up with: "./age1.py: line 5: syntax error near unexpected token `sys.argv' ./age1.py: line 5: `if len(sys.argv) == 2:' system: Ubuntu 10.10 Python 2.7.3 any reason for that?

    Read the article

  • Programmer Health - how to avoid going blind and sick!

    - by stefanyko
    Hi All! this is my very first time here! so nice to meet you guys! ;-) When i was starting with this job, ( when i have chosed of doing this for the rest of my life) i have thinked also, one day, before or after, i would become blind or at least sick by drinking 5 or more coffee per day and of course by sitting down on my pc for hours!!! ;-\ From many years now, i'm asking myself how my eyes can stay in front o the monitor for so many hours per day!? well now i'm to a point of no return!!! i feel my eyes each day more tired, and my productivity is waning, but i can't change work now and i don't want do this!!!! what i need to do for prevent this to become a more serious problem for me and for my eyes!? any suggestion will be really appreciated!!! Thanks!

    Read the article

  • JAVA or JAVA SCRIPT OR Idoc SCRIPT alphabetical sort

    - by tito86
    Hi folks, I have a task: All items within categories should be sorted alphabetically except for Examples. Special characters and numbers should be displayed before letters. I'm facing with a problem. Most of standart sort functions and plugins are being used the ASCII table. In this table the following symboles: ~,},{ etc. have the index more than letters,for example: Actual result of sorting is: 1 - #1 A T 2 - A T 3 - {C T I need to get: 1 - #1 A T 2 - {C T 3 - A T Plese give me your piece of advice or sny examples ASAP. Best Regards.

    Read the article

  • Override properties block when including a psake script in an other psake script

    - by DanceAlot
    I am new to psake and I have this issue: I have 2 psake scripts: (1): base_tasks.ps1: properties{ $a = "hello" $b = "hi" } task One{ Write-Host $a } (2): install.ps1 Include .\base_tasks.ps1 properties{ $a = "Goodbye" $b = "Adjeu" } task default -depends One Now, is it possible to override the properties and variables from file 1? I want to use file 1 as "base tasks" and use the tasks in the install.ps1 and override the properties. Or do I have to do that an other way? I will invoke install.ps1 and use my $a and $b from install.ps1. DanceAlot

    Read the article

  • What are the advantages and disadvantages to using your real name online?

    - by Jon Purdy
    As a programmer, do you see any professional or other advantage in using your real name in online discourse, versus an invented handle? I've always gone by a single username and had my real name displayed whenever possible, for a few reasons: My interests online are almost exclusively professional and aboveboard. It constructs a search-friendly public log of all of my work, everywhere. If someone wants to contact me, there are many ways to do it. My portfolio of work is all tied to me personally. Possible cons to full disclosure include: If you feel like becoming involved in something untoward, it could be harder. The psychopath who inherits your project can more easily find out where you live. You might be spammed by people who are not worth the precious time that could be better spent writing more of the brilliant software you're famous for. Your portfolio of work is all tied to you personally. It seems, anyway, that a vast majority of StackOverflow users go by invented handles rather than real names. Notable exceptions include the best-known users, who are typically well established in the industry. But how could we ever become legendary rockstar programmers if we didn't get our names out there? Discuss.

    Read the article

  • What do you feel are characteristics of a mature programmer?

    - by blparker
    Hey all. As part of ongoing research that I am conducting, I would like to ask a crowd, that I feel is the most qualified, to answer a question. What does the community feel are characteristics of a mature programmer? I'm not asking the question because I'm looking to hire or anything of that nature. A colleague and I repeatedly hear a trend throughout universities and specifically computer science departments. The students generally ask questions of the form: How can I become a mature programmer? How can I become a world class programmer? What steps should a new programmer take to become more skilled? So, with that, we are conducting research to attempt to identify an optimized path that would allow an introductory programmer to advance to that of a skilled/mature programmer. Now, I understand that there are many "it depends" out there depending on what vertical industry one works in, but I feel we can determine many common characteristics irrespective of the industry. Any thing you can offer is greatly appreciated. Thanks.

    Read the article

  • Are you satisfied with your programming? [closed]

    - by Richart Bremer
    If you are a programmer, are you satisfied with it? I really love to code. I code all kinds of things. I used to play computer games but they are not that interesting compared to developing a new search algorithm or similar. But sometimes I look into the future and see myself being 80 years old, sitting in front of a computer and everything I will have written will be rewritten because the programming languages do not exist anymore. I look back on my life and think "that's it?". Everything I wrote in the past is virtual and ultimately gone. I tried other things but coding is the only thing that does it for me. And at the same time I think I am wasting my life. What about you? Disclaimer: I presume this is the best forum for this question. If you don't agree suggest better place to migrate the question. If you can't, don't close it. Thank you.

    Read the article

  • Converting a generic list into JSON string and then handling it in java script

    - by Jalpesh P. Vadgama
    We all know that JSON (JavaScript Object Notification) is very useful in case of manipulating string on client side with java script and its performance is very good over browsers so let’s create a simple example where convert a Generic List then we will convert this list into JSON string and then we will call this web service from java script and will handle in java script. To do this we need a info class(Type) and for that class we are going to create generic list. Here is code for that I have created simple class with two properties UserId and UserName public class UserInfo { public int UserId { get; set; } public string UserName { get; set; } } Now Let’s create a web service and web method will create a class and then we will convert this with in JSON string with JavaScriptSerializer class. Here is web service class. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace Experiment.WebService { /// <summary> /// Summary description for WsApplicationUser /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class WsApplicationUser : System.Web.Services.WebService { [WebMethod] public string GetUserList() { List<UserInfo> userList = new List<UserInfo>(); for (int i = 1; i <= 5; i++) { UserInfo userInfo = new UserInfo(); userInfo.UserId = i; userInfo.UserName = string.Format("{0}{1}", "J", i.ToString()); userList.Add(userInfo); } System.Web.Script.Serialization.JavaScriptSerializer jSearializer = new System.Web.Script.Serialization.JavaScriptSerializer(); return jSearializer.Serialize(userList); } } } Note: Here you must have this attribute here in web service class ‘[System.Web.Script.Services.ScriptService]’ as this attribute will enable web service to call from client side. Now we have created a web service class let’s create a java script function ‘GetUserList’ which will call web service from JavaScript like following function GetUserList() { Experiment.WebService.WsApplicationUser.GetUserList(ReuqestCompleteCallback, RequestFailedCallback); } After as you can see we have inserted two call back function ReuqestCompleteCallback and RequestFailedCallback which handle errors and result from web service. ReuqestCompleteCallback will handle result of web service and if and error comes then RequestFailedCallback will print the error. Following is code for both function. function ReuqestCompleteCallback(result) { result = eval(result); var divResult = document.getElementById("divUserList"); CreateUserListTable(result); } function RequestFailedCallback(error) { var stackTrace = error.get_stackTrace(); var message = error.get_message(); var statusCode = error.get_statusCode(); var exceptionType = error.get_exceptionType(); var timedout = error.get_timedOut(); // Display the error. var divResult = document.getElementById("divUserList"); divResult.innerHTML = "Stack Trace: " + stackTrace + "<br/>" + "Service Error: " + message + "<br/>" + "Status Code: " + statusCode + "<br/>" + "Exception Type: " + exceptionType + "<br/>" + "Timedout: " + timedout; } Here in above there is a function called you can see that we have use ‘eval’ function which parse string in enumerable form. Then we are calling a function call ‘CreateUserListTable’ which will create a table string and paste string in the a div. Here is code for that function. function CreateUserListTable(userList) { var tablestring = '<table ><tr><td>UsreID</td><td>UserName</td></tr>'; for (var i = 0, len = userList.length; i < len; ++i) { tablestring=tablestring + "<tr>"; tablestring=tablestring + "<td>" + userList[i].UserId + "</td>"; tablestring=tablestring + "<td>" + userList[i].UserName + "</td>"; tablestring=tablestring + "</tr>"; } tablestring = tablestring + "</table>"; var divResult = document.getElementById("divUserList"); divResult.innerHTML = tablestring; } Now let’s create div which will have all html that is generated from this function. Here is code of my web page. We also need to add a script reference to enable web service from client side. Here is all HTML code we have. <form id="form1" runat="server"> <asp:ScriptManager ID="myScirptManger" runat="Server"> <Services> <asp:ServiceReference Path="~/WebService/WsApplicationUser.asmx" /> </Services> </asp:ScriptManager> <div id="divUserList"> </div> </form> Now as we have not defined where we are going to call ‘GetUserList’ function so let’s call this function on windows onload event of javascript like following. window.onload=GetUserList(); That’s it. Now let’s run it on browser to see whether it’s work or not and here is the output in browser as expected. That’s it. This was very basic example but you can crate your own JavaScript enabled grid from this and you can see possibilities are unlimited here. Stay tuned for more.. Happy programming.. Technorati Tags: JSON,Javascript,ASP.NET,WebService

    Read the article

  • Dangerous programming

    - by benhowdle89
    Ok, i'm talking pure software/web, i'm not on about code to power Life Support machines or NASA rockets. In terms of software/web development what is the most dangerous single piece of code someone could put into a program (say if they had a grudge against a client/employee) In PHP, the first thing that comes to mind is some sort of file deletion: function EmptyDir($dir) { $handle=opendir($dir); while (($file = readdir($handle))!==false) { echo "$file <br>"; @unlink($dir.'/'.$file); } closedir($handle); } EmptyDir('images'); Or a PHP script that takes a user's sensitive input and posts it to Google sitemap or something? I hope this doesnt get closed off as subjective as there surely must be a ranking order of dangerous code. So i'm asking for the No.1 spot :) DISCLAIMER: I have no grudges against anyone, just curious for the answer!

    Read the article

  • Windows 2008 startup script will not run?

    - by larsks
    I am trying to get a very simple batch script to run when my Windows 2008 Server (R2) system starts up. I have added the script to the "Startup Scripts" in the local group policy by running gpedit.msc, and I see the script listed under Windows Settings/Scripts (Startup/Shutdown)/Startup when I run rsop.msc, but the script is not being executed. The "Last Executed" column in rsop is empty even after a reboot, and a file that should be created by the script is never created. At the moment, the entire contents of the script are: rem Check if this script is running. date /t > c:\temp\flag The target directory (c:\temp) exists. The script is called c:\scripts\startup.bat, and works fine if I run it by hand.

    Read the article

  • Different behaviour of script locally and over ssh

    - by neorg
    I have a script on a server-A Script-A #!/bin/bash -l echo "script-A.sh" | change-environment.sh When I ssh onto server-A and execute it, it works fine. However, when I ssh user@server-A ./script-A.sh Script-A executes, but throws an undefined variable error in change-environment.sh. change-environment.sh runs in the c shell(I have no control over the script so the method I have used is about the only way I can use it), but everything else is in bash. Had found a similar question at I can run a script locally, but cannot do "ssh HOSTNAME /path/to/script.sh". However, there was no solution to the issue and it was a year old.

    Read the article

  • I am not satisfied with my career and accomplished nothing in my life. what should I do now [on hold]

    - by user2906155
    After my complete my College education I got chance to work on software programming. I work on few software and now nothing make me feel good. I don't like web-programming. Can't have too much mind to play with other people in team a designer or a senior. it's totally time wasting for me. We do integration without any source code control. copy through pen drive. I write in too many language for web-programming but know nothing about any language specially. I don't like to have a BOSS. I would like to do something on my own. From last 3 year I thing I will got a better job but I am unable to get it. I am not good at Programming nor my English is native. I have a big list for pay then my salary. I have problem with nothing. my atmosphere is about illiterate people. they abuse 24 hours a day. this thing make me sick. people watch CRIME patrol my home (watching rape in TV because it's happen to someone). I do my work from home. I don't like to live in my state. All state is one of the biggest illiterate state of my country. Once I apply for a Job in China and it's look like I can get thing Job but I don't get it. My family doesn't want me to settle anywhere else. I told my family 4 time a day that I can't live in this worst situation. Everyone (including the person who I work for) tell me that you can do it only you have money. Now I really don't know how to make money. My job not allow me to work for anyone. My productivity going down since I don't learn anything new. I thing if this happen to me for next 2 year I don't have any knowledge more then a peon. I hate it. When I was in other city then I see that if I spent 7 days their all my 7 days going better. even I go for travelling in green places then I like it. but all I hate it where I work for. When I work on other city then I see my productivity are improved and I don't hate my work. I listen a song "If you don't your love what are you doing it for". I seriously don' t know what I still live here because this place gave me nothing but depression and trouble. for people I clear that I don't belong to RICH or middle class family. All I got is doing something on my own or help of someone. affording a rental place make my run on footpath. All I save in one month is just 10$ (approximately) (actually I afford some guys's education now). Can a programmer live worst life like this. I really not happy. Today is a festival in India and I don't celebrate it because I really hate myself. I want to do suicide. someone guide me how to start solving this headache

    Read the article

  • Lua and Objective C not running script.

    - by beta
    I am trying to create an objective c interface that encapsulates the functionality of storing and running a lua script (compiled or not.) My code for the script interface is as follows: #import <Cocoa/Cocoa.h> #import "Types.h" #import "lua.h" #include "lualib.h" #include "lauxlib.h" @interface Script : NSObject<NSCoding> { @public s32 size; s8* data; BOOL done; } @property s32 size; @property s8* data; @property BOOL done; - (id) initWithScript: (u8*)data andSize:(s32)size; - (id) initFromFile: (const char*)file; - (void) runWithState: (lua_State*)state; - (void) encodeWithCoder: (NSCoder*)coder; - (id) initWithCoder: (NSCoder*)coder; @end #import "Script.h" @implementation Script @synthesize size; @synthesize data; @synthesize done; - (id) initWithScript: (s8*)d andSize:(s32)s { self = [super init]; self->size = s; self->data = d; return self; } - (id) initFromFile:(const char *)file { FILE* p; p = fopen(file, "rb"); if(p == NULL) return [super init]; fseek(p, 0, SEEK_END); s32 fs = ftell(p); rewind(p); u8* buffer = (u8*)malloc(fs); fread(buffer, 1, fs, p); fclose(p); return [self initWithScript:buffer andSize:size]; } - (void) runWithState: (lua_State*)state { if(luaL_loadbuffer(state, [self data], [self size], "Script") != 0) { NSLog(@"Error loading lua chunk."); return; } lua_pcall(state, 0, LUA_MULTRET, 0); } - (void) encodeWithCoder: (NSCoder*)coder { [coder encodeInt: size forKey: @"Script.size"]; [coder encodeBytes:data length:size forKey:@"Script.data"]; } - (id) initWithCoder: (NSCoder*)coder { self = [super init]; NSUInteger actualSize; size = [coder decodeIntForKey: @"Script.size"]; data = [[coder decodeBytesForKey:@"Script.data" returnedLength:&actualSize] retain]; return self; } @end Here is the main method: #import "Script.h" int main(int argc, char* argv[]) { Script* script = [[Script alloc] initFromFile:"./test.lua"]; lua_State* state = luaL_newstate(); luaL_openlibs(state); luaL_dostring(state, "print(_VERSION)"); [script runWithState:state]; luaL_dostring(state, "print(_VERSION)"); lua_close(state); } And the lua script is just: print("O Hai World!") Loading the file is correct, but I think it messes up at pcall. Any Help is greatly appreciated. Heading

    Read the article

  • What exactly happens when Complex Script Support is enabled?

    - by Ravi Chhabra
    When we click the check box "Install files for complex script and right to left languages (including Thai)" in Regional and Language settings what exactly happens? Changes to registry keys? I noticed that it installs some .fon files and keyboard dlls. Is this totally necessary if one just wish to read complex script on Windows XP? My test inside VirutalBox as Windows 7 as the host OS seems to indicate that for reading Complex Script need not be enabled. Yet that's not what all the literature on the subject says. What's going on?

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >