Search Results

Search found 292 results on 12 pages for 'derek adair'.

Page 10/12 | < Previous Page | 6 7 8 9 10 11 12  | Next Page >

  • Textmate tab and de-tab selected block

    - by Derek Organ
    Recently switched to Textmate on Mac for coding. On PC when ever I want to tab in or out a block of code I just highlight and press tab or shift+tab to move it in our out. It's very useful when you are adding an extra loop or conditional statement to a block of code to keep everything tidy and neatly indented. On Textmate however when I try this it just replaces my selected text with a tab. So is there a way to do tab and de-tab lines of code in textmate?

    Read the article

  • Can you change/redirect a django form's function by passing in your own function?

    - by Derek
    I'm dealing with django-paypal and want to change the button src images. So I went the the conf.py file in the source and edited the src destination. However, I really want to leave the source alone, and I noticed that the class PayPalPaymentsForm(forms.Form): has def get_image(self): return { (True, self.SUBSCRIBE): SUBSCRIPTION_SANDBOX_IMAGE, (True, self.BUY): SANDBOX_IMAGE, (True, self.DONATE): DONATION_SANDBOX_IMAGE, (False, self.SUBSCRIBE): SUBSCRIPTION_IMAGE, (False, self.BUY): IMAGE, (False, self.DONATE): DONATION_IMAGE, }[TEST, self.button_type] which handles all the image src destinations. Since changing this def in the source is worse than changing conf, I was wondering if there was a way to pass in customized defs you make like passing in initial arguments in forms? This way no source code is changed, and I can customize the get_image def as much as I need. passing in def something like this? def get_image(self): .... .... paypal = { 'amount': 10, 'item_name': 'test1', 'item_number': 'test1_slug', # PayPal wants a unique invoice ID 'invoice': str(uuid.uuid4()), } form = PayPalPaymentsForm(initial=paypal, get_image) Thanks!

    Read the article

  • Pointer-based binary heap implementation

    - by Derek Chiang
    Is it even possible to implement a binary heap using pointers rather than an array? I have searched around the internet (including SO) and no answer can be found. The main problem here is that, how do you keep track of the last pointer? When you insert X into the heap, you place X at the last pointer and then bubble it up. Now, where does the last pointer point to? And also, what happens when you want to remove the root? You exchange the root with the last element, and then bubble the new root down. Now, how do you know what's the new "last element" that you need when you remove root again?

    Read the article

  • C# Minimize all running windows when application runs

    - by Derek
    I am working on a C# windows form application. How can i edit my code in a way that when more than 2 faces is being detected by my webcam. More information: When "FaceDetectedLabel.Text = "Faces Detected : " + cam.facesdetected.ToString();" becomes Face Detected: 2 or more... How can i do the following: Minimize all program running except my application. Log out of my computer Here is my code: namespace PBD { public partial class MainPage : Form { //declaring global variables private Capture capture; //takes images from camera as image frames public MainPage() { InitializeComponent(); } private void ProcessFrame(object sender, EventArgs arg) { Wrapper cam = new Wrapper(); //show the image in the EmguCV ImageBox WebcamPictureBox.Image = cam.start_cam(capture).Resize(390, 243, Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC).ToBitmap(); FaceDetectedLabel.Text = "Faces Detected : " + cam.facesdetected.ToString(); } private void MainPage_Load(object sender, EventArgs e) { #region if capture is not created, create it now if (capture == null) { try { capture = new Capture(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } #endregion Application.Idle += ProcessFrame; }

    Read the article

  • Should class IOException in Java have been an unchecked RuntimeException?

    - by Derek Mahar
    Do you agree that the designers of Java class java.io.IOException should have made it an unchecked run-time exception derived from java.lang.RuntimeException instead of a checked exception derived only from java.lang.Exception? I think that class IOException should have been an unchecked exception because there is little that an application can do to resolve problems like file system errors. However, in When You Can't Throw An Exception, Elliotte Rusty Harold claims that most I/O errors are transient and so you can retry an I/O operation several times before giving up: For instance, an IOComparator might not take an I/O error lying down, but — because many I/O problems are transient — you can retry a few times, as shown in Listing 7: Is this generally the case? Can a Java application correct I/O errors or wait for the system to recover? If so, then it is reasonable for IOException to be checked, but if it is not the case, then IOException should be unchecked so that business logic can delegate handling of this exception to a separate system error handler.

    Read the article

  • AM I using DO WHILE NOT and EOF in VBscript Properly

    - by Derek Drummond
    This block of code is causing my page to fail to load. When I comment out the line `DO WHILE NOT Rs.EOF the page loads properly. SQL_Command_String = "SELECT * FROM Seminars WHERE [SeminarID] = 5 ORDER BY DESC" Rs = SQLConnection.Execute(SQL_Command_String) DO WHILE NOT Rs.EOF file1 = "./seminars/" & seminar_type & "/" & seminar_year & "/" & Rs("Date") & "-" & Rs("Year") & "_" & Rs("Last") & ".pdf" file2 = "./seminars/" & seminar_type & "/" & seminar_year & "/" & Rs("Date") & "-" & seminar_year & "_" & Rs("Last") & "(handouts).pdf" file3 = "./seminars/" & seminar_type & "/" & seminar_year & "/" & Rs("Date") & "-" & seminar_year & "_" & Rs("Last") & "_Flyer.pdf" Rs.MoveNext loop Is the SQL_Command_String an invalid SQL Command or is my reader not being used properly when I try to build that specific file path e.g. Rs("Date")? Is there an option where I could do something like: DO WHILE RS.hasNextLine

    Read the article

  • Using group_by with fields_for and accepts_nested_attributes_for

    - by Derek
    I have a the following rails models: class Release < ActiveRecord::Base has_many :release_questionnaires, :dependent => :destroy accepts_nested_attributes_for :release_questionnaires ... end class class ReleaseQuestionnaire < ActiveRecord::Base belongs_to :release belongs_to :milestone ... end class In my view code, I have the following form. <% form_for @release, ... do |f| %> ... <table class="questionnaires"> <% f.fields_for :release_questionnaires, @release.release_questionnaires.sort_by{|ra| ra.questionnaire.name} do |builder| %> ... <% end %> </table> <% end %> This works and allows me to view and edit the questionnaires as desired. However, I have an additional requirement to break the questionnaires out into their own tables grouped by the milestone they are associated to, rather than in a single table. It appears as though the group_by method is design to accomplish this, but I cannot get it to work as desired inside the tag. It may be that I'm missing something obvious, as I am a beginner... Any help is appreciated.

    Read the article

  • Ideas for loading initial data in an iPhone application?

    - by Derek Clarkson
    Hi all, In my app I want to load some initial data to show the user how it works. The app uses a CoreData managed sqllite db. SO far I've thought of 3 options: Write code into a class to programmatically create the data. Create a xml file in the apps resources and load through a NSXmlParser whose delegate creates the entries in the sqllite db. Same as option #2, but use a json file and bring in a 3rd party lib to read it. Are there other options I have not found yet? and given that I'm talking about perhaps 6 records per table when there are 3 tables, which would you choose?

    Read the article

  • How do I get the median/mode/range of a column in SQL using Java?

    - by Derek
    I have to get the median, mode and range of test scores from one column in a table but I am unsure how to go about doing that. When you connect to the database using java, you are normally returned a ResultSet that you can make a table or something out of but how do you get particular numbers or digits? Is there an SQL command to get the median/mode/range or will I have to calculate this myself, and how do you pull out numbers from the table in order to be able to calculate the mode/median/range? Thanks.

    Read the article

  • How to place a DIV over jw player when certain condition is met?

    - by Derek
    JW player can either playback video in flash or html5. I use a countdown timer in my app between certain videos. Right now the countdown timer is being displayed in a div beneath the jw player. I need to get that timer displayed in a div that covers the entire jw player interface. I'm stuck and could use some help. Here is some of the javascript code: jwplayer("container").setup({ 'file': 'devplaylist.xml', 'flashplayer': 'js/player.swf', 'plugins': { './countdown.js': {} }, 'repeat': 'list', 'autostart': true, 'height': 390, 'width': 720, events: { onPlaylist: function(event){ ... ... } onPlaylistItem: function(event){ ... ... var minutes = (Math.floor(time/60 )); var seconds = time % 60; if (seconds < 10) seconds = "0" + seconds; var text = minutes + ":" + seconds; document.getElementById('resttimer').innerHTML = text; //I need to have a DIV display the value of text (the countdown time) //directly over the jw player time--; }, 1000); ... ...} Any help is appreciated, DK

    Read the article

  • UIDatePicker Not storing time in core data

    - by Derek
    Hi, I am using a UIDatepicker with only "Time", I save the time in a NSDate object type, however when I try to store the Object in core data I get an error saying its not a NSDate type... *tt = [pickerTime date]; [myObject setValue:tt forKey:@"time"]; Thanks,

    Read the article

  • Add Wordpress Video Gallery from YouTube User account to template

    - by Derek Organ
    I'm trying to create a small gallery of my youtube videos in wordpress. I need to have full control of style though. What i'm looking to do is have one big video (latest) and the next three as small thumbs underneath that. Can anyone recommend the best way to do this. I've can get use RSS feed from my youtube page to get a list of the videos. I now need a simple way to embed this info in my template.

    Read the article

  • Make error: target pattern contains no '%'. Stop.

    - by Derek
    Hi all. I have a project that I have been running on IRIX that builds fine with gmake. I copied the source and make files onto a Redhat machine, and running gmake gives me the error posted in the subject. This is during a part of the make that is building .d dependency files, and they are separated by a colon, which I have read is a no-no, but why does it work on one system and not the other? What is the fix? Thanks

    Read the article

  • Using static strings to define input field names in JSPs - good idea or not?

    - by Derek Clarkson
    Hi all, I've just be asked to work on a large portal project and have been looking through the established code. I keep finding this in the jsps: <input class="portlet-form-button" name="<%=ModifyUserProfile.FORM_FIRST_TIME_LOGIN_SUBMIT%>" type="submit" ... The authors are using static strings defined in classes to define the names of input fields and buttons in jsp forms. I've never seen this done before and was wondering if this is common practice. I'm inclined to think not, but I'm asking because, apart from centralising names which I would have thought are not likely to change, I can't see the reason why. Any thoughts on this?

    Read the article

  • What happens if a bean attempts to load the Spring application context in its constructor?

    - by Derek Mahar
    Given the following Spring application context and class A, what happens when you run class A? applicationContext.xml (in classpath): <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean name="a" class="A"/> </beans> A.java: class A { private ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml"); public static void main(String[] args) { A a = new A(); } }

    Read the article

  • C# delegate to Java conversion

    - by Derek
    I am in the process of converting some code from C# to Java. I have never used C# before, but it has been pretty easy up to this point. I have a line that looks like this in the C# file: coverage.createMethod = delegate (Gridpoint gp){ //Some method stuff in here, with a return objecct } What exactly is this trying to do? It seems a little bit like an inline class but I am not sure how to go about converting htis to java

    Read the article

  • Managing Data Prefetching and Dependencies with .NET Typed Datasets

    - by Derek Morrison
    I'm using .NET typed datasets on a project, and I often get into situations where I prefetch data from several tables into a dataset and then pass that dataset to several methods for processing. It seems cleaner to let each method decide exactly which data it needs and then load the data itself. However, several of the methods work with the same data, and I want the performance benefit of loading data in the beginning only once. My problem is that I don't know of a good way or pattern to use for managing dependencies (I want to be sure I load all the data that I'm going to need for each class/method that will use the dataset). Currently, I just end up looking through the code for the various classes that will use the dataset to make sure I'm loading everything appropriately. What are good approaches or patterns to use in this situation? Am I doing something fundamentally wrong? Although I'm using typed datasets, this seems like it would be a common situation where prefetching data is used. Thanks!

    Read the article

  • How do make dependency generation work for C? (Also..decode this sed/make statement!)

    - by Derek
    Hi all. I have a make build system that I am trying to decipher that someone else wrote. I am getting an error when I run it on a redhat system, but not when I run it on my solaris system. The versions of gmake are the same major revision (one off on minor revision). This is for building a C project, and the make system has a global Makefile.global that is inherited by each directory's local Makefile The Makefile.global has all the targets in it, starting with all: $(LIB) $(BIN) where LIB builds libs and BIN builds binaries. jumping down the targets I have $(LIB) : $(GEN_LIB) $(GEN_LIB) : $(GEN_DEPS) $(GEN_OBJS) $(AR) $(ARFLAGS) $(GEN_LIB) $(GEN_OBJS) $(GEN_DEPS) : @set -e; rm -f $@; \ $(CC) $(CDEP_FLAG) $(CFLAGS) $(INCDIRS) `basename $@ | sed 's/\.d/\.c/' | sed 's,^,$(HOME_SRC)/,'` | sed 's,\(.*\)\.o: ,$(GEN_OBJDIR)/\1.o $@ :,g' > [email protected] ; \ cat [email protected] > $@ ; \ cat [email protected] | cut -d: -f2 | grep '\.h' | sed 's,\.h,.h :,g' >> $@ ; \ rm [email protected] $(GEN_OBJS) : $(CC) $(CFLAGS) $(INCDIRS) -c $(*F).c -lmpi -o $@ I think these are all the relevant targets I need to include to answer my question. Definitions of those variables: CC = icc CDEP_FLAG = -M CFLAGS = various compiler flags ifdef type flags INCDIRS = include directory where all .h files are GEN_OBJDIR = /lib/objs HOME_SRC = . GEN_LIB = lib/$(LIB) GEN_DEPDIR=/lib/deps GEN_DEPS = $(addprefix $(GEN_DEPDIR)/,$(addsuffix .d,$(basename $(OBJS)))) I think this has everything covered you need. Basically self explanatory from the names. Now as best I can tell, this is generating in /lib/deps a .d file that has the object and source dependencies in it. In other words, for the utilities.a library, I will get a utils.o and utils.c dependency stack, all in the file utils.d There is some syntax error that is being generated in that file I think, because I get the following error: ../lib/deps/util.d:25: *** target pattern contains no '%'. Stop. gmake[2]: *** [all] Error 2 gmake[1]: *** [all] Error 2 gmake: *** [all] Error 2 I am not sure if my error is in the dependency generation, or some further down part, like the object generation target? If you need further info, let me know, I will add to post

    Read the article

  • PHP mail may be filtered out by spam?

    - by Derek
    I am creating a small company, and would like to send out emails to my clients once they have signed up for my service to activate their accounts. I am currently using PHP's mail() function, however I am worried that my emails are being filtered out by spam filters. Is there a better way to go about this? $email = 'XZY Client Email address @ somedomain.com'; $emailSubject = "Welcome to XYZ Service!"; $to = $email; $subject .= "".$emailSubject.""; $headers .= "From: [email protected]\r\n" . "X-Mailer: php"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = "<html><body>"; $message .= "Welcome to XYZ Service! \n Activate your account by clicking the following link: link..."; mail($to, $subject, $message, $headers); Is there a way to authenticate these emails so that my clients know that they are from my actual service? Thank you in advance!

    Read the article

  • Are macro definitions compatible between MIPS and Intel C compiler?

    - by Derek
    I seem to be having a problem with a macro that I have defined in a C program. I compile this software and run it sucessfully with the MIPS compiler. It builds OK but throws the error "Segmentation fault" at runtime when using icc. I compiled both of these on 64 bit architectures (MIPS on SGI, with -64 flag and icc on an intel platform). Is there some magic switch I need to use to make this work correctly on both system? I turned on warnings for the intel compiler, and EVERY one of the places in my program where a macro is invoked throws a warning. Usually something along the lines of mismatched types on the macro's parameters (int to char *) or some such thing.

    Read the article

  • Problem with PHP; Posting Hidden Value!!?

    - by Derek
    Hi, I have a page which basically allows an admin user to create manager user types (basically a register function. So when the values are submitted, they are stored into the DB, very very basic stuff. However, I have a hidden variable type..reasons are I have 3 different user levels and I have declared they identification as an integer (e.g. 7 = manager, 8 =user etc.) Can someone help me out with how to correctly pass this hidden value so it stores in the database... Here is my form: <form id="userreg" name="userreg" method="post" action="adminadduser-process.php"> <label>Full Name:</label> <input name="fullname" size="40" id="fullname" value="<?php if (isset($_POST['fullname'])); ?>"/> <br /> <label>Username:</label> <input name="username" size="40" id="username" value="<?php if (isset($_POST['username'])); ?>"/> <br /> <label>Password:</label> <input name="password" size="40" id="password" value="<?php if (isset($_POST['password'])); ?>"/> <br /> <label>Email Address:</label> <input name="emailaddress" size="40" id="emailaddress" value="<?php if (isset($_POST['emailaddress'])); ?>"/> <br /> <input name="userlevel" type="hidden" size="1" id="userlevel" value="<?php $_POST[5]; ?>" /> <br /> <input value="Add User" class="addbtn" type="submit" /> </form></div> Next, here is the script that runs the query: <?php require_once "config.php"; $fullname = $_POST['fullname']; $username = $_POST['username']; $password = $_POST['password']; $emailaddress = $_POST['emailaddress']; $userlevel = $_POST[5]; $sql = "INSERT INTO users_tb VALUES('".$user_id."','".$fullname."','".$username."',MD5('".$password."'),'".$emailaddress."','".$userlevel."')"; $result = mysql_query($sql, $connection) or die("MySQL Error: ".mysql_error()); header("Location: adminhome.php"); exit(); ?> I'm basically trying to pass the hidden typem with a constant value of '5' just for this form, as it will not be changed...also while im here, for some reason, the 'fullname' is not stored in the DB either!!?? WTH?? all other fields are processed fine. Any help is much appreciated! Thank you.

    Read the article

< Previous Page | 6 7 8 9 10 11 12  | Next Page >