Search Results

Search found 4670 results on 187 pages for 'jvm arguments'.

Page 28/187 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Arguments against Create or Update

    - by Nix
    Recently someone stated that they thought all Creates should be CreateOrUpdates. Instinctively i thought bad, but now I am trying to find out if I have any grounds. Situation interface IService{ void Create(Object a); void Update(Object a); } or interface IService{ void CreateOrUpdate(Object a); } My first thought is if you implemented everything CreateOrUpdate then you have no control if someone accidentally sends you wrong data, or concurrency issues where someone changes a "primary" field right before you call update.... But if you remove those cases, are there any other cons?

    Read the article

  • How to pass function reference into arguments

    - by Ockonal
    Hi, I'm using boost::function for making function-references: typedef boost::function<void (SomeClass &handle)> Ref; someFunc(Ref &pointer) {/*...*/} void Foo(SomeClass &handle) {/*...*/} What is the best way to pass Foo into the someFunc? I tried something like: someFunc(Ref(Foo));

    Read the article

  • XNA and Ninject: Syntax for dependency arguments?

    - by Rosarch
    I have a class with a public constructor: public MasterEngine(IInputReader inputReader) { this.inputReader = inputReader; graphicsDeviceManager = new GraphicsDeviceManager(this); Components.Add(new GamerServicesComponent(this)); } How can I inject dependencies like graphicsDeviceManager and new GamerServicesComponent while still supplying the argument this?

    Read the article

  • mysql_query arguments in PHP

    - by Chris Wilson
    I'm currently building my first database in MySQL with an interface written in PHP and am using the 'learn-by-doing' approach. The figure below illustrates my database. Table names are at the top, and the attribute names are as they appear in the real database. I am attempting to query the values of each of these attributes using the code seen below the table. I think there is something wrong with my mysql_query() function since I am able to observe the expected behaviour when my form is successfully submitted, but no search results are returned. Can anyone see where I'm going wrong here? Update 1: I've updated the question with my enter script, minus the database login credentials. <html> <head> <title>Search</title> </head> <body> <h1>Search</h1> <!--Search form - get user input from this--> <form name = "search" action = "<?=$PHP_SELF?>" method = "get"> Search for <input type = "text" name = "find" /> in <select name = "field"> <option value = "Title">Title</option> <option value = "Description">Description</option> <option value = "City">Location</option> <option value = "Company_name">Employer</option> </select> <input type = "submit" name = "search" value = "Search" /> </form> <form name = "clearsearch" action = "Search.php"> <input type = "submit" value = "Reset search" /> </form> <?php if (isset($_GET["search"])) // Check if form has been submitted correctly { // Check for a search query if($_GET["find"] == "") { echo "<p>You did not enter a search query. Please press the 'Reset search' button and try again"; exit; } echo "<h2>Search results</h2>"; ?> <table align = "left" border = "1" cellspacing = "2" cellpadding = "2"> <tr> <th><font face="Arial, Helvetica, sans-serif">No.</font></th> <th><font face="Arial, Helvetica, sans-serif">Title</font></th> <th><font face="Arial, Helvetica, sans-serif">Employer</font></th> <th><font face="Arial, Helvetica, sans-serif">Description</font></th> <th><font face="Arial, Helvetica, sans-serif">Location</font></th> <th><font face="Arial, Helvetica, sans-serif">Date Posted</font></th> <th><font face="Arial, Helvetica, sans-serif">Application Deadline</font></th> </tr> <? // Connect to the database $username=REDACTED; $password=REDACTED; $host=REDACTED; $database=REDACTED; mysql_connect($host, $username, $password); @mysql_select_db($database) or die (mysql_error()); // Perform the search $find = mysql_real_escape_string($find); $query = "SELECT job.Title, job.Description, employer.Company_name, address.City, job.Date_posted, job.Application_deadline WHERE ( Title = '{$_GET['find']}' OR Company_name = '{$_GET['find']}' OR Date_posted = '{$_GET['find']}' OR Application_deadline = '{$_GET['find']}' ) AND job.employer_id_job = employer.employer_id AND job.address_id_job = address.address_id"; if (!$query) { die ('Invalid query:' .mysql_error()); } $result = mysql_query($query); $num = mysql_numrows($result); $count = 0; while ($count < $num) { $title = mysql_result ($result, $count, "Title"); $date_posted = mysql_result ($result, $count, "Date_posted"); $application_deadline = mysql_result ($result, $count, "Application_deadline"); $description = mysql_result ($result, $count, "Description"); $company = mysql_result ($result, $count, "Company_name"); $city = mysql_result ($result, $count, "City"); ?> <tr> <td><font face = "Arial, Helvetica, sans-serif"><? echo $count + 1; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $title; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $company; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $description; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $date_posted; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $application_deadline; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $education_level; ?></font></td> <td><font face = "Arial, Helvetica, sans-serif"><? echo $years_of_experience; ?></font></td> <? $count ++; } } ?> </body> </html>

    Read the article

  • Typedef equivalence in function arguments

    - by Warren Seine
    Hi guys, The question is kind of hard to ask without an example so here it is: #include <vector> struct O { }; struct C { template <typename T> void function1(void (C::*callback)(const O*)); template <typename T> void function2(void (C::*callback)(const typename T::value_type)); void print(const O*); }; int main() { C c; c.function1< std::vector<O*> >(&C::print); // Success. c.function2< std::vector<O*> >(&C::print); // Fail. } The error that I am given is: error: no matching function for call to ‘C::function2(void (C::*)(const O*))’. Basically, the only difference between calls is that in function2, I'm more generic since I use the typedef std::vector<O*>::value_type which should resolve to O*, hence similar to function1. I'm using G++ 4.2.1 (I know it's old), but Comeau confirms I'm wrong. Why does the compilation fail?

    Read the article

  • Error found - too many arguments to method call expected 1 have 2 - in app email

    - by Anthony Farah
    There seems to be an error with my coding, and it says that there are to many nils or something I need help MFMailComposeViewController *composer = [[MFMailComposeViewController alloc]init]; if ([MFMailComposeViewController canSendMail]) { [composer setToRecipients:[NSArray arrayWithObject:@"[email protected]", nil]]; [composer setSubject:nil];[composer setMailComposeDelegate:self]; [composer setMessageBody:nil isHTML:YES]; [composer setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

    Read the article

  • Passing arguments and conditions to model in codeigniter

    - by stormdrain
    I'm adding some models to a project, and was wondering if there is a "best practice" kind of approach to creating models: Does it make sense to create a function for each specific query? I was starting to do this, then had the idea of creating a generic function that I could pass parameters to. e.g: Instead of function getClients(){ return $this->db->query('SELECT client_id,last FROM Names ORDER BY id DESC'); } function getClientNames($clid){ return $this->db->query('SELECT * FROM Names WHERE client_id = '.$clid); } function getClientName($nameID){ return $this->db->query('SELECT * FROM Names WHERE id ='.$nameID); } } Something like function getNameData($args,$cond){ if($cond==''){ $q=$this->db->query('SELECT '.$args.' FROM Names'); return $q; }else{ $q=$this->db->query('SELECT '.$args.' FROM Names WHERE '.$cond); return $q; } } where I can pass the fields and conditions (if applicable) to the model. Is there a reason the latter example would be a bad idea? Thanks!

    Read the article

  • windows media player command arguments

    - by TonyNeallon
    Hi There, Is it possible to launch a mp3 or wmv file using windows media player at a specified time offset? e.g I watched 10 seconds of video and closed it. the next time my app launches the video it starts playing a timeline of 10 seconds. The videos and mp3s are being launched in windows mobile 5 and 6 apps.

    Read the article

  • Pass Arguments to Included Module in Ruby?

    - by viatropos
    I'm hoping to implement something like all of the great plugins out there for ruby, so that you can do this: acts_as_commentable has_attached_file :avatar But I have one constraint: That helper method can only include a module; it can't define any variables or methods. The reason for this is because, I want the options hash to define something like type, and that could be converted into one of say 20 different 'workhorse' modules, all of which I could sum up in a line like this: def dynamic_method(options = {}) include ("My::Helpers::#{options[:type].to_s.camelize}").constantize(options) end Then those 'workhorses' would handle the options, doing things like: has_many "#{options[:something]}" Here's what the structure looks like, and I'm wondering if you know the missing piece in the puzzle: # 1 - The workhorse, encapsuling all dynamic variables module My::Module def self.included(base) base.extend ClassMethods base.class_eval do include InstanceMethods end end module InstanceMethods self.instance_eval %Q? def #{options[:my_method]} "world!" end ? end module ClassMethods end end # 2 - all this does is define that helper method module HelperModule def self.included(base) base.extend(ClassMethods) end module ClassMethods def dynamic_method(options = {}) # don't know how to get options through! include My::Module(options) end end end # 3 - send it to active_record ActiveRecord::Base.send(:include, HelperModule) # 4 - what it looks like class TestClass < ActiveRecord::Base dynamic_method :my_method => "hello" end puts TestClass.new.hello #=> "world!" That %Q? I'm not totally sure how to use, but I'm basically just wanting to somehow be able to pass the options hash from that helper method into the workhorse module. Is that possible? That way, the workhorse module could define all sorts of functionality, but I could name the variables whatever I wanted at runtime.

    Read the article

  • Given an array of arguments, how do I send those arguments to a particular function in Ruby?

    - by Steven Xu
    Forgive the beginner question, but say I have an array: a = [1,2,3] And a function somewhere; let's say it's an instance function: class Ilike def turtles(*args) puts args.inspect end end How do I invoke Ilike.turtles with a as if I were calling (Ilike.new).turtles(1,2,3). I'm familiar with send, but this doesn't seem to translate an array into an argument list. A parallel of what I'm looking for is the Javascript apply, which is equivalent to call but converts the array into an argument list.

    Read the article

  • Create variables for unknown amount of arguments?

    - by user347600
    Working on an rsync script and the portion below is in a for loop. What I want to achieve is assign a variable to every arguement after 3. Just confused if I need to create another loop for that or not: #1: name name=$1 #2: ip ip=$2 #3: user user=$3 #4+: folder exlusion #any lines higher than 3 will be created as exlcude folders ex[ARG_NUMBER]=

    Read the article

  • Pour Apple, "App Store" est bien une marque exclusive, l'entreprise juge insuffisants les arguments de Microsoft le contestant

    Pour Apple, ?App Store? est bien une marque Exclusive, l'entreprise juge insuffisants les arguments de Microsoft le contestant Mise à jour du 02/03/11, par Hinault Romaric Apple réplique au recours de Microsoft qui contestait le dépôt du nom « App Store ». Dans un document déposé auprès de l'US Patent and Trademark Office, Apple déclare que les arguments avancés par Microsoft ne prouvent pas la nature générique du terme « App Store ». Pour mémoire, en janvier dernier, Microsoft avait officiellement contesté le dépôt du nom « App Store » par Apple, le jugeant trop générique pour être une marque, etne pouvant donc ...

    Read the article

  • instantiate object with reflection using constructor arguments

    - by justin
    I'm trying to figure out how to instantiate a case class object with reflection. Is there any support for this? The closest I've come is looking at scala.reflect.Invocation, but this seems more for executing methods that are a part of an object. case class MyClass(id:Long, name:String) def instantiate[T](className:String)(args:Any*) : T = { //your code here } Is close to the API I'm looking for. Any help would be appreciated.

    Read the article

  • How to run multiple arguments in Cygwin

    - by danutenshu
    I've been trying to run a program that will invert the order of a string and to run it, I have to type a second argument in prompt. int main(int argc, char* argv[]) { string text = argv[2]; for (int num=text.size(); num>./0; num--) { cout << text.at(num); } return 0; } e.g. ./program lorem result: merol

    Read the article

  • factory class, wrong number of arguments being passed to subclass constructor

    - by Hugh Bothwell
    I was looking at Python: Exception in the separated module works wrong which uses a multi-purpose GnuLibError class to 'stand in' for a variety of different errors. Each sub-error has its own ID number and error format string. I figured it would be better written as a hierarchy of Exception classes, and set out to do so: class GNULibError(Exception): sub_exceptions = 0 # patched with dict of subclasses once subclasses are created err_num = 0 err_format = None def __new__(cls, *args): print("new {}".format(cls)) # DEBUG if len(args) and args[0] in GNULibError.sub_exceptions: print(" factory -> {} {}".format(GNULibError.sub_exceptions[args[0]], args[1:])) # DEBUG return super(GNULibError, cls).__new__(GNULibError.sub_exceptions[args[0]], *(args[1:])) else: print(" plain {} {}".format(cls, args)) # DEBUG return super(GNULibError, cls).__new__(cls, *args) def __init__(self, *args): cls = type(self) print("init {} {}".format(cls, args)) # DEBUG self.args = args if cls.err_format is None: self.message = str(args) else: self.message = "[GNU Error {}] ".format(cls.err_num) + cls.err_format.format(*args) def __str__(self): return self.message def __repr__(self): return '{}{}'.format(type(self).__name__, self.args) class GNULibError_Directory(GNULibError): err_num = 1 err_format = "destination directory does not exist: {}" class GNULibError_Config(GNULibError): err_num = 2 err_format = "configure file does not exist: {}" class GNULibError_Module(GNULibError): err_num = 3 err_format = "selected module does not exist: {}" class GNULibError_Cache(GNULibError): err_num = 4 err_format = "{} is expected to contain gl_M4_BASE({})" class GNULibError_Sourcebase(GNULibError): err_num = 5 err_format = "missing sourcebase argument: {}" class GNULibError_Docbase(GNULibError): err_num = 6 err_format = "missing docbase argument: {}" class GNULibError_Testbase(GNULibError): err_num = 7 err_format = "missing testsbase argument: {}" class GNULibError_Libname(GNULibError): err_num = 8 err_format = "missing libname argument: {}" # patch master class with subclass reference # (TO DO: auto-detect all available subclasses instead of hardcoding them) GNULibError.sub_exceptions = { 1: GNULibError_Directory, 2: GNULibError_Config, 3: GNULibError_Module, 4: GNULibError_Cache, 5: GNULibError_Sourcebase, 6: GNULibError_Docbase, 7: GNULibError_Testbase, 8: GNULibError_Libname } This starts out with GNULibError as a factory class - if you call it with an error number belonging to a recognized subclass, it returns an object belonging to that subclass, otherwise it returns itself as a default error type. Based on this code, the following should be exactly equivalent (but aren't): e = GNULibError(3, 'missing.lib') f = GNULibError_Module('missing.lib') print e # -> '[GNU Error 3] selected module does not exist: 3' print f # -> '[GNU Error 3] selected module does not exist: missing.lib' I added some strategic print statements, and the error seems to be in GNULibError.__new__: >>> e = GNULibError(3, 'missing.lib') new <class '__main__.GNULibError'> factory -> <class '__main__.GNULibError_Module'> ('missing.lib',) # good... init <class '__main__.GNULibError_Module'> (3, 'missing.lib') # NO! ^ why? I call the subclass constructor as subclass.__new__(*args[1:]) - this should drop the 3, the subclass type ID - and yet its __init__ is still getting the 3 anyway! How can I trim the argument list that gets passed to subclass.__init__?

    Read the article

  • C++ passing arguments to a program already running

    - by wyatt
    I'm reading through a tutorial on using voice commands to control applications and, in an example of controlling rhythmbox, it suggests commands such as the following can be executed: rhythmbox-client --play rhythmbox-client --pause Why does this not simply open a new instance of the program, and how can I emulate the functionality in my own programs? For example, how could I pass a string to a particular instance of a program? Thanks

    Read the article

  • Functions without arguments, with unit as argument in scala

    - by scout
    def foo(x:Int, f:Unit=>Int) = println(f()) foo(2, {Unit => 3+4} //case1 def loop:Int = 7 foo(2, loop) //does not compile changing loop to //case 2 def loop():Int = 7 foo(2, loop) // does not compile changing loop to //case 3 def loop(x:Unit): Int = 7 //changing according to Don's Comments foo(2,loop) // compiles and works fine should'nt case 1 and case 2 also work? why are they not working? defining foo as def foo(x:Int, y:()=>Int) then case 2 works but not case 1. Arent they all supposed to work, defining the functions either way. //also i think ()=Int in foo is a bad style, y:=Int does not work, comments??

    Read the article

  • C++: combine const with template arguments

    - by awn
    The following example is working when I manualy replace T wirh char *, but why is not working as it is: template <typename T> class A{ public: A(const T _t) { } }; int main(){ const char * c = "asdf"; A<char *> a(c); } When compiling with gcc, I get this error: test.cpp: In function 'int main()': test.cpp:10: error: invalid conversion from 'const char*' to 'char*' test.cpp:10: error: initializing argument 1 of 'A<T>::A(T) [with T = char*]'

    Read the article

  • Arguments to JavaScript Anonymous Function

    - by Phonethics
    for (var i = 0; i < somearray.length; i++) { myclass.foo({'arg1':somearray[i][0]}, function() { console.log(somearray[i][0]); }); } How do I pass somearray or one of its indexes into the anonymous function ? somearray is already in the global scope, but I still get somearray[i] is undefined

    Read the article

  • Passing arguments to a function?

    - by dfjhdfjhdf
    I need to learn how to pass an associative array to a function so that I could do the following within the function: function someName($argums) { if (gettype($argums) != 'array' || !array_key_exists('myOneKey', $argums) || !array_key_exists('myOtherKey', $argums)) { return false; } /*do other stuff*/ } (That's how I would do in PHP what I am looking for in JavaScript.)

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >