Search Results

Search found 1683 results on 68 pages for 'andrew hicks'.

Page 43/68 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • New to C# and trying to use a global variable

    - by Andrew G. Johnson
    Is it possible to use global variables in C#? I'm coming from mainly a PHP background so variables are either accessible everywhere or just a global definition away. My main issue is I have a User class that I built myself to wrap around the current users table on my company's database. I am defining it in the MasterPage but can't seem to access it from the actual pages (I don't know if there's a better word to describe them but they are the pages that inherit the styles and format from the MasterPage) Any general tips or implementation practices for me? EDIT: here's some code snippets of what I'm trying to do: Site.master.cs public partial class SiteMaster : System.Web.UI.MasterPage { public User user = new User(); } logout.aspx <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="logout.aspx.cs" Inherits="logout" %> <%@ MasterType virtualPath="~/Site.master"%> logout.aspx.cs public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { User user = Master.user; } }

    Read the article

  • Replacing accented/umlauted characters with their unadorned counterparts in C# [closed]

    - by Andrew Rollings
    Duplicate of 249087 I have a bunch of user generated addresses that may contain characters with diacritic marks. What is the most effective (i.e. generic) way (apart from a straightforward replace) to automatically convert any such characters to their closest English equivalent? E.g. any of àâãäå would become a æ would become the two separate letters ae ç would become c any of èéêë would become e etc. for all possible letter variations (preferably without having to find and encode lookups for each diacritic form of the letter). (Note: I have to pass these addresses on to third party software that is incapable of printing anything other than English characters. I'd rather the software was capable of handling them, but I have no control over that.) EDIT: Never mind... Found the answer [here][2]. It showed up in the "Related" section to the right of the question after I posted, but not in my prior search or as a pre-post suggestion. Hmm. I added the 'diacritics' tag to the other question in any case. EDIT 2: Jeez! Who voted this -1 after I closed it?

    Read the article

  • Python 3.1 twitter post with installed library,

    - by Andrew
    I'd like to be able to post twitter messages from python 3.0. None of the twitter API I have looked at support python 3.1. Since the post proceedure only requires this : JSON: curl -u username:password -d status="your message here" http://api.twitter.com/1/statuses/update.json I was wondering if it is possible with the standard libraries to format this so a message could be sent. My head says it should be possible.

    Read the article

  • Configuration file reading. Best practice

    - by Andrew Florko
    Application stores configuration data in custom section of configuration file. This information is used all over the application. Nowadays I use helper static class to to provide access like this (some code omitted or simplified): [XmlRoot("webSiteSection")] public class WebSiteConfig : IConfigurationSectionHandler { public static WebSiteConfig Current { get { if (_current == null) _current = (WebSiteConfig) ConfigurationManager.GetSection("webSiteSection"); return _current; } } [XmlElement("section1")] public Section1 Section1 { get; set; } [XmlElement("section2")] public Section2 Section2 { get; set; } ... public object Create(object parent, object configContext, XmlNode section) { var serializer = new XmlSerializer(typeof(WebSiteConfig)); return serializer.Deserialize(new XmlNodeReader(section)); } } Then I use it like this <%: WebSiteConfig.Current.Section1.Value1 %> <%: WebSiteConfig.Current.Section1.Value2 %> What do you think of it? I find it usable because it keeps code simple, but also confused as IConfigurationSectionHandler is deprecated since .NET Framework 2.0

    Read the article

  • Problems with .net and toolbar, menu & status bar rendermode (blue) and standard form (grey)

    - by Andrew White
    Hiya, I'm a bit of a newbie to .NET so please ignore my ignorance. If you look at the above image (a complete prototype, ignore black bits :)) you will see lovely menus, toolbars & statusbars all using windows XP render mode and in a funky blue. Look at the form, labels, checkboxes and other buttons and you see horrible old school windows grey. These components don't have a render mode. My question: is there any way to show everything in XP style or do I have to chose new components? Thx. A.

    Read the article

  • Customizing the TFS 2008 build sequence to avoid compilation and deploy SSRS

    - by Andrew
    I'm trying to create a CI process for SQL Server Reporting Services. I am fairly new to TFS but quite experienced with MSBuild. In the past I've used a combination of MSBuild with Team City so the whole build process is more or less custom. Here lies the start of my problems, as the solution I am deploying only contains Report Server projects (rds), no compilation is required. I thought that I would override the the first default task that TFS runs (EndToEndIteration) to override the default TFS build sequence and inject my own. The first snag that I have come across is that the build always fails, how can I set the status of the build to success? Currently the EndToEndIteration task is very light and only has a message. Is this the best method to create a custom build process in TFS where compilation is not required? Or should I use the default sequence and override one of the hook tasks mentioned in http://msdn.microsoft.com/en-us/library/aa337604%28VS.80%29.aspx (ie: AfterCompile) The core steps that I'd like to achieve are: Bundle the RDL and datasource files Connect to the host server to register/deploy the reports Re-apply any subscriptions that previously existed Run tests to verify the deployment succeeded and is returning results as expected I have found another article on Report services deployment: http://stackoverflow.com/questions/88710/reporting-services-deployment But it doesn't mention the best practice for customizing the standard build process. Any help would be appreciated.

    Read the article

  • Database Modelling - Conceptually different entities but with near identical fields

    - by Andrew Shepherd
    Suppose you have two sets of conceptual entities: MarketPriceDataSet which has multiple ForwardPriceEntries PoolPriceForecastDataSet which has multiple PoolPriceForecastEntry Both different child objects have near identical fields: ForwardPriceEntry has MarketPriceDataSetId (foreign key to parent table) StartDate EndDate SimulationItemId ForwardPrice PoolPriceForecastEntry has PoolPriceForecastDataSetId (foreign key to parent table) StartDate EndDate SimulationItemId ForecastPoolPrice If I modelled them as separate tables, the only difference would be the foreign key, and the name of the price field. There has been a debate as to whether the two near identical tables should be merged into one. Options I've thought of to model this is: Just keep them as two independent, separate tables Have both sets in the one table with an additional "type" field, and a parent_id equalling a foreign key to either parent table. This would sacrifice referential integrity checks. Have both sets in the one table with an additional "type" field, and create a complicated sequence of joining tables to maintain referential integrity. What do you think I should do, and why?

    Read the article

  • "conveyor belt" cache architecture

    - by Andrew Matthews
    I'm producing an application with a few peculiar internal communication characteristics that make the usual suspects for data storage and transport (Qs and RDBMSs) ill-fitted. I'm wondering whether there is a product out there that matches the following characteristics: all data put into it is peristent all reads are delivered out of memory data is universally available data lives where it is most needed data is versioned (nice to have) updates are transactional (I'd like ACID characteristics) data is potentially replicated, but always in sync works on windows is based on or has bindings for .NET is really fast is really robust is redundant is scalable I'm looking at things like Microsoft codename "Velocity", but I am not sure whether it fits all of the above characteristics. Likewise, Memcached is not a perfect fit either. The current version of this app opts for an RDBMS with a signaling system for inter-system sync, but latency is too high and versioning of the DB is a pain. I need all the robustness, but with none of the trade-offs.

    Read the article

  • Faking Fixed Position in IE6

    - by Andrew
    I have a site that utilizes a bottom fixed position masthead here: http://www.entheospartners.com/newsite/ This setup works great in all browsers except IE6, which doesn't support fixed positioning in the least, so here's what I've done: When an IE6 user comes to the page, I make the determination if scrolling is necessary using this bit of code: var windowHeight = $(window).height(); var totalHeight = windowHeight - 100; // where 100 is the sum of the top nav height + footer height var contentHeight; if($('#subpage-content-small').length) { // main content div for a three column layout contentHeight = $('#subpage-content-small').height(); }; if($('#subpage-content-wide').length) { // main content div for a two column layout contentHeight = $('#subpage-content-wide').height(); }; if(contentHeight > totalHeight) { $('#container-container').css({ 'overflow-y' : "scroll", 'height' : totalHeight }); }; ...which calculates everything correctly, puts the scrollbars where they need to be (flush right), and sets them to the appropriate height. The problem is that the scrollbars don't move the content. I can't say that I've ever seen anything quite like this before, so I'm hoping someone else on here has. Thanks in advance! PS - Obviously, this needs to be looked at in IE6 for troubleshooting, which I know will be as painful for you as it is for me.

    Read the article

  • C++ Numerical truncation error

    - by Andrew
    Hello everyone, sorry if dumb but could not find an answer. #include <iostream> using namespace std; int main() { double a(0); double b(0.001); cout << a - 0.0 << endl; for (;a<1.0;a+=b); cout << a - 1.0 << endl; for (;a<10.0;a+=b); cout << a - 10.0 << endl; cout << a - 10.0-b << endl; return 0; } Output: 0 6.66134e-16 0.001 -1.03583e-13 Tried compiling it with MSVC9, MSVC10, Borland C++ 2010. All of them arrive in the end to the error of about 1e-13. Is it normal to have such a significant error accumulation over only a 1000, 10000 increments?

    Read the article

  • Multiple Questions per page using Drupal Quiz

    - by Andrew
    I'm using the Drupal Quiz module, and have setup some basic quizzes and stuff like that. However some further customization is required, involving more than 1 question per page, and a multi-type answer in this type of format: Question 1: Describe 4 things you did last summer a) [ short answer space - text field ] b) "I wept" c) "My whole family died so I learned self reliance" d) "I got another xbox" Question 2: Describe 2 things you hate about yourself a) "My arms are way shorter than my legs" b) "I was born without human emotion" So I guess in two parts, how to show multiple questions per page, and then how to allow multiple text fields for answers. Oh and this quiz is not graded, it's like a self assessment. Thanks!

    Read the article

  • Adding additional components to a web page after rendering by Wicket

    - by Andrew Fielden
    I have a requirement to create a web page using Wicket 1.5, which can present a variable number of panels to capture user input. All the panels have the same structure. The page would start off with one panel, and includes a button to dynamically add more as required. So the number of panels is unknown at the time the page is initially rendered. Effectively I'd be altering the structure of the page dynamically. This is possible in Javascript, using document.addElement() I've done a similar thing in the past by creating all the components on page load, and selectively showing/hiding components. The difference here is that the number of components (panels) is initially unknown. I'm unsure as to how this would be achieved with Wicket.

    Read the article

  • how to determine if a character vector is a valid numeric or integer vector

    - by Andrew Barr
    I am trying to turn a nested list structure into a dataframe. The list looks similar to the following (it is serialized data from parsed JSON read in using the httr package). myList <- list(object1 = list(w=1, x=list(y=0.1, z="cat")), object2 = list(w=2, x=list(y=0.2, z="dog"))) unlist(myList) does a great job of recursively flattening the list, and I can then use lapply to flatten all the objects nicely. flatList <- lapply(myList, FUN= function(object) {return(as.data.frame(rbind(unlist(object))))}) And finally, I can button it up using plyr::rbind.fill myDF <- do.call(plyr::rbind.fill, flatList) str(myDF) #'data.frame': 2 obs. of 3 variables: #$ w : Factor w/ 2 levels "1","2": 1 2 #$ x.y: Factor w/ 2 levels "0.1","0.2": 1 2 #$ x.z: Factor w/ 2 levels "cat","dog": 1 2 The problem is that w and x.y are now being interpreted as character vectors, which by default get parsed as factors in the dataframe. I believe that unlist() is the culprit, but I can't figure out another way to recursively flatten the list structure. A workaround would be to post-process the dataframe, and assign data types then. What is the best way to determine if a vector is a valid numeric or integer vector?

    Read the article

  • remote_addr problem

    - by Andrew Kolvik
    I am using xampp on localhost and when I use _SERVER["REMOTE_ADDR"] it returns ::1 (also does this in phpinfo()). Why does it do this? I want it to return a normal ip address like 127.0.0.1. My operating system is windows vista.

    Read the article

  • MySQL GROUP_CONCAT + IN() = missing data :-(

    - by Andrew Heath
    Example: Table: box boxID color 01 red 02 blue 03 green Table: boxHas boxID has 01 apple 01 pear 01 grapes 01 banana 02 lime 02 apple 02 pear 03 chihuahua 03 nachos 03 baby crocodile I want to query on the contents of each box, and return a table with each ID, color, and a column that concatenates the contents of each box, so I use: SELECT box.boxID, box.color, GROUP_CONCAT(DISTINCT boxHas.has SEPARATOR ", ") AS contents FROM box LEFT JOIN boxHas ON box.boxID=boxHas.boxID WHERE boxHas.has IN ('apple','pear') GROUP BY box.boxID ORDER BY box.boxID and I get the following table of results: boxID color contents 01 red apple, pear 02 blue apple, pear My question to you is: why isn't it listing ALL the has values in the contents column? Why is my WHERE statement also cropping my GROUP_CONCAT? The table I thought I was going to get is: boxID color contents 01 red apple, banana, grapes, pear 02 blue apple, lime, pear Although I want to limit my boxID results based upon the WHERE statement, I do not want to limit the contents field for valid boxes. :-/ Help?

    Read the article

  • How does the iPhone SDK Core Data system store date types to sqlite?

    - by Andrew Arrow
    I used core data to do this: NSManagedObjectContext *m = [self managedObjectContext]; Foo *f = (Foo *)[NSEntityDescription insertNewObjectForEntityForName:@"Foo" inManagedObjectContext:m]; f.created_at = [NSDate date]; [m insertObject:f]; NSError *error; [m save:&error]; Where the created_at field is defined as type "Date" in the xcdatamodel. When I export the sql from the sqlite database it created, created_at is defined as type "timestamp" and the values look like: 290902422.72624 Nine digits before the . and then some fraction. What is this format? It's not epoch time and it's not julianday format. Epoch would be: 1269280338.81213 julianday would be: 2455278.236746875 (notice only 7 digits before the . not 9 like I have) How can I convert a number like 290902422.72624 to epoch time? Thanks!

    Read the article

  • Incremement Page Hit Count in Django

    - by Andrew C
    I have a table with an IntegerField (hit_count), and when a page is visited (ie. http://site/page/3) I want record id 3 'hit_count' column in the database to increment by 1. The query should be like: update table set hit_count = hit_count + 1 where id=3 Can I do this with the standard Django Model conventions? Or should I just write the query by hand? I'm starting a new project, so I am trying to avoid hacks. We'll see how long this lasts! Thanks!

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >