Search Results

Search found 4685 results on 188 pages for 'proper'.

Page 19/188 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • What is the proper way to assign a general udf to application.cfc?

    - by Tom Hubbard
    I simply want to define a function in application.cfc and expose it application wide to all requests. Preferably the "assignment" would only happen on application startup. Is the preferred method to do something along the lines of this: <CFCOMPONENT OUTPUT="FALSE"> <CFSET this.name = "Website"> <CFSET this.clientManagement = true> <CFSET this.SessionManagement = true> <CFFUNCTION NAME="GetProperty" OUTPUT="False"> <CFARGUMENT NAME="Property"> <CFRETURN this.Props[Property]> </CFFUNCTION> <CFFUNCTION NAME="OnApplicationStart" OUTPUT="FALSE"> <CFSET Application.GetProperty = GetProperty> . . . or is there something better?

    Read the article

  • Why is the proper "respond_to" format not getting called?

    - by humble_coder
    Hi All, I'm having a bit of an odd issue. Really too odd to type out, but here goes. Basically I have a controller that refuses to "respond_to" using javascript unless I assign my "chart.generate_xml" to a variable before the "respond_to" block like so: @xml = @chart.generate_xml(@begin_date,@end_date,1.hour) respond_to do |format| format.html format.js{ render :update do |page| page.insert_html :bottom, "chart-div", @xml #page.insert_html :bottom, "chart-div", @chart.generate_xml(@begin_date,@end_date,1.hour) end } If I remove the upper "@xml= …" portion and go with the lower "page.insert", the "format.js" section doesn't get called. And if I try to force the format with "request.format = :js", I get the javascript returned as text. I'm not doing anything special here in that method call, so I'm not sure why it would choose to respond any differently. FWIW, the method that triggers this controller action is using JS to do so, so I'm confused as to why "format.js" isn't always getting called. Thoughts? Best.

    Read the article

  • Database Design: A proper table design for large number of column values.

    - by Jake
    I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...? Option 1 Have a table with 1000 columns. Seems like a bad idea. What if the number of statistics one day exceeds the maximum number of columns? Option 2 Have a table with three columns. Let's say, ID, StatisticType, and StatisticValue. That way, you can have as many statistics as you want. However, reading a single experiments statistics becomes more complicated. Moreover, what if different statistics are different data types?? Any suggestions?

    Read the article

  • what is the proper way to do logging in csv file?

    - by user2003548
    i want to log some information of every single request send to a busy http server in a formatted form,use log module would create some thing i don't want to: [I 131104 15:31:29 Sys:34] i think of csv format but i don't know how to customize it,and python got csv module,but read the manual import csv with open('some.csv', 'w', newline='') as f: writer = csv.writer(f) writer.writerows(someiterable) since it would open and close a file each time, i am afraid in this way would slow down the whole server performance, what could i do?

    Read the article

  • MySQL INSERT data does not get stored in proper db, only temporary?

    - by greye
    I'm having trouble with MySQL or Python and can't seem to isolate the problem. INSERTs only seem to last the run of the script and are not stored in the database. I have this script: import MySQLdb db = MySQLdb.connect(host="localhost", user="user", passwd="password", db="example") dbcursor = db.cursor() dbcursor.execute("select * from tablename") temp = dbcursor.fetchall() print 'before: '+str(temp) dbcursor.execute('INSERT INTO tablename (data1, data2, data3) VALUES ("1", "a", "b")') dbcursor.execute("select * from tablename") temp = dbcursor.fetchall() print 'after: '+str(temp) The first time I run it I get the expected output: >>> before: () after: ((1L, 'a', 'b'),) The problem is that if I run it again, the before comes out empty when it should already have the entry in it and the after doesn't break (data 1 is primary key). >>> before: () after: ((1L, 'a', 'b'),) >>> before: () after: ((1L, 'a', 'b'),) >>> before: () after: ((1L, 'a', 'b'),) If I try running the insert command twice in the same script it will break ("Duplicate entry for PRIMARY KEY") Any idea what might be happening here?

    Read the article

  • Proper way to resignFirstResponder when a UITableView is touched?

    - by Topher Fangio
    Hello all, I have a pretty simple UITableView who's cells contain UITextFields and I need to be able to call resignFirstResponder to hide the keyboard whenever a user touches the UITableView outside of one of the cells. I have read this question/answer but it seems like a very rudimentary way to achieve this. I have read about a way to do it by converting the UITableView to a UIControl so that you can connect the TouchDown event. Does anybody know the standard or preferred way to achieve this functionality?

    Read the article

  • Whats the proper way of accessing a database through an assembly?

    - by H4mm3rHead
    Hi, I have a ASP.NET MVC application which is build up as an assembly that queries the database and a asp.net frontend that references this assembly and this assembly abstracts the underlying database. This means that my Assembly contains a app.config file that contains the connectionstring to the database (Linq to Sql data model). How do I go about making this more flexible? Should i make a "initialize()" method somewhere in my assembly which takes the connection string from the asp.net mvc application and then that controls which database to use? or how is this done?

    Read the article

  • What is a proper way to store site-level global variables in a SharePoint site?

    - by ccomet
    One thing that has driven me nuts about SharePoint2007 is the apparent inability to have defineable settings that apply specifically to a site or site collection itself, and not the content. I mean, you have some pre-defined settings like the Site Logo, the Site Name, and various other things, but there doesn't appear to be anywhere to add new kinds of settings. The application I am working on needs to be able to create multiple kinds of "project site collections" that all follow a basic template, but have certain additional settings that apply specifically to that site collection and that one alone. In addition to the standard site name we also need to define the Project Number, the Project Name, and the Client Name. And given the requests of some of our clients, we also reach a point where we have to have configurable settings that alter how some of the workflows work, like whether files are marked with Letters or Numbers. Our current solution, which I'm hesitant about, has been to store an XML file on the SharePoint server. This file contains one node for each site collection, identified by the URL of the root site. Inside the node are all of the elements that need to be defined for that site collection. When we need them, we have to access the XML file (which will always require SPSecurity.RunWithElevatedPrivileges to access files right on the server) every time to load it and retrieve the data. There are a lot of automated processes which will have to do this, and I'm hesitant about the stability of this method when we reach hundreds of sites with thousands of files running tens of thousands of workflows, all wanting to access this file. Maybe they're unfounded worries, but I'd rather worry than risk everything breaking in a couple years. I was looking into the SPWeb object and found the AllProperties hashtable. It looks like just the kind of thing which might work, but I don't know how safe it is to be modifying this. I read through both MSDN and the WSS SDK but found nothing that clarified on adding completely new properties into AllProperties. Is it safe to use AllProperties for this kind of thing? Or is there yet another feature that I am missing, which could handle the concept of global variables at the site collection or site scope?

    Read the article

  • What's the proper technical term for "high ascii" characters?

    - by moodforaday
    What is the technically correct way of referring to "high ascii" or "extended ascii" characters? I don't just mean the range of 128-255, but any character beyond the 0-127 scope. Often they're called diacritics, accented letters, sometimes casually referred to as "national" or non-English characters, but these names are either imprecise or they cover only a subset of the possible characters. What correct, precise term that will programmers immediately recognize? And what would be the best English term to use when speaking to a non-technical audience?

    Read the article

  • What is the proper way to declare a specialization of a template for another template type?

    - by Head Geek
    The usual definition for a specialization of a template function is something like this: class Foo { [...] }; namespace std { template<> void swap(Foo& left, Foo& right) { [...] } } // namespace std But how do you properly define the specialization when the type it's specialized on is itself a template? Here's what I've got: template <size_t Bits> class fixed { [...] }; namespace std { template<size_t Bits> void swap(fixed<Bits>& left, fixed<Bits>& right) { [...] } } // namespace std Is this the right way to declare swap? It's supposed to be a specialization of the template function std::swap, but I can't tell whether the compiler is seeing it as such, or whether it thinks that it's an overload of it or something.

    Read the article

  • What is the proper location for a sqlite3 database file?

    - by Elliot Chen
    Hi, Everyone: I'm using a sqlite3 database to store app's data. Instead of building a database within program, I introduced an existing db file: 'abc.sqlite' into my project and put it under my 'Resources' folder. So, I think this db file should be inside of 'bundle', so at my init function, I used following statement to read it out: NSString *path = [[NSBundle mainBundle] pathForResource:@"abc" ofType:"sqlite"]; if(sqlite3_open([path UTF8String], &database) != SQLITE_OK) ... It's ok that this db can be opened and data can be retrieved from it. BUT, someone told me that it's better to copy this db file into user folder: such as 'Document'. So, my question is: is it ok to use this db from main bundle directly or copy it to user folder then use that copy. Which is better? Thank you very much!

    Read the article

  • MySQL Sub-query.. Doesn't provide proper information after 3 entries into table.

    - by Chris Keefer
    After I get 3 rows in my forum_threads table this no longer does it's job; to organize a list of active forum threads and put the most recently responded-to thread at the top of the list, followed by second most recent posted-to thread, followed by third, fourth, etc. Like I said, the query works wonders up until there is a fourth row added to forum_threads. SELECT forum_threads.*, forum_posts.thread_id FROM forum_threads INNER JOIN (SELECT MAX(id) AS id, thread_id as thread_id FROM forum_posts group by thread_id order by id DESC) forum_posts ON forum_threads.id = forum_posts.thread_id

    Read the article

  • cocoa -- What is the proper way to tell an NSWindow to redisplay its contents?

    - by William Jockusch
    According to the NSWindow Class Reference, you should "rarely need to invoke" the NSWindow methods "display" or "setViewsNeedDisplay". So what is the usual way to redisplay the window's contents? EDIT: I am having trouble dealing with resizing events. I just want to have everything scale proportionally. See this question. As no one seems to have any ideas for using masks to get it to happen, I want to redraw the whole thing.

    Read the article

  • Mod_Rewrite: Testing URL got indexed in Google - How do I create a proper 301 redirect?

    - by Jonathan Wold
    I worked on a website for which I had a "development URL" that looked something like this: www.domainname.com.php5-9.dfw1-2.websitetestlink.com/ Now, several weeks after the website launch, there is at least one page of content indexed on Google with that URL. Question: How do I redirect all requests from that test URL to reroute to the actual domain? So, for instance, I would want: www.domainname.com.php5-9.dfw1-2.websitetestlink.com/page-name To go to: www.domainname.com/page-name The website is powered by WordPress and hosted on a PHP server. I've experimented with .htaccess without much success.

    Read the article

  • JMeter CSV Data Set is corrupting Japanese strings stored as proper UTF-8, I get Question Marks instead

    - by Mark Bennett
    I read in search terms from a simple text file to send to a search engine. It works fine in English, but gives me ???? for any Japanese text. Text with mixed English and Japanese does show the English text, so I know it's reading it. What I'm seeing: Input text: Snow Leopard ??????????????? Turns into: Snow Leopard ??????????????? This is in my POST field of an HTTP. If I set JMeter to encode the data, it just puts in the percent sequence for question marks. Interesting note: In the example above there are 15 Japanese characters, and then 15 question marks, so at some point it's being seen as full characters and not just bytes. About the Data: The CSV file is very simple in structure. There's only one field / one column, which I name TERM, and later use as ${TERM} I don't really need full CSV because it's only one string per line. There's no commas or quotes. When I run the Unix "file" command on the file, it says UTF-8 text. I've also verified it in command line and graphical mode on two machines. JMeter CSV Dataset Config: Filename: japanese-searches.csv File encoding: UTF-8 (also tried without) Variable names: TERM Delimiter: , Allow Quoted Data: False (I also tried True, different, but still wrong) Recycle at EOF: True Stop at EOF: False Staring mode: All threads A few things I've tried: Tried Allow quoted Data. It changed to other strange characters. -Dfile.encoding=UTF-8 Tried encoding the POST, but it just turned into a bunch of %nn for question marks And I'm not sure how "debug" just after the each line of the CSV is read in. I think it's corrupted right away, but I'm not sure. If it's only mangled when I reference it, then instead of ${TERM} perhaps there's some other "to bytes" function call. I'll start checking into that. I haven't done anything with the JMeter functions yet.

    Read the article

  • What is the proper way to set my drawable directories to support the new Dell Streak without losing support for older devices?

    - by emmby
    This seems to be a widespread problem. I have the following drawable directories: drwxr-xr-x 18 mike staff 612 Feb 4 17:28 drawable/ drwxr-xr-x 51 mike staff 1734 Feb 4 17:32 drawable-nodpi/ drwxr-xr-x 44 mike staff 1496 Feb 4 17:30 drawable-normal-mdpi/ My xml drawable resources are in drawable. My resources intended for the large-mdpi (Dell Streak) and normal-hdpi (Droid, Nexus, Incredible, etc.) are all in drawable-nodpi. My resources for normal-mdpi (older phones like the G1) are in drawable-normal-mdpi. Unfortunately, the normal-hdpi phones like the Droid are pulling their resources from drawable-normal-mdpi instead of from drawable-nodpi. This is likely because of the rules in How Android Finds the Best-matching Resource. So the question is, how do I provide support for large-mdpi devices like the Streak along with normal-hdpi devices like the Droid, as well as normal-mdpi devices like the G1? The simplest solution would probably be to make two copies of my large resources, one in normal-hdpi for the droid and one in large-mdpi for the streak, but i'd like to avoid duplicating all of these resources. Update Per Mayra's suggestion, I could make an alias for every resource. However, there are a lot of resources I'd have to make aliases for, which would make maintenance a nightmare going forward, so I'm hoping for another solution.

    Read the article

  • What is the proper way to do a Subversion merge in Eclipse?

    - by awied
    I'm pretty used to how to do CVS merges in Eclipse, and I'm otherwise happy with the way that both Subclipse and Subversive work with the SVN repository, but I'm not quite sure how to do merges properly. When I do a merge, it seems to want to stick the merged files in a seperate directory in my project rather than overwriting the old files that are to be replaced in the merge, as I am used to in CVS. The question is not particular to either Subclipse or Subversive. Thanks for the help!

    Read the article

  • What is the proper way to use a Logger in a Serializable Java class?

    - by Tim Visher
    I have the following (doctored) class in a system I'm working on and Findbugs is generating a SE_BAD_FIELD warning and I'm trying to understand why it would say that before I fix it in the way that I thought I would. The reason I'm confused is because the description would seem to indicate that I had used no other non-serializable instance fields in the class but bar.model.Foo is also not serializable and used in the exact same way (as far as I can tell) but Findbugs generates no warning for it. import bar.model.Foo; import java.io.File; import java.io.Serializable; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Demo implements Serializable { private final Logger logger = LoggerFactory.getLogger(this.getClass()); private final File file; private final List<Foo> originalFoos; private Integer count; private int primitive = 0; public Demo() { for (Foo foo : originalFoos) { this.logger.debug(...); } } ... } My initial blush at a solution is to get a logger reference from the factory right as I use it: public DispositionFile() { Logger logger = LoggerFactory.getLogger(this.getClass()); for (Foo foo : originalFoos) { this.logger.debug(...); } } That doesn't seem particularly efficient, though. Thoughts?

    Read the article

  • Why is YAML installing to my home directory instead of its proper directory?

    - by Zack Shapiro
    I keep getting the following error when installing Ruby 1.9.3-p125: It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. I've tried installing LibYAML and for some reason it's installing in my home directory on OS X Lion where the Documents, Music, Pictures, etc. folders are. Any idea how I can get rid of this error, properly install YAML and never have to deal with this again?

    Read the article

  • Wrapping unmanaged C++ with C++/CLI - a proper approach.

    - by Jamie
    Hi there, as stated in the title, I want to have my old C++ library working in managed .NET. I think of two possibilities: 1) I might try to compile the library with /clr and try "It Just Works" approach. 2) I might write a managed wrapper to the unmanaged library. First of all, I want to have my library working FAST, as it was in unmanaged environment. Thus, I am not sure if the first approach will not cause a large decrease in performance. However, it seems to be faster to implement (not a right word :-)) (assuming it will work for me). On the other hand, I think of some problems that might appear while writing a wrapper (e.g. how to wrap some STL collection (vector for instance)?) I think of writing a wrapper residing in the same project as the unmanaged C++ resides - is that a reasonable approach (e.g. MyUnmanagedClass and MyManagedClass in the same project, the second wrapping the other)? What would you suggest in that problem? Which solution is going to give me better performance of the resulting code? Thank you in advance for any suggestions and clues! Cheers

    Read the article

  • What is the proper odbc command for calling Oracle stored procedure with parameters from .Net?

    - by Hamish Grubijan
    In the case of MSFT SQL Server 08, it is: odbcCommand = new OdbcCommand("{call " + SP_NAME + " (?,?,?,?,?,?,?) }", odbcConn); When I try to do the same thing for Oracle, I get: OdbcException: ERROR [HYC00] [Oracle][ODBC]Optional feature not implemented. Feel free to ask for clarification, and please help. I am using .Net 3.5, SQL Server 08, and Oracle 11g_home1. P.S. The Oracle stored procedure does have some 3 more parameters, but I believe I am handling this in my code.

    Read the article

  • What's the proper way to use sqlite on the iPhone?

    - by Elliot Chen
    Hi, Experts: Can you please give some suggestions on sqlite using on the iPhone? Within my application, I use a sqlite DB to store all local data. Two methods can be used to retrieve those data during running time. 1, Load all the data into memory at initialization stage. (More memory used, less DB open/close operation needed) 2, Read corresponding records when necessary, free the occupied memory after using. (Good habit for memory using, but much DB open/close operations needs). I prefer to use method 2, but not sure whether too many DB opening/closing operations could affect app's efficiency. Or do you think I can 'upgrade' method 2 by opening DB when app launches and closing DB when app quits? Thanks for your suggestions very much!

    Read the article

  • What is the proper way to access datastore in custom Model Binders?

    - by mare
    How should I properly implement data access in my custom model binders? Like in controllers I use IContentRepository and then have it create an instance of its implementing class in constructor. So I have everything ready for incorporating IoC (DI) at a later stage. Now I need something similar in model binder. I need to make some DB lookups in the binder. I'm thinking of doing it the same way I do it in controllers but I am open to suggestion. This is a snippet from one of my controllers so you can imagine how I'm doing it in them: public class WidgetZoneController : BaseController { // BaseController has IContentRepository ContentRepository field public WidgetZoneController() : this(new XmlWidgetZoneRepository()) { } public WidgetZoneController(IContentRepository repository) { ContentRepository = repository; } ...

    Read the article

  • Why is my implementation of strcmp not returning the proper value?

    - by Avanish Giri
    Why is this printing out 0 back in main but 6 when it is inside of the strcmp function? 7 int main() 8 { 9 char* str = "test string"; 10 char* str2 = "test strong"; 11 //printf("string length = %d\n",strlen(str)); 12 13 int num = strcmp(str,str2); 14 15 printf("num = %d\n",num); 16 } 29 int strcmp(char* str, char* str2) 30 { 31 if(*str == '\0' && *str2 == '\0') 32 return 0; 33 if(*str2 - *str == 0) 34 { 35 strcmp(str+1,str2+1); 36 } 37 else 38 { 39 int num = *str2 - *str; 40 cout << "num = " <<num<<endl; 41 return num; 42 } 43 } The output is: num = 6 num = 0 Why is it printing 0 when obviously the value that it should be returning is 6?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >