User Profile

Collapse

Profile Sidebar

Collapse
HaLo2FrEeEk
HaLo2FrEeEk
Last Activity: Mar 20 '12, 08:21 AM
Joined: Feb 10 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • HaLo2FrEeEk
    started a topic SendMessage to another application

    SendMessage to another application

    I've been playing around with a program called WebcamXP lately. I read through the manual and learned that I can interact with it using Windows Messages and SendMessage(), but I've been having some trouble. Here is the manual:

    PDF, 10.3MB

    The section of interest is Appendix E on page 80. It describes the Message that needs to be sent to perform each action.

    Now, I've got a using for InteropServices and...
    See more | Go to post

  • When you submit a form with checkboxes, the POST (or GET) array will contain the names of the ones that are checked only, so in your for loop you could check if the name of the current checkbox being echoed exists in the POST ( / GET) array and add a "SELECTED" attribute to the input tag.

    That is, if I understand your question correctly. If you mean remembering between sessions then you'll need cookies, but it's a similar concept....
    See more | Go to post

    Leave a comment:


  • Counting from multiple tables with the same column

    I have a system where, essentially, users are able to put in 3 different pieces of information: a tip, a comment, and a vote. These pieces of information are saved to 3 different tables. The linking column of each table is the user ID. I want to do a query to determine if the user has any pieces of information at all, of any of the three types. I'm trying to do it in a single query, but it's coming out totally wrong. Here's what I'm working...
    See more | Go to post

  • HaLo2FrEeEk
    replied to Help with simplifying this query
    The queries take exactly the same amount of time, since all the IN() is doing is grouping the id = # conditions together. The explain results were identical.
    See more | Go to post

    Leave a comment:


  • HaLo2FrEeEk
    replied to Help with simplifying this query
    Actually, I didn't know that IN() could be used like this, but it turns out that:

    SELECT date FROM current_daily WHERE # IN(daily1, daily2, daily3, daily4) ORDER BY date ASC

    That works great. The # is the same, so for example I might be checking for all dates where id 10 was used, so I'd do this:

    SELECT date FROM current_daily WHERE 10 IN(daily1, daily2, daily3, daily4) ORDER BY date ASC
    See more | Go to post

    Leave a comment:


  • Maps don't work with Chrome, as far as I know. How can I have the links in a separate div, yet still be able to position it in the proper place. If I make the div with the links a child of the main sidebar div, then it'll inherit its z-index. Even if I change it to something higher, since it's still inside the lower-positioned element it won't work. I tried that. I can't think of a way that I'd be able to put the links div outside of the sidebar...
    See more | Go to post

    Leave a comment:


  • HaLo2FrEeEk
    started a topic negative z-index making links unclickable

    negative z-index making links unclickable

    I'm working on a project and I decided to add a sidebar to show a little more information. I made the sidebar a child of the main body container, which is a 720px width div, and gave it a position: absolute, then set it's right position so that it appears at the left edge of the container. The body container has a box shadow, and I want the sidebar to look like it's coming out from under the container, so I set it's z-index to -100. Unfortunately,...
    See more | Go to post

  • HaLo2FrEeEk
    started a topic Help with simplifying this query

    Help with simplifying this query

    I'm tracking challenges for a video game. There are 4 daily challenges and 1 weekly challenge. They update at 3am PST. I have a cron job that runs at 5 after to make sure the new information is in the API before I make the request, and I store the challenges in a table in the database, with an id. If the challenge is already present in the table, I don't insert it again, I just get the existing row's id. I have another table that contains the...
    See more | Go to post

  • HaLo2FrEeEk
    replied to Simple thumb up / down vote system
    I actually worded this a little wrong to avoid the obligatory long explanation of what I was trying to do. There are challenges, which people will submit tips for. Others can comment on the tips, or vote on them, but they don't have to do either one together, you can vote without commenting and vice versa. I did get a great query that would get the votes and tips in a single query though, it uses the same CASE WHEN code to count the up and down...
    See more | Go to post

    Leave a comment:


  • HaLo2FrEeEk
    started a topic Normalizing a timestamp to an interval
    in PHP

    Normalizing a timestamp to an interval

    I have the need to take the current timestamp and normalize it to an interval. I had a working example of this for 10 minute intervals, but for some reason it won't work with days.

    So for example, I want to take the timestamp right now and get the timestamp of the most recent occurance of 3am was. It might be march 24th at 2am, which means that 3am hasn't hit yet so I need march 23rd's 3 am timestamp.

    I tried using...
    See more | Go to post

  • HaLo2FrEeEk
    replied to background-color on HTML or BODY?
    Nah, I got it fixed by setting the image and page background color in the HTML ruleset, and setting the body background color to transparent with a BODY ruleset. I works in all browsers I've tested it in.
    See more | Go to post

    Leave a comment:


  • I just figured I'd post an answer here. Since no help was forthcoming, I asked the same question on StackOverflow and got the answer I was looking for. MY final query is a lot simpler than I expected it to be, and I'm really happy to be learning about [LEFT/INNER/OUTER] JOIN, it's so useful! Here's the query I'll be using:

    Code:
    SELECT
      COUNT(CASE WHEN V.vote = 1 THEN 'up' ELSE NULL END) AS up,
      COUNT(CASE WHEN V.vote
    ...
    See more | Go to post

    Leave a comment:


  • Sorting results from one table by rows in another table

    I've got a table where I store tips for a challenge. Its structure is this:

    tip_id, challenge_id, user_id, ip_address, tip_date, tip_text

    The tips can be voted up or down, I store vote data in another table, which looks like this:

    tip_id, ip_address, vote_date, vote

    The similar column between the two is tip_id. Vote is a bool, 0 means a vote down, 1 means a vote up.

    My page...
    See more | Go to post

  • I don't remember if it's an outer join or just a regular left join, I think it goes something like this:

    SELECT * FROM challenges C LEFT JOIN tips T ON C.id = T.challenge_id WHERE title = 'some title';

    I could have it wrong though. I'm not using it currently, but I copied it into my PHP and commented it out, so i'd have it if I needed it. Basically the query gets. All of the tips for all of the challenges that have a specific...
    See more | Go to post

    Leave a comment:


  • I was thinking, perhaps have a table with just the titles, then another table with the requirements. Rows in both tables would have an ID and could be linked together, so for example I'd have one row in the titles table called "A Solid Outing", then I'd have 3 rows in the description table for each of the requirements / rewards, each of them would have a field linking it to the title row. Let's say today's challenge is the one worth 3000,...
    See more | Go to post

    Leave a comment:


  • HaLo2FrEeEk
    replied to Reverse border-radius?
    The only way I'd be able to do it would be with images, because of the transparency on the elements. It's ok though, I decided it actually looks better without the inner rounded corner.
    See more | Go to post

    Leave a comment:


  • Stretch div to bottom of page if contents don't fill it

    I'm designing a layout for a project and I'm a little rusty on HTML and CSS. I have a div that is centered in the page using margin: auto, it also has a margin-top of 15 and uses CSS3's box-shadow and a border-radius set to 10px. What I want is for the bottom of the div to be locked to the bottom of the screen, unless the content within it exceeds the height of the screen in which case it would fit to the contents.

    I've tried margin-bottom,...
    See more | Go to post

  • I store the challenges so that people can post tips on the best way to complete them. The tips are stored in a separate table. A tip for a specific challenge will contain that challenge's ID in the row.

    Let's say today's challenge is one of the ones I used in my example above, we'll go with the first one, which has an ID of 33. I'll want all tips for challenge ID 33, but since the other two (IDs 69 and 136) are similar to the first...
    See more | Go to post

    Leave a comment:


  • Getting similar rows (same title, different description)

    I'm still working on my project with the challenges, and wanted to try something. Every day new daly challenges are put out. I track them and save them to a database. Sometimes the challenges are reused, in those cases I simply reference the saved challenge in the database, instead of putting in a new row. Other times, however, the challenge title is the same as one previously used, but the requirements or rewards are different. For example:...
    See more | Go to post

  • HaLo2FrEeEk
    started a topic background-color on HTML or BODY?

    background-color on HTML or BODY?

    I'm working on a project that has a background image which needs to be repeated on the x-axis. There will be elements which have transparency overlaying the background image as well. Logically, I set the background attribute of the BODY element in my CSS:

    Code:
    body {
      background: #494949 url(http://example.com/myimge.png) repeat-x;
      }
    To my surprise, this worked in IE9, Firefox, Opera, and Safari, but not...
    See more | Go to post
No activity results to display
Show More
Working...