Open Side Menu Go to the Top

07-04-2012 , 09:00 PM
How much fun was C# when you were first starting out?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
07-04-2012 , 09:06 PM
I found it a ton of fun. It took me around 15 hours ( from 0 knowledge ) to create a little sim that would spawn cells and even use basic physics ( using a physics engine tho ), things just went flying. Obv no copy paste from someone else.

I should have a video somewhere...

edit: http://www.youtube.com/watch?v=il7rCQsuz9E&feature=plcp

I was pretty proud of it. Now after more than a week of Cocos2D i have exactly a non moving sprite on a blank screen.

Maybe I'm just getting dumber.

edit2: Obv I'm in no way a pro at C#, but I managed to get the stuff that I imagined done. I even managed to create a working minecraft clone on my own. Here it's just BAD_EXEC error after error.

Maybe C# is easy mode and here I'm stuck on a harder language. Bah.

Last edited by YouR_DooM; 07-04-2012 at 09:25 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-04-2012 , 09:21 PM
ObjC probably flusters anyone who thinks the C++/Java type of objects are The Only Way, because its objects come from a different design perspective.

But, being a fan of Smalltalk-derived languages, I like it. I intend to look into the feasibility of ObjC web development at some point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-05-2012 , 10:38 AM
Quote:
Originally Posted by NoahSD
Hopefully someone who knows wtf they're talking about will step in, but is it possible that you just have a simple bug?
No xD I scrapped it about 3 times so far.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-05-2012 , 12:36 PM
Neil, why not just use Smalltalk (Seaside/Iliad mebbe?). The language needs more projects in it anyways.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-05-2012 , 02:49 PM
Quote:
Originally Posted by clowntable
Neil, why not just use Smalltalk (Seaside/Iliad mebbe?). The language needs more projects in it anyways.
Maybe he likes them appstore monies?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-05-2012 , 07:27 PM
Quote:
Originally Posted by YouR_DooM
Coming from C#, I just started Objective-C ( yeah, apps, i know i suck ) and man does it feel terrible. C# is just so awesome and fluid imho.

I have no clue what the general consensus is, but I find that language so mother****ing old and mechanical.....

**** you apple.

On a side note, I would pick up Java, but the google store is made by morons that think that I like filing taxes in all the countries I sell apps in, so they can go **** themselves. The hell are these morons doing with my 30% ?
You should check out appcelerator, especially if you already know javascript.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-05-2012 , 08:25 PM
Quote:
Originally Posted by YouR_DooM
Maybe he likes them appstore monies?
That and I like the Apple Foundation framework. I'm comfortable with it, I'm familiar with it, and with ObjC 2.0, I get decent memory management.

I have no reason to go to Smalltalk itself.

The reason I'm looking at ObjC over Ruby for web development is that I'm gradually getting discouraged at the way Matz manages the project, particularly with respect to "stable" releases and backward compatibility.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 04:16 AM
Quote:
Originally Posted by Neil S

The reason I'm looking at ObjC over Ruby for web development is that I'm gradually getting discouraged at the way Matz manages the project, particularly with respect to "stable" releases and backward compatibility.
Neil, you seem like a good programmer, so I am genuinely curious: Whatever you are referring to, how would it affect you practically as, say, a Rails programmer? Or is it just a matter a principle for you?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 07:18 AM
From what I remember the Rails folks themselves aren't huge on backwards compability either...pushing ever onwards
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 09:10 AM
Quote:
Originally Posted by gaming_mouse
Neil, you seem like a good programmer, so I am genuinely curious: Whatever you are referring to, how would it affect you practically as, say, a Rails programmer? Or is it just a matter a principle for you?
Well Rails, when it gets bad enough in the past, has just not been available on certain new versions of Ruby. It took them forever to be available on 1.9 at all, if I recall.

So how it would affect me if I used Rails (which I don't really care for) would be that I would be required to keep parallel versions of Ruby on hand for Rails.

Which wouldn't be fun.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 01:30 PM
Sorry bit of shameless self promotion, just finished writing our new web store:
http://www.scirra.com/store

This page is one I'm most happy with:
http://www.scirra.com/store/music-bu...k-prescription

I don't know if anyone else has written a store before? I found it to be one of the most challenging things I've ever done. It loads as much as it can with AJAX as well (namely clicking left menus, adding to cart without page reloading, changing currency without page reloading etc) which makes it very speedy and responsive, but was another layer that complicated things. It should all degrade gracefully as well for non JS browsers (although I haven't extensively tested this!)

One of the hardest parts was the database design, and of course payment handling. The database has some fairly complex relationships in it and doing things like revenue sharing for authors in multiple currencies is a pita!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 02:36 PM
Gull,

The whole cart feels really slick -- nice work. i especially love the subtle graphic effects when things change. One tiny tiny nit -- remove the "update" button and just make the cart update as you type a new quantity, or maybe when you leave the form field?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 03:04 PM
I'm trying to construct a SQL database that will keep track of survey results.

Here are some finer details:
  • A survey has many questions. A single question can be used in many surveys.
  • A question has many possible answers. A single answer can be used for many questions.
  • One user can do many surveys. One survey has many users.
  • We want to keep track of the index of each question in any survey it appears in
  • On user can answer a specific question only once, regardless of what survey it is in.

The last bullet point is the one giving me the most trouble.

I've been wrapping my head around this for a few days and I've been trying to design a UML class diagram before constructing this in SQL. Here's what I've got right now:
Spoiler:




I think that I'm very close here, but I'm not a fan of the 'QuestionAnswer' class and think I'm doing something wrong. It just doesn't seem right. I'm not sure it should be considered an association class between an OfferedAnswer and a Question...

Could anyone give me any pointers here? I need to keep track of a user's responses, while also ensuring that each response is uniqued on (userID, questionID).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 03:14 PM
Business logic belongs in code. Don't try to handle those complex relationships in your storage layer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 03:15 PM
Also I'm on my phone + lol uml = I didn't look at your drawring too closely.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 03:52 PM
Quote:
Originally Posted by tyler_cracker
Business logic belongs in code. Don't try to handle those complex relationships in your storage layer.
What do you mean? There's no logic there, it's just a db schema.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 04:06 PM
Quote:
Originally Posted by Colombo

Could anyone give me any pointers here? I need to keep track of a user's responses, while also ensuring that each response is uniqued on (userID, questionID).
Not sure I understand the question. Obviously you need a QuestionAnswer table of some sort to store the answers to the questions.

I do think this schema is going to lead to some difficulties in the UI where you create surveys and have the option to choose questions from existing ones, and how you handle the display of questions in a survey where a user has already answered -- do you just skip those? Without knowing why you've decided this question reuse is so important it's hard to evaluate.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 04:15 PM
I've done something very similar to this in the past. This shouldn't be too tough, you just need to use primary keys.

/* holds data for individual surveys */
create table surveys
(
survey_id int unsigned not null auto_increment primary key,
description text not null
)
engine=INNODB;

/*
Table for the text and type of each question.
The qid column has an auto incrementing primary key so each question can be uniquely identified.
*/

create table questions
(
qid int unsigned not null auto_increment primary key,
qtext text not null,
qtype text not null
)
engine=INNODB;

/*
This table creates relationships between surveys and questions. The primary keys of the surveys table and questions table are used as a composite key. This allows a single question to be used on different surveys, but only once.
*/

create table survey_questions
(
survey_id int unsigned not null default 0,
qid int unsigned not null default 0,
primary key (survey_id, qid)
)
engine=INNODB;

/*
Table that holds the answers to each question.The primary key is a composite of the unique userID and qid for each question. This allows each user to only provide an answer for each question once.
*/

create table user_answers
(
userID int unsigned not null default 0,
qid int unsigned not null default 0,
answer_text text not null,
primary key (userID, qid)
)
engine=INNODB;

Also, from your picture it looks like you might be duplicating data. The NumQuestions field contains data that is available elsewhere (that's why I left it out in mine). If you need the # of questions in a survey, why don't you try something like

SELECT count(*) FROM survey_questions WHERE survey_id = current_survey

where "current_survey" is just the survey_id of whichever one you're trying to find the number of questions for.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 04:47 PM
Quote:
Originally Posted by gaming_mouse
Not sure I understand the question. Obviously you need a QuestionAnswer table of some sort to store the answers to the questions.

I do think this schema is going to lead to some difficulties in the UI where you create surveys and have the option to choose questions from existing ones, and how you handle the display of questions in a survey where a user has already answered -- do you just skip those? Without knowing why you've decided this question reuse is so important it's hard to evaluate.
This can probably be handled pretty easily with a subquery. If you want to pull the questions in a particular survey, but only ones that the user hasn't answered elsewhere, I think this would work:

SELECT questions.*
FROM questions, survey_questions
WHERE questions.qid = survey_questions.qid
AND survey_questions.survey_id = current_survey
AND questions.qid NOT IN (SELECT qid FROM user_answers WHERE userID = current_user)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 05:49 PM
Quote:
Originally Posted by sdturner02
This can probably be handled pretty easily with a subquery. If you want to pull the questions in a particular survey, but only ones that the user hasn't answered elsewhere, I think this would work:

SELECT questions.*
FROM questions, survey_questions
WHERE questions.qid = survey_questions.qid
AND survey_questions.survey_id = current_survey
AND questions.qid NOT IN (SELECT qid FROM user_answers WHERE userID = current_user)
What's hard isn't writing a query to figure out what questions they havn't answered. What's hard is all the UX issues it raises:

Do you silently omit the question?
Do you display it but greyed out with the existing answer which cannot be changed?
Do you just show a message saying Question 6 has been skipped because you already answered it? Or do you just renumber the questions? Etc, etc.

You really have to think hard about your business goals and the user experience to answer questions like this. They might seem trivial and easy, but ime figuring stuff like this out is by far the hardest and most time consuming part of application development.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 05:52 PM
I totally, 100% agree. I thought you were talking about the just the actual DB query.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 08:04 PM
I'm running some database calculations using python and MySQL (with SQLAlchemy) and I'm getting REALLY slow database write speeds.. over six hours to write/update 400,000 records. Any idea what could be causing this? I did some googling and didn't find anything useful. I have a fairly powerful computer, 16 GB of RAM, so I don't think that's the bottleneck. And the insert isn't too complicated: "INSERT INTO data(session_id,game_id,count) VALUES (:a,:b,1) ON DUPLICATE KEY UPDATE count = count + 1". Are my MySQL settings screwed up somehow (I remember raising some buffer RAM value when I installed MySQL)? Select queries seem to run just fine, it's only inserts that are super slow.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-06-2012 , 09:51 PM
Wow never mind, http://dev.mysql.com/doc/refman/5.0/...ert-speed.html helped a lot. Start/commit transaction and combine all the inserts into one query FTW. Down to 30 secs now
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-07-2012 , 01:57 AM
Quote:
Originally Posted by gaming_mouse
What's hard isn't writing a query to figure out what questions they havn't answered. What's hard is all the UX issues it raises:

Do you silently omit the question?
Do you display it but greyed out with the existing answer which cannot be changed?
Do you just show a message saying Question 6 has been skipped because you already answered it? Or do you just renumber the questions? Etc, etc.

You really have to think hard about your business goals and the user experience to answer questions like this. They might seem trivial and easy, but ime figuring stuff like this out is by far the hardest and most time consuming part of application development.
all this.

It seems no matter what you do you have to mix a little of business logic and database schema.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m