Daily Archives

Articles indexed Wednesday May 12 2010

Page 3/121 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Help with Regex statement in Ruby

    - by user336777
    I have a string called 'raw'. I am trying to parse it in ruby in the following way: raw = "HbA1C ranging 8.0—10.0%" raw.scan /\d*.?\d+[ ](-+|\342\200\224)[ ]\d*.?\d+/ The output from the above is []. I think it should be: ["8.0—10.0"]. Does anyone have any insight into what is wrong with the above regex statement? Note: \342\200\224 is equal to '—'. The piece that is not working is: (-+|\342\200\224) I think it should be equivalent to saying, match on 1 or more '-' OR match on the string \342\200\224. Any help would be greatly appreciated it!

    Read the article

  • Best way to determine variable type and treat each one differently in F#

    - by James Black
    I have a function that will create a select where clause, but right now everything has to be a string. I would like to look at the variable passed in and determine what type it is and then treat it properly. For example, numeric values don't have single quotes around them, option type will either be null or have some value and boolean will actually be zero or one. member self.BuildSelectWhereQuery (oldUser:'a) = let properties = List.zip oldUser.ToSqlValuesList sqlColumnList let init = false, new StringBuilder() let anyChange, (formatted:StringBuilder) = properties |> Seq.fold (fun (anyChange, sb) (oldVal, name) -> match(anyChange) with | true -> true, sb.AppendFormat(" AND {0} = '{1}'", name, oldVal) | _ -> true, sb.AppendFormat("{0} = '{1}'", name, oldVal) ) init formatted.ToString() Here is one entity: type CityType() = inherit BaseType() let mutable name = "" let mutable stateId = 0 member this.Name with get() = name and set restnameval=name <- restnameval member this.StateId with get() = stateId and set stateidval=stateId <- stateidval override this.ToSqlValuesList = [this.Name; this.StateId.ToString()] So, if name was some other value besides a string, or stateId can be optional, then I have two changes to make: How do I modify ToSqlValuesList to have the variable so I can tell the variable type? How do I change my select function to handle this? I am thinking that I need a new function does the processing, but what is the best FP way to do this, rather than using something like typeof?

    Read the article

  • TFS and code coverage for web application (MVC) assemblies not working

    - by Andrew
    I've got an MVC web application with associated controller tests that run under a TFS build as per normal. I can see the tests running and passing in the build log and they appear in the "Result details for Any CPU/Release" section of the build I also have a number of other assemblies with associated tests that are running in the same build. Tests are passing and the details are being shown in the results and logs just fine. I've enabled code coverage in the build script and the testrunconfig. The coverage is appearing for all assemblies EXCEPT the web application even though it looks like the tests have been run for it. Is there anything obvious that I have missed or some sort of work around that I need to do? I've searched around for a while and haven't found an answer. Has anyone got code coverage working for MVC web applications?

    Read the article

  • Integrating Twitter Into An ASP.NET Website Using OAuth

    Earlier this year I wrote an article about Twitterizer, an open-source .NET library that can be used to integrate your application with Twitter. Using Twitterizer you can allow your visitors to post tweets, view their timeline, and much more, all without leaving your website. The original article, Integrating Twitter Into An ASP.NET Website, showed how to post tweets and view a timeline to a particular Twitter account using Twitterizer 1.0. To post a tweet to a specific account, Twitterizer 1.0 uses basic authentication. Basic authentication is a very simple authentication scheme. For an application to post a tweet to JohnDoe's Twitter account, it would submit JohnDoe's username and password (along with the tweet text) to Twitter's servers. Basic authentication, while easy to implement, is not an ideal authentication scheme as it requires that the integrating application know the username(s) and password(s) of the accounts that it is connected to. Consequently, a user must share her password in order to connect her Twitter account with the application. Such password sharing is not only insecure, but it can also cause difficulties down the line if the user changes her password or decides that she no longer wants to connect her account to certain applications (but wants to remain connected to others). To remedy these issues, Twitter introduced support for OAuth, which is a simple, secure protocol for granting API access. In a nutshell, OAuth allows a user to connect an application to their Twitter account without having to share their password. Instead, the user is sent to Twitter's website where they confirm whether they want to connect to the application. Upon confirmation, Twitter generates an token that is then sent back to the application. The application then submits this token when integrating with the user's account. The token serves as proof that the user has allowed this application access to their account. (Twitter users can view what application's they're connected to and may revoke these tokens on an application-by-application basis.) In late 2009, Twitter announced that it was ending its support for basic authentication in June 2010. As a result, the code examined in Integrating Twitter Into An ASP.NET Website, which uses basic authentication, will no longer work once the cut off date is reached. The good news is that the Twitterizer version 2.0 supports OAuth. This article examines how to use Twitterizer 2.0 and OAuth from a website. Specifically, we'll see how to retrieve and display a user's latest tweets and how to post a tweet from an ASP.NET page. Read on to learn more! Read More >

    Read the article

  • Does PHP 5.3 +PDO plays nicely with MySql 5.1

    - by Itay Moav
    Since the last few weeks I see php 5.3 has become a part of the official repositories of several linux distributions, So I guess it is stable enough. Mysql announced they will stop support mysql 5.0 So will those two play well together, are all the extensions up to date?

    Read the article

  • this operation has been canceled due to restrictions in effect on this computer

    - by Dan
    I have this HUGELY irritating problem on Windows 7 (x64). Whenever I click on ANY link (that exists on a Word document, excel or Outlook), I get an alert box with the message: "This operation has been canceled due to restrictions in effect on this computer" I have been scouring my settings and the internet for a solution, but to no avail. Has anybody else encounted this problem? It even happens when I click anchors in word documents i.e. I can't even click on an entry in a Table of Contents to go to the appropriate page - I get this same error then. Is this a Windows 7 thing? Anyway to turn this off?

    Read the article

  • Why am I getting org.xml.sax.SAXException for this block of XML?

    - by drachenstern
    I've anonymised a bit of this. Hopefully it doesn't detract from the useful message. stringARRAY is where I think I'm getting thrown at, but I'm not sure, so if I'm looking at the wrong place, lemme know. From the WSDL <xsd:element name="LongishOpName"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="unbounded" name="stringARRAY" type="xsd:string" /> <xsd:element name="stringfield1" type="xsd:string" /> <xsd:element name="stringfield2" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> Actual method call looks like this: string originalValue = "some useful value"; string[] usefulName1 = new[] { originalValue }; service.response[] responses = server.LongishOpName( usefulName1, someString1, someString2 ); And it generates this XML to the server (Thanks to Fiddler2): <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <LongishOpName xmlns="http://appropriate-namespace"> <stringARRAY>114003</stringARRAY> <stringfield1>a string</stringfield1> <stringfield2>a string</stringfield2> </LongishOpName> </soap:Body> </soap:Envelope> To which I get this response <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>org.xml.sax.SAXException: Found character data inside an array element while deserializing</faultstring> <detail> <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">SERVERNAME</ns1:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> Is my soap message actually coming out malformed? (yes I am using the ASP.NET web references to do all the lifting, I'm not generating by hand) Should I be doing something different? Do I just need to go home and sleep on it and tomorrow everything will "just work"?

    Read the article

  • iPhone code to create new NSUserDefaults objects?

    - by Rob
    I have NSUserDefaults storing a number of string variables for things like name, date of birth, address, etc. What I would like to know is how to write a code that will create a new object for each new user. For example, I have a spinning wheel that shows up immediately after the first time the user runs the app. What I want, is for that wheel to have one single option - "New User". Once that New User fills out a bunch of text fields that I am using NSUserDefaults to save, I want that user to be saved on that spinning wheel so that the next time they open up the app they have the option of returning to all of the variables that they previously put in, or creating a new user so they can input all new variables. I know how to do everything except write the code to create new users automatically. Potentially, the program should allow for a limitless number of these user objects and then just use something arbitrary like their last name to input into the spinning wheel. I would assume that the code would need to be put somewhere in the following code used to save the NSUserDefaults: NSUserDefaults *userData = [NSUserDefaults standardUserDefaults]; [userData setObject:txtName.text forKey:@"name"];

    Read the article

  • Internet Explorer visual element stacking issue

    - by Michael
    Gday All, I know this issue is well known, however I have searched high and low for a solution to no avail. I have created a menu system using nested ordered lists where the menu functionality is controlled by CSS and Jquery. The menu works perfectly in FF, Chrome, Opera and Epiphany. However in IE 6/7/8 my popup menu is being displayed underneath a table. See the image below. The very top box is a div element containing my menu system. I am working with legacy code that uses tables for display so the next box and the "ts found. Try a different subcate" text is in a "td" element of a table. I have tried to force the table to have a lower z-index but this does not work. Any insights into why this is only present in IE would be appreciated. Cheers, Michael

    Read the article

  • Efficient data structure design

    - by Sway
    Hi there, I need to match a series of user inputed words against a large dictionary of words (to ensure the entered value exists). So if the user entered: "orange" it should match an entry "orange' in the dictionary. Now the catch is that the user can also enter a wildcard or series of wildcard characters like say "or__ge" which would also match "orange" The key requirements are: * this should be as fast as possible. * use the smallest amount of memory to achieve it. If the size of the word list was small I could use a string containing all the words and use regular expressions. however given that the word list could contain potentially hundreds of thousands of enteries I'm assuming this wouldn't work. So is some sort of 'tree' be the way to go for this...? Any thoughts or suggestions on this would be totally appreciated! Thanks in advance, Matt

    Read the article

  • Asynchronous Processing = Spanning Threads = Valid?

    - by jens
    Hello Experts, am I allowed (without any sideeffects) to create and start a new Thread() from within a doGet() Method of a servlet? Or does this somehow leak ressources? Is it valid to also pass the "Session" Object into the Thread to later save the result of my asynchronous processing (I will synchronized correctly) in the session? Or will this leak ressources when using the session "in indepedant threads"? = What would happen if the session meanwhile would be expired by the webcontainer as it has timedout and I will access it from my thread? Or would could this also lead to the sideffect, that storing the session in the thread will prevent the webcontainer from expiring the session at all (and therefore finally leak ressources as the sessions do not get cleared up)? (I know there are other Solutions, like working with DB-(Job)Records, JMS or Servlets 3.0) but I need so solve the problem as described by spanning a new Thread within doGet.) Thank you very much!! Jens

    Read the article

  • Using multiple SWF Object - Flash doesn't focus on rollover

    - by WiseDonkey
    I've got a page with multiple embeds of Flash objects, including dynamically created graphs. I'm including them all with SWF Object JS declared in the header. It works fine in the fact that all are loaded. But, for some reason when you move down on the page (so they're out of view) and back, or click on another object it no longer has focus when you're rolling over. I.e. I have a flash menu that moves on rollover. When you go down the page, click on something, then go back up it no longer response to rollover. I've seen bits on here and elsewhere about losing focus in Firefox (which is the browser Im using - i havent managed to find this bug in IE) but it's talking about literally not being able to type or whatever, when you click on it. This is on rollover. Has anyone got any advice or thoughts on this subject?

    Read the article

  • How to interpret Objective-C errors?

    - by Greg Maletic
    I'm getting the following error: 2010-05-11 17:46:28.475 MyApp[54112:5e1b] bool _WebTryThreadLock(bool), 0x140faa0: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... Is there any way for me to figure out where [54112:5e1b] is in my code, so I can try to narrow down the error? Thanks.

    Read the article

  • How can I alter anythingSlider so that it disables the next / previous buttons when only 1 <li> in t

    - by madphill
    I have a page with multiple instances of anythingSlider on it and I'm using PHP to dynamically load pages that swap out the content in them. Reference: http://ceedcreative.com/CEED_2.0/ I would like to edit the anythingSlider to disable the previous / next buttons if the UL it's displaying only has one LI within it. In other words, no buttons, just a clean div that's the same heigh and width (no scrolling) if there's only one image.

    Read the article

  • Excel VBA Text To Column

    - by Pat
    This is what I currently have: H101 John Doe Jane Doe Jack Doe H102 John Smith Jane Smith Katie Smith Jack Smith And here is what I want: H101 John Doe H101 Jane Doe H101 Jack Doe H102 John Smith H102 Jane Smith H102 Katie Smith H102 Jack Smith Obviously I want to do this on a bigger scale. The number of columns is between 1 & 6, so I cant limit it that way. I was able to get a script that allows me to put each individual on one row. However, I am having a hard time getting the first column to copy over to each row. Sub ToOneColumn() Dim i As Long, k As Long, j As Integer Application.ScreenUpdating = False Columns(2).Insert i = 0 k = 1 While Not IsEmpty(Cells(k, 3)) j = 3 While Not IsEmpty(Cells(k, j)) i = i + 1 Cells(i, 1) = Cells(k, 1) //CODE IN QUESTION Cells(i, 2) = Cells(k, j) Cells(k, j).Clear j = j + 1 Wend k = k + 1 Wend Application.ScreenUpdating = True End Sub Like I said, it was working fine to get everyone each on their own row, but can't figure out how to get that first column. It seems like it should be so simple, but it's bugging me. Any help is greatly appreciated.

    Read the article

  • Executing Javascript in WebBrowser Control stopped working after upgrade to Access 2010

    - by Noah
    BACKGROUND: The following works in Access 2007, but broke when I installed 2010 I have a WebBrowser control in an Access Form; I set its location as follows Me.WebBrowser0.ControlSource = "http://foo.com" and then execute a script in the page Script = "StartScript(null);" Me.WebBrowser0.Object.Document.parentWindow.execScript Script, "JavaScript" This worked just fine in Access 2007, but after installing 2010 I get the following pop-up error: Run-Time error '-2147024891 (80070005)': Access is Denied. Any ideas?

    Read the article

  • Integrating Twitter Into An ASP.NET Website Using OAuth

    Earlier this year I wrote an article about <a href="http://www.twitterizer.net/">Twitterizer</a>, an open-source .NET library that can be used to integrate your application with <a href="http://twitter.com/">Twitter</a>. Using Twitterizer you can allow your visitors to post tweets, view their timeline, and much more, all without leaving your website. The original article, <a href="http://www.4guysfromrolla.com/articles/021710-1.aspx">Integrating Twitter Into An ASP.NET Website</a>, showed how to post tweets and view a timeline to a particular Twitter account using Twitterizer 1.0. To post a tweet to a specific account, Twitterizer 1.0 uses <i>basic authentication</i>. Basic authentication is a very simple

    Read the article

  • Clarity Comics Comic Reader for Windows Phone 7

    Weve been really busy building all sorts custom Windows Phone 7 goodies lately.  One of the experiences weve been working on recently is a comic book reader  for WP7.  Here at Clarity we have particular individuals that are nuts about comics and codingso it was a no-brainer to knock this thing out.  Under the Covers There are a couple of components to this application that made it come together quickly.  First, as you know, WP7 runs Silverlight so we were able to leverage a bunch of silverlight assets we had hanging around from previous projects.  We were shocked to see the 80% code reuse claim was true!  Second, the application was built on the newly created Clarity Phone Framework (CP7).  This framework provides a platform that we can leverage to quickly wire up applications and get them out the door.  The framework includes gesture support, mapping controls, data visualization,  a special mvvm architecture for the phone, navigation animations, and a handful of other controls weve cooked up in our labslike voice recognition support.  (additional posts on the framework are coming soon) Third, the reading experience of the comic reader is driven by Deep Zoom.  We were pleasantly surprised to see that the windows phone 7 sdk worked nicely with Deep Zoom and the Deep Zoom composer.  We did have to add some hooks in there to get the gestures to work, but nothing too deep (no pun intended).  Unfortunately we cant release the code for this one just yet.  But rest-assured, there will be plenty more Windows Phone 7 and Silverlight goodies to come. Cheers!Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Clarity Comics Comic Reader for Windows Phone 7

    Weve been really busy building all sorts custom Windows Phone 7 goodies lately.  One of the experiences weve been working on recently is a comic book reader  for WP7.  Here at Clarity we have particular individuals that are nuts about comics and codingso it was a no-brainer to knock this thing out.  Under the Covers There are a couple of components to this application that made it come together quickly.  First, as you know, WP7 runs Silverlight so we were able to leverage a bunch of silverlight assets we had hanging around from previous projects.  We were shocked to see the 80% code reuse claim was true!  Second, the application was built on the newly created Clarity Phone Framework (CP7).  This framework provides a platform that we can leverage to quickly wire up applications and get them out the door.  The framework includes gesture support, mapping controls, data visualization,  a special mvvm architecture for the phone, navigation animations, and a handful of other controls weve cooked up in our labslike voice recognition support.  (additional posts on the framework are coming soon) Third, the reading experience of the comic reader is driven by Deep Zoom.  We were pleasantly surprised to see that the windows phone 7 sdk worked nicely with Deep Zoom and the Deep Zoom composer.  We did have to add some hooks in there to get the gestures to work, but nothing too deep (no pun intended).  Unfortunately we cant release the code for this one just yet.  But rest-assured, there will be plenty more Windows Phone 7 and Silverlight goodies to come. Cheers!Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Running WordPress on Windows Server

    A few days ago, I saw someone posted on Twitter a question about running WordPress on Windows Server. Since I had done this for a few sites, I responded with my thoughts and tips. Another suggested that I post those here, and so here I go. WordPress is a blogging/content-management platform that has been around for a while. It has been gaining more in popularity for general purpose content sites over the past year Id say, but is primarily seen as a blogging platform by most. Even though I use Subtext...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >