Search Results

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

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

  • Are Sting int values guaranteed to be constant over different projects

    - by jax
    I have some messages being passed back from my server through php. The problem is that the messages are in English and if the user is using another language they will still get the message in English. So I had an idea that maybe instead of passing back the message I would instead pass the String resource Id from the android app, that way the app will get the correct string id for their language. I will use this in a number of apps so I just want to know if the string id is guaranteed to be the same across different android projects?

    Read the article

  • How to get total number of potential results in Lucene

    - by Slace
    I'm using lucene on a site of mine and I want to show the total result count from a query, for example: Showing results x to y of z But I can't find any method which will return me the total number of potential results. I can only seem to find methods which you have to specify the number of results you want, and since I only want 10 per page it seems logical to pass in 10 as the number of results. Or am I doing this wrong, should I be passing in say 1000 and then just taking the 10 in the range that I require?

    Read the article

  • Is directly executing SQL bad app design?

    - by Michael Lowman
    I'm developing an iOS application that's a manager/viewer for another project. The idea is the app will be able to process the data stored in a database into a number of visualizations-- the overall effect being similar to cacti. I'm making the visualizations fully user-configurable: the user defines what she wants to see and adds restrictions. She might specify, for instance, to graph a metric over the last three weeks with user accounts that are currently active and aren't based in the United States. My problem is that the only design I can think of is more or less passing direct SQL from the iOS app to the backend server to be executed against the database. I know it's bad practice and everything should be written in terms of stored procedures. But how else do I maintain enough flexiblity to keep fully user-defined queries? While the application does compose the SQL, direct SQL is never visible or injectable by the user. That's all abstracted away in UIDateTimeChoosers, UIPickerViews, and the like.

    Read the article

  • ASP.Net layered communication

    - by Chris Klepeis
    Hi, We're developing a layered web application. The specs: 3 layers, data layer, business layer, ui layer. Programmed in C# Data Layer uses the entity framework Currently we plan on having the data layer return IEnumerable<T> to the business layer via linq 2 entities, and the business layer will return data to the ui layer. Since the ui layer has no knowledge of the existance of the data layer, how would it handle a result of IEnumerable passed to it from the BLL, where T is defined in the data layer? Are there any GOOD example out there on how to do this. Please note that I'm extremely new to factories / interfaces / abstraction to loosely couple layers. I saw the question here http://stackoverflow.com/questions/917457/passing-data-in-an-ntier-application and it was recommended to have the entity layer shared amongst all layers... however I do not want the other layers to be able to query the database.

    Read the article

  • Convert bit vector (array of booleans) to an integer, and integer to bit vector, in Java.

    - by dreeves
    What's the best way to unstub the following functions? // Convert a bit-vector to an integer. int bitvec2int(boolean[] b) { [CODE HERE] } // Convert an integer x to an n-element bit-vector. boolean[] int2bitvec(int x, int n) { [CODE HERE] } Or is there a better way to do that sort of thing than passing boolean arrays around? This comes up in an Android app where we need an array of 20 booleans to persist and the easiest way to do that is to write an integer or string to the key-value store. I'll post the way we (Bee and I) wrote the above as an answer. Thanks!

    Read the article

  • Are string resource ID values guaranteed to be consistent over different projects?

    - by jax
    I have some messages being passed back from my server through php. The problem is that the messages are in English and if the user is using another language they will still get the message in English. So I had an idea that maybe instead of passing back the message I would instead pass the String resource Id from the android app, that way the app will get the correct string id for their language. I will use this in a number of apps so I just want to know if the string id is guaranteed to be the same across different android projects?

    Read the article

  • retrieve value from db in php

    - by wangdoo
    I have a db in which 1 column value will be always null.I want it to pass to next page but it is passing all values of other column except this null value column. This is my code $row=mysql_query("SELECT * FROM `thirdpartycategorymaster` WHERE ISNULL(`delete`)"); while($row1=mysql_fetch_array($row)) { <td><b><a href="catdel.php?head1=<?php echo $row1['ThirdPartyCategoryName'] . '&&msg1=' . $row1['ThirdPartyCategoryID'] . '&&ctdel=' . $row1['delete']; ?> ">Delete</a></b></td> This my db table ThirdPartyCategoryID ThirdPartyCategoryName delete 29 ecommerce NULL

    Read the article

  • How to change the name dynamicaly using jQuery grid

    - by kumar
    I have jQuery grid with user data; my first column is ID: $("#table").click(function(e) { var row = jQuery(e.target).parent(); Name = row.attr("id"); Friends(Name); }); Now when I click on the row I am getting the ID value. I am passing this ID to one function to display it. It always shows the name of the first row - it isn't changing for every row click... Any ideas?

    Read the article

  • Path with no slash after drive letter and colon - what does it point to?

    - by ya23
    I have mistyped a path and instead of c:\foo.txt wrote c:foo.txt. I expected it to either fail or to resolve to c:\foo.txt, but instead it seems to be resolved to foo.txt in a current user's home folder. Powershell returns: PS C:\> [System.IO.Path]::GetFullPath("c:\foo.txt") c:\foo.txt PS C:\> [System.IO.Path]::GetFullPath("c:foo.txt") C:\Users\Administrator\foo.txt PS C:\> [System.IO.Path]::GetFullPath("g:foo.txt") G:\foo.txt Running explorer.exe from commandline and passing it any of the above results in C:\Users\Administrator\Documents to be opened. I haven't found any documentation of that and I'm utterly confused, please explain the behaviour.

    Read the article

  • Why does an ampersand in URL cause failure of some command in Mac OS X Terminal?

    - by congliu
    Why does an ampersand in URL cause failure of the following command? I want to open a web page by running Safari in Terminal, placing the URL as an argument. This works as expected: open -a safari "http://endic.naver.com/search.nhn?sLn=en&searchOption=all&query=good" But once the quotes being removed, it wouldn't work as expected: open -a safari http://endic.naver.com/search.nhn?sLn=en&searchOption=all&query=good Instead, it returns: [3] 5395 [4] 5396 [1] Done open -a safari http://endic.naver.com/search.nhn?sLn=en [2] Done searchOption=all Seems like ampersand in the URL was treated as "running previous command in the background", though there is no space following the ampersand in the URL.

    Read the article

  • MVC: Structuring Feed Output

    - by Brian Wigginton
    The framework I'm using on my project follows the MVC Pattern. I"M building JSON feeds and need to structure them in a different way then what the system gives me by default from the ORM. Where should I be handling the task of mangling and shaping my data that I'll serve up, in the model, view or controller? Right now I'm doing it in my controller, then passing that data to the view. I can see this fitting better under the Model or the View but not sure which one.

    Read the article

  • In scala can I pass repeated parameters to other methods?

    - by Fred Haslam
    Here is something I can do in java, take the results of a repeated parameter and pass it to another method: public void foo(String ... args){bar(args);} public void bar(String ... args){System.out.println("count="+args.length);} In scala it would look like this: def foo(args:String*) = bar(args) def bar(args:String*) = println("count="+args.length) But this won't compile, the bar signature expects a series of individual strings, and the args passed in is some non-string structure. For now I'm just passing around arrays. It would be very nice to use starred parameters. Is there some way to do it?

    Read the article

  • boost variant static_visitor problem picking correct function

    - by Steve
    I'm sure I'm having a problem with template resolution here, but I'm not sure why I'm having the problem. I have a static visitor I'm passing to boost variant where i've had to do template specialization for certain cases. The case for everything except for MyClass should throw in the static_visitor below. Unfortunately, when the visitor is applied to pull a MyClass out, it selects the most generic case rather than the exact match. I would type each case explicitly, but that will be rather long. So, why is the compiler resolving the most generic case over the exact match, and is there anyway to fix it template<> class CastVisitor<MyClass>:public boost::static_visitor<MyClass> { public: template<typename U> MyClass operator()(const U & i) const { throw std::exception("Unable to cast"); } MyClass operator()(const MyClass& i) { return i; } };

    Read the article

  • How can I write faster JavaScript?

    - by a paid nerd
    I'm writing an HTML5 canvas visualization. According to the Chrome Developer Tools profiler, 90% of the work is being done in (program), which I assume is the V8 interpreter at work calling functions and switching contexts and whatnot. Other than logic optimizations (e.g., only redrawing parts of the visualization that have changed), what can I do to optimize the CPU usage of my JavaScript? I'm willing to sacrifice some amount of readability and extensibility for performance. Is there a big list I'm missing because my Google skills suck? I have some ideas but I'm not sure if they're worth it: Limit function calls When possible, use arrays instead of objects and properties Use variables for math operation results as much as possible Cache common math operations such as Math.PI / 180 Use sin and cos approximation functions instead of Math.sin() and Math.cos() Reuse objects when passing around data instead of creating new ones Replace Math.abs() with ~~ Study jsperf.com until my eyes bleed Use a preprocessor on my JavaScript to do some of the above operations

    Read the article

  • fb sharer.php - use custom url for title

    - by Manasi
    Hi, I am using facebook's sharer.php to post to facebook from my application. My application is hosted at //[my_domain]/[some_param]/index I am setting the title, description and the image url to be displayed on facebook in the meta tags of the page found at the above mentioned url. when i share the link facebook generates the following message to share: [some_img] [some_title] http://[my_domain]/[some_param]/index [some_message] What i need to do is either hide or change this url "http://[my_domain]/[some_param]/index" that is shown by default, since i do not want the users to see this. Instead i am passing the desired url that i want the users to see in So is there some way of doing this?

    Read the article

  • Pass a parameter from one jsp to another using form.action

    - by Ntz
    I have an ID that I need in the next jsp once the user click a button. I am trying to do the following: FirstJSP.jsp: function getSecond() { var frm = document.getElementById("frm"); frm.action = "**second.jsp?id=myId;"** frm.submit(); } ... form id="frm" ..... input type="button" value="Next" onclick="getSecond()"/ ...... This code takes me to my second page, but if I tried to access the id, it gives me an error since the id is null. I access the id in the second page by: final Long passedId = Long.parseLong(request.getParameter("id")); I think I am not passing the parameter correctly, but I don't know how to do it. Any ideas? Thank you so much!

    Read the article

  • How to give 'Everybody' full rights to a file (programmatically)

    - by egrunin
    I'm modifying an old C++ program to run on Vista. It does not require Admin privileges. I've changed the code to put logfiles in \ProgramData\MyApp\. These logfiles are written with the stdio functions (fopen, fprintf, fclose). Here's the problem: UserA runs the program first, it creates \ProgramData\MyApp\MyLogFile.txt UserB runs the program next, it tries to append to MyLogFile.txt and gets access denied. I tried creating a null SECURITY_DESCRIPTOR and passing that to CreateFile(). That does create a file with "no permissions assigned", but it seems as if the first user to write to the file takes ownership and afterwards all the other non-admin users are out of luck. It's important that all users share the same logfiles, but it's also important that I change as little code as possible.

    Read the article

  • how should i load a bitmap for an android game?

    - by Heysus Escobar
    i been working on a game with no bitmaps or anything, I'm using rectangles as objects and changing their color for their purpose like a red rectangles for player and gray rectangles for walls. My question is what is the right way to replace the rectangles with bitmaps/images? I know to load Bitmaps you can just do this : Bitmap randomBitmap = BitmapFactory.decodeResource(getResources(), com.example.android4gametest.R.drawable.ic_launcher); Should i load all my Bitmaps and pass them to their Classes or should i load the bitmap inside their class instead of passing it ? and how would i do that because i cannot use the BitmapFactory because i have no access to the getResources()! or should i load my bitmaps/images from my assets folder which i know i wont have the same "tools" you can say to mess with the bitmap.

    Read the article

  • Do (statically linked) DLLs use a different heap than the main program?

    - by happy_emi
    I'm new to Windows programming and I've just "lost" two hours hunting a bug which everyone seems aware of: you cannot create an object on the heap in a DLL and destroy it in another DLL (or in the main program). I'm almost sure that on Linux/Unix this is NOT the case (if it is, please say it, but I'm pretty sure I did that thousands of times without problems...). At this point I have a couple of questions: 1) Do statically linked DLLs use a different heap than the main program? 2) Is the statically linked DLL mapped in the same process space of the main program? (I'm quite sure the answer here is a big YES otherwise it wouldn't make sense passing pointers from a function in the main program to a function in a DLL). I'm talking about plain/regular DLL, not COM/ATL services EDIT: By "statically linked" I mean that I don't use LoadLibrary to load the DLL but I link with the stub library

    Read the article

  • Apply CSS class to invalid controls on web form

    - by user137639
    I need to apply a css class to invalid controls on a web form. I'd like to make it a resusable class. This is what I have so far: public class Validation { public static void ApplyInvalidClass(Page page, string className) { foreach (System.Web.UI.WebControls.BaseValidator bv in page.Validators) { if (!bv.IsValid) { Control ctrl = page.FindControl(bv.ControlToValidate); if (ctrl != null) { if (ctrl is TextBox) { TextBox txt = ctrl as TextBox; txt.CssClass = "invalid"; } if (ctrl is DropDownList) { DropDownList ddl = ctrl as DropDownList; ddl.CssClass = "invalid"; } if (ctrl is CheckBox) { CheckBox cb = ctrl as CheckBox; cb.CssClass = "invalid"; } if (ctrl is HtmlGenericControl) { HtmlGenericControl html = ctrl as HtmlGenericControl; html.Attributes.Add("class", className); } } } } } } The problem is what I call this on a .Net user control, I guess because I'm passing in Page, page.FindControl(bv.ControlToValidate) is always null. Is there a better way to do this?

    Read the article

  • How can I pass an object as a parameter in the google app engine RPC flow?

    - by jimmartens
    I'm building a pretty basic app, and one thing I want to do is pass an object as a parameter up through the service - async - impl instead of passing up a million separate parameters. so in async, I do something like this: import shared.Profile; ... public interface ProfileServiceAsync { public void addProfile(Profile inProf, AsyncCallback<Void> async); Now, profile is a class in com. ... .shared and I have the following in my ... .gwt.xml <source path='shared'/> That being said when I try to compile I get this error. [ERROR] Errors in 'file:/D:/projects/eclipse/workspace/.../src/com/.../client/ProfileServiceAsync.java' [ERROR] Line 11: No source code is available for type shared.Profile; did you forget to inherit a required module? Any ideas on this?

    Read the article

  • Making linq avoid using in memory filtering where possible

    - by linqmonkey
    Consider the these two LINQ2SQL data retrieval methods. The first creates a 'proper' SQL statement that filters the data, but requires passing the data context into the method. The second has a nicer syntax but loads the entire list of that accounts projects, then does in memory filtering. Is there any way to preserve the syntax of the second method but with the performance advantage of the first? public partial class Account { public IQueryable<Project> GetProjectsByYear(LinqDataContext context, int year) { return context.Projects.Where(p => p.AccountID==this.AccountID && p.Year==year).OrderBy(p => p.ProjectNo) } public IQueryable<Project> GetProjectsByYear(int year) { return this.Projects.Where(p => p.Year==year).OrderBy(p => p.ProjectNo).AsQueryable() } }

    Read the article

  • SQL use comma-separated values with IN clause

    - by user342944
    I am developing an ASP.NET application and passing a string value like "1,2,3,4" into a procedure to select those values which are IN (1,2,3,4) but its saying "Conversion failed when converting the varchar value '1,2,3,4' to data type int." Here is the aspx code: private void fillRoles() { /*Read in User Profile Data from database */ Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetStoredProcCommand("sp_getUserRoles"); db.AddInParameter(cmd, "@pGroupIDs", System.Data.DbType.String); db.SetParameterValue(cmd, "@pGroupIDs", "1,2,3,4"); IDataReader reader = db.ExecuteReader(cmd); DropDownListRole.DataTextField = "Group"; DropDownListRole.DataValueField = "ID"; while (reader.Read()) { DropDownListRole.Items.Add((new ListItem(reader[1].ToString(), reader[0].ToString()))); } reader.Close(); } Here is my procedure: CREATE Procedure [dbo].[sp_getUserRoles](@pGroupIDs varchar(50)) AS BEGIN SELECT * FROM CheckList_Groups Where id in (@pGroupIDs) END

    Read the article

  • 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

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