Search Results

Search found 600 results on 24 pages for 'anthony kong'.

Page 19/24 | < Previous Page | 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Custom Drupal Module not creating any tables

    - by Anthony
    Anything specific I need in the module file? Install File function module_install() { //lets create the school database $create_table_sql = "CREATE TABLE IF NOT EXISTS `table1` ( id int(11) NOT NULL, principal_name varchar(300) NOT NULL, school_name varchar(300) NOT NULL, address1 varchar(300) NOT NULL, address2 varchar(300) NOT NULL, city varchar(300) NOT NULL, computer_serial_no varchar(300) NOT NULL, state varchar(200) NOT NULL, uid int(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; db_query($create_table_sql); //lets create the student database $create_table_sql = "CREATE TABLE IF NOT EXISTS table2 ( id int(11) NOT NULL, principal_name varchar(300) NOT NULL, school_name varchar(300) NOT NULL, address1 varchar(300) NOT NULL, address2 varchar(300) NOT NULL, city varchar(300) NOT NULL, computer_serial_no varchar(300) NOT NULL, state varchar(200) NOT NULL, uid int(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; db_query($create_table_sql); } /** * _UNINSTALL hook * * This function is run to uninstall the module. * */ function module_uninstall() { // Delete the DB db_query("drop table table1"); db_query("drop table table2"); } Info File Just in Case ; $Id$ name = My Module description = This module deals with blah blah package = Somepackage core = 6.x version = "6.x-1.0" core = "6.x"

    Read the article

  • Thread-safe use of a singleton's members

    - by Anthony Mastrean
    I have a C# singleton class that multiple classes use. Is access through Instance to the Toggle() method thread-safe? If yes, by what assumptions, rules, etc. If no, why and how can I fix it? public class MyClass { private static readonly MyClass instance = new MyClass(); public static MyClass Instance { get { return instance; } } private int value = 0; public int Toggle() { if(value == 0) { value = 1; } else if(value == 1) { value = 0; } return value; } }

    Read the article

  • rake db:migrate fails when trying to do inserts

    - by anthony
    I'm trying to get a database populate so I can begin working on a project. THis project is already built and I'm being brought in to helpwith front-end work. Problem is I can't get rake db:migrate to do any inserts. Every time I run rake db:migrate I get this: ... == 20081220084043 CreateTimeDimension: migrating ============================== -- create_table(:time_dimension) - 0.0870s INSERT time_dimension(time_key, year, month, day, day_of_week, weekend, quarter) VALUES(20080101, 2008, 1, 1, 'Tuesday', false, 1) rake aborted! Could not load driver (uninitialized constant Mysql::Driver) ... I'm building on a MBP with Snow Leopard. I've installed XCode from the disk that comes with the mac. I've updated ruby, installed rails and all the needed gems. I have the 64 bit version of MySQL installed. I've tried the 32 bit version of MySQL and I've even tried installing from macports (via http://www.robbyonrails.com/articles/2010/02/08/installing-ruby-on-rails-passenger-postgresql-mysql-oh-my-zsh-on-snow-leopard-fourth-edition) The mysql gemis installed using: sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/path/to/mysql/bin/mysql_config the migrate creates the tables just fine but it dies every. single. time. it trys an insert. Any help would be great

    Read the article

  • overflow auto not working in IE

    - by Anthony Russo
    First off I have read a couple of q and a's on here about this issue but none of them seem to help. I have a couple other pages on the website that have no problems with resizing to height using overflow auto. The thing I have noticed is the pages work fine with one div. The page that is not working has two or more div and also I have tried it with a container but I still get the vertical and horizontal scroll bars. <div class="content"> <div class="container"> <div class="a"> <div class="left">List Items</div> <div class="right">List Items</div> </div> <div class="b"> This div is a FORM. </div> </div> </div> I could be making a simple error to you guys but I am new so bare with me!

    Read the article

  • Why can't I create an abstract constructor on an abstract C# class?

    - by Anthony D
    I am creating an abstract class. I want each of my derived classes to be forced to implement a specific signature of constructor. As such, I did what I would have done has I wanted to force them to implement a method, I made an abstract one. public abstract class A { abstract A(int a, int b); } However I get a message saying the abstract modifier is invalid on this item. My goal was to force some code like this. public class B : A { public B(int a, int b) : base(a, b) { //Some other awesome code. } } This is all C# .NET code. Can anyone help me out? Update 1 I wanted to add some things. What I ended up with was this. private A() { } protected A(int a, int b) { //Code } That does what some folks are saying, default is private, and the class needs to implement a constructor. However that doesn't FORCE a constructor with the signature A(int a, int b). public abstract class A { protected abstract A(int a, int b) { } } Update 2 I should be clear, to work around this I made my default constructor private, and my other constructor protected. I am not really looking for a way to make my code work. I took care of that. I am looking to understand why C# does not let you do this.

    Read the article

  • Limiting the size of a python dictionary

    - by anthony
    I'd like to work with a dict in python, but limit the number of key/value pairs to X. In other words, if the dict is currently storing X key/value pairs and I perform an insertion, I would like one of the existing pairs to be dropped. It would be nice if it was the least recently inserted/accesses key but that's not completely necessary. If this exists in the standard library please save me some time and point it out!

    Read the article

  • How do you submit a rails 3 form without refreshing the page?

    - by Anthony H
    I've seen this done using ajax & php, but not rails 3. I've tried using: <%= form_for(:technician, :url => {:controller => 'pos', :action => 'create_ticket'}, :remote => true) do |f| %> but the page still refreshes each time. I'm building a point of sale program, so I don't want the page to refresh. How do I send the form data to the controller to process and store in the database without refreshing?

    Read the article

  • Reading binary file with Octave

    - by Anthony Blake
    I'm trying to a binary file consisting of floats with Octave (on OS X), but I'm getting the following error: octave-3.2.3:2> load Input.dat R -binary error: load: failed to read matrix from file `Input.dat' The file was written like so: std::ofstream fout("Input.dat", std::ios::trunc | std::ios::binary); fout.write(reinterpret_cast<char*>(Buf), N*sizeof(double)); fout.close(); Any idea what could be going wrong here?

    Read the article

  • What is the '@(' doing in this Perl code?

    - by Anthony Veckey
    In this code snippet: use strict; use warnings; use Data::Dumper; my $r = [qw(testing this thing)]; print Dumper($r); foreach my $row (@({$r}) { print "$row\n"; $row .= 'mod'; } print Dumper($r); print Dumper(@({$r}); I figured out that the '(' after the '@' in the foreach is causing this not to loop correctly. I have no idea why this code even works as there is no ending parenthesis. What is this doing? It looks to be creating a new variable on the fly, but shouldn't 'use strict' have fired or something? Please help explain what that '@(' is doing and why it still runs without an ending parenthesis.

    Read the article

  • Submit form if ajax validator returns true using jquery

    - by Anthony
    I am not sure where I'm going wrong. The idea is that before the form is submitted, one of the input fields is sent to a server-side validator via ajax. If the response is 1, the input is valid and the form should be submitted. If the response is 0, the form should not be submitted. The issue is that I can't figure out how to set a variable within the ajax request function that will prevent the form from being submitted. This is what I have: $("#form").submit(function() { var valid= false; var input = $("#input").val(); $.ajax({ type: "POST", url: "validator.php", data: "input=" + input, success: function(msg){ valid = (msg == 1) ? true : false; if(!valid) { $("#valid_input").html("Please enter valid info"); } else { $("#valid_input").html(""); } } }); return valid; });

    Read the article

  • Regular Expression to Match All Characters after another Regex Match

    - by Anthony Wood
    I know this may sound a little confusing, so I am open to suggestions on renaming the title. Basically I have string such as C:...\Downloads\Folder\SubFolder\SubSubFolder. and I want to return the SubFolder and SubSubFolder only. So far, my Regex looks like (?=\\Downloads\\.*?\\).* which matches Downloads\Folder\SubFolder\SubSubFolder. Does anybody have any Ideas what I am missing???? All the solutions below seem to work (except if you didn't know "Folder"). Potentially a bug with the tool I was using to test the regular expressions.

    Read the article

  • Error found - too many arguments to method call expected 1 have 2 - in app email

    - by Anthony Farah
    There seems to be an error with my coding, and it says that there are to many nils or something I need help MFMailComposeViewController *composer = [[MFMailComposeViewController alloc]init]; if ([MFMailComposeViewController canSendMail]) { [composer setToRecipients:[NSArray arrayWithObject:@"[email protected]", nil]]; [composer setSubject:nil];[composer setMailComposeDelegate:self]; [composer setMessageBody:nil isHTML:YES]; [composer setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

    Read the article

  • Better alternatives to know whether a control is valid in javascript?

    - by Anthony
    I want to know whether a control is valid or not in javascript. Is there a direct client side API available in Asp.Net which can tell me whether a control is valid or not? Eg. If I have 2 validators attached to a textbox, I need a function that can tell me whether the textbox is valid or not. If even 1 validator is not valid then it should return false. I can't seem to find a function that can give me this. Here is a little helper that I wrote which does the job but is inefficient: function isControlValid(control) { for (i = 0; i < Page_Validators.length; i++) { var validator = Page_Validators[i]; var controlId = validator.controltovalidate; if ($(control).attr('id') == controlId && validator.isvalid == false) { return false; } } return true; } Anybody has any better alternatives?

    Read the article

  • Counting the number of occurrences of characters in an array

    - by Anthony Pittelli
    This is what I have but it is not working, this is confusing for me. If you scroll down I commented on someones post the exact problem I am having and what I am trying to do. I was thinking maybe the problem is my code to generate the random characters: public void add (char fromChar, char toChar){ Random r = new Random(); //creates a random object int randInt; for (int i=0; i<charArray.length; i++){ randInt = r.nextInt((toChar-fromChar) +1); charArray[i] = (char) randInt; //casts these integers as characters } }//end add public int[] countLetters() { int[] count = new int[26]; char current; for (int b = 0; b <= 26; b++) { for (int i = 97; i <= 123; i++) { char a = (char) i; for (int ch = 0; ch < charArray.length; ch++) { current = charArray[ch]; if (current == a) { count[b]++; } } } } return count; }

    Read the article

  • How can I find days between different paired rows?

    - by Anthony
    I've been racking my brain about how to do this in one query without PHP code. In a nutshell, I have a table that records email activity. For the sake of this example, here is the data: recipient_id activity date 1 delivered 2011-08-30 1 open 2011-08-31 2 delivered 2011-08-30 3 delivered 2011-08-24 3 open 2011-08-30 3 open 2011-08-31 The goal: I want to display to users a single number that tells how many recipients open their email within 24 hours. E.G. "Users that open their email within 24 hours: 13 Readers" In the case of the sample data, above, the value would be "1". (Recipient one was delivered an email and opened it the next day. Recipient 2 never opened it and recipient 3 waited 5 days.) Can anyone think of a way to express the goal in a single query? Reminder: In order to count, the person must have a 'delivered' tag and at least one 'open' tag. Each 'open' tag only counts once per recipient.

    Read the article

  • Can I use an "IN" filter on an Advantage Database Table (TAdsTable)?

    - by Anthony
    I want to apply a filter to an advantage table using multiple values for an Integer field. The equivalent SQL would be: SELECT * FROM TableName WHERE FieldName IN (1, 2, 3) Is it possible to do the same on an AdsTable within having to repeat the field using an "OR"? I want to something like: Filter := 'FieldName IN (1, 2, 3)' Instead of: Filter := 'FieldName = 1 OR FieldName = 2 OR FieldName = 3'

    Read the article

  • IE 7 issues: Super simple page - TD height not taking effect

    - by Anthony
    This is my markup: <!DOCTYPE HTML> <html> <head> <title>Test title</title> <style type="text/css"> * { margin:0px auto; padding:0px; } html,body { height:100%; width:100%; } </style> </head> <body> <table cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;"> <tr> <td style="height:55px;background:#CCC;" valign="top"> <h1>Header</h1> </td> </tr> <tr> <td valign="top"> Content @RenderBody() </td> </tr> <tr> <td style="height:85px;background:#CCC;" valign="bottom"> Footer </td> </tr> </table> </body> </html> Can anybody tell me why td height is not taking effect? This same markup works in IE9. Is it due to the HTML5 doctype?

    Read the article

  • EF4 (CPT5) ForeignKeyAttribute in base class - Assert Failure entityType != null

    - by Anthony Johnston
    Getting an error when trying to set a ForeignKeyAttribute in a base class class User{} abstract class FruitBase{ [ForeignKey("CreateById")] public User CreateBy{ get; set; } public int CreateById{ get; set; } } class Banana{} class DataContext : DbContext{ DbSet<Banana> Bananas{ get; set; } } If I move the FruitBase code into the banana, all is well, but I don't want to, as there will be many many fruit and I want to remain relatively DRY if I can Is this a know issue that will be fixed by March? Does anyone know a work around?

    Read the article

  • How can I centralise MySQL data between 3 or more geographically separate servers?

    - by Andy Castles
    To explain the background to the question: We have a home-grown PHP application (for running online language-learning courses) running on a Linux server and using MySQL on localhost for saving user data (e.g. results of tests taken, marks of submitted work, time spent on different pages in the courses, etc). As we have students from different geographic locations we currently have 3 virtual servers hosted close to those locations (Spain, UK and Hong Kong) and users are added to the server closest to them (they access via different URLs, e.g. europe.domain.com, uk.domain.com and asia.domain.com). This works but is an administrative nightmare as we have to remember which server a particular user is on, and users can only connect to one server. We would like to somehow centralise the information so that all users are visible on any of the servers and users could connect to any of the 3 servers. The question is, what method should we use to implement this. It must be an issue that that lots of people have encountered but I haven't found anything conclusive after a fair bit of Googling around. The closest I have seen to solutions are: something like master-master replication, but I have read so many posts suggesting that this is not a good idea as things like auto_increment fields can break. circular replication, this sounded perfect but to quote from O'Reilly's High Performance MySQL, "In general, rings are brittle and best avoided" We're not against rewriting code in the application to make it work with whatever solution is required but I am not sure if replication is the correct thing to use. Thanks, Andy P.S. I should add that we experimented with writes to a central database and then using reads from a local database but the response time between the different servers for writing was pretty bad and it's also important that written data is available immediately for reading so if replication is too slow this could cause out-of-date data to be returned. Edit: I have been thinking about writing my own rudimentary replication script which would involve something like having each user given a server ID to say which is his "home server", e.g. users in asia would be marked as having the Hong Kong server as their own server. Then the replication scripts (which would be a PHP script set to run as a cron job reasonably frequently, e.g. every 15 minutes or so) would run independently on each of the servers in the system. They would go through the database and distribute any information about users with the "home server" set to the server that the script is running on to all of the other databases in the system. They would also need to suck new information which has been added to any of the other databases on the system where the "home server" flag is the server where the script is running. I would need to work out the details and build in the logic to deal with conflicts but I think it would be possible, however I wanted to make sure that there is not a correct solution for this already out there as it seems like it must be a problem that many people have already come across.

    Read the article

  • OpenWorld: Our (Road) Maps are Looking Good!

    - by Tony Berk
    Wow, only one (or two) days down at Oracle OpenWorld! Are you on overload yet? I'm still trying to figure out how to be in 3 sessions at the same time... I guess everyone needs to prioritize! There was a lot to see in Monday's sessions, especially some great forward-looking roadmap sessions. In case you aren't here or you decided to go to other sessions, this is my quick summary of what I could capture from a couple of the roadmaps: In the Fusion CRM Strategy and Roadmap session, Anthony Lye provided an overview of the Fusion CRM strategy including the key design principles of 3 E's: Easy, Effective and Efficient. After an overview of how Oracle has deployed Fusion CRM internally to 25,000 users worldwide, Anthony discussed the features coming in the next release, the releases in the next 12 months and beyond. I can't detail too much since you haven't read Oracle's Safe Harbor statement, but check out Fusion Tap and look for new features and added functionality for sales prediction, marketing, social and integration with a number of the key Customer Experience products.  In the Oracle RightNow CX Cloud Service Vision and Roadmap session, Chris Hamilton presented the focus areas for the RightNow product. As a result of the large increase in development resources after the acquisition, the RightNow CX team is planning a lot of enhancements to the functionality, infrastructure and integrations. As a key piece of the Oracle Customer Experience (CX) strategy, RightNow will be integrated with Oracle Social Network, Oracle Commerce (ATG and Endeca), Oracle Knowledge, Oracle Policy Automation and, of course, further integration with Fusion Sales and Marketing. Look forward to seeing more on the Virtual Assistant, Smart Interaction Hub and Mobility. In addition to the roadmaps, I was looking forward to hearing from Oracle CRM customers. So, I sat in on two great Siebel customer panels: The Maximizing User Adoption Rates for Siebel Sales and Siebel Partner Relationship Management panel consisted of speakers from CSL Behring, McKesson and Intuit. It was great to get an overview of implementations for both B2B and B2C companies. It was great hearing that all of these companies have more than 1,000 sales users (Intuit has 4,000) and how the 360 degree view of the customer in Siebel is helping these customers improve their customers' experience (CX). They are all great examples of centralized implementations which have standardized processes across the globe and across business units.  Waste Management, Farmers Insurance and the US Citizenship & Immigration Services presented in the Driving Great Customer Experiences with Siebel Service Applications session. Talk about serving large customer bases! Is it possible that Farmers with only 10 million households is the smallest of these 3? All of them provided great examples of how they are improving the customer experience (CX) including 60-70% improvements in efficiency or reducing the number of applications the customer service reps (CSRs) need to use from 10 to 1 (Waste Management) and context aware call transfers to avoid the caller explaining their issue 3 times (USCIS). So that's my wrap up of only 4 sessions from Monday. In between sessions, I stopped by the Oracle DEMOgrounds and CRM Pavilion to visit with a group of great partners and see the products and partner integrations in action. Don't miss a recap of Mark Hurd's Keynote. I can't believe there were another 40+ sessions covering CRM, Fusion, Cloud, etc. that I missed today! Anyone else see any great sessions?

    Read the article

  • Querying using table-valued parameter

    - by antmx
    I need help please with writing a sproc, it takes a table-valued parameter @Locations, whose Type is defined as follows: CREATE TYPE [dbo].[tvpLocation] AS TABLE( [CountryId] [int] NULL, [ResortName] [nvarchar](100) NULL, [Ordinal] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [Ordinal] ASC )WITH (IGNORE_DUP_KEY = OFF) ) @Locations will contain at least 1 row. Each row WILL have a non-null CountryId, and MAY have a non-null ResortName. Each row will have a unique Ordinal, the first being 0. The combinations of CountryId and ResortName in @Locations will be unique. The sproc needs to search against the following table structure. The image can be seen better by right-clicking it and View Image, or similar depending on your browser. Now this is where I'm stuck, the sproc should be able to find Tours where: The Tour's 1st TourHotel (Ordinal 0) has the same CountryId (and ResortName if specified) of the 1st row of @Locations (Ordinal 0). And also if @Locations has 1 row, the Tour must have additional TourHotels, ALL of which must be in the remaining CountryIds (and ResortNames if specified) of these remaining @Locations rows. Edit This is the code I finally used, based on Anthony Faull's suggestion. Thank you so much Anthony: select distinct T.Id from tblTour T join tblTourHotel TH on TH.TourId = T.Id join tblHotel H ON H.Id = TH.HotelId JOIN @Locations L ON ( ( L.Ordinal = 0 AND TH.Ordinal = 0 ) OR ( L.Ordinal > 0 AND TH.Ordinal > 0 ) ) AND L.CountryId = H.CountryId AND ( L.ResortName = H.ResortName OR L.ResortName IS NULL ) cross apply( select COUNT(TH2.Id) AS [Count] FROM tblTourHotel TH2 where TH2.TourId = TH.TourId ) TourHotelCount where TourHotelCount.[Count] = @LocationCount group by T.Id, T.TourRef, T.Description, T.DepartureDate, T.NumNights, T.DepartureAirportId, T.DestinationAirportId, T.AirlineId, T.FEPrice having COUNT(distinct TH.Id) = @LocationCount

    Read the article

  • Best Of 2010

    - by Mike Dietrich
    Hi there, in Australia, Japan, Singapore and many other countries it's already 2011 - but Germany and the US is still some time until midnight :-) To round up the year you'll find a few off-topic pictures from 2010. You might click on the pictures to get a better resolution. Enjoy ... Moscow - Red Square Tokyo Train - Cell Phone Mania Great Chinese Wall near Beijing Hong Kong by Night Yearing Station Winery, Yarra - Victoria, Australia Dublin, Ireland - during the ash cloud - no comment - Liberty It's sometime foggy in SF Singapore Opera Stockholm - Gamla Stan Unbelievable white beach at Camps Bay, Clifton, Capetown Words fail me ... Mike

    Read the article

  • Des chercheurs utilisent des bactéries pour stocker des données, le biostockage va-t-il remplacer les disques durs ?

    Des chercheurs utilisent des bactéries pour stocker des données, le biostockage va-t-il remplacer les disques durs ? L'Université de Hong Kong travaille actuellement sur un projet ambitieux de biostockage, qui a pour principe d'utiliser des organismes vivants pour stocker et crypter des informations. "Cela veut dire que l'on pourra conserver, très longtemps, de vastes quantités de données dans une boîte contenant des bactéries, au frigidaire", explique un étudiant travaillant sur le dossier. Comment cela fonctionne-t-il ? Les bactéries se reproduisent et se renouvellent sans cesse. Ainsi, elles peuvent se passer un message pendant des milliers d'années. Ces organismes unicellul...

    Read the article

  • Year 2012 So Far...

    - by rajeshr
    It's hard to seek excuses for not showing up in here for regular updates. I'm not venturing into it hence. Year 2012 has been very engaging, both professionally and personally, and I wish to present before you some wonderful people whom I met in the OU classrooms while delivering training programs on various Oracle technologies. While I went through a number of Oracle products in the last few months, two of 'em were more regular than others: Solaris 11 and MySQL. Not to forget the First Global Teach Live Virtual Class on Java ME. Oracle Solaris 11 Training in Bangalore Oracle Solaris 11 Training in Delhi Oracle Solaris 11 Training in Hyderabad Oracle VM for SPARC Training at OU Hong Kong Oracle VM for SPARC Training at Bangalore Oracle Solaris 11 Training in Bangalore Oracle Solaris 10 Training in Bangalore Oracle Solaris 11 Training in Delhi MySQL training Programs at Kochi, Kerala. Attending Ofir Leitner's Pilot teach on Java ME Oracle Solaris 11 Training in Bangalore Sad, I don't have photographs of some smart people whom I came across in my live virtual classes on various Oracle technologies

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24  | Next Page >