1. Super Secret Santa

    Date: 11/30/05 (Algorithms)    Keywords: php, database, shopping

    So every year my friends and I do a Secret Santa exchange (the basic idea under a normal setup is to take a set of n names and derange them, so each person buys a gift for someone else, the 'secret' part being that nobody knows who's shopping for whom)... but we have a large group and there's some people who simply don't know each other, so being the programmer that I am, I scripted up a few PHP pages and a database to allow people to sign up to partipate, and then select the members that they would be willing to shop for. Ideally, I can call the "assignment" algorithm, write the results back to the database, and never know who has whom.

    The trick now is to write an efficient (ideally! correctness is vital, no approximations! and n is not THAT large that exponential is out of the question) algorithm to find the shopping assignments OR prove that the input does not allow an assignment where every participant is: 1) being shopped for by exactly one person and 2) shops for exactly one person other than himself

    Algorithmically speaking:

    GIVEN:
    D, a simple digraph (no loops), where a node is a person and an edge from X to Y indicates X is willing to shop for Y

    FIND:
    D', a subset of D, where forall v in V, indegree(v) = outdegree(v) = 1. D' need not be connected (there is no guarantee D is). OR prove that given D, there is no satisfying D'.

    CONSTRAINTS:
    Must be correct. Time is key. A large but reasonable amount of space may be used. Bonus points if the algorithm can be randomized (or even produces different output if you start at a different node, so long as other constraints are still met).


    Since I have a small n, I can play around with insane solutions like "select a random assignment, check for validity, if not valid repeat"... but it seems like there should be some sort of algorithm to do this, but at the same time, I wonder if maybe it is more difficult than it seems...

    Source: http://www.livejournal.com/community/algorithms/67335.html

  2. Dumb SQL Server Query question

    Date: 12/01/05 (Asp Dot Net)    Keywords: database, sql

    I'm writing a program that does queries on a database, and we just converted to a code-table format (instead of whole strings going in the DB we just put in numbers that reference another table which has all the definitions. Note that these tables are NOT connected (sadly.)) Anyways I'm writing this program that returns data from the database into a datagridview. I've been told that I can't do the conversion on the DataSet or the DGV side and that SQL server needs to do it, so basically I need to write a query that will get all the records that match the request, and then in a particular column, instead of putting in the number that is in teh database, have it look at the code table, find the matching id, and have THAT be displayed instead.

    Here's conceptually what I'm going for (this is NOT SQL compliant and my SQL knowledge isn't that great. Hell if it was I wouldn't be here asking this question which I know any standard SQL DB user will likely know the answer to):

    SELECT * FROM Table1, Table2
    In Table1.Column,
    instead of showing the code in it,
    WHERE Table1.Column = Table2.Column(id),
    Display in Table1.Column the info in Table2.Description.

    I realize this is sort of hard to describe in text vs speech. I know there's an easy way to do this with an Inner Join, but that simply adds the info from the 2nd table to the end of the first (and displayed) table.

    Here's the SQL code

    SELECT * FROM sfrf_request
    INNER JOIN sfrf_request_type
    ON CONVERT(int,sfrf_request.request_type)=sfrf_request_type.id
    WHERE sfrf_request.id = ddl1.SelectedIndex

    BTW the CONVERT function is used because the column has string data in it still and thus I can't reference it as an integer.

    Any help would be greatly appreciated.

    Source: http://www.livejournal.com/community/aspdotnet/49681.html

  3. Blogging suggestions?

    Date: 12/02/05 (Web Development)    Keywords: rss, database, web, google

    Hey everyone. Quick question.

    My husband and I run a small press comic book publishing company, and we're currently redesigning our website.

    Long story short, we're looking to set up a blog of some sort that i can customize the look of, that google will index and that i can turn into an .rss feed. we're willing to
    pay for the service, although it has to be very reasonably priced.

    I was going to work with movable type, which i know fits these criteria, but I'm thinking it's a bit over my head to install. I've installed messageboards and worked with databases before, but it's been a while, and I'm rusty.

    Don't need a lot of bells and whistles, and really, the simpler the better.

    Any suggestions? Thanks in advance.

    Source: http://www.livejournal.com/community/webdev/275939.html

  4. SqlDataSource UpdateParemeters

    Date: 12/06/05 (Asp Dot Net)    Keywords: database, sql

    Hey gang,

    I'm in the process of fixing an application a former programmer slap together. We found the database design went against company standards, so our DBA went through to fix her up. Now I'm working on the task of fixing the UI code to interact properly with the new changes.

    However, I've ran in to a strange behavior with UpdateParameters within my SqlDataSource.

    Originally, the Stored Proc calls for the following parameters:

    @id int = 0,
    @original_id int = 0,
    @original_division_id int = 0,
    @division int = 0,
    @division_id int = 0,
    @revenue_type varchar(100) = '',
    @revenue_num int = 0


    Our DBA changed to:

    @original_id int = 0,
    @original_division_id int = 0,
    @division int = 0,
    @division_id int = 0,
    @revenue_type varchar(100) = '',
    @revenue_num int = 0


    The difference? @id has been removed. (Original programmer wasn't even friggin using it!)

    Now I've updated my SqlDataSource UpdateParameters to reflect changes, only to find when running SQL Profiler that my stored proc is being executed with 1 added parameter... @id!!

    exec updRevenueType @original_id = 15, @original_division_id = 2, @division = 2, @division_id = 2, @revenue_type = N'Broadcast Designeeee', @revenue_num = 4020, @id = 15


    Does SqlDataSource do some weirdness on the background I'm unaware of that looks at the database scheme or something and add it's own parameters? This is rather frustrating trying to find out where this stray parameter is coming from! Anyone else run in to similar behavior?

    More info: I'm using C# on .NET 2.0

    Source: http://www.livejournal.com/community/aspdotnet/50533.html

  5. Plain Web-Speak

    Date: 12/06/05 (WebDesign)    Keywords: software, database

    How can I explain to a complete layman the difference between a database site - where she can upload her images and add text etc online - and her own brochure site, which has to be edited with software and then uploaded via FTP? She doesn't understand why she can't just 'go in and fiddle with her pages online'.

    Does anyone have an amusing similie or metaphor I can utilise?

    Source: http://www.livejournal.com/community/webdesign/1026862.html

  6. Exchange Small Business Size Limit

    Date: 01/01/70 (Programming)    Keywords: database, microsoft

    In case you didn't know Microsoft Exchange Small Business and Standard have a database size limit of 16GB. If you happen to exceed this limit all of your Microsoft Exchange email messages will sit in the local delivery queue. No...

    Source: http://www.coreycollins.com/blog/archives/000073.php

  7. Problems creating tables with UTF8 for 5.0 INNOdb databases

    Date: 12/08/05 (MySQL Communtiy)    Keywords: mysql, rss, software, database, sql, linux

    Any ideas?

    CREATE TABLE `LAD_RSSDB_FEEDSTER_CORE` (
    `RSS_ID` int NOT NULL auto_increment,
    `SITE` varchar(64) DEFAULT 'rssdb' NOT NULL,
    `ACCOUNT_ID` int DEFAULT -2 NOT NULL,
    `URL` varchar(900) NOT NULL,
    `CHANGED` tinyint DEFAULT 1 NOT NULL,
    `STATUS` tinyint DEFAULT 0 NOT NULL,
    `LAST_PINGED` datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
    `LAST_DOWNLOADED` datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
    `TIMESTAMP` timestamp NOT NULL,
    `PING_INTERVAL` bigint DEFAULT 144000 NOT NULL,
    `CRC32` int DEFAULT 0 NOT NULL,
    `STRIKES` int DEFAULT 0 NOT NULL,
    `FIRST_CREATED` datetime NOT NULL,
    `CREATED_BY` varchar(50) DEFAULT 'unknown' NOT NULL,
    `NM_PROCESSED` int DEFAULT 0 NOT NULL,
    `NM_CUMUL` int DEFAULT 0 NOT NULL,
    UNIQUE KEY `RSSDB_FEEDSTER_CORE_IND1` USING BTREE (`RSS_ID`),
    KEY `RSSDB_FEEDSTER_CORE_IND2` USING BTREE (`URL`)
    ) ENGINE=INNODB DEFAULT CHARSET=utf8;

    and I got the following error message:

    #HY000Can't create table './rss/LAD_RSSDB_FEEDSTER_CORE.frm' (errno: 139)

    Machine is l00nix and build is:
    root@mosdef [6:43pm]:86:/data# mysqladmin version -p
    Enter password:
    mysqladmin Ver 8.41 Distrib 5.0.16, for pc-linux-gnu on i686
    Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license

    Server version 5.0.16-log
    Protocol version 10
    Connection Localhost via UNIX socket
    UNIX socket /tmp/mysql.sock
    Uptime: 5 days 1 hour 57 min 29 sec

    Threads: 7 Questions: 11430901 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 34 Queries per second avg: 26.036

    The production version of this will be on FreeBSD - is this a locale issue? Do I need to recreate databases and/or recompile?

    Source: http://www.livejournal.com/community/mysql/75539.html

  8. A small problem

    Date: 12/08/05 (SQL Server)    Keywords: database, sql

    I am having some issues starting a procedure. I need to create a sql procedure where the user creates a new dog in a database. The information that is going to be inserted is : gender first, which will stop the program if not identified in the database, breed, which will go under unknown if there is no existing record in database, owner id, which will go under ORPHAN if no existing record, eye color, which will create a new entry for a new eye color is not already in DB, and finally create the dog with dog_id once all the other parts are taken care of. I need to have exception handling in this procedure as well. I would like someone to help me to start this.

    Source: http://www.livejournal.com/community/sqlserver/37683.html

  9. PHP Forms

    Date: 12/08/05 (PHP Community)    Keywords: php, html, database, web

    Hi, I am sure this is really simple but I am beat and I hope someone can point me in the right direction.

    I have a php program that takes data from a form and puts it into a database. This information can then be edited with a web form as well. The data is displayed in a news page for the web site's visitors. Ok all that is easy. The part I am having a hard time with is the correct way to handle the text. I suppose essentially its like LJ but on a much smaller scale with no comments. A daily news system.

    I can use nl2br() to convert the new lines, but then in the editing window I dont want the user to see it when they are editing. The know nothing about HTML.

    Can you point me to a resource that will explain the correct procedure for handling this? Or just tell me which functions to use.

    Much thanks.

    Source: http://www.livejournal.com/community/php/375861.html

  10. asp - database connection - help me i'm drowning.

    Date: 12/08/05 (Asp Dot Net)    Keywords: database, asp, sql, web

    hello all.. ok here's the story...

    i know some basic asp .. i've edited a database driven website fro a while.
    I'm no trying to create a new site .. thats also database driven.

    How do i connect to the server in order to pull info from it?

    I tried following the trail from the site i currently update but i'm not sure what i'm seeing here...

    Anyone know how to connect an asp site to a sql 2003 database?

    Source: http://www.livejournal.com/community/aspdotnet/51038.html

  11. Dropdown madness

    Date: 12/09/05 (Javascript Community)    Keywords: database

    Hi all I have a project that requires me to be able to do the following.

    Display a dropdown of US states, when state is selected the corresponding countys will appear in another dropdown.

    Like this page: http://www.personalinjurylawyer.com/

    If anyone can help me with the following I would be most appreciative.

    1) Where can I buy the code that would make that happen?
    or
    2) Where can I buy the database so I can create the code on my own?

    Thanks in advance.


    cross posted.

    Source: http://www.livejournal.com/community/javascript/87393.html

  12. Dropdown madness

    Date: 12/09/05 (PHP Community)    Keywords: database

    Hi all I have a project that requires me to be able to do the following.

    Display a dropdown of US states, when state is selected the corresponding countys will appear in another dropdown.

    Like this page: http://www.personalinjurylawyer.com/

    If anyone can help me with the following I would be most appreciative.

    1) Where can I buy the code that would make that happen?
    or
    2) Where can I buy the database so I can create the code on my own?

    Thanks in advance.


    cross posted.

    Source: http://www.livejournal.com/community/php/376952.html

  13. Dropdown madness

    Date: 12/09/05 (Web Development)    Keywords: database

    Hi all I have a project that requires me to be able to do the following.

    Display a dropdown of US states, when state is selected the corresponding countys will appear in another dropdown.

    Like this page: http://www.personalinjurylawyer.com/

    If anyone can help me with the following I would be most appreciative.

    1) Where can I buy the code that would make that happen?
    or
    2) Where can I buy the database so I can create the code on my own?

    Thanks in advance.


    cross posted.

    Source: http://www.livejournal.com/community/webdev/277433.html

  14. SELECT TOP and LIMIT

    Date: 01/01/70 (Programming)    Keywords: programming, mysql, database, sql

    I was doing a little programming with a MySQL database today and I ran into a little snag. I am really familiar with using a MSSQL database and was trying to limit my results the same way I do in...

    Source: http://www.coreycollins.com/blog/archives/000075.php

  15. visual stuidio 2005 help

    Date: 12/11/05 (Asp Dot Net)    Keywords: database, asp, sql

    I've created 2 pages, one to display data from a database and another to insert data. I'm having trouble with the sql insert query.
    The first page displays data fine, not in the format I'd like but one thing at a time.

    How do I on the second page, create text boxes and the proper connections to insert data into my database. I'm pretty sure this is a simple basic step but I can not figure it out.

    Any help or tutorials? I usually hit www.asp.net when I’m stuck and their tutorial is not helping on this one.



    Thanks!

    Source: http://www.livejournal.com/community/aspdotnet/51352.html

  16. Sql query

    Date: 12/12/05 (MySQL Communtiy)    Keywords: php, mysql, database, sql

    I've just set up a testing server on a windows platform, it's not ideal but it's better than nothiing, for myself, when trying to create a table in a database, either manually or thru phpmyadmin, the MySQL server stops responding. I'm using the latest release of MySQL although that seems not to matter as it seemed to do it with an earlier version. Any ideas on this??

    Source: http://www.livejournal.com/community/mysql/76242.html

  17. Arrays and functions?

    Date: 12/13/05 (Web Development)    Keywords: database, asp, sql

    Amazingly enough, I've *just* started using functions with my ASP code, even though I've been doing ASP for a little while now.

    Right now, I'm only using a function to deal with connecting to my database and retrieving information based on the SQL I use.

    In several cases, however, I need to use multiple recordsets for part of a page's content. It gets a little tiresome to use the same function over and over.

    Is there a way that I could store all of my SQL statements in an array and then use that array in my function so that it would run through however many items there are in the array (this could not be a static number, since one page might use four different statements and another might use three), run all the SQL statements, and then put the results in different recordsets?

    Or..would it just be easier to make one huge SQL statement, like

    SELECT table1.field1, table2.field1, table2.field2, table3.field5 FROM table1, table2, table2 WHERE
    ... etc?

    Sorry if this question seems inordinately stupid.

    Source: http://www.livejournal.com/community/webdev/278824.html

  18. the web hosting question...

    Date: 12/14/05 (Web Development)    Keywords: php, mysql, database, sql, web, apache

    I was wondering if anyone could recommend me a webhost that will meet the following requirements:

    + I want as much control as possible. If I decide one week I want to mess around with OracleDB, I want to be able to install it. If I want to use Ruby on Rails, I want to be able to install that too. I basically want to be able to do as much server administration as possible

    + I have the following musts: PHP 5, Apache, MySQL(preferred, but some kind of database)

    + I need a decent amount of space and bandwidth, but not a whole lot.

    I have considered a dedicated server, but it seems to be far too expensive for now at least. Any ideas?

    Source: http://www.livejournal.com/community/webdev/279180.html

  19. Dropdowns

    Date: 12/14/05 (Javascript Community)    Keywords: php, mysql, database, sql, java

    Hi, I have some questions regarding the best way to go about creating dynamic dropdowns in javascript.

    I have to create a form with two dropdown lists. One for US states the other for counties within those states. The county dropdown will remain blank until the user selects a state, then the county dropdown will be populated with the correct counties for that state.

    I have this working using PHP (the rest of the application is PHP) but I want to do it without reloading the page. The list of states and counties are stored in 2 tables in a mysql database.

    My first instinct is use PHP to write the javascript for me. Do the DB work with PHP and then write the javascript arrays. But that seems wrong.

    I would think that the javascript should go something like this and would be called from an onchange handler in the state dropdown. I dont know the exact syntax.

    create function setOptions(id)
    
    create array of counties indexed with their id's from the database
    
    if there is an id passed to the function
        iterate through the array of counties
            if a key matches the id then write that to the options tag of the county select list
    
    
    


    Is that the right direction? Any pointers would be much appreciated.

    Thanks

    Source: http://www.livejournal.com/community/javascript/88041.html

  20. Why isn't this working?

    Date: 12/14/05 (PHP Community)    Keywords: php, database

    Just a small problem, but I'm going desperate here because I don't know what wrong. I'm pretty much a noob, you should know...

    this script is for generating the sitetitle; if there's one set in the file it should take the one for the file (that part works), and if it's display.php, it should pull it from a database. The database one is not working, doesn't show anything....
    Here's my code:

    " . $sql . "
    " . mysql_error());
    while ($row = mysql_fetch_array($result))
    {
    $title = $row["title"];
    $category = $row["category"];
    echo " :: $title :: ($category)";
    }
    }
    else echo "";
    ?>


    Thanks in advance :)

    Source: http://www.livejournal.com/community/php/379164.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home