« first day (250 days earlier)      last day (4692 days later) » 

2:24 AM
no idea
 
 
1 hour later…
3:34 AM
in XNA4/C#, whats the best datastructure for the bullets in a bullethell (1k bullets on screen) game? List<MyBullet>, LinkedList, or a static array??
 
 
3 hours later…
6:16 AM
man
why does udpclient suck so much
client.BeginReceive(RecieveCallback, null);
this gives a socket excepction if the last client.send() failed
Who designed this crap?
 
6:43 AM
I have a 2D array and a 1D array which is a flat version of the 2D array.
If I have an index of a cell in the 2D array (x, y), how can I flatten the index ?
 
Gilad the 2d array isnt jagged is it?
 
It isn't jagged
struct Cell
{
...
}

class Blablabla {
Cell[,] cells;
}
...
Cell[] cells = blabla.cells.Flatten(); //Extension method
 
newArray[x*width + y]?
 
let me check
Works!
Thanks!
 
lol np
 
 
2 hours later…
8:57 AM
I'm trying to use reflection to find public properties of an object.

using :

PropertyInfo[] aAll = typeof(foo).GetProperties(BindingFlags.Public);

At this point aAll.Count() == 0 even though the class foo has many Public properties.
 
What are the options to host/run a C# console application? It's a continuous process... and I don't have a windows server available...
 
BvdVen. Personally when I do that I use Cygwin and a screen process then fire the console application off within the screen process.
That's until I've converted it to a propper Windows Service.
 
ok, thanks I will look into that
 
@hokapoka you must add either BindingFlags.Instance or BindingFlags.Static in order to get a return
e.g. typeof(foo).GetProperties(BindingFlags.Instance | BindingFlags.Public)
 
madd0 Oh I thought I tried .Instance & Public, will try again
Yes I had, it's still the same.
 
9:07 AM
@hokapoka what does foo look like ?
 
public class DataServers
{
public void LoadData()
{
// Snip init of Publics
}

public Customers.CustomersServer oCustomersServer;
public Users.UsersServer oUsersServer;
}
 
@hokapoka ok, as I suspected, those are not properties, they're fields ;)
 
argh - dhoe
I need to change them to properties in any case, many thanks.
 
fields are just that, memory fields that hold data, whereas properties, although they look like fields when they are used, are actually methods, so there's a pretty big difference between them
 
Yes, I must admit they shouldn't really have been fields in the first place.
 
9:20 AM
@hokapoka when I'm in a hurry, what I do is use auto-implemented properties (prop+Tab+Tab) at least the code is somewhat future-proof ;)
 
yes I have a snippit that I normally use gso+ Tab+Tab
Not 100% sure why I didn't use it - I'm annoyed at myself, I must have been rushing I guess.
sweet, that's working perfectally.
Many thanks madd0
 
@hokapoka you're welcome ;)
 
9:38 AM
I had one other issue. The properties I'm testing for are derived from :

public class MyServerBase<T> where T : MyItemBase.

So I have a An Item Base :

public class CustomerItem : MyItemBase

And the server class :

public class CustomerServer : MyServerBase<CustomerItem>
How would I test for the PropertyType == typeof(MyServerBase<MyItemBase>)
It's BaseType is returning MyServerBase<CustomerItem>
I could test the string value of the BaseType, but I'd rather use proper types.
 
9:51 AM
@hokapoka I'm not sure I understood what you want to test exactly...
 
The end point is to get a string value from each of the properties that are in the class I'm reflecting.
I want test each of the properties to see if they are derived from MyServerBase if so cast it and then read the string from the property.
The BaseType that's return for the property is MyServerBase<CustomerItem> not MyServerBase<MyItemBase> I don't know how to test for MyServerBase<MyItemBase> and subsequently cast to that.
 
@hokapoka ok, you want something like:
PropertyType.GetGenericTypeDefinition() == typeof(MyServerBase<>)
 
Thanks madd0. I'm going to grab some food and have another play in a little while
 
 
2 hours later…
12:12 PM
Hey guys, anybody want to help me into the Database Entity Framework? I have some questions I feel it's better if I can talk interactively about.
 
just shoot the question
 
12:34 PM
hi all
 
@username Hello
 
I've noticed that when I have a question on C# I'm searching rather on Stackoverflow then in google
@Madcowe how is your tetris?
 
@username ha - I'm still in the "Try google first, but then most likely go to SO for the answer" phase =)
 
@username havent done anything yet, in a way I have been working at the restaurant though...
 
1:00 PM
Someone knows what language the .NET Compiler is written in?
 
1:16 PM
supposedly there is not one compiler for all .NET - each language has it's own, but they all compile to the same CIL
The Common Language Runtime (CLR) is a special run time environment that provides the underlying infrastructure for Microsoft's .NET framework. This runtime is where the source code of an application is compiled into an intermediate language called CIL , originally known as MSIL (Microsoft Intermediate Language). When the program is then run, the CIL code is translated into the native code of the operating system using a just-in-time (JIT) compiler. This intermediate language is used to keep the environment platform-neutral and as a result, supports all .NET languages such as C# or VB...
Check that guy out
 
Thank you.
 
so the answer to your question
is probably C
 
1:48 PM
hello guys ... any SharePoint expert with good experience dealing with Ribbon here?
i guess not!
 
2:46 PM
@Madcowe Alright.. How the hell do I make foreign key relationships with navigation attributes easily? When i do add -> relationship I can't decide on WHICH key it should resolve the relationship. it only lets me decide which entities are related
in linq to sql it's so much easier to do..
 
Hey. New to C#. Need to get a single field value (boolean) from a MySql DB and set something to visible or not if the bool is true/false
 
@AdamLynch how do you want to access the db?
 
@sinni800 ugh any way:). The easiest way to do this I guess
 
Hah.
Alright, I'd do a ADO db connection then... you will have to install the mysql connector for .NET
 
@AdamLynch What have you got so far then?
 
2:50 PM
Can you use linq to sql with MySQL?
Linq to sql is about as easy as it gets
 
@Justin no
 
Well that sucks, someone should fix that =)
 
@Justin this is why i have to fight around with the Entity Framework
@Justin nobody will, because the Linq to SQL people are in the Entity Framework team now.
 
@Patrick I've written some code based on a DB connection in an existing file but it's for a different (SQLlite) DB
@Patrick SQLiteDataReader reader;

string GET_isPrivate = @"SELECT isPrivate FROM cni9.company WHERE countryCode=? AND id=?;";

using (SQLiteConnection indexConn = new SQLiteConnection("Server=localhost;Database=cni9;Uid=root;Pwd=test;"))
using (SQLiteCommand cmd = new SQLiteCommand(GET_isPrivate, indexConn))
{
indexConn.Open();
cmd.Parameters.AddWithValue("countryCode", countryCode);
cmd.Parameters.AddWithValue("id", companyCode);
reader = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
 
@AdamLynch So you are familiar with the SqlConnection and stuff?
 
2:51 PM
@sinni800 Quick google gave this, don't know if its production ready or anytrhing code2code.net/DB_Linq
 
@Justin it has to be production ready, the project is kind of large.
 
@sinni800 Yeah I'd go with ado and mysql connector then
 
@Justin the provider from MySql is entity framework and thus linq ready.
 
@Patrick Nope
 
@AdamLynch Yes, well. Fetch the MySQL connector for .NET like @sinni800 mentioned, and replace the "SQLiteConnection" with the respective Connection class in MySQL.NET
@AdamLynch But you just gave an example with a SqlConnection class....
 
2:53 PM
@Justin I want to use the entity framework, because for a big project using the normal connection is a little.. clumsy
@Patrick Prolly copypaste ;D
 
@Patrick I did? what?
 
@sinni800 Understandable =)
 
@Justin type safety, autocomplete and all..
@Justin could you help me out with the foreign key relationships?
 
if it's a large project why is it using mysql? :x
 
@ChrisMarisic i wanted to use mssql but my partner was like "I AINT BUYING MSSQL LICENSES, TOO!"
 
2:54 PM
@sinni800 You have the mysql/entity framework stuff already setup?
 
@justin yes
 
@AdamLynch Your example above... The same logic is used in "every" db usage in .NET. You create a connection, feed it a connectionstring, and create a command from which you get a reader.
 
@sinni800 You should just be able to setup associations between the models right? Or do you specifically setting up FKs on the DB side
 
@ChrisMarisic I couldn't care less because I found out mysql works just as well... I dont know how it works later when the site might have a million users..
 
2:56 PM
it doesn't
 
Doesn't facebook run on mysql?
 
@Patrick ok, great. I'll install the connector now
 
or atleast without 10x the hardware
 
@Justin i did set up the FKs in DB before
@Justin in mssql
@ChrisMarisic Facebook approach: Doesnt work? throw more hardware at it!
 
indeed, that is the key to LAMP
 
2:57 PM
hardware is cheap enough now a days i guess
 
@ChrisMarisic even though you wouldnt need to throw that much hardware at it if it was mssql.
 
of course facebook realized that LAMP sucks enough that they wrote HipHop their PHP to C++? or something compiler
 
hardware's usually cheaper than developers in any case ;)
 
if im ever able to switch to mssql at least the entity framework will not be in my way
 
more hardware = more developers to handle distributed systems programming
 
2:58 PM
Alright, @Justin
 
EF 4.1 and PetaPoco are the 2 primary tools I consider for present day development against DBs
 
@Patrick "Failed to install performance counters. (-2147024891)" then it rolls back changes. Ugh
 
well against mssql
 
@AdamLynch A nice page for creating connection strings: connectionstrings.com and then create a MySqlConnection instead of the SQLiteConnection
 
@ChrisMarisic when he saw the mssql studio on skype he went like OHH NOO I DONT WANNA I DONT WANNA
Either set up the FKs in mysql or set them up in ET, guys?
the mysql software has database modeling..
 
3:00 PM
EF should have no problems managing FKs for you
 
@AdamLynch "Connection reset by peer"... Without context an error message is not that useful.. :-(
 
@Patrick I've gotten that already but nothing I can do if the connector won't install:@. What? That's the full error message I was shown in the MISI installer
 
of course my view for designing a database is object model that makes sense and then to trust EF 4.1 code first for getting the db about 95% of the way right
and tweak anything that really needs it
exact same way i used to dev with NH, code first then let NH gen my db
 
@AdamLynch You never specified it was in the installer before
 
so, @ChrisMarisic you make your db in EF, then let it be propagated to the db server?
 
3:02 PM
we've also had decent success combining FluentMigrator to version our db
 
So, tell me, how do I make foreign key relationships as easy as they are in linq to sql?
 
@AdamLynch Are you running as administrator?
 
I just want navigation properties :O
 
@Patrick Okay. Can you help?
 
Oh forget it..
When I try to do it reversely it onyl creates sql server sql commands
 
3:03 PM
@Patrick sorry didnt see the latest... I'll try it again
 
@sinni800 negative, i design my data model. and then let EF generate sql for that, then use FluentMigrator to version it
 
@AdamLynch I dunno, if you can't install the connector perhaps you can find just the dll's
 
@ChrisMarisic the sql generated only works for mssql :(
 
really? even when you set it up to mysql?
 
@Patrick yeah I am running it as admin. Ugh this is frustrating. This task should be simple
 
3:05 PM
that seems like it'd be a rather large over sight if the provider model in EF didn't account for the sql generation side not just querying side
 
@ChrisMarisic yes..
 
well that's beat if that's absolutely the case
 
hello everybody, anybody knows how to arrange objects in dataset designer automatically?
 
you do know you can get a web hosting account from Arvixe.com with unlimited sql server db's for like $25/month right?
 
@ChrisMarisic well the mysql ERM designer is very well made
 
3:06 PM
there's also sql azure, it's more expense
 
@ChrisMarisic will they allow me thousands of requests per second?
 
expensive*
 
that's what it's gonna be in the end
MAYBE.
 
@sinni800 sure, why not?
 
hmm our main server will be in germany
 
3:08 PM
have you looked into the bizspark program?
if you're a new company you get to use all of the Microsoft stack basically for free
 
oh right.
 
@AdamLynch try this instead: dev.mysql.com/downloads/mirror.php?id=403018#mirrors . It's just the dll's, as in "no-install"
 
i'll check it out
 
bizspark is crazy awesome
 
@Patrick extracting now
 
3:10 PM
Then you can simply add a reference to the dll in your project (if you are using VS) and you should find the mysqlconnection class using the IDE
 
@Patrick sounds good
 
since you're hosting in eu, if you join bizspark i think you can get super cheap hosting from OVH with 2008 R2, Sql Server 2008 R2 etc
it's so lame that OVH won't sell hosting to US citizens
 
freaking limitations :(
oh what the hell
i have to make an unique index so i can choose a column to be a foreign key
but the column cant be unique
 
^ that sounds like a wrong db design
 
@ChrisMarisic I head that OVH is going to start CA and US operations soon though
 
3:13 PM
@Patrick tried adding v4 and it complained that this project is geared towards an older .net framework so I tried adding the v2 dlls and it gave the same complaint about 1 of the 5 dlls but i added it anyway. Now VS won't find mysqlconnection
 
EF enforces FK constraints
 
@ChrisMarisic n:m bridge table
 
@madd0 as in hosting inside the US? or allowing US to purchase hosting in their EU data centers?
@sinni800 then you probably don't have EF infromed correctly that you're trying to do a many-to-many just google Entity Framework Many-to-many
 
oh, no, im currently doing this in the mysql manager
which is more helpful than the mssql studio to behonest
 
/shrug i'm not sure what you're talking about anymore
 
3:16 PM
im currently trying to design the database
and doing it with mysql workbench and then importing the same with EF seems like the better solution to me
oh what the heck
 
i'm not sure if it works with mysql but EF does support database first
 
@AdamLynch Have you added the using directive in your class?
 
i just realized that theres a toolbox
 
you can build your entire db, then have EF generate your data models
from your actual db
 
@ChrisMarisic this is what im doing now
@ChrisMarisic mysql has a ERM database design tool
 
3:18 PM
@AdamLynch I have to go, I'm sure someone else will be able to assist you.
bye everyone
 
Does C# have any Object Literal Notation? For example I's like to declare a Dictionary<string, string>
 
@Patrick yes I have. Okay
 
var dictionary = new Dictionary<string, string> { { "key", "value" }, { "key2", "value2" } };
 
oh sweet, it does.
Many Thanks Chris.
 
Can anyone here help me with what should a simple task of getting a single field value (boolean) from a MySql DB?
 
3:21 PM
np!
 
C# DANCE PARTY
O-|=<
O-/=<
O-\=<
 
heh
 
... ::wallflower'd::
 
\m/ \m/
\ O /
-|-
/\

:P
damn
whitespace fail
 
=)
 
3:34 PM
So no one here is able to connect to a MySql DB? ha
 
@Anton I'm a fan anyway =)
 
I've deleted the .xss file and the designer arranged datatables :D
 
3:54 PM
Another thing, guys
I want to replace the membership provider from asp.net... and i did, i did make one that saves to my sql database. but now of course i will add more properties to a user but the normal membership provider you can extend does not give you the capability to add more things. also some i dont use, like passwordquestion... where can i continue?
 
@ChrisMarisic I understood both, they will at least have data centers in the US and then probably let the clients of their US subsidiary to host elsewhere if needed
@sinni800 you should look into profiles, that's where you add additional information about accounts
 
Alright, @madd0 so I can't really go down more without too much hassle?
@madd0 so I a) implement a profileprovider. how do I make it known which profile entries i allow? i heard something about using web.config
 
@sinni800 yes, the default providers allow specifying the properties in web.config. I assume you can do it in the code of a custom provider too, but I wouldn't know how to do it
 
@madd0 oh alright.
 
4:31 PM
grah, mysql is horrible
 
4:43 PM
@madd0 that would be pretty awesome, I've never found a host you can get 1gbps with a bunch of bw for like $75/euro a month
other than OVH / their sibling company kisume or something
 
@ChrisMarisic dunno what the rates in the US will be though; they'll probably stick to their philosophy but if bandwidth is more expensive in the US, it will necessarily show
 
can anybody help me why my relationships dont work in my databases :(
 
 
1 hour later…
6:06 PM
hi folks.
how are you doing? Is today a holiday where you live ?
 
6:48 PM
@yas4891 negative...
@sinni800 Have you considered a relationship therapist? ;-)
 
 
1 hour later…
8:02 PM
@CBarlow Blargh
 
8:26 PM
@sinni800 lol
 
@Madcowe im stressed by mysql :O
 
hm that is something I never used :O
but what seems to be the problem?
 
"errno 150"
It doesn't really tell you much mor
 
have you tried that?
 
I know, it doesn't help
68.000 results and for error 150 there could be like 10 things wrong
I read quite a few posts
 
8:30 PM
@sinni800 hm.... also I would like to say that I instinctly grabbed a tennis ball which was just besides my laptop in the intention of making the mouse cursor move... and I am currently using the touch pad
 
@Madcowe wow
 
@sinni800 so... you got a hay stack and are trying to find a needle?
 
pretty much
@Madcowe redoing all the relationships sometimes solved the problem, but now it doesn't
 
@sinni800 also, what is errno 150? when does it happen and what could cause it?
 
it happens when.. SOMETHING is wrong in your foreign key relationship
 
8:33 PM
@sinni800 oh god almighty have mercy on this poor soul :O
 
but to be fair, theres actually a "detailed" error report
"there is no index in referenced table which would contain
the columns as the first columns, or the data types in the
referenced table do not match the ones in table. Constraint:"
 
have you checked the types?
 
i did
 
like if one is auto-number and the other is number?
 
sec..
well it worked before
 
8:34 PM
@sinni800 and also make sure the foreign key is the number and the main table is the auto-number, for example
 
@Madcowe the worst thing is
@Madcowe it's a n:m relationship
the "connection" table is auto generated by the mysql workbench program
 
@sinni800 by n:m do you mean the one to many thing? (PS, the only sql I had was on microsoft office access and on my mother language which is portuguese)
 
@Madcowe no, many to many
 
ah, and the middle table is auto-generated then?
 
What the -- okay, dropbox works again D;
 
8:40 PM
@sinni800 so there is no problem now? xD
 
When I let it propagate the thing to the actual database
it gives me the error
 
do you know which table has the erroR?
 
roles
Executing SQL script in server

ERROR: Error 1005: Can't create table 'roles' (errno: 150)
CREATE TABLE IF NOT EXISTS `roles` (

`Role_ID` INT(10) NOT NULL AUTO_INCREMENT ,

`Role_Name` VARCHAR(50) NOT NULL ,

PRIMARY KEY (`Role_ID`) ,

UNIQUE INDEX `Role_ID_UNIQUE` (`Role_ID` ASC) )

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8
 
can you remove the "users_" and the "roles_"?
 
huh, where? oh you mean the 4 keys?
 
8:44 PM
@sinni800 user_has_roles
 
so I now deleted the whole bridge table
 
I say that because usually when I connect 2... uh... keys? yea keys, I use the same name exactly
 
the whole connection to the roles is now gone
 
@sinni800 try to create the bridge table manually
 
okay, I did it myself this time, but I still feel it's wrong, @Madcowe
 
8:53 PM
@sinni800 what do you mean?
 
... Still error 150, WHAT THE
 
comparing to the other one, your's lacks user profiles or something
 
strangely it went all the way around
which wasn't necessary imo
i also dont get why the roles table should have a foreign key for the users table... it shouldnt be connected to it
 
@sinni800 hm I dont know :s
 
crazy shit
@Madcowe i just found something: datanamic.com/support/relationshiptypes.html
non identifying relationships
 
9:14 PM
@sinni800 did it work?
 
no
errno 150
 
9:38 PM
@Madcowe WHOO I MADE IT
 
@sinni800 clap clap clap, what was it?
 
@Madcowe you have to a) manually delete all tables before you use the EEM tool to make them
then B) theres a little button that makes relationships from already existing columns... which i've overseen
 
@sinni800 nice
 

« first day (250 days earlier)      last day (4692 days later) »