Search Results

Search found 9082 results on 364 pages for 'c functions'.

Page 79/364 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • passing on command line options in bash

    - by bryan
    I have a question. I have a script, a kind of long script written in bash aprox. 370 lines. That has several functions and in those functions the user has to enter information which is then stored in files. ( This is suppose to represent a MySQL database, with the functions INSERT, UPDATE, SELECT, SELECT where x=y.) I created this myself in bash, now the only thing that rests me is that I need to be able to pass arguments on the command line to the script, that will do the same as the script does. I know that bash has positional parameters such as $1 $2 $3 $* $@ $0 ( refers to the name of the script) etc. I know how I can use these parameters in a simple if function. This is not enough for my script. I basicly need to do the same thing that the script does, but then from the command line. I have been struggling with this for a couple of days now and I cannot think of a way to get it to work. Maybe someone here can help me with this? If you want to have the script. That can be possible, but I don't think I can paste it in here... EDIT: Link to script, http://pastebin.com/Hd5VsDv2 Note, I am a beginner in bash scripting. EDIT: This is in reply to Answer 1. As I said I hope I can just replace the if [ "$1" = "one" ] ; then echo "found one" to if [ "$1" = "one" ] ; then echo SELECT where SELECT is the function I previously had in my script(above) http://pastebin.com/VFMkBL6g LINK to testing script

    Read the article

  • Exchange 2010 Transport rules stepping on each other

    - by TopHat
    I have a group of users that I have to restrict email access for and so far using Exchange Transport Rules has worked very well. The problem I am having is that Rule 0 is supposed to bcc the email to a review mailbox but otherwise not change anything and Rule 9 is supposed to block the email and throw a custom NDR to tell the user why they were blocked. Here are my results in practice however. If Rule 0 is enabled and Rule 9 is enabled then only Rule 9 functions If Rule 0 is disabled and Rule 9 is enabled then Rule 9 functions If Rule 0 is enabled and Rule 9 is disabled then Rule 0 functions This is after the Transport Service has been restarted (multiple times actually). I have other rule pairs that work correctly. None of these are overlapping rulesets however. - copy email going to address outside domain and then block - copy email coming in from outside and then block Here is the rule for copying internal emails (Rule 0): Apply rule to messages from a member of Blind carbon copy (Bcc) the message to except when the message is sent to a member of or [email protected] Here is the rule to block the same email (rule 9): Apply rule to messages from a member of send 'Email to non-supervisors or managers has been prohibited. Please contact your supervisor for more information.' to sender with 5.7.420 except when the message is sent to , [email protected], The distribution group used for membership in these rules is used for the other blocking and copying rules and works as expected. Is there something I missed in this setup? All of the copy rules are at the front of the transport rule group and all the actual copies at at the end of the queue if that makes a difference. Any thoughts as to why the email doesn't get copied when it gets blocked?

    Read the article

  • How to autorun wpa_supplicant on Debian startup

    - by The Electric Muffin
    I'd like to run wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf on Debian startup (runlevels 2-5). I found some vague instructions from a related question that said to put a script in /etc/init.d/ and then symlink to it from the apropriate /etc/rcRUNLEVEL.d/ directories. However, I noticed that there are already some files named "wpasupplicant" that probably run at startup: /etc/network/if-down.d/wpasupplicant /etc/network/if-post-down.d/wpasupplicant /etc/network/if-pre-up.d/wpasupplicant /etc/network/if-up.d/wpasupplicant They all are symlinks to the same script, /etc/wpa_supplicant/ifupdown.sh. It has a comment at the beginning saying it "[...] allows ifup(8), and ifdown(8) to manage wpa_supplicant(8) and wpa_cli(8) processes running in daemon mode." However, the closest it gets to calling wpa_supplicant itself is (in functions.sh): WPA_SUP_BIN="/sbin/wpa_supplicant" [snip] start-stop-daemon --start --oknodo $DAEMON_VERBOSITY \ --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \ -- $WPA_SUP_OPTIONS $WPA_SUP_CONF [snip] start-stop-daemon --stop --oknodo $DAEMON_VERBOSITY \ --exec $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE Does that mean it's safe to make an init.d script for wpa_supplicant, and if so what would it look like? General info: Debian Squeeze (5.0) official wpasupplicant package (v0.6.10-2.1) The full contents of my system's functions.sh and ifupdown.sh are here (dependent, of course, on my system's uptime—it's a five-year-old laptop that greatly enjoys overheating): functions.sh ifupdown.sh

    Read the article

  • ASP.NET web forms as ASP.NET MVC

    - by lopkiju
    I am sorry for possible misleading about the title, but I have no idea for a proper title. Feel free to edit. Anyway, I am using ASP.NET Web Forms, and maybe this isn't how web forms is intended to be used, but I like to construct and populate HTML elements manually. It gives me more control. I don't use DataBinding and that kind of stuff. I use SqlConnection, SqlCommand and SqlDataReader, set SQL string etc. and read the data from the DataReader. Old school if you like. :) I do create WebControls so that I don't have to copy-paste every time I need some control, but mostly, I need WebControls to render as HTML so I can append that HTML into some other function that renders the final output with the control inside. I know I can render a control with control.RenderControl(writer), but this can only be done in (pre)Render or RenderContents overrides. For example. I have a dal.cs file where is stored all static functions and voids that communicate with the database. Functions mostly return string so that it can be appended into some other function to render the final result. The reason I am doing like this is that I want to separate the coding from the HTML as much as I can so that I don't do <% while (dataReader.Read()) % in HTML and display the data. I moved this into a CodeBehind. I also use this functions to render in the HttpHandler for AJAX response. That works perfectly, but when I want to add a control (ASP.NET Server control (.cs extension, not .ascx)) I don't know how to do that, so I see my self writing the same control as function that returns string or another function inside that control that returns string and replaces a job that would RenderContents do, so that I can call that function when I need control to be appended into a another string. I know this may not be a very good practice. As I see all the tutorials/videos about the ASP.NET MVC, I think it suite my needs as with the MVC you have to construct everything (or most of it) by your self, which I am already doing right now with web forms. After this long intro, I want to ask how can I build my controls so I can use them as I mentioned (return string) or I have to forget about server controls and build the controls as functions and used them that way? Is that even possible with ASP.NET Server Controls (.cs extension) or am I right when I said that I am not using it right. To be clear, I am talking about how to properly use a web forms, but to avoid data binders because I want to construct everything by my self (render HTML in Code Behind). Someone might think that I am appending strings like "some " + "string", which I am not. I am using StringBuilder for that so there's no slowness. Every opinion is welcome.

    Read the article

  • Entity Framework 4 Table Valued Function

    - by Imran
    Hi, I am aware that table valued functions are not supported in previous versions of entity framework. I was wondering if this is now supported in EF 4? I cant see my functions in the edm designer so i'm guessing they are not supported unless I am doing something wrong? If they are not supported is there a workaround? Thanks, Imran

    Read the article

  • how to call Rasapi from vbscript

    - by d34
    I need to write a VBScript script to check the state of a dial-up connection, perform the dial up if disconnected, hang up the connection etc. I know this can be done using RAS API functions, so I'm wondering if there's any way to call these functions from VBScript? If not, how else can I manage dial-up connections using VBScript? Can somebody point me in a useful direction? Thanks.

    Read the article

  • bbPress - Login/Register bridge

    - by poru
    Hello, I really need to login to my bbPress forum with my seperate web application, but for that I need to know how the password in the database is encrypted. I already tried to include the functions from "functions.bb-pluggable.php" etc. but that's a mess and don't work. So I need wheter a API/Bridge or how the password is encrypted.

    Read the article

  • Does Mootools prevents javascript closure 100%?

    - by terrani
    Hi, While I was talking about javascript closure to my friend, I was told that using Mootools can prevent closures 100%. To my knowledege, a variable causes a closure. How does Mootools itself prevents javascript closure? I think my friend is sayting that Mootools' functions are closure-safe functions. Any suggestions?

    Read the article

  • Convert MYSQL Timestamp to time_t

    - by Kewley
    I'm writing a multi-threaded program that needs to be able to check if a row requires updating and act accordingly. I had problems using the built in date/time functions of MySql and so decided to just store the "lastupdate" timestamp as an integer in the table. However, I'm having problems converting this timestamp to time_t so that I can use the time functions with it. Any help is greatly appreciated.

    Read the article

  • Globals are bad! But should I use them in this context?

    - by Matt
    Would setting the $link to my database be one thing that I should use a GLOBAL scope for? In my setting of (lots of functions)...it seems as though having only one variable that is in the global scope would be wise. I am currently using the functions to transfer it back and forth so that way I do not have it in the global scope. But it is a bit of a hindrance to my script. Please advise.

    Read the article

  • IEEE 1003.1 licenses compared

    - by LarsOn
    Software or real people can technically copy a BSD software, install it and sell it. What are technical and licence advantages and disadvantages compared to taking Linux or other 1003.1 and delivering or selling it? Which license is most flexible for instance when selling or delivering a computer BSD licence seems more flexible than Linux and other specs also interesting (Haiku and likewise). Typical case someone wants a computer with which we can deliver BSD or Linux quite similar weighing licence flexibility (BSD seems best licence) and functions (Linux seems have most functions)

    Read the article

  • Why is C++0x's `noexcept` checked dynamically?

    - by rlbond
    I am curious about the rationale behind noexcept in the C++0x FCD. throw(X) was depreciated, but noexcept seems to do the same thing. Is there a reason that noexcept isn't checked at compile time? It seems that it would be better if these functions were checked statically that they only called throwing functions within a try block.

    Read the article

  • How to generate function call graphs for JavaScript?

    - by Jeremy Rudd
    Are there softwares that can generate graphs that show which functions call which functions? I need to analyze JavaScript source code, a language which Doxygen/Graphviz does not support, though it does support C++ and others. If there are no tools that support JavaScript out-of-the-box, is there a way to convert JS to C++ so I can use Doxygen itself?

    Read the article

  • How to put a breakpoint at the end of a function in windbg, so that I dont need to edit it even if s

    - by shan23
    I need to log some data when some functions are hit, both at the start of execution and and the end of it. While i have no problem with putting breakpoints at the start of the functions(using bu [module]!functionname, I dont know how to put a breakpoint at the end of a function, SUCH THAT i dont need to edit the breakpoint everytime i add/delete somelines from the file/function. I'm sure its a very common scenario, just that I dont know how its done !! Can anyone elucidate ?

    Read the article

  • Win32 API P-Invoke to bring a disk online, offline, and set unique ID

    - by Andy Schneider
    I am currently using Diskpart to accomplish these functions, but i would like to be able to use P-Invoke and not have to shell out to an external process in my C# app. The example Diskpart scripts are: //Online a disk Select disk 7 disk online // Reset GPT Identifier select disk 7 UNIQUEID DISK ID=baf784e7-6bbd-4cfb-aaac-e86c96e166ee I tried searching pinvoke.net but could only find functions that dealt with volumes, not disks. Any idea on how to accomplish these diskpart commands using Pinvoke?

    Read the article

  • Static code analysis for VB6 and classic ASP

    - by Ryan
    I'm looking for a static code analysis tool that will determine if I have orphaned functions in my VB6 code. The problem I'm running into is we make calls to the VB6 code from classic asp. Is there a tool that will look at both the classic asp and VB6 and determine if there are any orphaned functions?

    Read the article

  • PHP best practices for naming conventions

    - by alex
    I recently started these naming conventions.. all functions & variables = camelCase constants with define() = ALL_CAPS_AND_UNDERSCORES Now I see a lot of other people mix up camelCase and underscores and they seem to have some sort of convention to it... What do you use and what is best? I've heard that public and private functions should have underscores before some.. I assume private have 2 underscores as in __construct() ? Thank you!

    Read the article

  • SqlMetal, Sql Server 2008 database, Table with HierachyID, dal cs file is created sometimes ?

    - by judek.mp
    I have 2 databases with a 2 tables with HierachyID fields. For one database I can get a dal cs file, for the other database I cannot get a dal cs file ? HBus is a database I can get the dal cs for, ... SqlMetal /server:.\SQLSERVER2008 /database:HBus /code:HBusDC.cs /views /functions /sprocs /namespace:HBusDC /context:HBusDataContext This kicks me out a file, ... which works, but excludes the HierarchyID field for the table and includes all other fields for that table. This is OK I do not mind. The above cmd line kicks out an warning but still produces a file, like so SqlMetal /server:.\SQLSERVER2008 /database:HBus /code:HBusDC.cs /views /functions /sprocs /namespace:HBusDC /context:HBusDataContext Microsoft (R) Database Mapping Generator 2008 version 1.00.30729 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved. Warning : SQM1021: Unable to extract column 'OrgNode' of Table 'dbo.HMsg' from SqlServer because the column's DbType is a user-defined type (UDT). Warning : SQM1021: Unable to extract column 'OrgNode' of Table 'dbo.vwHMsg' from SqlServer because the column's DbType is a user-defined type (UDT). HMsg is a table with a HierarchyID field. I have another database, Elf, almost the same thing but I get a warning and an Error when using sql metal and I do not get a dal cs file ... SqlMetal /server:.\SQLSERVER2008 /database:Elf /code:ElfDataContextDal.cs /views /functions /sprocs /namespace:HBusDC /context:HBusDataContext An error as well as the warning and the cs file fails to appear on my disc, ... :-( SqlMetal /server:.\SQLSERVER2008 /database:Elf /code:ElfDataContextDal.cs /views /functions /sprocs /namespace:HBusDC /context:HBusDataContext Microsoft (R) Database Mapping Generator 2008 version 1.00.30729 for Microsoft (R) .NET Framework version 3.5 Copyright (C) Microsoft Corporation. All rights reserved. Warning : SQM1021: Unable to extract column 'OrgNode' of Table 'dbo.EntityLink' from SqlServer because the column's DbType is a user-defined type (UDT). Error : Requested value 'ELF.SYS.HIERARCHYID' was not found. The fields are declared the same way in Elf db OrgNode [HierarchyID] null , in HBus db ... OrgNode [HierarchyID] null , Both databases are in the same instance of sql server 2008, so the HierarchyID is an inbuilt type, neither db has HierarchyID udt ,... cheers in advance for any replies ...

    Read the article

  • using moogaloop to embed a custom video player from Vimeo

    - by scullytr
    Anyone have any luck using Vimeo's moogaloop player? I'm wanting to use Vimeo's supposed API functions to create custom buttons to control the Vimeo player on my site. Here's the reference page for moogaloop: http://vimeo.com/api/docs/moogaloop I've been able to get the player to embed using SWFObject, but I can't seem to get the API functions to work (e.g. api_play()). Any help is greatly appreciated. Thanks! -Tim.

    Read the article

  • .NET: Writing DataAccess dll

    - by RedsDevils
    I would like to write all data relations processes (general functions regarding with DataAccess via .NET) in dll and I want to use it repeatedly. What kinds of functions should have in that dll? Some want to use Stored Procedures , Some with Statements. Can you all suggest me? Please guide me! Thanks all!

    Read the article

  • .NET: Wrinting DataAccess dll

    - by RedsDevils
    I would like to write all data relations processes (general functions regarding with DataAccess via .NET) in dll and I wanna use it repeatedly. What kinds of functions should have in that dll? Some want to use Storedprocedures , Some with Statemets. Can you all suggest me? Please guide me! Thanks all!

    Read the article

  • Uploading images from server using Php

    - by THOmas
    In my php application i have a folder in which all the photos are kept. The images are in different sizes.So i want to select photos from the folder and applying some image functions and upload to a different folder through php code. This is same as image uploading but the difference is that the source file is in server That is i want to select photos from server applying some image functions and upload again on the server Pls help me

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >