Search Results

Search found 4242 results on 170 pages for 'mark tompson'.

Page 81/170 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Why is Django sending the wrong email template?

    - by Mark
    I'm so baffled... I keep staring at this code, looking for the typo, but I can't find it! template = 'emails/transporter_joined' tt = loader.get_template(template+'.txt') c = Context({'user':user, 'fee': settings.FEE * Decimal('100.00'),'settings':settings}) e = EmailMultiAlternatives('Activate Your Account', tt.render(c), '[email protected]', [user.email]) try: ht = loader.get_template(template+'.html') e.attach_alternative(ht.render(c), 'text/html') except: pass e.send() First it should load the 'emails/transporter_joined.txt' template, and adds that to the email. And then it tries to load a '.html' version and attaches that too. In Gmail you can see the the "original email" with both emails, and all the headers in plain text. It very clearly shows the .txt version twice. the .html and .txt files are definitely different. What am I doing wrong here? If I replace this tt = loader.get_template(template+'.txt') With .html instead, then it sends the .html twice... it must be Django that's screwing up, no?

    Read the article

  • Measure time in minutes in C

    - by Mark Szymanski
    I am writing a program that will need to measure time in minutes. To be exact, it will wait 10 minutes, execute some code, wait 2 minutes, execute more code and repeat this 5 times (anyone guess what I'm trying to do?) and I am wondering how to do the breaks. Thanks in advance! Oh, and by the way, I'm on Mac.

    Read the article

  • Maintaining file permissions across SVN updates?

    - by Mark Mayo
    I have a series of python scripts with execute permissions in Linux. They are stored in SVN. If I then run svn up to update them, the overwritten files are back to 644 - ie no execute permissions for anyone. Yes I could just script it to chmod +x * afterwards, but surely there's a way to store permissions in SVN or to maintain them when you update? Any suggestions appreciated.

    Read the article

  • Is there an Easier way to Get a 3 deep Panel Control from a Form in order to add a new Control to it programmatically?

    - by Mark Sweetman
    I have a VB Windows Program Created by someone else, it was programmed so that anyone could Add to the functionality of the program through the use of Class Libraries, the Program calls them (ie... the Class Libraries, DLL files) Plugins, The Plugin I am creating is a C# Class Library. ie.. .dll This specific Plugin Im working on Adds a Simple DateTime Clock Function in the form of a Label and inserts it into a Panel that is 3 Deep. The Code I have I have tested and it works. My Question is this: Is there a better way to do it? for instance I use Controls.Find 3 different times, each time I know what Panel I am looking for and there will only be a single Panel added to the Control[] array. So again Im doing a foreach on an array that only holds a single element 3 different times. Now like I said the code works and does as I expected it to. It just seems overly redudant, and Im wondering if there could be a performance issue. here is the code: foreach (Control p0 in mDesigner.Controls) if (p0.Name == "Panel1") { Control panel1 = (Control)p0; Control[] controls = panel1.Controls.Find("Panel2", true); foreach (Control p1 in controls) if (p1.Name == "Panel2") { Control panel2 = (Control)p1; Control[] controls1 = panel2.Controls.Find("Panel3", true); foreach(Control p2 in controls1) if (p2.Name == "Panel3") { Control panel3 = (Control)p2; panel3.Controls.Add(clock); } } }

    Read the article

  • jquery css transform, why translate?

    - by Mark
    The CSS transform translate property, I don't get the difference between changing that value and changing the margin or position with css2. Where would you want to use transform? (ignoring the ie incompat for the moment)

    Read the article

  • Generic collection class?

    - by Mark
    Is there anyway I can do this? class TSOC<TCollection, TValue> : ICollection<TValue>, INotifyCollectionChanged where TCollection : ICollection { private TCollection<TValue> collection; } It doesn't like my definition of collection. I'd prefer the definition to look like TSOC<TCollection> where the user can pass in List<int> or something, but then I need to pull out the "int" to know what interface to implement.

    Read the article

  • Android SurfaceView/Canvas flickering after trying to clear it

    - by Mark D
    So I am trying to clear the Canvas using canvas.drawColor(Color.BLACK) but if I just call this once, the display flickers and displays the old drawing which should have been covered up by the drawColor. Here is the important bits of my code - public void update() { //This method is called by a Thread Canvas canvas = holder.lockCanvas(null); if (canvas != null) { onDraw(canvas); } holder.unlockCanvasAndPost(canvas); } @Override protected void onDraw(Canvas canvas) { if (toClear) { canvas.drawColor(Color.BLACK); //if this is not set to change back to false, it does not flicker toClear = false; } //Draw some objects that are moving around } public void clearScreen() { //This method is called when the user pressed a button toClear = true; } After Googling around a litte, I heard about double buffering but came to the understanding that lockCanvas() and unlockCanvasAndPost() should handle this for me. What is going wrong here?

    Read the article

  • How to emulate a BEFORE DELETE trigger in SQL Server 2005

    - by Mark
    Let's say I have three tables, [ONE], [ONE_TWO], and [TWO]. [ONE_TWO] is a many-to-many join table with only [ONE_ID and [TWO_ID] columns. There are foreign keys set up to link [ONE] to [ONE_TWO] and [TWO] to [ONE_TWO]. The FKs use the ON DELETE CASCADE option so that if either a [ONE] or [TWO] record is deleted, the associated [ONE_TWO] records will be automatically deleted as well. I want to have a trigger on the [TWO] table such that when a [TWO] record is deleted, it executes a stored procedure that takes a [ONE_ID] as a parameter, passing the [ONE_ID] values that were linked to the [TWO_ID] before the delete occurred: DECLARE @Statement NVARCHAR(max) SET @Statement = '' SELECT @Statement = @Statement + N'EXEC [MyProc] ''' + CAST([one_two].[one_id] AS VARCHAR(36)) + '''; ' FROM deleted JOIN [one_two] ON deleted.[two_id] = [one_two].[two_id] EXEC (@Statement) Clearly, I need a BEFORE DELETE trigger, but there is no such thing in SQL Server 2005. I can't use an INSTEAD OF trigger because of the cascading FK. I get the impression that if I use a FOR DELETE trigger, when I join [deleted] to [ONE_TWO] to find the list of [ONE_ID] values, the FK cascade will have already deleted the associated [ONE_TWO] records so I will never find any [ONE_ID] values. Is this true? If so, how can I achieve my objective? I'm thinking that I'd need to change the FK joining [TWO] to [ONE_TWO] to not use cascades and to do the delete from [ONE_TWO] manually in the trigger just before I manually delete the [TWO] records. But I'd rather not go through all that if there is a simpler way.

    Read the article

  • Validate authenticity of website owner

    - by Cyber Junkie
    Hello all! I'm planning to develop a web app where users will list their site/blog. When people submit their sites, how can I confirm that they are the owners of it? So for instance there is a user Mark who wants to submit someone else's website without their approval. I want to restrict Mark from doing so unless he is the actual owner. My idea was to do a comparison between the user's email domain and the website domain she/he wants to submit. If they match allow the user to submit the website. However most people don't register with their website domain address.. or perhaps I'll implement a Facebook connect in the future. What other methods would you suggest?

    Read the article

  • WPF format displayed text?

    - by Mark
    I have a column defined like this: <DataGridTextColumn Binding="{Binding Path=FileSizeBytes, Mode=OneWay}" Header="Size" IsReadOnly="True" /> But instead of displaying the file size as a big number, I'd like to display units, but still have it sort by the actual FileSizeBytes. Is there some way I can run it through a function or something before displaying it?

    Read the article

  • Updating access 2000 database through code in VB6

    - by Mark
    I have an application that uses an access 2000 database currently in distribution. I need to update one of the recordsets with additional fields on my customer's computers. My data controls work fine as I have them set to connect in access 2000 format but when I try to open the database in code, I get an unrecognized data format error. What is the best way to replace or add to the database on their machines? Any help is greatly appreciated.

    Read the article

  • javascript Programmically exit fullsreen

    - by Mark
    I understand why browsers would disallow websites from programically making the browser fullscreen. However, users typically expect the 'esc' button to exit from full screen, and browsers simply don't do that. Is there any way to get the browser to exit from full screen. Thanks.

    Read the article

  • php Getting the 'new' values in an array

    - by Mark
    Trying to learn about php's arrays today. I have a set of arrays like this: $a = array ( 0 => array ( 'value' => 'America', ), 1 => array ( 'value' => 'England', ), 2 => array ( 'value' => 'Australia', ), ) $b = array ( 0 => array ( 'value' => 'America', ), 1 => array ( 'value' => 'England', ), 2 => array ( 'value' => 'Canada', ), ) I need to get the 'new' subarrays that array b brings to the table. ie, I need to return array ( 'value' => 'Canada', ) I thought I could first merge $a+$b and then compare the result to $a. $merge = array_merge($a,$b); $result = array_diff($merge,$a); But somehow that does not work. It returns array() How come? And thanks!

    Read the article

  • file names based on file content

    - by Mark
    So iow, some algorithm to generate a unique, reasonable length filename based on binary file content. Two files that have the same binary content should have the same name. Obviously there would be limits to this, as presumably you couldn't have unique reasonable length filenames for each of a large set of large files only differing at a handful of bit positions. But presumably there is some heuristic, best approximation to this that for example exploits known attributes of typical image files. If I had the name of some algorithm that does this I can google it and find other approaches as well.

    Read the article

  • FireFox Toolbar Open Window in new Tab

    - by Mark
    Hi all, I have a Toolbarbutton <toolbarbutton context="TabMenue" id="esbTb_rss_reader" label="News" type="menu"> with a Context menue which comes up when the button is right clickt <menupopup id="TabMenue" > <menuitem label="New Tab" oncommand="esbTb_loadURLNewTab()"/> </menupopup> so this function should open the new window in a new tab function esbTb_loadURLNewTab() { window.open(ClickUrl,'name'); } I don't get it working that the new Window is showing up in a new tab it always opens a new firefox window. I tried also like described in this article to set the browser.link.open_newwindow and browser.link.open_newwindow.restriction preferences but that doesn't bringt anything. And I tried it with all Target attributes which came in my mind. So I'm grateful for any hints, tips what ever this is driving me crazy...

    Read the article

  • "An access violation (Segmentation Fault) raised in your program."

    - by Mark
    My C++ program compiles and works up until I call this function from main(): int uword(){fstream infile("numbers.txt"); fstream exfile("wordlist.txt"); string numb[numoflines]; string lines[numoflines]; number = 1; line = 1; for(int i=0;!infile.eof();++i) { getline (infile,number); numb[i] = number; getline (exfile,line); lines[i] = line; } infile.close(); exfile.close(); string yourword; Something here causes it to crash, in the debug it pops up with "An access violation (Segmentation Fault) raised in your program."

    Read the article

  • Why does the order of the loops affect performance when iterating over a 2D array? [closed]

    - by Mark
    Possible Duplicate: Which of these two for loops is more efficient in terms of time and cache performance Below are two programs that are almost identical except that I switched the i and j variables around. They both run in different amounts of time. Could someone explain why this happens? Version 1 #include <stdio.h> #include <stdlib.h> main () { int i,j; static int x[4000][4000]; for (i = 0; i < 4000; i++) { for (j = 0; j < 4000; j++) { x[j][i] = i + j; } } } Version 2 #include <stdio.h> #include <stdlib.h> main () { int i,j; static int x[4000][4000]; for (j = 0; j < 4000; j++) { for (i = 0; i < 4000; i++) { x[j][i] = i + j; } } }

    Read the article

  • onPerformSync() is not triggered after ContentResolver.requestSync() call

    - by mark
    I am trying to implement sync adaptor, I have followed This guide. But onPerformSync() is not triggered after ContentResolver.requestSync() call . I have also tried some other tutorials and tried to run their code, but still same issue. Please tell me does I need to do some extra configuration for this. My code of triggering sync operation is as folows : Account newAccount = new Account(GlobalInfo.ACCOUNT, GlobalInfo.ACCOUNT_TYPE); AccountManager accountManager = (AccountManager) this.getSystemService(ACCOUNT_SERVICE); accountManager.addAccountExplicitly(newAccount, null, null); ContentResolver.requestSync(newAccount,GlobalInfo.AUTHORITY, Bundle.EMPTY); Please guide me to solve this issue. EDIT : Accounted created (in Settings - Accounts and Sync settings) by above code showing sync is off

    Read the article

  • How do I "think in AngularJS" if I have a jQuery background?

    - by Mark Rajcok
    How do I “think in AngularJS” if I have a jQuery background? Suppose I'm familiar with developing client-side applications in jQuery, but now I'd like to start using AngularJS. Can you describe the paradigm shift that is necessary? Here are a few questions that might help you frame an answer: How do I architect and design client-side web applications differently? What is the biggest difference? What should I stop doing/using; what should I start doing/using instead? Are there any server-side considerations/restrictions? I'm not looking for a detailed comparison between jQuery and AngularJS.

    Read the article

  • Div smart width

    - by Mark
    see fiddle html <div class="e" style="left:5px;top:5px;">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbb</div> <div class="e" style="left:5px;top:100px;">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>? css .e { font-size: 10px; font-family: arial; background-color: yellow; position: absolute; max-width: 300px; } you will notice the 2nd div fits the size of the content exactly, but on the first div there's a bunch of empty space to the right of the a's and b's. This is because the div hit its max width of 300px and then wrapped the b's to a 2nd line. The wrapping is good, but then I would expect the div to then shrink back down to the width of the a's so that there's no empty space to the right. Is it possible to get it to do this? Tested in Chrome and FF.

    Read the article

  • JQuery validation based on class?

    - by Mark Kadlec
    I have a form that will have dynamically created elements, one of those will be of date type. There can also be many fields of this type on my form, all which must be validated. I am using a strongly typed view in Asp MVC, so the name will change based on various factors. What I would like to do is validate based on a class name instead, since that will be constant for that type of field. Ie: <%= Html.TextBox("questionAnswers[" + index + "].AnswerValue", qa.AnswerValue, new { @class = "DateTypeClass" })%> So then I would need JQuery validation based on the classname DateTypeClass versus the Name. Any ideas?

    Read the article

  • php values of one array to key of another array

    - by mark
    I have 2 arrays $arr1 = Array ( [0] => 12 [1] => 4 [2] => 8 [3] => xx [4] => 1 [5] => 1year [6] => 7 ) $arr2 = Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 ) I want to create a new array with the values of a2 as keys in $arr1. My resultant array should be like this $arr3 = Array ( [1] => 12 [2] => 4 [3] => 8 [4] => xx [5] => 1 [6] => 1year [7] => 7 )

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >