Search Results

Search found 4244 results on 170 pages for 'mark milford'.

Page 132/170 | < Previous Page | 128 129 130 131 132 133 134 135 136 137 138 139  | Next Page >

  • Explanation needed for sum of prime below n numbers

    - by Bala Krishnan
    Today I solved a problem given in Project Euler its problem no 10 and it took 7 hrs for my python program to show the result. But in that forum itself a person named lassevk posted solution for this and it took only 4 sec. And its not possible for me to post this question in that forum because its not discussion forum. So, think about this if you want to mark this question as non-constructive. marked = [0] * 2000000 value = 3 s = 2 while value < 2000000: if marked[value] == 0: s += value i = value while i < 2000000: marked[i] = 1 i += value value += 2 print s If any one understand this code please explain it simple as possible. Link to the Problem 10 question.

    Read the article

  • DOM class injection in PHP

    - by Adam Kiss
    idea Via jQuery, I was able to mark all :first-child and :last-child elements in document (well, almost all :)) with class first which could I later style (i.e. first li in ul#navigation would be easily adressable as ul#navigation .first). I used following code: var $f = $('*:first-child') $f.addClass('first'); var $l = $('body *:last-child') $l.addClass('last'); question Now, my question is if it's possible to do the same via php, so non-JS users/gadgets could have the same effects and additional styling and also it would be less overkill on browser. So, is it possible to capture output, parse it as html and inject this class easily in php?

    Read the article

  • iPhone Using a Modal View from a TabBar View

    - by mbarron
    Using a Modal View from a TabBar View I always get the following error: Error from Debugger: Previous Frame identical to this frame (gdb could not unwind past this frame) I have an App using a TabBar. From one of the TabViews I need to display a View modally. I try: if(self.gmailController == nil) { self.gmailController = [[GMailViewController alloc] initWithNibName:@"GMailView" bundle:nil]; } [[self.navigationController] presentModalViewController:gmailController animated:YES]; //////// And I have tried: [self.parentViewController presentModalViewController:gmailController animated:YES]; and [self.tabBarController presentModalViewController:gmailController animated:YES]; and [self presentModalViewController:gmailController animated:YES]; Thanks for reading! Any comments welcome. Mark

    Read the article

  • Save user favorites

    - by Radu D
    Hi, In my application I need to display items to the user. He can mark some items as favorites. I need to display those differently. How can I save the favorites on the user's computer? I need something like a config entry ... but I need to change that as the user add/remove the favorites. Do you think that I should save that in registry ... or on the disk in a separate file? Does .net offers some support for such situations? Thanks, Radu

    Read the article

  • How do I add text to curved image?

    - by miki123
    $config['source_image'] = '/path/to/image/mypic.jpg'; $config['wm_text'] = 'Copyright 2006 - John Doe'; $config['wm_type'] = 'text'; $config['wm_font_path'] = './system/fonts/texb.ttf'; $config['wm_font_size'] = '16'; $config['wm_font_color'] = 'ffffff'; $config['wm_vrt_alignment'] = 'bottom'; $config['wm_hor_alignment'] = 'center'; $config['wm_padding'] = '20'; $this->image_lib->initialize($config); $this->image_lib->watermark(); This is water mark code in php, it is working fine when we add text to curve image like mug image, the letter is not overlap the curved image how can we overcome?

    Read the article

  • distinguishing a string with flex

    - by haluk
    Hi, I need to tokenize some strings which will be splitted of according to operators like = and !=. I was successful using regex until the string has != operator. In my case, string was seperated into two parts, which is expected but ! mark is in the left side even it is part of given operator. Therefore, I believe that regex is not suitable for it and I want to benefit from lex. Since I do not have enough knowledge and experience with lex, I am not sure whether it fits my work or not. Basically, I am trying to do replace the right hand side of the operators with actual values from other data. Do you people think that can it be helpful for my case? Thanks.

    Read the article

  • Php Mailer problem - messages marked as spam -

    - by Guanche
    A few days ago I upgraded Php Mailer and now some email providers my messages mark as spam. This is what I see in the headers of the marked messages: X-SpamTest-Info: {TO: header missing} This is from my php file. $mail->From = $sender; $mail->FromName = $sender_name; $mail->Subject = $subject; $mail->Body = $body; $mail->AddAddress($recipient,$recipient_name); $mail->AddReplyTo($replyto,"No-Reply"); Dont know how to add "to" header and can't understand how it's possible that "to" is missing but email arrives to the correct "to" address...

    Read the article

  • Unexpected key-value behavior in a Core Data Context

    - by ????
    If I create an array of strings (via key-value coding) containing the names of a Managed Object entity's attributes which are stored in the App Delegate the first time, I get an array of NSStrings without any problems. If I subsequently make the same call later from the same entry point in code, that same collection becomes an array of NULL objects- even though nothing in the Core Data Context has changed. One unappealing work-around involves re-creating the string array every time, but I'm wondering if anyone has a guess as to what's happening behind the scenes. // Return an array of strings with the names of attributes the Activity entity - (NSArray *)activityAttributeNames { #pragma mark ALWAYS REFRESH THE ENTITY NAMES? //if (activityAttributeNames == nil) { // Create an entity pointer for Activity NSEntityDescription *entity = [NSEntityDescription entityForName:@"Activity" inManagedObjectContext:managedObjectContext]; NSArray *entityAttributeArray = [[NSArray alloc] initWithArray:[[entity attributesByName] allValues]]; // Extract the names of the attributes with Key-Value Coding activityAttributeNames = [entityAttributeArray valueForKeyPath:@"name"]; [entityAttributeArray release]; //} return activityAttributeNames; }

    Read the article

  • What is the flag to show the nesting of views in a Mac app?

    - by theMikeSwan
    I have just spet the last few hours trying to find the flag to use in Terminal to launch an app with the colored outlines around the various view elements to show how they are nested. I know that Matt Gemmell covered it during the Cocoa Face Off session of NSConference 2009 (at about the 13minute mark in the video). Unfortunately I can't actually read what he types and he doesn't speak the exact command. I know it has to be in the Apple docs somewhere but the search system is currently not being of any use. It looks like her just adds -showAllViews YES to the end of the command to open TextEdit but that command has no effect in 10.6.6. I have also tried every other capitalization I can think of as well as using view instead of views. Every command opens TextEdit just fine but doesn't show the colored outlines.

    Read the article

  • Error in eclipse: "The project cannot be built until build path errors are resolved"

    - by Darkphenom
    I am a CS student learning java so I do some work at home and at college on a mixture of linux and windows. I have a problem after copying a new project into the eclipse workspace. The project shows up but with a red exclamation mark and an error saying: "The project cannot be built until build path errors are resolved" Can somebody help me out with this? I tried this http://www.scottdstrader.com/blog/ether_archives/000921.html but it didn't work. Also, are there any good ways of syncing an eclipse workspace across multiple computers?

    Read the article

  • "import as" leads to unresolved import error, "from .. import" does not

    - by Markus R.
    I'm trying to write some plugins for the irc bot supybot with eclipse/pydev. Pydev gives me errors about unresolved imports on supybot-modules/packages (e. g. import supybot.utils as utils), but works ok on e. g. "from supybot.commands import *". So I guess I set up dydev correctly, as it finds the wanted modules. The problem must be in pydev/eclipse, as the bot works correct and in eric5 I get also no errors about that. Removing the interpreter and setting it up didn't help. Any other ideas on how to fix this? System: Arch Linux, Eclipse Juno, PyDev 2.7.1, wanted (and set up) python interpreter is 2.7, supybot is installed in site-packages for Python 2.7. Edit: Just noticed: PyDev doesn't mark the "from ... import *" as error, but if I use functions imported from there I get an error on that function.

    Read the article

  • PHP: Regular Expression to get a URL from a string

    - by Matthew Iselin
    I'm working on some PHP code which takes input from various sources and needs to find the URLs and save them somewhere. The kind of input that needs to be handled is as follows: http://www.youtube.com/watch?v=IY2j_GPIqRA Try google: http://google.com! (note exclamation mark is not part of the URL) Is http://somesite.com/ down for anyone else? Output: http://www.youtube.com/watch?v=IY2j_GPIqRA http://google.com http://somesite.com/ I've already borrowed one regular expression from the internet which works, but unfortunately wipes the query string out - not good! Any help putting together a regular expression, or perhaps another solution to this problem, would be appreciated.

    Read the article

  • Diamonds Are Forever. Services Are Not.

    - by rayman
    Hi, ive read this article by Mark Murphy, while i was looking for a solution to my case. I have a Listener in my system, which suppose to get a UDP trigger times to times from an outside server, ive done this listener as a service. how could i prevent it being shut off by the user? (SDK 1.5), i`am working for a company which create cell phones, and we spread the device with this Listener. as soon as the listener goes off our systems will be terminated any idea for this scenario? *i`am already aware to the face, that the system could also take it off, but this case will be easier to handle and avoid. thanks, ray.

    Read the article

  • Find changed properties of a class

    - by Rohit
    I am using asp.net 3.5 I have a license class containing 10 properties and not marked as serializable. I have to log property changes to the database. License is an entity class,and it is not in my scope to modify it. So I cannot mark it as serializabel neither i can use IpropertyChanged Interface. Now i cannot store it in viewstate as it is not serializable. I wanted to store it so that i can compare it with new values and see which value has changed. How to proceed with this.

    Read the article

  • Passing variables from SQL proceedure to PHP

    - by Sam Corbet
    I am trying to create an sql proceedure that will return the results back to the php page. I want to be able to call the procedure as follows from the php call procedure_name($var1) which will run this script: -- --------------------------------------------------------------------------------- -- pUIGetCliStmtGenFlag -- -- This procedure returns the status of the Trading Period: -- -- --------------------------------------------------------------------------------- drop procedure if exists pUIGetCliStmtGenFlag; delimiter // create procedure pUIGetCliStmtGenFlag( IN pTradingPeriodMonth DATE ) MODIFIES SQL DATA COMMENT 'Checks if the TP has been closed' begin SELECT trading_period_month, dt_end, amt_traded_system_ccy FROM ca_trading_period WHERE trading_period_month=$var1 -- If amt_traded_system_ccy is NULL give the TP an open status otherwise mark as closed IF amt_traded_system_ccy is NULL $tpstatus='open' ELSE $tpstatus='closed' end; // delimiter ; I then want to be able to use $tpstatus in the rest of the php script. I know this is simple but this is completely new to me and I cant find the correct method

    Read the article

  • Find all html characters in drop-down option text and replace them via jQuery

    - by Jon Harding
    I have a dropdown menu that pulls in text from a database column. The database column can include HTML mark-up. In the drop-down I obviously don't need that in the text. I am working on some jquery and it partially accomplished what I'm looking for. However, it seems to only be replacing the first instance of each character $('select option').each(function() { this.text = this.text.replace('&nbsp;', ' '); this.text = this.text.replace('<div>', '' ); this.text = this.text.replace('</div>', '' ); }); Here is the HTML for the drop-down: <select name="ctl00$SubPageBody$ClassList" id="ctl00_SubPageBody_ClassList"> <option value="196">Four Week Series: July 19, 2012, 11:00am-12:00pm&<div>July 26, 2012, 11:00am-12:00pm&nbsp;</div><div>August 2, 2012, 11:00am-12:00pm</div><div>August 9, 2012, 11:00am-12:00pm</div></option> </select>

    Read the article

  • ASP.NET 3.5 Page character encoding problem

    - by Dorian McHensie
    Hello everyone. I have a problem in my asp.net 3.5 application (C#) when I try to render in my pages characters like 'è' which are shown in a very strange manner (if i'm lucky i get a ? mark in my web page). in fact Expression Web, when i open my web site, substitutes the è char with �... How can I tell asp.net that I want to use a particular charset so that i can write in the html source letters like è without using hexadecimal codes?????? I tried in the web.config this: inside the system.web namespace of the file but nothing works.... Can anyone tell me how to do? THANKS in advance

    Read the article

  • To "null" or not to "null" my class's attributes

    - by Helper Method
    When I write a class in Java, I like to initialize the attributes which are set to a default value directly and attributes which are set by the caller in the constructor, something like this: public class Stack<E> { private List<E> list; private size = 0; public Stack(int initialCapacity) { list = new ArrayList<E>(initialCapacity); } // remainder omitted } Now suppose I have a Tree class: public class Tree<E> { private Node<E> root = null; // no constructor needed, remainder omitted } Shall I set the root attribute to null, to mark that it is set to null by default, or omit the null value?

    Read the article

  • Using Maven to build JAR from source in Subversion trunk

    - by Anonymouse
    There's a Java library that I would like to use in my project. My project uses Maven to pull in dependencies and it works great for everything except this one library. The problem is, this library never has releases. The author maintains the source in a Subversion repository and only makes changes in trunk. Is there a way I can tell Maven to Update (or check out) the library's source tree from Subversion Build it according to its POM Use the resulting jar as a dependency for this project Do this regularly (possibly at each build) For bonus points, mark which Subversion revision of that library I want to use Thanks!

    Read the article

  • Searching pgadmin db and grabbing information?

    - by Bootstrotter
    I'm currently trying to write a script in RoR to go into my PGAdmin database and look at a list of users, THEN ignore users that have an image path but look at users who don't have one and then upload a link of a generic photo into their row. My database looks Something like this: id integer | name | email | image path | 12 Bob [email protected] www.faces.org 81 Sally [email protected] 114 Mark [email protected] www.faces.org How would I start grabbing those users, I only have 103 users right now, but I also need to think about scaling for the future. Here is a starting point. I know this is kind of vague but really all I need is just a starting point. to get into it. Thanks for the information. require 'sqlite3' db = SQlite3 users = users.find([1, 103]) Any help would be great.

    Read the article

  • How do I add a Marker to a jQuery UI Slider?

    - by Bijan
    I have a simple jQuery UI slider that has a numerical range from 25 to 35. It works fine and the default value is 28. I'm hoping to add a simple tick mark to the slider to indicate that 28 is where the default is. Is there a simple way to add an indicator? $('#cycle_length').slider({ range: "min", value: 28, min: 25, max: 35, step: 1, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); } }); $( "#amount" ).val( $( "#cycle_length" ).slider( "value" ) );

    Read the article

  • whatz wrong in this SELECt query of MSSQL... ?

    - by user522211
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim SQLData As New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True") Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT * FROM Table1 WHERE Date =" & TextBox1.Text & "'", SQLData) SQLData.Open() Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader() While dtrReader.Read() For j As Integer = 1 To 31 Dim s As String = "s" & j If dtrReader(s.ToString()).ToString() = "b" Then Dim img As ImageButton = DirectCast(Panel1.FindControl(s.ToString()), ImageButton) img.ImageUrl = "~/Images/booked.gif" img.Enabled = False End If Next End While dtrReader.Close() SQLData.Close() End Sub SHOWS AN ERROR : Unclosed quotation mark after the character string ''.

    Read the article

  • Loading xml with encoding UTF 16 using XDocument

    - by Sangram
    Hi, I am trying to read the xml document using XDocument method . but i am getting an error when xml has <?xml version="1.0" encoding="utf-16"?> When i removed encoding manually.It works perfectly. I am getting error " There is no Unicode byte order mark. Cannot switch to Unicode. " i tried searching and i landed up here-- Why does C# XmlDocument.LoadXml(string) fail when an XML header is included? But could not solve my problem. My code : XDocument xdoc = XDocument.Load(path); Any suggestions ?? thank you.

    Read the article

  • What are the things Java got right?

    - by hamletdarcy
    What are the things that Java (the language and platform) got categorically right? In other words, what things are more recent programming languages preserving and carrying forward? Some easy answer are: garbage collection, a VM, lack of pointers, classloaders, reflection(?) What about language based answers? Please don't list the things Java did wrong, just right. (note by Mark Harrison) This is an interesting and useful question, especially for those of us who don't use java regularly. I'm voting for reopening. Please don't close as argumentative, as it doesn't seem to be causing any arguments.

    Read the article

  • tsql sum data and include default values for missing data

    - by markpirvine
    Hi, I would like a query that will shouw a sum of columns with a default value for missing data. For example assume I have a table as follows: type_lookup: id name 1 self 2 manager 3 peer And a table as follows data: id type_lookup_id value 1 1 1 2 1 4 3 2 9 4 2 1 5 2 9 6 1 5 7 2 6 8 1 2 9 1 1 After running a query I would like a result set as follows: type_lookup_id value 1 13 2 25 3 0 I would like all rows in type_lookup table to be included in the result set - even if they don't appear in the data table. Any help would be greatly appreciated, Mark

    Read the article

< Previous Page | 128 129 130 131 132 133 134 135 136 137 138 139  | Next Page >