Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 8/297 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • find: missing argument to -exec in bash script

    - by Mephi_stofel
    The following works fine when I type it exactly in the command line: find /<some_path>/{epson,epson_laser,epson_inkjet} -iname "*.ppd" -exec grep "\*ModelName\:" {} \; | sed 's/.*\"\(.*\)\"/\1/' However, when I try to call the following from a bash script I get find: missing argument to -exec'. I have also tried the following (in many variants): eval find "$1" -iname "*.ppd" -exec 'bash -c grep "\*ModelName\:" "$1" | sed "s/.*\"\(.*\)\"/\1/" \; as was mentioned in find-exec-echo-missing-argument-to-exec.

    Read the article

  • ghc6 install trouble: hGetContents: invalid argument (invalid UTF-8 byte sequence)

    - by olimay
    Having trouble installing ghc6 on Ubuntu Maverick via apt. Here's what seems to be the relevant error that comes up when I try to (apt-get|aptitude) install ghc6: A package failed to install. Trying to recover: Setting up ghc6 (6.12.1-13ubuntu1) ... ghc-pkg: /home/opm/.ghc/i386-linux-6.12.1/package.conf.d/unix-compat-0.2-edefa7bced91ebe610d455bab466e200.conf: hGetContents: invalid argument (invalid UTF-8 byte sequence) (Here's the full output, if you're interested: http://paste.ubuntu.com/566475/ ) This still happens after apt-get clean and apt-get update. My searching around has not really helped me understand what's going on, except that it might be caused by a mismatch in locale. So, here's the output of locale too: LANG=en_US.utf8 LANGUAGE=en_US:en LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL= Any ideas? Additional background: this all seems very strange to me, because I used to have ghc6 installed correctly--I use XMonad as my main window manager most of the time. I tried to install haskell-platform (through apt), which failed and told me that there was something wrong with ghc6, and so I reinstalled ghc6 and began to get the above error message.

    Read the article

  • Passing an ActionScript JPG Byte Array to Javscript (and eventually to PHP)

    - by Gus
    Our web application has a feature which uses Flash (AS3) to take photos using the user's web cam, then passes the resulting byte array to PHP where it is reconstructed and saved on the server. However, we need to be able to take this web application offline, and we have chosen Gears to do so. The user takes the app offline, performs his tasks, then when he's reconnected to the server, we "sync" the data back with our central database. We don't have PHP to interact with Flash anymore, but we still need to allow users to take and save photos. We don't know how to save a JPG that Flash creates in a local database. Our hope was that we could save the byte array, a serialized string, or somehow actually persist the object itself, then pass it back to either PHP or Flash (and then PHP) to recreate the JPG. We have tried: - passing the byte array to Javascript instead of PHP, but javascript doesn't seem to be able to do anything with it (the object seems to be stripped of its methods) - stringifying the byte array in Flash, and then passing it to Javascript, but we always get the same string: ÿØÿà Now we are thinking of serializing the string in Flash, passing it to Javascript, then on the return route, passing that string back to Flash which will then pass it to PHP to be reconstructed as a JPG. (whew). Since no one on our team has extensive Flash background, we're a bit lost. Is serialization the way to go? Is there a more realistic way to do this? Does anyone have any experience with this sort of thing? Perhaps we can build a javascript class that is the same as the byte array class in AS?

    Read the article

  • PHP Sessions and Passing Session ID

    - by Jason McCreary
    I have an API where I am passing the session id back and forth between calls. I set up the session like so: // start API session session_name('apikey'); session_id($data['apikey']); // required to link session session_start(); Although I named my session and am passing the session id via GET and POST using the name, PHP does not automatically resume that session. It always creates a new one unless I set the explicitly set the session id. I found some old user comments on www.php.net that said unless the session id is the first parameter PHP won't set it automatically. This seems odd, but even when I call tried it still didn't work: rest_services.php?apikey=sdr6d3subaofcav53cpf71j4v3&q=testing I have used PHP for years, but am a little confused on why I needed to explicitly set the session with session_id() when I am naming the session and passing it's key accordingly. UPDATE It seems I wasn't clear. My question is why is setting the session ID with session_id() required when I am passing the id, using the session name apikey, via $_GET or $_POST. Theoretically this is no different than PHP's SID when cookies are disabled. But for me it doesn't work unless I explicitly set the session ID. Why?

    Read the article

  • HP Procurve Issue Passing Multiple VLANs over a link

    - by MichaelRwat
    Just to start off with I am a Cisco guy that got placed into an HP project. Basic topology overview from outside in: ASA 5505 with two Ethernet connections to a 2910-24 port switch. This switch is then (Cisco Trunking) to a 2626 switch passing vlan (1 untagged and 100 tagged)between them. I created SVI's on each of the switches for both VLAN's for testing purposes. I can not get vlan 100 to pass across this link. I also have trunks configured to AP's off of the switch and can not ping the vlan 100 BVI on the AP's but can reach the vlan 1 BVI. Port 25 on Access layer (2626) connects (trunks) with port A1 of 2610. STP is not running at all on any switch (this is not my network I can't change this nor did I design this) Distribution Sw: MP1-0# show run ip default-gateway 10.100.100.100 vlan 1 name "DATA" untagged 1-22,24-A1,B1 ip address 10.100.100.6 255.255.255.0 no untagged 23 exit vlan 100 name "GUEST" untagged 23 tagged 24-A1 ip address 10.100.102.6 255.255.255.0 exit Access Sw: ip default-gateway 10.100.100.100 vlan 1 name "DEFAULT_VLAN" untagged 1-26 ip address 10.100.100.5 255.255.255.0 exit vlan 100 name "GUEST" ip address 10.100.102.5 255.255.255.0 tagged 15,25 exitt From the ASA I can ping the vlan 100 address of the 2610 but not the 2626 (10.100.102.6)[Not passing the "trunk"] If I plug into an access port vlan 100 of the 2626 I can ping the SVI for vlan 100 as intended. I can not ping across the "trunk" over vlan 100 but I can across vlan 1. There may be something obvious I'm missing but please review my configuration and thank you for the assistance.

    Read the article

  • Cann Boost Program_options separate comma separated argument values

    - by lrm
    If my command line is: > prog --mylist=a,b,c Can Boost's program_options be setup to see three distinct argument values for the mylist argument? I have configured program_options as: namespace po = boost::program_options; po::options_description opts("blah") opts.add_options() ("mylist", std::vector<std::string>>()->multitoken, "description"); po::variables_map vm; po::store(po::parse_command_line(argc, argv, opts), vm); po::notify(vm); When I check the value of the mylist argument, I see one value as a,b,c. I'd like to see three distinct values, split on comma. This works fine if I specify the command line as: > prog --mylist=a b c or > prog --mylist=a --mylist=b --mylist=c Is there a way to configure program_options so that it sees a,b,c as three values that should each be inserted into the vector, rather than one? I am using boost 1.41, g++ 4.5.0 20100520, and have enabled c++0x experimental extensions.

    Read the article

  • Can Boost Program_options separate comma separated argument values

    - by lrm
    If my command line is: > prog --mylist=a,b,c Can Boost's program_options be setup to see three distinct argument values for the mylist argument? I have configured program_options as: namespace po = boost::program_options; po::options_description opts("blah") opts.add_options() ("mylist", std::vector<std::string>>()->multitoken, "description"); po::variables_map vm; po::store(po::parse_command_line(argc, argv, opts), vm); po::notify(vm); When I check the value of the mylist argument, I see one value as a,b,c. I'd like to see three distinct values, split on comma. This works fine if I specify the command line as: > prog --mylist=a b c or > prog --mylist=a --mylist=b --mylist=c Is there a way to configure program_options so that it sees a,b,c as three values that should each be inserted into the vector, rather than one? I am using boost 1.41, g++ 4.5.0 20100520, and have enabled c++0x experimental extensions.

    Read the article

  • Argument passing regarding ivars

    - by StoneBreaker
    I am passing an iVar into a function. The iVar is a double. The value of the iVar inside the function is correct, but the value of the iVar outside the function is not changed. This must have something to do with the way that I am receiving the iVar into the function. How do I pass a double iVar in so that its value is changed in the object and not only in the function? I do the same thing with pointers and the results are as expected, so I think I am not understanding scalar argument passing in c/objective-c.

    Read the article

  • Trouble passing a template function as an argument to another function in C++

    - by Darel
    Source of the problem -Accelerated C++, problem 8-5 I've written a small program that examines lines of string input, and tallies the number of times a word appears on a given line. The following code accomplishes this: #include <map> #include <iostream> #include <string> #include <vector> #include <list> #include <cctype> #include <iterator> using std::vector; using std::string; using std::cin; using std::cout; using std::endl; using std::getline; using std::istream; using std::string; using std::list; using std::map; using std::isspace; using std::ostream_iterator; using std::allocator; inline void keep_window_open() { cin.clear(); cout << "Please enter EOF to exit\n"; char ch; cin >> ch; return; } template <class Out> void split(const string& s, Out os) { vector<string> ret; typedef string::size_type string_size; string_size i = 0; // invariant: we have processed characters `['original value of `i', `i)' while (i != s.size()) { // ignore leading blanks // invariant: characters in range `['original `i', current `i)' are all spaces while (i != s.size() && isspace(s[i])) ++i; // find end of next word string_size j = i; // invariant: none of the characters in range `['original `j', current `j)' is a space while (j != s.size() && !isspace(s[j])) ++j; // if we found some nonwhitespace characters if (i != j) { // copy from `s' starting at `i' and taking `j' `\-' `i' chars *os++ = (s.substr(i, j - i)); i = j; } } } // find all the lines that refer to each word in the input map<string, vector<int> > xref(istream& in) // works // now try to pass the template function as an argument to function - what do i put for templated type? //map<string, vector<int> > xref(istream& in, void find_words(vector<string, typedef Out) = split) #LINE 1# { string line; int line_number = 0; map<string, vector<int> > ret; // read the next line while (getline(in, line)) { ++line_number; // break the input line into words vector<string> words; // works // #LINE 2# split(line, back_inserter(words)); // #LINE 3# //find_words(line, back_inserter(words)); // #LINE 4# attempting to use find_words as an argument to function // remember that each word occurs on the current line for (vector<string>::const_iterator it = words.begin(); it != words.end(); ++it) ret[*it].push_back(line_number); } return ret; } int main() { cout << endl << "Enter lines of text, followed by EOF (^Z):" << endl; // call `xref' using `split' by default map<string, vector<int> > ret = xref(cin); // write the results for (map<string, vector<int> >::const_iterator it = ret.begin(); it != ret.end(); ++it) { // write the word cout << it->first << " occurs on line(s): "; // followed by one or more line numbers vector<int>::const_iterator line_it = it->second.begin(); cout << *line_it; // write the first line number ++line_it; // write the rest of the line numbers, if any while (line_it != it->second.end()) { cout << ", " << *line_it; ++line_it; } // write a new line to separate each word from the next cout << endl; } keep_window_open(); return 0; } As you can see, the split function is a template function to handle various types of output iterators as desired. My problem comes when I try to generalize the xref function by passing in the templated split function as an argument. I can't seem to get the type correct. So my question is, can you pass a template function to another function as an argument, and if so, do you have to declare all types before passing it? Or can the compiler infer the types from the way the templated function is used in the body? To demonstrate the errors I get, comment out the existing xref function header, and uncomment the alternate header I'm trying to get working (just below the following commment line.) Also comment the lines tagged LINE 2 and LINE 3 and uncomment LINE 4, which is attempting to use the argument find_words (which defaults to split.) Thanks for any feedback!

    Read the article

  • Passing IP address with mod_proxy

    - by Konrad Garus
    I have Apache with mod_proxy passing requests to Tomcat. The trouble is, when I get client IP address associated with a request in web app hosted on Tomcat, it always returns 127.0.0.1. Is it possible to have Apache pass the original IP address to Tomcat?

    Read the article

  • Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier.

    - by Rushabh
    DataTable distinctTable = dTable.DefaultView.ToTable(true,"ITEM_NO","ITEM_STOCK"); DataTable dtSummerized = new DataTable("SummerizedResult"); dtSummerized.Columns.Add("ITEM_NO",typeof(string)); dtSummerized.Columns.Add("ITEM_STOCK",typeof(double)); int count=0; foreach(DataRow dRow in distinctTable.Rows) { count++; //string itemNo = Convert.ToString(dRow[0]); double TotalItem = Convert.ToDouble(dRow[1]); string TotalStock = dTable.Compute("sum(" + TotalItem + ")", "ITEM_NO=" + dRow["ITEM_NO"].ToString()).ToString(); dtSummerized.Rows.Add(count,dRow["ITEM_NO"],TotalStock); } Error Message: Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier. Do anyone can help me out? Thanks.

    Read the article

  • TCL array values updation based on command line argument

    - by Raj
    Hi, I am trying to substitute variable value inside array so as to update array values based on command line inputs. e.g. I am receiving IP address as command line argument for my TCL script and trying to update commands with recvd IP value. My array is: array set myArr { 1 myCmd1("192.268.2.1","abc.txt") 2 myCmd2("192.268.2.1","xyz.txt") 3 myCmd3("192.268.2.1","klm.txt") } Here, "192.268.2.1" will actually be supplied as command line argument. I tried doing array set myArr { 1 myCmd1($myIP,"abc.txt") 2 myCmd2($myIP,"xyz.txt") 3 myCmd3($myIP,"klm.txt") } and other combinations like ${myIP}, {[set $myIP]} but none is working. Thanks in advance for any help/inputs.

    Read the article

  • error C2784: Could not deduce template argument

    - by atch
    Hi guys, Still fighting with templates. In this example, despite the fact that is copied straight from a book I'm getting the following error message: Error 2 error C2784: 'IsClassT<T>::One IsClassT<T>::test(int C::* )' : could not deduce template argument for 'int C::* ' from 'int'. This is an example from a book Templates - The Complete Guide. (I work with Visual Studio 2010 RC). template<typename T> class IsClassT { private: typedef char One; typedef struct { char a[2]; } Two; template<typename C> static One test(int C::*); template<typename C> static Two test(…); public: enum { Yes = sizeof(IsClassT<T>::test<T>(0)) == 1 }; enum { No = !Yes }; }; class MyClass { }; struct MyStruct { }; union MyUnion { }; void myfunc() { } enum E {e1} e; // check by passing type as template argument template <typename T> void check() { if (IsClassT<T>::Yes) { std::cout << " IsClassT " << std::endl; } else { std::cout << " !IsClassT " << std::endl; } } // check by passing type as function call argument template <typename T> void checkT (T) { check<T>(); } int main() { /*std::cout << "int: "; check<int>(); */ std::cout << "MyClass: "; check<MyClass>(); } And although I know roughly what's going on in this example I cannot fix this error. Thanks for help.

    Read the article

  • .NET command line argument bug?

    - by Tomas
    Hello, I am trying to read command lien argument but it seems there is some kind of bug in .NET. The parameter which I pass to my console application /i "C:\Projects\PC\trunk\Simulator\PDF-Source\PDF-Source\bin\Debug\ConversionFiles\dummy.pdf" /o "result" CommandLine variable return three arguments, but I pass four and values of these arguments messed up. /i = true "C:\Projects\PC\trunk\Simulator\PDF-Source\PDF-Source\bin\Debug\ConversionFiles\dummy.pdf" = true /o = "result" As you see only the last argument is parsed corectlly. Is this bug? regards, Tomas My code static void Main(string[] args) { Arguments CommandLine = new Arguments(args);

    Read the article

  • What is the String 'volumeName' argument of MediaStore.Audio.Playlists.Members.getContentUri referri

    - by Brett
    I am wanting to query the members of a given playlist. I have the correct playlist id, and want to use a managedQuery() to look at the playlist members in question. What I have is this: private String [] columns = { MediaStore.Audio.Playlists.Members.PLAYLIST_ID, MediaStore.Audio.Playlists.Members.TITLE, }; Uri membersUri = MediaStore.Audio.Playlists.Members.getContentUri(volume, playlistId); Cursor tCursor = managedQuery(membersUri, columns, null, null, null); I don't know what the volume argument needs to be. I've tried this: MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI.toString() for the "volume" argument. That gives me back a valid content URI that looks like: content://media/external/audio/playlists/2/members However, my cursor comes back null. I probably am way off base -- I know what I want to do is very simple.

    Read the article

  • http(/* argument here */) How is this Object (Http) being used without an explicit or implicit meth

    - by Randin
    In the example for coding with Json using Databinder Dispatch Nathan uses an Object (Http) without a method, shown here: import dispatch._ import Http._ Http("http://www.fox.com/dollhouse/" >>> System.out ) How is he doing this? Thank you for all of the answers unfortunatly I was not specific enough... It looks like it is simply passing an argument to a constructor of class or companion object Http. In another example, I've seen another form: http = new Http http(/* argument here */) Is this valid Scala? I guess it must be, because the author is a Scala expert. But it makes no sense to me. Actions are usually performed by invoking methods on objects, whether explicitly as object.doSomething() or implicitly as object = something (using the apply() method underneath the syntactic sugar). All I can think of is that a constructor is being used to do something in addition to constructing an object. In other words, it is having side effects, such as in this case going off and doing something on the web.

    Read the article

  • How to combine template partial specialization and template argument deduction

    - by KKKoo0
    My understanding is that template argument deduction is only for function templates, but function templates does not allow partial specialization. Is there a way to achieve both? I basically want to achieve a function-like object (can be a functor) with the signature template<class InputIterator1, class InputIterator2, class OutputIterator, int distribution> void GetQuantity(InputIterator1 frist1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, double supply, double limit); Depending on the value of distribution, I want to have a couple of specializations of this template. And when I call this function,I basically do not want to specify all the type parameters, because they are many of them (and thus I need argument deduction)!

    Read the article

  • Binding output of Custom Activity designer to activity argument

    - by gbanfill
    I am trying to add a custom activity designer for an activity that I have. The activity looks a little like: public class WaitForUserInputActvitiy : NativeActivity { public InArgument<UserInteractionProperty[]> UserInteraction { get; set; } } I am trying to put a designer on the activity to make it a bit nicer to set these values (so you don't end up typing VB in directly. My designer is based on mindscape property grid. I have an ObservableDictionary source that I want to get the values from and put them in to the InArgument. Currently I am using private void TestGrid_LostFocus(object sender, RoutedEventArgs e) { using (ModelEditingScope editingScope = this.ModelItem.BeginEdit()) { Argument myArg = Argument.Create(typeof(WaitForUserInputActvitiy), ArgumentDirection.In); this.ModelItem.Properties["UserInteraction"].SetValue(source.Values.ToArray()); editingScope.Complete(); } } However this results in an ArgumentException "Object of type UserInteractionProperty[] cannot be converted to InArgument`1[UserInteractionProperty[]]. So how do I convert my array of UserInteractionProperties into an InArgument?

    Read the article

  • how to identify an argument as a "Year" in PERL

    - by dexter
    i have created a file argument.pl which takes several arguments first of which should be in form of a year example of argument : 2010 23 type here 2010 is a year my code does something like: use strict; use warning use Date::Calc qw(:all); my ($startyear, $startmonth, $startday) = Today(); my $weekofyear = (Week_of_Year ($startyear,$startmonth,$startday))[0]; my $Year = $startyear; ... ... if ($ARGV[0]) { $Year = $ARGV[0]; } here this code fill $Year with "current year" if if $ARGV[0] is null or doesn't exists now here instead of if ($ARGV[0]) is it possible to check that the value in $ARGV[0] is a valid year (like 2010, 1976,1999 etc.)

    Read the article

  • Using a function with reference as a function with pointers?

    - by epatel
    Today I stumbled over a piece of code that looked horrifying to me. The pieces was chattered in different files, I have tried write the gist of it in a simple test case below. The code base is routinely scanned with FlexeLint on a daily basis, but this construct has been laying in the code since 2004. The thing is that a function implemented with a parameter passing using references is called as a function with a parameter passing using pointers...due to a function cast. The construct has worked since 2004 on Irix and now when porting it actually do work on Linux/gcc too. My question now. Is this a construct one can trust? I can understand if compiler constructors implement the reference passing as it was a pointer, but is it reliable? Are there hidden risks? Should I change the fref(..) to use pointers and risk braking anything in the process? What to you think? #include <iostream> using namespace std; // ---------------------------------------- // This will be passed as a reference in fref(..) struct string_struct { char str[256]; }; // ---------------------------------------- // Using pointer here! void fptr(const char *str) { cout << "fptr: " << str << endl; } // ---------------------------------------- // Using reference here! void fref(string_struct &str) { cout << "fref: " << str.str << endl; } // ---------------------------------------- // Cast to f(const char*) and call with pointer void ftest(void (*fin)()) { void (*fcall)(const char*) = (void(*)(const char*))fin; fcall("Hello!"); } // ---------------------------------------- // Let's go for a test int main() { ftest((void (*)())fptr); // test with fptr that's using pointer ftest((void (*)())fref); // test with fref that's using reference return 0; }

    Read the article

  • Execute method with Action<T> argument using Reflection

    - by JGr
    How can i create a Action method to use as a argument to the following function? public void When(Action<T> action) { if (internalValue != null) action(internalValue); } I have the MethodInfo on the method, and the parameter type like so: var methods = value.GetType().GetMethods(); MethodInfo mInfo = methods.First(method => method.Name == "When"); Type parameterType = (mInfo.GetParameters()[0]).ParameterType; But after that i have no idea how to make the actual Action method to pass as argument, i also do not know how to define the Action method body.

    Read the article

  • Can FileOutputStream() take a relative path as an argument

    - by Ankur
    I am creating a FileOutputStream object. It takes a file or String as an argument in its constructor. My question is, can I give it a relative URL as an argument for the location of a file, it doesn't seem to work, but I am trying to work out if this is possible at all (if not I will stop trying). If it is not possible, how can I (from a servlet) get the absolute path (on the filesystem, not the logical URL) to the current location in such a way that I can pass that to the constructor. Part of my problem is that my dev box is Windows but I will publish this to a Unix box, so the paths cannot be the same i.e. on Windows C:/.... and on unix /usr/...

    Read the article

  • Perl passing argument into eval

    - by ehretf
    I'm facing an issue using eval function. Indeed I have some function name inside a SQL database, my goal is to execute those functions within perl (after retrieve in SQL). Here is what I'm doing, considering that $RssSource-{$k}{Proceed} contains "&test" as a string retrieved from SQL: my $str2 = "ABCD"; eval "$RssSource->{$k}{Proceed}";warn if $@; sub test { my $arg = shift; print "fct TEST -> ", $row, "\n"; } This is working correctly and display: fct TEST -> However I would like to be able to pass $str2 as an argument to $RssSource-{$k}{Proceed} but I don't know how, every syntax I tried return an error: eval "$RssSource->{$k}{Proceed}$str2" eval "$RssSource->{$k}{Proceed}($str2)" eval "$RssSource->{$k}{Proceed}"$str2 eval "$RssSource->{$k}{Proceed}"($str2) May someone tell me how to properly pass an argument to the evaluated function? Thanks a lot for your help Regards. Florent

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >