Search Results

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

Page 169/297 | < Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >

  • What configure options were used when building gcc / libstdc++?

    - by OK
    After reading about the problem of passing empty std::string objects between DLLs and EXEs, I am concerned about the configure options used to build my gcc / libstdc++. More specific I want to know if --enable-fully-dynamic-string was used during ./configure. I'm using MinGW 4.4.0 on Windows XP. Does anybody know the configuration used to build this release? Is there a general way to find this information for any installation of GNU gcc? The gcc manual gives me no hint on this topic. Thanks for your input!

    Read the article

  • Rails 3: Create an instance with 3 foreign keys.

    - by donald
    Hello, Having a reviews table: # Table name: reviews # # id :integer not null, primary key # wsp_id :integer # service_id :integer # user_id :integer # description :text # rating :integer # created_at :datetime # updated_at :datetime # belongs_to :wsp belongs_to :service belongs_to :user How can I create a review for a service and pass the wsp_id and user_id? Do I need to use nested routes? I am able to do @user.reviews.new(params[:review]) but I'm not being able of passing the wsp_id and the service_id. Here's my Reviews create controller. def create @review = current_user.reviews.new(params[:review]) if @review.save #Saved else #Error, not saved end end What am I doing wrong? Thank you!

    Read the article

  • How to make this very long url appear short?

    - by Camran
    I have made most my site SE friendly, but one part of my site bugs me... I have a HUGE form in one of the pages, and when submitting the form (action=php_page) URL is so long it covers half a word document in one line with all the passing variables... This is very ugly... Is there any way to make this long URL appear short? Or some other solution you know of? Let me know if you need more input... Thanks

    Read the article

  • Powershell - remote folder availability while counting files

    - by ziklop
    I´m trying to make a Powershell script that reports if there´s a file older than x minutes on remote folder. I make this: $strfolder = 'folder1 ..................' $pocet = (Get-ChildItem \\server1\edi1\folder1\*.* ) | where-object {($_.LastWriteTime -lt (Get-Date).AddDays(-0).AddHours(-0).AddMinutes(-20))} | Measure-Object if($pocet.count -eq 0){Write-Host $strfolder "OK" -foreground Green} else {Write-Host $strfolder "ERROR" -foreground Red} But there´s one huge problem. The folder is often unavailable for me bacause of the high load and I found out when there is no connection it doesn´t report an error but continues with zero in $pocet.count. It means it reports everything is ok when the folder is unavailable. I was thinking about using if(Test-Path..) but what about it became unavailable just after passing Test-Path? Does anyone has a solution please? Thank you in advance

    Read the article

  • How to acquire the Context in an Adobe AIR Native Extension?

    - by rotaercz
    In the following line of code... ProgressDialog progressDialog = ProgressDialog.show(getBaseContext(), "LOADING_TITLE", "LOADING_MESSAGE"); In place of getBaseContext() I've tried... getApplicationContext() this NativeActivity.this (NativeActivity)getApplicationContext() Among others. I'm not sure why it's not working. In the NativeExtensionContext which extends FREContext I am passing the activity using getActivity() to NativeActivity. Everything works well but I get a "Nullpointerexception" or “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application” when I try I try to get a reference to the Context. Anyone with experience using Adobe AIR Native Extensions and/or Android Java would be great.

    Read the article

  • What is the difference between the * and the & operators in c programming?

    - by Wesley
    I am just making sure I understand this concept correctly. With the * operator, I make a new variable, which is allocated a place in memory. So as to not unnecessarily duplicate variables and their values, the & operator is used in passing values to methods and such and it actually points to the original instance of the variable, as opposed to making new copies...Is that right? It is obviously a shallow understanding, but I just want to make sure I am not getting them mixed up. Thanks!

    Read the article

  • Shortcut with arguments in Debian

    - by Duncan
    I have a volume on a debian server which contains a large number of images at full resolution in various folders. What I'd like to do is have a separate sort of browse proxy folder which contains lower quality browse copies of these to enable users to access them for viewing over lower speed dial in accounts. I'd ideally like these to be created on the fly using ImageMagick so there isnt the need to store the large number of browse copies full time and worry about keeping them up to date etc The way I'd invisaged this happening is the browse proxy folder containing a duplicate file and folder structure but with symlinks pointing to a script to transform them with the file path as an argument. Except I know this isnt possible with symlinks so am wondering if there's another way of doing this on linux. On windows shortcuts can take arguments and I'm wondering how to do the same on a Linux platform? (or perhaps I'm going about this the wrong way?)

    Read the article

  • Need help: input int from console and pass it into method in different class

    - by christophe
    i'm a beginner, Need help, Please!!! I want to read number "a" from console and then store them in variable to use as passing to a different class (different .java file). How do i code the 2 classes? thanks public class PassedInMethod{ private int a; . public PAssMethod(int a) { a = a; // TODO: where to get the a? System.out.println("a was passed in!"+a); } public class Mainclass{ public static void main( String args[] ){ Scanner input = new Scanner( System.in ); int a; System.out.print( "Enter your nember: " ); a = input.nextInt(); PassedInMethod(int a); }

    Read the article

  • Incompatible format types

    - by nebffa
    I'm playing around with strncpy in C and am having some trouble. The code is as follows: #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { char src[] = "Benjamin Franklin"; char dest[5]; strncpy(src, dest, sizeof(dest) / sizeof(char)); dest[5] = '\0'; printf("%s\n", dest); return 0; } which compiles with no errors using: gcc -Wall -g -Werror test.c -o test and prints out gibberish like p4?? I cannot really understand what I'm doing wrong especially since I have played around with it a lot and been looking online for answers. Perhaps since I am using arrays I am passing the address to printf without realising it?

    Read the article

  • SQL Server. Stored procedure to get the biweekly periods

    - by Yada
    I'm currently trying to write a stored procedure that can compute the biweekly periods when a date is passed in as a parameter. The business logic: the first Monday of the year is first day of the biweekly period. For example in 2010: period period_start period_end 1 2010-01-04 2010-01-17 2 2010-01-18 2010-01-31 3 2010-02-01 2010-02-14 .... 26 2010-12-20 2011-01-02 Passing today's date of 2010-12-31 will return 26, 2010-12-20 and 2011-01-02. I'm not too strong in T-SQL. Any help is appreciated. Thanks

    Read the article

  • Why does the assignment operator return a value and not a reference?

    - by Nick Lowman
    I saw the example below explained on this site and thought both answers would be 20 and not the 10 that is returned. He wrote that both the comma and assignment returns a value, not a reference. I don't quite understand what that means. I understand it in relation to passing variables into functions or methods i.e primitive types are passed in by value and objects by reference but I'm not sure how it applies in this case. I also understand about context and the value of 'this' (after help from stackoverflow) but I thought in both cases I would still be invoking it as a method, foo.bar() which would mean foo is the context but it seems both result in a function call bar(). Why is that and what does it all mean? var x = 10; var foo = { x: 20, bar: function () {return this.x;} }; (foo.bar = foo.bar)();//returns 10 (foo.bar, foo.bar)();//returns 10

    Read the article

  • What should I name instances of a twisted.internet.defer.Deferred?

    - by slacy
    I'm writing code using Twisted, and having trouble coming up with a sensible variable name for my twisted internet deferred's. Here are my candidates: d : Too generic, too short, violates pylint rule C0103. def : Conflicts with function defintion builtin. defer : Conflicts with module twisted.internet.defer deferred : OK but pretty long cb : Still too short, violates pylint C0103, conflicts with many callback method names. cback : Too Weird? callback : Conflicts with method Deferred.callback() I'm looking for other suggestions. It seems like most of the Twisted example code uses "d" which is fine for simple invocations, but when you're passing Deferred's around to methods and storing them as member variables, it's really far too descriptive.

    Read the article

  • Postback of delimited text from javascript and parsing on server side

    - by Alt_Doru
    In my ASP.NET page, I have a Javascript object, like this: var args = new Object(); args.Data1 = document.getElementById("Data1").value; args.Data2 = document.getElementById("Data2").value; args.Data3 = document.getElementById("Data3").value; The object is populated on client side using user input data. I am passing the data to a C# method, through an Ajax request: someObj.AjaxRequest(argsData1 + "|" + argsData2 + "|" + argsData3) Finally, I need to obtain the data in my C# code: string data1 = [JS args.Data1] string data2 = [JS args.Data2] string data3 = [JS args.Data3] My question is what's the best solution for this? As i am concatenating bits of user input, I don't think it's best to use "|" as a delimiter. Also, it's not clear to me how to actually parse the data in my C# code to populate the three variables with the original data.

    Read the article

  • SVNNotify Where is it? how do I find it?

    - by John Isaacks
    I am on ubuntu. ok first of all I am running a post-commit script. I need the path to svnnotify to run it. The path the turotial I am reading has it as /usr/local/bin/svnnotify but nothing is in that location on my computer. I tried it anyways and I get something like: Warning post-commit hook failed: not found so I think I need to replace /usr/local/bin/svnnotify with the correct path to svnnotify. Well I do a search (Places>Search for Files) for svnnotify and nothing comes up. I know svnnotify is installed becuase if I open a command line and run svnnotify it tells me I am missing the required path argument. So how can it be installed if its not in the file system anywhere? I don't really know how linux works, its very new to me, so I am confused. Is there something I am missing?

    Read the article

  • Read Core data in Serial Queue for iPhone app

    - by user1277209
    I have an app which uses Core data and the values are fetched from a link on internet. This runs absolutely fine when I am creating a serial queue in AppDelegate and I am not facing any problem with the same. Now, when I am trying to re-create similar scenario in a UITableViewController and executing the same in a serial queue but when the control reaches NSError *error; NSArray *match = [context executeFetchRequest:fetchRequest error:&error]; execution control disappears and then this code remains in the execution till eternity. Can anyone help me with what exactly is wrong here? FYI, I am passing the same ManagedObjectContext to the serial queue.

    Read the article

  • How can I declare constant strings for use in both an unmanaged C++ dll and in a C# application?

    - by Surfbutler
    Curently I'm passing my const string values up from my C++ into my C# at startup via a callback, but I'm wondering if there's a way of defining them in a C++ header file that I can then also refer to in C#. I already do this with enums as they are easy. I include a file in both my C++ library project (via a .h file with a pragma once at the top), and my C# application (as a link): #if _NET public #endif enum ETestData { First, Second }; I know it sounds messy, but it works :) But...how can I do the same with string constants - I'm initially thinking the syntax is too different between the platforms, but maybe there's a way? Using clever syntax involving #if _NET, #defines etc? Using resource files? Using a C++/CLI library? Any ideas?

    Read the article

  • MVC + Repository Pattern - Still depends on Data Model?

    - by Jack
    I've started a project for school in which I am using ASP.NET MVC 2 + LINQ2SQL, and a business layer so my UI doesnt interact with the DB directly. My question is this: In my MVC project, when bringing up views and passing around data, I still have to include my Data project for access to the classes in my Linq2Sql project. Is this correct? Example: Controller: ClassesRepository cr = new ClassesRepository(); // this is from my Business project Class classToEdit = cr.GetByClassId(id); // "Class" is from my data project I still have to reference the Class class in my linq2sql data project - shouldn't my UI be completely independent of my data layer? Or maybe I'm going about this all wrong.

    Read the article

  • C++: Allocation of variables in a loop

    - by Rosarch
    Let's say I have a loop like this: vector<shared_ptr<someStruct>> vec; int i = 0; while (condition) { i++ shared_ptr<someStruct> sps(new someStruct()); WCHAR wchr[20]; memset(wchr, i, 20); sps->pwsz = wchr; vec.push_back(sps); } At the end of this loop, I see that for each sps element of the vector, sps->pwsz is the same. Is this because I'm passing a pointer to memory allocated in a loop, which is destructed after each iteration, and then refilling that same memory on the next iteration?

    Read the article

  • Secure Webservice?

    - by cam
    I'm trying to create a secure webservice (that provides simple database data) with PHP that can be connected to through my Silverlight application. I don't know enough about PHP to be able to see another way to do this. The webservice should only be accessible through the client, and only with the proper username/password. The only two ways I can imagine to do this would be by passing the username/password hash via URL, or use a "hidden form" and do it via POST_. I'm just trying to get past this point, I'm the sole developer on this project and I'm just trying to get past this PHP webservice part so I can get back to being an application programmer :) Normally, I would learn PHP, but I'm on the clock, so I'm just looking for a point in the right direction on how to achieve this!

    Read the article

  • Reference to an instance method of a particular object

    - by Andrey
    In the following code, if i try to pass method reference using the class name, works. But passing the reference variable compiler gives an error, i do not understand why? public class User { private String name; public User(String name) { this.name = name; } public void printName() { System.out.println(name); } } public class Main { public static void main(String[] args) { User u1 = new User("AAA"); User u2 = new User("BBB"); User u3 = new User("ZZZ"); List<User> userList = Arrays.asList(u1, u2, u3); userList.forEach(User::printName); // works userList.forEach(u1::printName); // compile error } } Thanks,

    Read the article

  • How do check if PDO object is connected properly inside a different class?

    - by tgun926
    I want to fetch some information from my mysql database in a class, so I'm passing in the PDO object into a __construct function, and working from there. However, what's an elegant way of checking to see if the PDO object was correctly created, and that the connection is open when the Table class is instantiated? class Table{ public function __construct(PDO $db, $week){ try{ $query = $db -> query ("SELECT * FROM `table1` where `day` = 'monday'"); } catch(PDOExeption $e){ echo 'error: '. $e->getMessage(); //die(); } } } I don't think this code does what I want.

    Read the article

  • explain this macro

    - by deostroll
    #define __T(x) L ## x Found in code from one of the MFC source header file. It is mostly used for converting strings to ........ (I don't know what). If I am correct it converts strings to LPCTSTR...don't know what that type is either... I can't seem to convert char* into LPCTSTR. While MFC file handling, the following code will always return error while trying to open the file... char* filepath = "C:\\Program Files\\Microsoft Office\\Office12\\BITMAPS\\STYLES\\GLOBE.WMF"; if( !file.Open((LPCTSTR)filepath , CFile::modeRead, &fexp) ) { fexp.ReportError(); return 1; } But instead if I wrote it this way, it doesn't give error: if( !file.Open( _T("C:\\Program Files\\Microsoft Office\\Office12\\BITMAPS\\STYLES\\GLOBE.WMF") , CFile::modeRead, &fexp) ) { fexp.ReportError(); return 1; } I am looking at passing a variable as the first argument to the CFile::Open() method.

    Read the article

  • C# Unit Testing: How do I set a Lazy<T>.ValueCreated to false?

    - by michael paul
    Basically, I have a unit test that gets a singleton instance of a class. Some of my tests required me to mock this singleton, so when I do Foo.Instance I get a different type of instance. The problem is that my checks are passing individually, but failing overall because one test is interfering with another. I tried to do a TestCleanup where I set: Foo_Accessor._instance = null; but that didn't work. What I really need is Foo_Accessor._instance.IsValueCreated = false; (_instance is a Lazy). Any way to unset the Lazy object that I didn't think of?

    Read the article

  • best way to write a-> ..->[a] recursive functions in haskell

    - by Roman A. Taycher
    So I keep having this small problem where I have something like func :: a -> b -> [a] -- or basically any a-> ...-> [a] where ... is any types -> func x y = func' [x] y -- as long as they are used to generate a list of [a] from x func' :: [a] -> b -> [a] func = undefined --situation dependant generates a list from each element and returns it as one long list should I keep it like this? should I use func' hidden by a where? should I only use the [a] - b - [a] version and leave the responsibility of passing [variable] to the callee? I might well need to compose these functions and might want to mess around with the order so I'm leaning towards option 3. What do you think?

    Read the article

  • How do you create a daemon in Python?

    - by DavidM
    Searching on Google reveals x2 code snippets. The first result is to this code recipe which has a lot of documentation and explanation, along with some useful discussion underneath. However, another code sample, whilst not containing so much documentation, includes sample code for passing commands such as start, stop and restart. It also creates a PID file which can be handy for checking if the daemon is already running etc. These samples both explain how to create the daemon. Are there any additional things that need to be considered? Is one sample better than the other, and why?

    Read the article

< Previous Page | 165 166 167 168 169 170 171 172 173 174 175 176  | Next Page >