Search Results

Search found 24792 results on 992 pages for 'chris may'.

Page 77/992 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • How to Format time in Yahoo PIpes to get the minutes past..??

    - by Nok Imchen
    I fetched the tweets from twitter api using yahoo pipes. Now, twitter gives the time in this format "Thu May 27 19:56:21 +0000 2010". I want to know how many minutes have past since "Thu May 27 19:56:21 +0000 2010". How, can i format "Thu May 27 19:56:21 +0000 2010" in order to get the minutes past?? in other words, i want to subract "now" and "Thu May 27 19:56:21 +0000 2010". Then convert the result into minutes. Please help me...

    Read the article

  • Downloading a webpage in C# example

    - by Chris
    I am trying to understand some example code on this web page: (http://www.csharp-station.com/HowTo/HttpWebFetch.aspx) that downloads a file from the internet. The piece of code quoted below goes through a loop getting chunks of data and saving them to a string until all the data has been downloaded. As I understand it, "count" contains the size of the downloaded chunk and the loop runs until count is 0 (an empty chunk of data is downloaded). My question is, isn't it possible that count could be 0 without the file being completely downloaded? Say if the network connection is interrupted, the stream may not have any data to read on a pass of the loop and count should be 0, ending the download prematurely. Or does ResStream.Read stop the program until it gets data? Is this the correct way to save a stream? int count = 0; do { // fill the buffer with data count = resStream.Read(buf, 0, buf.Length); // make sure we read some data if (count != 0) { // translate from bytes to ASCII text tempString = Encoding.ASCII.GetString(buf, 0, count); // continue building the string sb.Append(tempString); } } while (count 0); // any more data to read?

    Read the article

  • Simple regular expression for decimal numbers?

    - by finch
    I know this may be the simplest question ever asked on Stack Overflow, but what is the regular expression for a decimal with a precision of 2? Valid examples: 123.12 2 56754 92929292929292.12 0.21 3.1 Invalid examples: 12.1232 2.23332 e666.76 Sorry for the lame question, but for the life of me I haven't been able to find anyone that can help! The decimal place may be option, and that integers may also be included.

    Read the article

  • How can i run code on the client side from a browser?

    - by acidzombie24
    With LLVM and silverlight this may be possible now (or it may be possible with flash). I like the user to select a file and then do the following things 1) Hash it with md5 and sha1 2) If archive check if an exe is in it 3) If archive check if password protected The first to see if the user has uploaded it already (today, yesterday, last month) 2nd to prevent viruses 3rd i should be fine without but if i decide to not allow protected archives i can warn before the user uploads it. How may i do this through the browser?

    Read the article

  • access dropdown control from the master page to the content page using asp.net

    - by Isha Jain
    i have a master page and the content pages in the master page i have the textbox and dropdown the value in the dropdown may vary according to the content pages e.g for one content page the dropdown may contain branchname, city, address and let for other content page under same master page the dropdown may have values like Contactnumber, EmailID, ........... ......... etc..... so please help me to how can i bind that dropdown from my content page thanks.

    Read the article

  • PHP: how to access variables inside a function that have been declared outside of it?

    - by Chris
    Please, I am very new and have not been confronted with OOP and all this related stuff, which I guess may be related to this issue (public, private, ...). So, any help and suggestions are very appreciated! :) At the very beginning of each page I include a file that starts the SESSION etc, lets call it session.php. In this file session.php, I include a file that contains a function, let's call it function1.php, because I need the function to be available in session.php. However, later in the main page I also include function2.php which needs to access variables set in session.php, so I additionally tried to include session.php in function2.php. The problem is that an error occurs as function1 will be declared multiple times... Fatal error: Cannot redeclare function1() (previously declared in ... So, what would be a more elegant and clean(er) solution for this? How could you solve it? Basically, I'd need to access variables inside a function that have been included in the main page before... Thank you very much in advance!

    Read the article

  • Any application to bind documents of different kind

    - by Codeslayer
    A situation that may be quite common in offices is: We communicate with clients over e-mails, exchange documents and spreadsheets with them. Is there any tool which will help me in binding all these outputs. Maybe I may get flamed on this as this is not exactly a programming question. But some inputs may certainly help me. Thanx

    Read the article

  • whats the best way to parse and replace the string with its values ?

    - by shahjapan
    I may have string like, """Hello, %(name)s, how are you today, here is amount needed: %(partner_id.account_id.debit_amount)d """ what would be the best solution for such template may i need to combine regular expression and eval, input string may differ like $partner_id.account_id.debit_amount$ - for the moment I've kept as python string format - just for testing.

    Read the article

  • Display and Use Advanced Find for Product Subscriptions by Account in Microsoft CRM 4.0

    - by Chris
    By default when viewing an account in edit mode you have access to Opportunities, Invoices, and Quotes which contain the products being shopped by the account and/or the sales department. I'm trying to determine where to store, display, and use the products that an account has a subscription too. I may not understand the implementation but it seems that there should be "Products" option directly off the root Account management window that will show the user all the products the account has purchased. We are trying to integrate this with our production tracking system where product sales can originate from other channels that will not flow through CRM first. This product subscription does not fit into the Opportunity, Quote, or Invoice model because they are confirmed recurring sales that were automatically purchased via tools like a Public Website, Portal, etc. By enabling this tracking in CRM we can use the advanced find feature to facilitate follow up sales and marketing efforts. Example: Find everyone who is subscribed to model A, so we can notify them of a new holiday campaign where they can get 10% off on all add-ons. It's my assumption that this is a common scenario, however I'd like to better understand how to approach this within the world of Microsoft CRM. Thank you in advance.

    Read the article

  • How do I organize C# classes that inherit from one another, but also have properties that inherit from one another?

    - by Chris
    I have an application that has a concept of a Venue, a place where events happen. A Venue is owned by a Company and has many VenueParts. So, it looks like this: public abstract class Venue { public int Id { get; set; } public string Name { get; set; } public virtual Company Company { get; set; } public virtual ICollection<VenuePart> VenueParts { get; set; } } A Venue can be a GolfCourseVenue, which is a Venue that has a Slope and a specific kind of VenuePart called a HoleVenuePart: public class GolfCourseVenue { public string Slope { get; set; } public virtual ICollection<HoleVenuePart> Holes { get; set; } } In the future, there may also be other kinds of Venues that all inherit from Venue. They might add their own fields, and will always have VenueParts of their own specific type. My declarations above seem wrong, because now I have a GolfCourseVenue with two collections, when really it should just have the one. I can't override it, because the type is different, right? When I run reports, I would like to refer to the classes generically, where I just spit out Venues and VenueParts. But, when I render forms and such, I would like to be specific. I have a lot of relationships like this and am wondering what I am doing wrong. For example, I have an Order that has OrderItems, but also specific kinds of Orders that have specific kinds of OrderItems.

    Read the article

  • Batch insert mode with hibernate and oracle: seems to be dropping back to slow mode silently

    - by Chris
    I'm trying to get a batch insert working with Hibernate into Oracle, according to what i've read here: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/batch.html , but with my benchmarking it doesn't seem any faster than before. Can anyone suggest a way to prove whether hibernate is using batch mode or not? I hear that there are numerous reasons why it may silently drop into normal mode (eg associations and generated ids) so is there some way to find out why it has gone non-batch? My hibernate.cfg.xml contains this line which i believe is all i need to enable batch mode: <property name="jdbc.batch_size">50</property> My insert code looks like this: List<LogEntry> entries = ..a list of 100 LogEntry data classes... Session sess = sessionFactory.getCurrentSession(); for(LogEntry e : entries) { sess.save(e); } sess.flush(); sess.clear(); My 'logentry' class has no associations, the only interesting field is the id: @Entity @Table(name="log_entries") public class LogEntry { @Id @GeneratedValue public Long id; ..other fields - strings and ints... However, since it is oracle, i believe the @GeneratedValue will use the sequence generator. And i believe that only the 'identity' generator will stop bulk inserts. So if anyone can explain why it isn't running in batch mode, or how i can find out for sure if it is or isn't in batch mode, or find out why hibernate is silently dropping back to slow mode, i'd be most grateful. Thanks

    Read the article

  • str_replace problem

    - by user330840
    I am trying to change title data into URL. I need to get rid off all text starting from "deadline" from the following dynamic data which I get from $title: New York deadline May 14th, 2010 (urgent) New Hampshire deadline May 19th, 2010 New Jersey deadline I expect the result should be like this new-york new-hampshire new-jersey Here is the code I have tried $newurl = strip_tags(str_replace("deadline","","$title")); $code_entities_match = array( '&quot;' ,'!' ,'@' ,'#' ,'$' ,'%' ,'^' ,'&' ,'*' ,'(' ,')' ,'+' ,'{' ,'}' ,'|' ,':' ,'"' ,'<' ,'>' ,'?' ,'[' ,']' ,'' ,';' ,"'" ,',' ,'.' ,'_' ,'/' ,'*' ,'+' ,'~' ,'`' ,'=' ,' ' ,'---' ,'--','--'); $code_entities_replace = array('' ,'-' ,'-' ,'' ,'' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'-' ,'-' ,'-','-'); $newtitle = str_replace($code_entities_match, $code_entities_replace, $newurl); $urltitle = strtolower($newtitle); Unfortunately, the results are: new-york-deadline-may-14th-2010-urgent new-hampshire-deadline-may-19th-2010 new-jersey- Anyone can help?

    Read the article

  • lists searches in SYB or uniplate haskell

    - by Chris
    I have been using uniplate and SYB and I am trying to transform a list For instance type Tree = [DataA] data DataA = DataA1 [DataB] | DataA2 String | DataA3 String [DataA] deriving Show data DataB = DataB1 [DataA] | DataB2 String | DataB3 String [DataB] deriving Show For instance, I would like to traverse my tree and append a value to all [DataB] So my first thought was to do this: changeDataB:: Tree -> Tree changeDataB = everywhere(mkT changeDataB') chanegDataB'::[DataB] -> [DataB] changeDataB' <add changes here> or if I was using uniplate changeDataB:: Tree -> Tree changeDataB = transformBi changeDataB' chanegDataB'::[DataB] -> [DataB] changeDataB' <add changes here> The problem is that I only want to search on the full list. Doing either of these searches will cause a search on the full list and all of the sub-lists (including the empty list) The other problem is that a value in [DataB] may generate a [DataB], so I don't know if this is the same kind of solution as not searching chars in a string. I could pattern match on DataA1 and DataB3, but in my real application there are a bunch of [DataB]. Pattern matching on the parents would be extensive. The other thought that I had was to create a data DataBs = [DataB] and use that to transform on. That seems kind of lame, there must be a better solution.

    Read the article

  • shorten something in AS 2.0 using eval or set?

    - by chris
    eval("_parent.volumetone" + target1)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target2)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target3)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target4)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target5)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target6)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target7)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target8)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target9)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target10)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target11)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target12)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target13)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target14)._yscale = Math.round(number)/1.5+50; eval("_parent.volumetone" + target15)._yscale = Math.round(number)/1.5+50; i have these lines of repetitive code. the variables target1 to target15 are a random number between 1 and 110. so one may point to _parent.volumetone49 and adjust its _yscale for example. the code above works the way i want, but i want it shorter. here's something i tried with no success: for (i = 0; i < 15; i++) { set("_parent.volumetone" + ("target"+i) + "._xscale", Math.round(funhousenumber)/1.5+50); } basically having a loop that starts at 1 and goes to 15, then replaces target1 with target+i, i being 1, which would give target1 and thus the number contained in it. maybe i have to use eval()? i'm still not sure what i'm doing but i'm learning as i go. thanks.

    Read the article

  • Preg_replace regex, newlines, connection resets

    - by bob_the_destroyer
    I have mixed html, custom code, and regular text I need to examine and change frequently on several, long wiki pages. I'm working with a proprietary wiki-like application and have no control over how the application functions or validates user input. The layout of pages that users add must follow a very specific standard layout and always include very specific text in only certain places - a standard which frequently changes. If users add pages that are so far out of the standard, they will be deleted. The fact that all this is obviously a complete waste of time when alternative platforms to do exactly what's needed here exist is already understood. I've built a PHP based API to automate this post-validation and frequent restandardization process for me. I've been able set up regex patterns to handle all this mixed text, and they all work fine for handling single lines. The problem I have is this: Poorly formed regex against long text with line breaks can lead to unexpected results, such as connection resets. I have no access to server-side logs to troubleshoot. How do I overcome this? This is just one example of what I currently have: {column} and {section} tags I'm searching for below can have any number of attributes, and wrap any text. {section} may or may not exist and may or may not be one or more lines under {column}, but it has to be wrapped inside {column}. {column} itself may or may not exist, and if it doesn't, I don't care. I want to grab the inner section contents and wrap it in an html div tag. I can't recall the exact pattern I'm using offhand at the moment, but it's close enough... $pattern = "/\{column:id=summary([|]?([a-zA-Z0-9-_ ]+[:][a-zA-Z0-9-_ ]+[ ]?))\}(.*)({section([|]([a-zA-Z0-9-_ ]+[:][a-zA-Z0-9-_ ]+[ ]?))\}(.*)\{section\}(.*))?{column\}/s"; $replacement = "{html}<div id='summary'$7</div{html}"; $text = preg_replace($pattern, $replacement, $subject); Handling the {column} and {section} attributes and passing only valid HTML parameters to the new html div or a subtext of it is itself a challenge, but my main focus above right now is getting that (.*) value within {section} above without causing a connection reset. Any pointers?

    Read the article

  • How to evaluate text strings provided by sed/grep/whatever?

    - by T.J.
    This is for UNIX shell programming. It have to be supported by multiple UNIX platforms including Solaris, Linux, and AIX. I have this scenario -- I am to read from a text file a string that may or may not contain an environment variable that may or may not be defined. For example: <foo.bar> This error code was found: $(error_code) I have the following code: statement=$(sed -n $1'p' $messagefile) echo $echo_flag $statement $1 = line number supplied to this particular function/script. $messagefile = filename of log file. $echo_flag = "-e" in Linux, otherwise, empty. $(error_code) = 42. Instead of getting this when running: <foo.bar> This error code was found: 42 I still get this: <foo.bar> This error code was found: $(error_code) How exactly do I tell the shell script that the value of statement should be evaluated further beyond what sed have done?

    Read the article

  • How to configure multiple mappings using FluentHibernate?

    - by chris.baglieri
    First time rocking it with NHibernate/Fluent so apologies in advance if this is a naive question. I have a set of Models I want to map. When I create my session factory I'm trying to do all mappings at once. I am not using auto-mapping (though I may if what I am trying to do ends up being more painful than it ought to be). The problem I am running into is that it seems only the top map is taking. Given the code snippet below and running a unit test that attempts to save 'bar', it fails and checking the logs I see NHibernate is trying to save a bar entity to the foo table. While I suspect it's my mappings it could be something else that I am simply overlooking. Code that creates the session factory (note I've also tried separate calls into .Mappings): Fluently.Configure().Database(MsSqlConfiguration.MsSql2008 .ConnectionString(c => c .Server(@"localhost\SQLEXPRESS") .Database("foo") .Username("foo") .Password("foo"))) .Mappings(m => { m.FluentMappings.AddFromAssemblyOf<FooMap>() .Conventions.Add(FluentNHibernate.Conventions.Helpers .Table.Is(x => "foos")); m.FluentMappings.AddFromAssemblyOf<BarMap>() .Conventions.Add(FluentNHibernate.Conventions.Helpers .Table.Is(x => "bars")); }) .BuildSessionFactory(); Unit test snippet: using (var session = Data.SessionHelper.SessionFactory.OpenSession()) { var bar = new Bar(); session.Save(bar); Assert.NotNull(bar.Id); }

    Read the article

  • EF 4.0 Guid or Int as A primary Key

    - by bigb
    I am Implementing custom ASPNetMembership using EF 4.0 Is there any reason why i should use Guid as a primary key in User tables? As far as i know Int as a PK on SQL Server more performanced than strings. And Int is easier to iterate. Also, for security purpose if i need to pass this it id somewhere in url i may encrypt it somehow and pass it like a strings with no probs. But if i want to use auto generated Guid on SQL Server side using EF 4.0 i need to do this trick http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/ I can't see any cases why i should use Guid as PK, may be only one if system going to have millions ans millions users, but also, theoretically, Guid could be duplicated sometime isn't so? Anyway Int32 size is 2,147.483.647 it is pretty much even for very-very big system, but if this number is still not enough I may go with Int64, in that cases I may have 9,223.372.036.854.775.807 rows. Pretty much huh? From another hand, M$ using Guids as PK in their ASPNetMembership implementation. [aspnetdb].[aspnet_Users] - PK UserId Type uniqueidentifier, should be some reasons/explanation why the did it?! May be some one has any ideas/experience about that?

    Read the article

  • Array Indexing Properties of A Class

    - by Chris
    I have a class that has several properties: class Person { string Name; int Age; DateTime BirthDate; } Then I have a sort of wrapper class with a List<Person>. Within this wrapper class I want to be able to do something like Wrapper["Name"] that returns a new List<string> using .Select(x=>x.Name). How do I create a wrapper class around an IEnumerable that supports mapping a string to the Property name? Something like the pseudo code below, but obviously it doesn't work. I'm 99.9% sure the solution will have to use Reflection and thats fine. class Wrapper { List<Person> PersonList; List<dynamic> this[string Column] { return PersonList.Select(x => x.[Column]).ToList(); } } This may not seem like a good design, but its a fix to eventually enable the correct design from .NET 2.0 days. As I have it right now, the data is stored in Columns, so there is actually a List of Lists within my class right now. Using the above example there would be three ILists (with a string Title) Name, Age, and Birthdate. Everything is currently predicated on addressing the columns by their "string" name. I'm trying to convert the data structure to row based with an IEnumberable interface to allow Linq eventually while still maintaining the functionality of my current code. Is converting the code to a Row based IEnumberable a good idea?

    Read the article

  • Creating a Month Dropdown in C# ASP.NET MVC

    - by Chris M
    This method seems stupid and a bit heavy; is there a more optimal way of creating the same thing (its for an MVC View Dropdown) private List<KeyValuePair<int, string>> getMonthListDD { get { var dDur = new List<KeyValuePair<int, string>>(); dDur.Add(new KeyValuePair<int, string>(1, "January")); dDur.Add(new KeyValuePair<int, string>(2, "Febuary")); dDur.Add(new KeyValuePair<int, string>(3, "March")); dDur.Add(new KeyValuePair<int, string>(4, "April")); dDur.Add(new KeyValuePair<int, string>(5, "May")); dDur.Add(new KeyValuePair<int, string>(6, "June")); dDur.Add(new KeyValuePair<int, string>(7, "July")); dDur.Add(new KeyValuePair<int, string>(8, "August")); dDur.Add(new KeyValuePair<int, string>(9, "September")); dDur.Add(new KeyValuePair<int, string>(10, "October")); dDur.Add(new KeyValuePair<int, string>(11, "November")); dDur.Add(new KeyValuePair<int, string>(12, "December")); return dDur; } }

    Read the article

  • SQL Server 2008, Books Online, and old documentation...

    - by Chris J
    [I have no idea if stackoverflow really is right right place for this, but don't know how many devs on here run into msi issues with SQL Server; suggest SuperUser or ServerFault if folk think it's better on either of those] About a year ago, when we were looking at moving our codebase forward and migrating to SQL Server 2008, I pulled down a copy of Books Online from the MSDN. Reviewed, did background research, fed results upstream, grabbed Express and tinkered with that. Then we got the nod to move forward (hurrah!) this past couple of weeks. So armed with Developer Edition, and running through the install, I've since found out I've zapped the Books Online MSI, no-ones got a copy of it, and Microsoft only have a later version (Oct 2009) available, so damned if I can update my SQL Server fully and properly... {mutter grumble}. Does anyone know if old versions of Books Online are available for download anywhere? Poking around the Microsoft download centre can't find it, neither is my google-fu finding it. For reference, I'm looking for SQLServer2008_BOL_August2008_ENU.msi ... This may just be a case of good ol' manual delete the files and (try) and clean up the registry :-(

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >