Jump to content

bholbrook

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Posts posted by bholbrook

  1. Okay, please don't flame me for putting this in the wrong forum, I'm trying to get to some of the more advanced peoples out there.

     

    My server SEEMS to be randomly changing letters from my programs. From a JS page "scope to scopt" from the MySql DB "Support" to "Suuport", and from PHP "$iStatus" to "$iModule".

     

    These are changes that I know for sure were correct to start, and not mistyped. The program I use isn't the culprit, as they're all edited in seperate programs.

     

    Is it possible that there is a glitch, virus, or hacker in the server that would do this?

     

    ----------------

    Now playing: Foo Fighters - What If I Do?

    via FoxyTunes

  2. The circle was just an example, let's ignore the circle for a minute.

     

    We have 4 teams:

     

    TEAM 1 went 2 - 1

    TEAM 2 went 2 - 1

    TEAM 3 went 1 - 2

    TEAM 4 went 1 - 2

     

    TEAM 1 DEF. TEAM 2

    TEAM 1 DEF. TEAM 3

    TEAM 2 DEF. TEAM 3

    TEAM 2 DEF. TEAM 4

    TEAM 3 DEF. TEAM 4

    TEAM 4 DEF. TEAM 1

     

    How am I going to sort these teams? The rankings should be

     

    TEAM 1 (Because they are tied for top of the league by their record WITH TEAM 2, who they beat)

    TEAM 2 (Because they are tied for top of the league by their record WITH TEAM 1, who they lost to)

    TEAM 3 (Because they are tied for bottom of the league by their record WITH TEAM 4, who they beat)

    TEAM 4 (Because they are tied for bottom of the league by their record WITH TEAM 3, who they lost to)

     

    How do I program this sort because on the logic in the parenthesis'?

  3. Thanks for the reply

     

    I understand what you're saying. My problem is in sorting the teams by how they played against each other, specifically how to create the relationship between each team.

     

    I cannot change the ranking system as that is defined by the league and not by my program.

  4. Okay, I have a list of 10 teams and I need them sorted top to bottom in order of standing. Calculating their order is where I'm having the problem.

     

    I order the teams by:

     

    1. WIN PERCENTAGE

    2. POINTS

    3. RECORD AGAINST TEAM TIED WITH

    4. WINS

    5. RUNS DIFFERENTIAL

     

    I have all these figured out except #3. I don't even know where to start (thus the no code posting). Assume I can get an array with any and all information needed.

     

    Keep in mind this scenerio:

     

    TEAM 1 beat TEAM 2 twice

    TEAM 2 beat TEAM 3 twice

    TEAM 3 beat TEAM1 twice

     

    These three teams are essentially tied and need to revert to tied breaker #4. If you know of an article on this kind of algorithm or if you've done this yourself, please let me know.

  5. Personally I dont recommend trying to make a table having a list of errors unless they come form PHP and MySQL still you wouldnt need one.

     

    I would 100% disagree with this, especially as we enter the age of Web 2.0 and AJAX websites. Anytime I send an async request, I return my expected value, or an error code (ERR:00190). This error code can then be sent back in to another script as another async request with two parameters, the language and the error number:

     

    --using YUI & Javascript

    YAHOO.util.Connect.asyncRequest("GET","error.php?err=00190&lang=en",{...},null);

     

    This will go to error.php which will pull the error in the language requested and can be displayed with your Javascript handler. Goto http://developer.yahoo.com/yui for info on YUI.

  6. Make an error handler that will do it for you. That way you can trigger errors wherever you need to know what is going one without having to build your own solution.

     

    You can also use a try/catch block to get the information you need without forcing an error... http://ca.php.net/try

     

    try
    {
        throw new Exception("This is a message to display");
    }
    catch( Exception $e )
    {
        echo $e->getMessage(); // This is a message to display
        echo $e->getLine();    // 3
    }
    

  7. @stuffradio: Thanks for the link. I definitely took Google for a spin before posting; I didn't see that website. Good article, however, I am looking for something more complex than simply changing colors and images. Thanks for your efforts.

  8. Hello!

     

    I am in charge of creating a large scale website, and for the first time it has to be 100% skinnable. I need to be able to move components and output to different places and in different sizes for different audiences. Does anybody know of a good extensive article on the process of creating a website that allows for complex skinning?

     

    Thanks!

  9. I want to create a simple PHP SMS script where someone can text a number and I can return them data. I also want to be able to charge for this. How does this work? I see commericals for this stuff all the time (albeit the use I have is more useful then a joke), but how does it work?

  10. Thanks Barand

    For those interested, we used symblic linking to fic the problem.

    Symbolic linking allows us to make one filder on the server for classes and then create SYMBOLIC folders in out sites. In a linux shell type:

    ln -s [SOURCE DIRECTORY] [FOLDER NAME] and the folder will be created linking to the source.
  11. You can use the output buffer.

    headers can't be modified after they're sent, but you can determine WHEN they're sent.

    [b]WONT WORK[/b]
    [code]
    <html>
    <? header("location:page.html"); ?>
    [/code]

    [b]WILL WORK[/b]
    [code]
    <? ob_start(); ?>
    <html>
    <? header("location:page.html"); ?>
    <? ob_end_flush(); ?>
    [/code]

    There is more to know on output buffers, I suggest you give it a read. Also, when you change the page location, the first page will finish processing. Make sure to put an exit(); after your header if you dont want that to happen.
  12. Okay, somewhere in my script my session is being altered. I need to know where. I know for sure that it is my problem via the code below.

    [code]

    global $strSession;
    global $intLine;
    $intLine = 0;

    function checkSession(){

    $GLOBALS['intLine']++;

    if($GLOBALS['strSession'] != $_SESSION){

    echo "<P>";
    echo "<strong>".$GLOBALS['intLine']."</strong>";
    var_dump($_SESSION);
    echo "</P>";
    $GLOBALS['strSession'] = $_SESSION;

    }

    }

    register_tick_function("checkSession");

    declare(ticks=1);

    [/code]

    Whenever the session changes, i print it out. The problem is that i dont know WHERE the change is happening. One miht suggest 'start at the top and look for session calls' but that is hard to do with a 10,000 line script (not psgetti coded, there is an entire library i bring in & its an admin side script, so time to load is acceptable).

    At any rate, i need to know what line of what file the session canges on.

    exception class doesn't work, only retruns data of where the exception is thrown
    trigger_error works the same way.

    ANy ideas?
  13. 1) Download the files to your computer.
    2) Download the trial version of FIREWORKS from MACROMEDIA.COM
    3) Click FILE, BATCH PROCESS
    4) Select ALL .BMP files and click NEXT
    5) Click EXPORT and ADD>
    6) Select Settings for JPEG and click NEXT
    7) Select OUTPUT location
    8) Click BATCH
    9) Find something  useful to do for an hour.
  14. Hello

    I am a long time programmer of many languages, but I find that there is no useful documentation on PLPGSQL, so bare with me. I am writing a function that has multiple inputs and it doesnt liek my input params. Code posted below follwed by the call, followed by the error.

    PGSQL Version 8.x from PG Lightning Admin

    [b]FUNCTION[/b]
    [code]CREATE or REPLACE FUNCTION public."createAgent"(
    IN strname text,
    IN intfranchiseid int4,
    IN intteamid int4,
    IN boolcreateschema boolean,
    IN strschemaname text,
    OUT intentityid int4)
    RETURNS pg_catalog.int4 AS
    $BODY$
    DECLARE

    intAgentId integer := 0;
    intEntityHolder integer := 0;
    arrAttributes text := '{}';

    BEGIN

    --query to insert agent into database
    INSERT INTO public.rev2_agent (
    "agent_franchise_id",
    "agent_team_id",
    "agent_name"
    ) VALUES ( intFranchiseId, intTeamId, strName );

    --get new agent id
    SELECT INTO intAgentId CURRVAL('public.rev2_selling_agent_seq');

    --insert entity
    INSERT INTO public.rev2_selling_entity (
    "selling_entity_seller_id",
    "selling_entity_schema"
    ) VALUES (
    intAgentId,
    strSchemaName
    );

    --get new entity id
    SELECT INTO intEntityHolder CURRVAL('public.rev2_selling_entity_selling_entity_id_seq');

    --check for create schema
    IF boolCreateSchema = TRUE THEN

    --create schema
    EXECUTE 'CREATE SCHEMA' || strSchemaName;

    --create config table in new schema
    EXECUTE 'CREATE TABLE' || strSchemaName || '.config ('
    || 'config_id serial UNIQUE,'
    || 'config_attribute varchar(100) NOT NULL,'
    || 'config_value varchar(100),'
    || 'CONSTRAINT config_id_pkey PRIMARY KEY (config_id)';

    --create array of attributes
    arrAttributes[0] := 'prefix';
    arrAttributes[1] := 'ftp_user';
    arrAttributes[2] := 'ftp_pass';
    arrAttributes[3] := 'ftp_host';
    arrAttributes[4] := 'ftp_port';
    arrAttributes[5] := 'ftp_time';
    arrAttributes[6] := 'ftp_path';

    --add fields to table
    FOR i IN 0..6 LOOP

    EXECUTE 'INSERT INTO' || strSchemaName || '.config'
    || '( config_attribute ) VALUES ("'
    || arrAttributes[i]
    || '")';


    END LOOP;

    END IF;

    --return entity id
    intEntityId := intEntityHolder;

    END;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE;[/code]

    [b]FUNCTION CALL[/b]
    [code]SELECT public.createAgent('Brad Holbrook', 2, 0, FALSE, 'privatehomesellers');[/code]

    [b]ERROR:[/b]
    PostgreSQL Error Code: (1)
    ERROR:  function public.createagent("unknown", integer, integer, boolean, "unknown") does not exist
    HINT:  No function matches the given name and argument types. You may need to add explicit type casts.
  15. Unfortunately we have no control over what database is being used, and I don't believe it is a database issue; the database field is holding the appropriate text.

    I didn't think that strings had limits, and if ODBC doesn't limit it, what couold be the problem?

    Does ODBC or MSSQL send the information in 4096 bit chunks and it has to be read that way?

  16. I have successfully inplemented something quite like this.

    You need to compare values of the same length

    if DELL is in and you are entered DELL INC, you only want to try to match the first 4 letters and see if they're the same.

    you can also use the similar_text function whic takes two values and gives you the percent that is the same, and throw new entries at a sertain threshold.

    While DELL and DELL INC are the same, DELL INC and DELL FINANCIAL are not, so throwing the last part will not help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.